[Closed] node storage and dependency loops
Using the weak referencing has changed a lot of what you can do with storing references to nodes in scenes. I tried at one point to write my own character node of sorts. It all worked but I stored the entire character and rig in a #nodeTab in a scripted modifier. It all worked but I couldn’t move the character anymore. All the references to the nodes was killing performance as I had just created all kinds of nasty dependancies. Using the weak referencing now I can do it without a problem. Have a look at Maxine that ships with Max 8. I have stored reference to all the control objects in a custom attribute and there is no speed it at all.
Here is a line out of the script that I used to add the weak referencing to the #nodeTabs.
Ar=selection as array
for o in Ar do
(
obj=nodeTransformMonitor node:o forwardTransformChangeMsgs:false
append $Maxine_OuterWaist_CNT.modifiers[1].mainControl.lArm obj
)
I made a mistake with the weak referencing. It need to be stored in a #maxObject not a #node.
OK, that’s starting to get a little bit over my feeble maxscript junior level head. I take it that that script is storing the names of the selected objects within the custom attribute on your hip control’s top modifier? I also take it that you use some script contained within your CA to call upon and manipulate those objects stored within?
Anyhoo, I replaced all of the CA node stores on my control objects with one object that holds all of the nodes in a script controller and I noticed a bit of a speed increase (even though max 8 is pretty speedy with complex rigs already). It’s also nice to have all of the nodes stroed in one, easy to find place so I can simply add and remove them as I need.
Thanks guys.
:¬)
Brad, I’m writting a tutorial on how this can be used with custom attributes. Should be done by tomorrow for you. You really need to look into this as it is the best way to be storing nodes.
I just added a quick tutorial for Weak Referencing on my site. Please have a look and let me know if it is clear enough or if I should add anything to it.
There are links on the home page as well as in the tutorial sections of the site.