[Closed] #MaxObjectTab vs Script Controller. Which is faster?
For every keyable object, or object that I operate on, I store it in it’s own MaxTabObject array. That way the index is always 1. Fingers and constrained objects I only store as groups.
– MY CA DEFINITION
‘UpperArm’ type:#maxObjectTab tabSize:0 tabSizeVariable:true
– ADDING ONE ITEM TO THE ARRAY
append AttributeHolderMod.UpperArm (nodeTransformMonitor node:Upper forwardTransformChangeMsgs:false)
– MY ‘ON ROLLOUT OPEN’ LOCAL DECLARATION
UpperArm = AttributeHolderMod.UpperArm[1].node
But, I had a couple of MaxTabObject question as well.
-
I’m using several (about 20) MaxTabObject parameters per limb. Most only have one object node. Would it be better to have one parameter with all my objects in it? (I’m currently not experiencing any slow down.)
-
Also would a fixed tab size versus a varible tab size give better performance? If I always know how many objects I’m going to add?
Thanks for any help.
Just don’t use arrays, just use maxObject instead of maxObjectTab and you don’t have to worry about access arrays at all.
Thanks guys! Just gonna take a little moment to digest all that juicy new information and try to find a portion of my brain to store it in. I think there’s a few Simpsons quotes I could push out to make room…
OK, I think that a CA setup with multiple maxobjecttabs for different parts of the rig would work best. I can split the rig into various arrays knowing that some will remain constant and some will vary in number (but now a predictable number). Theoretically it should be quicker too as it only needs to find the objects in small arrays.
I’ll let you know how much quicker it is.
Thanks again.
:¬)
OK, after a lot of work, I replaced all of the nodes refered to in the script controller with lots of maxtobjecttab arrays and yes, it’s a lot quicker to manipulate the rig now.
Previously, when adjusting a key at the root of the rig in the trackview with interactive update turned on, it would pause for a second before moving smoothly, now it pauses only for about 1/5 of a second before moving, making the result near enough to real-time for me.
Thanks again guys for all your help.
:¬)
Brad, are you saying that you are adding CA defs to script controllers to store nodes? If so and you are in Max 8 ot higher there is no need for this at all as it is built in. Or am I missing what you are doing?
Nah, what I was doing was having an object deemed as a node storage object which had a position script controller on it. It would have hundreds of variables in it with each one pointing to a different node on the rig. From there I would store that object as a #node on different CAs on the rig. The CAs would have scripts in them to call upon the node storage object and delve through its variable to recall the object needed.
For example:
this.node.position.controller.getvarvalue "master_control"
This system worked fine, it’s just that it would slow down too much. The new #maxtobjecttab system works much quicker.
:¬)