Page MenuHome

Data Type Names
Open, NormalPublic

Description

Currently, Blender exposes only very few data types to users in node editors.
The main types are Value, Integer, Vector and Color.
Unfortunately, more types are required when we want to give users more possibilities.
New types will become very useful when they are usable in a more general purpose node tree and when we want to let users define custom attributes on e.g. mesh vertices.

Examples for types that might become necessary are vectors of various dimensions of floats and integers.
Furthermore, we really need a boolean type.

Besides these simple types, there are a couple more complex types, that might become important in the future.
Namely matrices of various sizes, text and different float and integer sizes.

When we have more types, giving them precise names using some naming convention is important.
Especially the current name Value might be too generic and should be replaced in my opinion.

To get some inspiration for how to name data types in 3D software, I checked the docs of some other applications.
The names below might not be 100% correct in all cases, but this is what I found in their docs.
Having this overview hopefully helps to decide what we want to have for Blender.

  • Shading Nodes in Blender: Value, Integer, Vector, Color
  • Animation Nodes: Float, Integer, Vector, Text, Matrix, Color, Boolean
  • Houdini: int, float, vector2, vector, vector4, array, struct, matrix2, matrix3, matrix, string
  • Softimage ICE: scalar, integer, rotation, location, 2D vector, 3D vector, color, Boolean, 3x3 matrix, color
  • Unreal Blueprint: Boolean, Byte, Integer, Integer64, Float, Name, String, Text, Vector, Rotator, Transform
  • Maya Bifrost: bool, signed/unsigned char, signed short int, double, string, char3, float3, double4, int3x3, ulong4x4, .... Grouped in the UI, similar types have the same color (e.g. 2d, 3d and 4d vectors; all matrix types; integers of all types; decimal values)
  • Max Creation Graph: sInt32, Single, Boolean, String, Matrix, Quaternion, Vector3

Various aspects need to be considered when picking a naming scheme:

  • Similar types should have similar names.
  • Should data type names be familiar to technical users?
  • What is a good compromise between precise names like int32 and simple names to be displayed in the UI like Integer?
  • Should there be two versions of every type name for different kinds of users?
  • Should type names contain spaces (can be important when their are used in file names or programming languages)?

I do not have a strong opinion on what the names should be exactly. I'd just like to get some feedback to decide which naming scheme to use.

Details

Type
Design

Related Objects

Event Timeline

! In T71384, @Jacques Lucke (JacquesLucke) wrote:
Similar types should have similar names.
Should data type names be familiar to technical users?
What is a good compromise between precise names like int32 and simple names to be displayed in the UI like Integer?
Should there be two versions of every type name for different kinds of users?

Yes, similar/internally-compatible types would ideally have similar names.
Given the current efforts to make 2.8 UI more user oriented using less "programmer jargon", I'd say they should as much as possible be named using "everyday language" for non technical end users, without oversimplification. "Float" over "Value" would seem like an acceptable trade, or perhaps more technical terms like "int32" could be described in tooltips.

Robert Guetzkow (rjg) added a comment.EditedFri, Nov 8, 3:33 PM

One aspect that should definitely be discussed here or as a follow up task is color coding for the sockets as you've mentioned in the Maya Bifrost bullet point. New data types will need a color that tells the user which sockets can be connected. With several new data types, especially ones with specific bit length, it could quickly become overloaded if we add a unique color per data type and it would be hard to know what sockets can be connected to each other. However using the same color for data types that can be converted / cast isn't great either, because if you allow connections between data types from higher to lower value range the user will get unintended scaling, wrap-around or clipping of values.

Indeed agree, given the potential amount of data types colors alone may be insufficient, though most listed implementations have around 10 ~11 data types.
Mapping those to colors I think we could manage 10 different enough hues.

One alternative is to additionally use different socket shapes (circle, square, triangle, star) combined with colors.
Shapes could indicate some sort of relation/compatibility between types, and maybe the increase in possible combinations is enough.

Given the current efforts to make 2.8 UI more user oriented using less "programmer jargon", I'd say they should as much as possible be named using "everyday language" for non technical end users, without oversimplification. "Float" over "Value" would seem like an acceptable trade, or perhaps more technical terms like "int32" could be described in tooltips.

I agree. How are 2D and 3D vector of floats and ints called in "everyday language"?

Yes, 10 different data types can easily be encoded with colors. Animation Nodes has many more and it is ok still. One interesting aspect I'm not sure about yet is whether similar types should have similar colors. I noticed that sometimes it would be better to give them very different colors because e.g. int and float often appear in the same places and it is hard to tell them apart when they have a similar color. On the other hand, having very different data types with similar colors is not that bad, because it is more obvious that they are not compatible.

