View Full Version : Controller Keyable property causing problems...

06 June 2008, 07:20 PM
I don't know if it's a bug or what, but the way max treats the keyable property of tracks seems to be wrong. Because if I set that to false and autokey is on, max locks the parameter from being edited. Shouldn't it just to not create the keys?

The fact is that I created a Turbosmooth manager for the characters and animators (me too) often accidentally animate the iterations. I expected I can solve that by just setting the keyable properties to false, but doing this causes the problem I said above.

Other thing that come to my mind was to instantiate the tracks of the custom attributes that controls the Turbosmooths with the modifiers, but I cannot because:

1) The animatable property of the custom attributes is set to false, so there's no controller to instantiate.

2) If I set it to true to have a controller and be able to instantiate, I fall on the very first problem I said here in this post.

So what can I do to be able to have a Turbosmooth Manager that prevents the users to animate the turbosmooth efficiently?

For now I created a button "Clear TS Animations", but it's far from being elegant...



06 June 2008, 09:17 PM
but if the "iterations" subAnim has a controller, you can change the value, even if "keyable" is false:

with animate off $.modifiers[1].iterations.controller.value = x

but using a weak reference to any instanced controller

06 June 2008, 02:41 PM
I'm feeling so stupid now...totally forgot the "with animate off" command... :D Thanks a lot man!

Just to note, we cannot change the value having or not a controller on the subanim if keyable is false AND autokey is on. Only using "with animate off" as you suggested, but then there's no need to have a controller on the subanim.

Ahhh, and I don't have a solid knowledge about weak references, could you explain in simple terms?



06 June 2008, 12:32 AM
"A weak reference is essentially a node callback to an object. Its called when the object changes, unlike the .this construct or node variable which gets evaluated every time the script gets evaluated even if nothing changes.

To give an object you need to assign it a custom attribute with either a maxObject type parameter or a maxObjectTab if you want a array type - these are paramBlock2 types. Once an object has this custom attribute, you can reference itself to this paramater type by:

$theObject.attribute (name of the maxObject parameter) = nodeTransformMonitor node:theObject forwardTransformChangeMsgs:false)

now typing in $object.attribute.node will give a reference to itself. A good tutorial for this is to assign two objects with a weak reference. Add a position list to each and position_script() then a bezier_position() to each.

In the position script of each, have it reference the other objects bezier position in the list as a reference to it e.g:

a.attribute.node.pos.controller[2].controller + offset position (add this offset only to one of them) This will make two object control each other a > b and b < a. Its essentially the same as instancing a controller but give you flexibility.

.this in script controller

CGTalk Moderation
06 June 2008, 12:32 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.