Problems with dynamic component timing



Hello all. I am having issues with creating a series of animated rotations with dynamic components. I am modeling a hasp with two hinges, and have broken it up into a couple components. I have successfully written a series of animation attributes that rotate the parent component, and a child component around the correct axis’s using onclick with the animatecustom function. Where I am having trouble is with the timing.
When the parent component is at 0 degrees, and you click, I need the child component to wait to rotate until the parent has moved to 90degrees. Then, once the child rotates to 90 degrees, on the next click, I need the child to move to 0 degrees first, and then, only after the child moves, the parent needs to move to -90 degrees. I’ve played with logic functions a bit, but cant figure out a way to get this to work. Any help would be greatly appreciated. Thanks.


Check this example:


Thanks, that was a useful thread, but I am now struggling to get the provided functions working in my model. I have modified the code in the example to fit my application, and it doesn’t work. I’m not sure what I’m doing wrong here. The issue seems to be with how the IF statement/attribute’s are being interpreted.
For some reason the “Time”, and “Time2” statements are being executed as if the IF statements are always false(the second value is always used), even when the “state” they’re referencing should be true.
I’ve tried tweaking the “state” IF statement, to the other number that “RotZ” reaches during the operation. I’ve also tried changing the attribute that “state” references, to the “Motion_full” attribute, which is where RotZ gets its value from, but so far nothing seems to work. Any insights here would be greatly appreciated. Thanks.


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.