Another solution would be to just not use colors to encode types at all. Instead we could just write the types next to the sockets (as it is done in Max Creation Graph afaik). The best solution is probably somewhere in the middle.

I'd prefer not to use different socket shapes to encode different data types for now. We might need different shapes to encode even higher level information. For example, a different shape can be used when the socket is not even a data type but something else.

In general, I'd prefer to keep this discussion focused on the types we want to have and which names we want to give them. We can decide which colors/shapes to use afterwards.

! In T71384#808078, @Jacques Lucke (JacquesLucke) wrote:
I agree. How are 2D and 3D vector of floats and ints called in "everyday language"?

Haha I don't have an answer for that. I guess "2D Float Vector" or "2D Value Vector" would have to do and a tooltip could show "2D Float Vector"

One interesting aspect I'm not sure about yet is whether similar types should have similar colors. I noticed that sometimes it would be better to give them very different colors because e.g. int and float often appear in the same places and it is hard to tell them apart when they have a similar color.

Good point. Then again very similar colors are easier to tell apart side by side, rather then being far between. Two similar shades of say orange are easier to distinguish if they are next to each other, and similar colors for related or interchangeable datatypes would help structure thought.

Another solution would be to just not use colors to encode types at all. Instead we could just write the types next to the sockets (as it is done in Max Creation Graph afaik).
I'd prefer not to use different socket shapes to encode different data types for now.

Another option is to use icons instead, next to sockets rather than full names. It seems more compact in terms of space.

Back on topic, is there a specific datatype for lists of things. Won't we need one for objects or list input like an Array?

is there a specific datatype for lists of things. Won't we need one for objects or list input like an Array?

Yes, lists of float/vector/... will be data types as well. Whether we call this "Float List", "List of Float", "Multiple Floats", "Float Vector", "Vector of Floats", "Float Array", ... can be decided after we know how the base type will be called.

Robert Guetzkow (rjg) added a comment.EditedFri, Nov 8, 8:38 PM

Given the current efforts to make 2.8 UI more user oriented using less "programmer jargon", I'd say they should as much as possible be named using "everyday language" for non technical end users, without oversimplification. "Float" over "Value" would seem like an acceptable trade, or perhaps more technical terms like "int32" could be described in tooltips.

I agree as well. Does it make sense to have data types with different ranges like short, int32, int64, e.g. for memory consumption or performance reasons?

My suggestion for the datatypes would be: Integer, Float, Boolean, String, Vector 3D, Vector 4D, Matrix 3x3, Matrix 4x4, Color. Creating arrays of each data type could be useful as well.

Does it make sense to have varying precision data types like short, int32, int64, e.g. for memory consumption or performance reasons?

One possible compromise is that we allow to have these specialized types when adding e.g. mesh attributes. However, node trees only process e.g. one specific integer type.

My suggestion for the datatypes would be: Integer, Float, Boolean, String, Vector 3D, Vector 4D, Matrix 3x3, Matrix 4x4, Color.

I guess Vector 2D should be added as well (for uvs). Houdini does something interesting, they skip the "3D" in the three dimensional case, so that it is just called Vector.
How about vectors of integers? I do not have a use case for it right now, does someone have an idea?

I guess Vector 2D should be added as well (for uvs).

Makes sense. Although with the different dimensions of vector and matrix, would higher dimensions be useful as well? I had something like filter kernels in mind, although perhaps not the most compelling use case.
One could have a socket that outputs a arbitrary dimensional matrix (same thing for a vector) for which the dimension would be known at compile / execution time and the corresponding input socket would need to work on arbitrary dimensions as well. It may not be a good idea or easy to implement, just putting the idea out there.

Houdini does something interesting, they skip the "3D" in the three dimensional case, so that it is just called Vector.

Seems inconsistent to me.

How about vectors of integers? I do not have a use case for it right now, does someone have an idea?

I don't have a specific use case on top of my head, but I can imagine cases where you'd want to avoid floating point precision issues.

! In T71384#808089, @Jacques Lucke (JacquesLucke) wrote:
How about vectors of integers? I do not have a use case for it right now, does someone have an idea?

Not sure I understand correctly, but perhaps useful for some sort of grid or increment snapping, voxel based volumetrics, or voxelized geometry or quantizing data.

I vote Softimage and Animation Nodes styles. Because, more friendly to artists.