PDA

View Full Version : How to make Script Controllers to refresh in Animate on context?


loocas
05-05-2008, 09:07 PM
I've recently bumped into a super-stupid problem of Max's script controllers. I have no idea whether this is a design oversight or an intended implementation or simply a bug.

I have a complex rig of which some helpers are being driven by script controllers. All works fine and smooth as long as I don't turn the "AUTO KEY" mode on. In that moment, all of the controllers STOP REFRESHING and thus recalculating all the data in them. This could be "forgiven", but then I have several custom tools I wrote that work with a "with animate on" which is basically the same thing! The whole rig doesn't work and the whole toolset I've written is USELES :banghead:

WHAT THE HELL!?!?! :banghead: :banghead:

Does anyone know a workaround or a solution to this stupid "bug"?! I'm at the end of all the variations and options that I tried.

I also tried updating the sliderTime in the loop cycle, this works, but takes AGES to go through all the objects in the rig and loop through all the frames in the shot to store transform data, it's almost as slow as plotting point caches on the geometry. So, this is the LAST option I'll implement in my tools if everything else fails.

PEN
05-05-2008, 09:16 PM
Have you added variables to the left hand list and used those instead of referencing nodes by name?

loocas
05-05-2008, 09:34 PM
Have you added variables to the left hand list and used those instead of referencing nodes by name?

Yes, I have. I just found the problem, however, no workaround yet.

The problem is as follows:

I have a node under whose position controller I store a custAttrib definition which only contains a float variable, let's call it "test".

Then, on a different node, I assign to its z_rotation (in a list) a float script controller that references the custAttrib's "test" variable.

Now, when I play the animation, the variable increses in size by 10, let's say, so that the object spins. The problem is, when I enter the "Auto Key" mode, the variable get's all the changes keyed, so I disabled the "test" variable's .keyable property (set it to FALSE). Now, when I play the anim, all is fine, but AS SOON AS I enter the "Auto Key" mode, the whole system fails to refresh and the object doesn't spin after the first frame (it rotates correctly on the first frame, but that's it).

How can this be solved? I don't want to end up with billions of keys on the variable's controller, but I need the controller to make the object spin within the "animate on" context. :shrug:

loocas
05-05-2008, 09:38 PM
Same behaviour occurs when you add a Script Controller to the z_rot controller and define a "storedRot" and type in the controller this code:

if F < 1 then
(
result = 0.0
storedRot = 0.0
)
else
(
result = storedRot + 0.1
storedRot = result
)

result

loocas
05-05-2008, 11:40 PM
Oks, I found a workaround: persistent global variables.

They don't get keyable and update even when in the animate on context, which is what I've been all the time after.

It's a bit "dirtier" approach, but at least it works for what I need it for. :bounce:

JHN
05-06-2008, 08:56 AM
I find it typical that with lots of rigging problems CA's seem to cause some or lots of updating problems...

Do persistent globals merge and xref ok? (never used them)

-Johan

loocas
05-06-2008, 10:30 AM
I find it typical that with lots of rigging problems CA's seem to cause some or lots of updating problems...

Do persistent globals merge and xref ok? (never used them)

-Johan

I'll quote the documentation as I've never XRefed a persistent global variable, but merge seems to work fine:

When merging or XRef-ing in a file (scene/object XRefs are a special case of merge), when reading in persistent global variables,


NEW in 3ds Max 8: If the variable being read from the scene file already exists as a persistent global variable, the value of the persistent global is not overwritten. (It was overwritten in versions prior to 3ds Max 8).

If the variable exists as a non-persistent global variable, the global variable's value is overwritten.

If the variable does not exist as a global variable, a non-persistent global variable will be created. The last 2 behaviors are the same as in previous versions of 3ds Max.

PEN
05-06-2008, 01:53 PM
I wish I could find time to look at this closer for you as I'm using CA defs all the time for this sort of thing without a problem. I'll see if I can come up with a solution some time this week for you. I'm burried in writting another mocap converter at the moment and need it ready asap.

loocas
05-06-2008, 02:22 PM
I wish I could find time to look at this closer for you as I'm using CA defs all the time for this sort of thing without a problem. I'll see if I can come up with a solution some time this week for you. I'm burried in writting another mocap converter at the moment and need it ready asap.

I absolutely understand your busy schedule, no rush, mate, I very much appretiate that you even took a peek in this thread ;) :thumbsup:

Keep the great work up, man! And all the best with the current project of yours... :deal:

CGTalk Moderation
05-06-2008, 02:22 PM
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.