- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I'm a fairly young 3D artist with no experience with coding/scripting, I'm currently working on experiences for AR (scenes exported form maya as glb) and some functions like MotionPath Flow or extruding curves do not export, so I found a way to get similar effects with the animation by rigging meshes and attaching locators to the curve. Unfortunately it's a very long and time consuming process especially with things like ribbons or growing vines, so I wanted to create a command in MEL that would do it all for me (assign motionpath to selected curve and locator, break the u value connection of the motionpath, assign new expression to it that is dependable on 2 attributes of the curve). So the MEL command is:
pathAnimation -fractionMode true -follow true -followAxis x -upAxis y -worldUpType "vector" -worldUpVector 0 1 0 -inverseUp false -inverseFront false -bank false -startTimeU 45 -endTimeU 58;
disconnectAttr motionPathX_uValue.output motionPathX.uValue;
expressionEditor EE "motionPath" "uValue";
expression -s "motionPathX.uValue = curve1.Pos - curve1.Gap*X-1" -o motionPath -ae 1 -uc all ;
so if instead of X i fill in the numbers myself the command works - of course since i copy-pasted from script editor, but manually inserting the number of the next motionpath to be created doesn't save me any time at all, so my question is to anyone with a basic understanding of MEL that would be kind enough to answer:
How am i supposed to phrase the commend so that the next motionpath automatically generates it's number "x" and then uses this number in all the other lines of the command and uses this number minus 1 "x-1" in the line "- curve1.Gap*x-1;"?
Kind regards,
Anita
Solved! Go to Solution.