scripting - What is the function to run simulation in MEL? -
i create mel script creates scene, setting ncloth , passive collider objects , run simulation frame.
in script editor, can see scene set-up there no function starting simulation.
technique @andreas suggests called "command harvesting". great way learn , how maya doing things. answer specific question:
you can use cmds.play()
start playing on maya. see docs options.
you might want set start frame , end frame of playback range using cmds.playbackoptions()
command. see docs options.
so do: (relevant explanatory comments added)
# egs. play frame 1 120 # note playbackspeed flag used # need set 0 "play every frame". # setting maxplaybackspeed 0 result in free playback, playback isn't clamped. # @ point, playback wouldn't realtime, accurate. # dynamics , simulations must played or nucleus not evaluate properly. cmds.playbackoptions(animationstarttime=1, animationendtime=120, playbackspeed=0, maxplaybackspeed=0) # start playback cmds.play(forward=true)
edit: noticed had asked mel commands. take above commands , mel-ify them, so:
playbackoptions -e animationstarttime 1 animationendtime 120 playbackspeed 0; play -f 1;
suggestion: best playblast playback watch in proper fps , playback speed.
hope useful.
Comments
Post a Comment