Q: What did the tree say to autumn?
A: Leaf me alone.
Now that I’ve got that out of my system, I thought we’d take a quick look at the humble DRM Leaf property. We’ve all used it one way or the other, whether we are setting up a hierarchy or applying formula logic. The Leaf property is a core system property which ships with DRM and signifies whether a node can have children below or not.
One of the simplest reasons to use this property is to change a node from a leaf to a limb…of course, if it doesn’t have any children.
Action Script?
What if we wanted to automate this change of property? This is possible by using the usual “ChangeProp” syntax. As the drop down list in the screenshot suggests, it is a simple Boolean property (did you know that George Boole had a crater on the moon named after him?). So the syntax to the script might look like:
Running the above script will change the leaf to a limb node.
Import Action?
When you set up your hierarchies initially through imports, you might want to pay attention to the Node Options selection. Ignoring this is fine, if you have the ability to set a node as a leaf or not from your import table/file. If you want DRM to make the decision for you whether a node is a leaf or not, checking the following option would be a good idea.
Some Blender Action?
When you are in situations when you have to blend a couple of versions, occasionally, a node might be a limb in the target version, but a leaf in the source version. Assuming the source version is accurate, how do we set a blender to work correctly? In the example below, “LC_CF” is a leaf in the source version, but a limb in the target.
I think my blender would run correctly based on the setting below:
I run the blend, and no error messages are returned, so surely, all things must be good in Fandangoville?
Nope, a quick check on the hierarchy shows that nothing has changed; the node still remains as a limb.
The fix though, is quite simple. And it comes back to our humble Leaf property. The trick is to add the Leaf property to the Properties section of the blender as shown below.
And boom, all is good in Fandangoville again.
What if there were children below the limb that was being changed as seen below?
The blender will fail in this case and show an error.
If we make the assumption that our source version is accurate, then the way around it is to ensure that the Process Removes option is checked.
And there you have it, the node becomes a leaf again and the child below it has been removed.
This may or may not work for you (specifically, removals), depending upon your implementation needs. So, make sure to test, test and test again. The whole point behind this post was to look at the humble Leaf property and how understanding it in different contexts shows how powerful it is.