When you are working with Xpresso in Cinema4D it is often important to choose the correct datatype. This is particularly true when you are creating user data for your objects.
Open the user data manager and choose to add data. The next thing you need to do is select the data type. Unfortunately if you go back to edit existing user data later you cannot change the data type specified, so it is preferable to create the correct data type in the first place.
Another time you need to know the correct data type could be if you are working with XGroups and need to specify your input and output ports. Again you will be presented with a list of names and all you really want to do is add a port for perhaps position, rotation or colour, etc.
One of the simplest methods to find the required data type is to add an xpresso node that already has a similar port. For instance, you may wish to add user data to an object to control position, to adjust radius or to create a checkbox.
Create a cube and drag it to the Xpresso window and add the ports like the images below. Then as you mouse over the ports, take a look at the lower left of the Xpresso window. Cinema4D will display some text that gives you the name of the port and also the data type used.
Kai Pederson made a very valid point in his comment below which definitely deserves a mention.
“Personally I hate having to look down there when I’m mousing over a port so I turn on bubble help, this way when I mouse over a port or a wire, it will show that information in the bubble help right where my mouse is.”
Thanks for the tip Kai.
So if you are unsure of the correct data type, simply find a node or object that has a similar type of parameter. You can then drag this object into Xpresso and create a port for that parameter. The status bar will then let you know the data type.
If all of this seems like a bit of a long winded method to find out this information, don’t worry! There is actually a really quick way to do this. If you have an object that already has the type of user interface that you need. Be this a checkbox, vector field, colour chooser, etc.
Right click on the element in the Attribute Manager, choose Copy User Data Interface. Now instead of choosing User Data > Manage User Data, choose Paste User Data Interface. The user data manager will open and the element you copied will be already created. You just need to adjust the parameters so they are more suitable for your needs.
Xpresso Tutorial – Which Data Type?