How to Stop Particle Emitter at certain frame using MEL Scripting

How to Stop Particle Emitter at certain frame using MEL Scripting

b00375640
Contributor Contributor
524 Views
4 Replies
Message 1 of 5

How to Stop Particle Emitter at certain frame using MEL Scripting

b00375640
Contributor
Contributor

Hi there,

I am very new to MEL scripting and for my assignment, I have to use MEL Scripting to control my dynamics. I have a water fall effect that I would like to stop or gradually stop at a certain frame in my animation. How would I script that? I am a complete beginner so any help with comments would be great. 

Thank you 🙂

Accepted solutions (1)
525 Views
4 Replies
Replies (4)
Message 2 of 5

Kahylan
Advisor
Advisor

Hi!

 

I don't know much about simulation so  I really can't give you any specific code here.

 

But the command you are looking for is "setKeyFrame"

 

https://help.autodesk.com/cloudhelp/2017/ENU/Maya-Tech-Docs/Commands/setKeyframe.html

 

Just add a setKeyframe command for every Keyframe you need.

 

I hope this helps!

 

 

0 Likes
Message 3 of 5

b00375640
Contributor
Contributor

Hi there,

Thanks for your reply!

 

The problem is I don't know which attribute to key for my emitter. I assumed I would need to key the rate (particles per second) but I don't see that option in the channel box. 

 

I also have no clue how to even start some script. I'm a complete newbie

0 Likes
Message 4 of 5

Kahylan
Advisor
Advisor
Accepted solution

Maya attributes are normally written in camel code, meaning they have a Capital letter at the start of each word. soe particles per second is probably "particlesPerSecond". If that isn't the case, you can always open up the script editor, then manually set a keyframe on the attribute and the command history will tell you on what attriubte it just set a keyframe. The attribute is everything after the first "." . So if you have "pCube1.transformX" for examle "transformX" is the Attribute.

0 Likes
Message 5 of 5

b00375640
Contributor
Contributor

Ah okay, thanks that helps

I'll do some experimenting and see if I can keyframe the attribute then