Cinema 4D - Customize Cinema 4D With User Data for You

103 49
Cinema 4D has so many features and the ability to customize your interface is one of the most special.
Not only does this capability let you customize your management interface, you get an implicit introduction to Xpresso controls and editor in the process.
If that isn't enough, it's pretty darn easy to do too.
Interested? Read on.
The steps for creating your custom data interface and then customizing further with menu tools and Xpresso is very straight forward.
Not only are the steps very straight forward, you see your changes immediately and can test them, verify their 'workability', right away! Let's begin with a couple objects and a light and add some user data for the light.
As we work through the steps, you will see how easy it can be.
Begin by creating a sphere and a plane.
Let your sphere rest on top of your plane and create a spotlight illuminating your sphere.
It always make objects more illustrative to add a material so if you have a material you like, glass or tile, to help our two objects stand out, by all means apply a nice visual material.
With your light chosen, under the 'attributes' panel, 'User Data', choose 'Add User Data'.
This will prompt a new menu panel with the properties you are going to define.
In our case, under name, enter 'height' and under 'Data Type', enter 'Float Slider'.
You see several other properties such as units, minimum and maximum values but simply naming our data item and specifying it's data type is all we need.
As soon as you create your first data item, you see it under the object's 'User Data' panel.
Click on your light if you are not already, click the 'User Data' panel and there it is, your newly defined 'height' value.
You see the slider bar to adjust it because you chose that for your interface, a 'float slider'.
However, if you slide your newly defined data item, nothing happens! Well, that's because we need to bind our newly defined data to a data item.
This is very easy to do and that really is all there is to it.
First, with your light chosen, click on the 'User Data' panel under attributes, then right click on our newly defined 'height' property.
This will open a panel of options; choose the first one at the top: 'Animation', then 'Set Driver'.
This series of choices is like many where 'child' menus are presented when you make choices.
It is really easy quite easy to follow.
What did we just do? We set our newly defined data item as a 'driver' of a previously defined data item.
In this case, the height of our light.
Now choose the 'coordinates' tab under the attributes set of values, choose the 'Y' value which determines the height of our light, right click on 'Y', and under 'Animation', choose 'Set Driver(Absolute)'.
Now we have connected our newly defined data item to a previously defined data item.
Now return to the 'User Data' tab, move the slider and see that now this does indeed adjust the height, the 'Y' value of our light.
Pretty cool? Yet here's the really cool part.
Look at your light object under the 'Objects' panel and see that now, there is an Xpresso tag next to it.
Double click on the Xpresso tag and you will see the light 'Y Position' directed to the 'Range Mapper', then directed to the output for the 'Y Position'.
The 'Range Mapper' might not mean much to you now but it is fairly intuitive.
The 'Range Mapper' box in the Xpresso world represents the function that 'maps' the range of values for a given parameter.
In our case, the parameter is the height of the light.
This is a great way to introduce yourself to the structure of the Xpresso editor, broaden your Cinema skill set while you are creating your own customized interface for a particular project! Not bad for a simple introduction...
to 'User Data'.
We'll explore more of the 'User Data' and Xpresso possibilities, in our next tutorial.
Source...

Leave A Reply

Your email address will not be published.