Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / Creating a motion path with a name?
  RSS 2.0 ATOM  

Creating a motion path with a name?
Rate this thread
 
63159
 
Permlink of this thread  
avatar
  • R*
  • Posted: 29 December 2011 04:41 AM
  • Total Posts: 10
  • Joined: 29 December 2011 04:20 AM

Hey

Is there a way to create a motion path with a name instead of the default “path” name. I currently have this line of code:

curve -n path --30 0 0 -p 0 0 30 -p 30 0 0 -p 0 0 -30 --30 0 0 -d 2//creates a motion path
rename "path1" "path2"//renames motion path "path 1" to "path2".

Its creating problems as i have multiple motion paths so i have to create them in numerical order. If i was to try to create the second motion path first, i’d get an error because the default name assigned to that motion path doesn’t exist because there isn’t another motion path before that.

It probably sounds confusing, but the gist of it is i want to create a motion path with a name tied to it instead of editing the name after the motion path has been created like in the code above.

I tried:

curve -n path --30 0 0 -p 0 0 30 -p 30 0 0 -p 0 0 -30 --30 0 0 -d 2 -name path2;

But it doesn’t work.

Thanks.



Replies: 0
avatar
  • ldunham1
  • Posted: 30 December 2011 11:51 PM

typically you would store the name in a variable upon creation, so:

string $curve[]=`curve -n path -p -30 0 0 -p 0 0 30 -p 30 0 0 -p 0 0 -30 -p -30 0 0 -d 2` ;

so you can then access the curves transform name through $curve[0] and its shape (which has the curve goodies on) through $curve[1].

btw

curve -n path --30 0 0 -p 0 0 30 -p 30 0 0 -p 0 0 -30 --30 0 0 -d 2 -name path2;

wont work as your using the -name flag twice, at the beginning and the end (-n path and -name path2)



Lee Dunham | Character TD
ldunham.blogspot.com

Replies: 1
/img/forum/dark/default_avatar.png

I don’t understand but never mind.

One final question. I’m trying to create a tick box in a window to control the “use all lights” and “use default lighting” commands under the “lights” tab in the viewport. But the problem is, i don’t know the code for the two operations. The script editor doesn’t show it.

Author: R*

Replied: 31 December 2011 04:41 AM