Accessing the scale value of an object in Cinema 4D that is being affected by MoGraph effectors, especially within Xpresso, can be a bit tricky. This is because the effectors often modify the scale at a level that isn’t directly reflected in the object’s basic parameters.
To access the scale value of an object as it is after being affected by MoGraph effectors, you need to use the MoGraph Data node in Xpresso. This node allows you to extract various types of data from MoGraph objects, including the scale as affected by effectors. Here’s a basic outline of how you can do this:
-
Create a MoGraph Data Node:
- Open the Xpresso editor and create a MoGraph Data node. You can find this under the MoGraph menu in the Xpresso node browser.
-
Set the MoGraph Object:
- Drag your MoGraph object (like a Cloner or Matrix object) into the Xpresso editor. This will create a node for the object.
- Connect the object node to the MoGraph Data node. For example, if it’s a Cloner object, you’d connect the Cloner node to the MoGraph Data node.
-
Configure the MoGraph Data Node:
- In the MoGraph Data node, you need to set it to retrieve the right kind of data. In the attributes of the node, set it to retrieve the ‘Matrix’ or ‘Scale’ data.
- If you choose ‘Matrix’, you will get the transformation matrix of each clone, which includes scale information. If you choose ‘Scale’, you will get just the scale vector.
-
Extract the Scale Information:
- You will likely need to use additional nodes to extract the specific scale values from the data provided by the MoGraph Data node. For example, if you’re using the Matrix data, you might need a Matrix2Vectors node to break down the matrix into position, scale, and rotation vectors.
-
Use the Data as Needed:
- Now that you have the scale data, you can connect it to other nodes within your Xpresso setup to drive other parameters or calculations.
Remember that MoGraph Data node will provide information about all clones or elements in your MoGraph setup. If you need data for a specific clone, you’ll have to specify its index (i.e., which clone number you want the data for).
Also, note that this approach gives you the final transformation matrix of each element, which includes the combined effects of all transformations (position, rotation, scale) and is influenced by all effectors affecting the object. If you only need the scale component, be sure to isolate it properly.