Play a animation with Delay (Python code)

Play a animation with Delay (Python code)

Anonymous
Not applicable
1,479 Views
4 Replies
Message 1 of 5

Play a animation with Delay (Python code)

Anonymous
Not applicable

Hi there

 

I just want to know, is there any python code to play a animation with delay?

for example, i created a animation, when i press A it plays. but i want, when i press B, the same animation plays but after 3 second.

 

Thank you

0 Likes
Accepted solutions (2)
1,480 Views
4 Replies
Replies (4)
Message 2 of 5

seiferp
Community Manager
Community Manager
Accepted solution

You can achieve this with building a timer in python. I have attached an example that plays door one after 1 second you execute the variant set and door two after 3 seconds, door one has finished playing. This means when you change the value of door one, door two is still waiting until door one has finished. This allows you to play around with the timing without adopting all animations like you would do in the timeline.

 

play_with_timer.png

Message 3 of 5

Anonymous
Not applicable

Really thank you

 

How about a "python delay code" for a vset?

for example, when i press A, the light of a car will turn on. the light contain 3 pieces and i set 3 vset for each with a same hotkey.

what i want is, when i press A, this 3 vsets start after 5second.

 

is there any code?

0 Likes
Message 4 of 5

michael_nikelsky
Autodesk
Autodesk
Accepted solution

You can also achieve this by creating a clip that calls and empty Variant Set at frame 0 and the animation clip you want to play after a certain offset (note that you need to use the + in the toolbar of the Clipmaker, for some reason the functionality is missing from the popup menu). Then just create a Variant Set that calls this clip. This very easily allows you to finetune the timings by just moving the clip where you want it to be. 



Michael Nikelsky
Sr. Principal Engineer
0 Likes
Message 5 of 5

Anonymous
Not applicable

Thanks a lot Michael 😊

0 Likes