GraphN Data Types
In GraphN, every node has a set of input and output properties, each with its data type. When you create a Values node, you'll see all available property types in its Type dropdown:
Before we dive into all data types, it's important to understand the basics: each type has its own custom color that you can see on the node's socket. When a socket is represented by two vertical bars, the data type is an array, meaning it can be a vector array that contains multiple positions or a Mesh type which can contain multiple meshes, and so on.
Let's go through all data types available:
SceneContainer is the data type that allows GraphN to query arbitrary objects in your scene. If you had a cube and a sphere in your viewport and wanted to access them right inside GraphN, you could create a Values node, then give it two elements, which represent one object in the container, and name them with the name of your objects in your scene. In the GIF below, we're doing just that: creating an empty container, then adding two objects pCube1 and pSphere1 to it.
Of course, writing names manually like this is a tedious process, and in Unreal Engine, names are much trickier and harder to handle/copy. To solve that, you could simply select the objects in your scene, then create the node Get Selected Objects. It'll automatically check what objects you have selected, and create a container with those objects inside it. An even faster alternative is selecting your objects in the scene, then hitting ALT+S.
Keep in mind that the SceneContainer type only handles objects that exist in the scene; meaning materials, textures, and other objects that aren't selectable in the viewport aren't supported. For those types, we have the AssetContainer type, which we'll explore right below.
An asset container has the same logic as a scene container: it's an array of objects, but instead of representing objects in the scene, it represents other objects that are not in the scene. Such objects could be materials and textures, or in a software like Unreal Engine, they could be any object that resides in the Content Browser. So if you wanted an object from the content browser, you'd select it there, then call the node Get Selected Assets, which would give you an asset container with whatever object you had selected. Same thing in Maya, just select your material in the hypershade editor, and you'll get it as an asset container.
This type represents a numerical value with a decimal point, such as 0.5, 35.6, and so on. This type can represent anything from a distance property to an intensity value but is usually fairly straightforward.
Integer represents numerical values that's not a fraction, so 1, 2, 8, 500, and so on. This number can be used to represent the number of objects you want, the number of subdivisions on a mesh, and so on.
A string is an arbitrary text representation. If you wanted to get a material by its name, the name would be of type string. In the near future, we'll be offering "3D Type nodes", which would allow you to convert arbitrary strings into 3D text, making the string property much more useful and powerful beyond its current usage.
Basic type that represents a True or False value. You often see it in properties that allow you to reverse the behavior of a node; a node that gives you the closest points to some object may have a Reverse checkbox, which when checked would make the node give you the furthest points.
Contains XYZ float values such as 0.0, 90.0, and 0.0, which can refer to a rotation, for example. This data type can be used to represent any coordinate, color, normal, and many other info that have an XYZ or RGB value set. If you queried the position of a mesh, you'd get a Vector3F.
In this illustration, we can see that manipulating our XYZ values produces different colors on our points.
Represents an array of Vector3Fs, which are arbitrary XYZ float values that can represent a position, color, normal value, and much more. If you queried all vertices on a mesh, you'd get a vector array, where each vector would represent the position of a specific vertex.
In this illustration, every yellow point you see is a Vector3F, and all of them reside in one vector array.
From a technical point of view, while GraphN mostly operates in Python, it's important to understand that vector, float, integer, and mask array are all custom C++ types, and they're not just blazing fast but also high-performance, computer graphics focused arrays.
Represent an array of floating values. Such values could be weights, angles, and any other floating point data. As an example, the node Mesh Faces Areas returns a Float Array where each float represents the area of a specific face of your input meshes.
Represents an array of integers. This property is becoming more and more uncommon as it gets replaced with the Mask Array type, but you can often need it to create a range of numbers like 123456... or any other type of array with integers.
In GraphN, the mask array type can be thought of as an array of True and False values. To give you a concrete example, say you've scattered a bunch of points on a plane, and wanted to remove all points that were close to some object, like a curve. This is how a Mask property would help you do that:
As you can see, the Mask property does exactly what it says once we connect it: it masks out all the points that are close to our curve. A mask can be used for so much more: you could delete faces on a mesh with it, or use it to access specific mesh components, etc...
Curves represent GraphN's curve/spline/path objects. In GraphN, we provide a wide variety of curve nodes to resample curves, smooth, bevel, slice, and query all sorts of curve data, such as curve point positions, rotations, normals, tangents, and binormals.
Curves are an array type, which means you can create one or a million curves at once, and they'd be stored in the same object.
The Mesh type represents GraphN's native mesh data structure. You can store multiple meshes in one property, which makes this an array property. All common mesh data, such as components, vertex colors, and UVs are supported, and GraphN provides a bunch of geometry nodes that help you work with them.
In GraphN, Lists are a generic type that allows you to pack multiple object types into one. For example, you may have a Vector Array which represents an array of positions, and you could pack multiple vector arrays into a list data type.
In GraphN, the type Any is usually assigned to properties where their input type could be anything. You have nodes like Print, which allow you to output anything you want in your 3D software's output. Because print can output anything, we give it the type any.
A Map represents a structure with a key and a value, like name: joe, where name is the key, and joe is the value. This type can be used in pipeline automation to create JSON data but has very few common world-building use cases.
A callback is a property that simply executes whatever input is given to it. It doesn't give back any value like a vector array or scene container, and can often be used simply to continue the execution of a graph.