Spin

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  05 May 2003
Spin

I beguin today Mel ;(

I seek to make spin a cube to a loop on 360° by increment of 30°deg.

On ligntwave I make

' main
{
copy (); // com. copier

for ($x=10; $x<360; $x+=10) //loop 360° by increment 10°

{
rotate (10, "Y"); // rotate on 10 °
paste ();
}
}

But I dont know with Mel....
 
  05 May 2003
1) Make a cube and rename it cube.

2) Open the Expression Editor

3) Enter the following expression:

cube.ry = frame * 10;

-- Mark

P.S. Sounds like you need a certain textbook!!
__________________
Mark R. Wilkins
author of MEL Scripting for Maya Animators
 
  05 May 2003
Quote: Originally posted by mark_wilkins
P.S. Sounds like you need a certain textbook!!


I think you're right there.....

I'd have to recommend one:

Complete....

sorry, sorry.... my mistake...

MEL Scripting for Maya Animators


I can't remember who it's by, though - but I'm sure a search on Amazon will bring it up.....


__________________
Hugh Macdonald
nvizible
 
  05 May 2003
Thx for ur reponse and now I discovered Expression Editor but it wasn't this.
I want my cube duplicate all 10° deg on 360.

MEL Scripting for Maya Animators, I heard some speak but actually i beguin and i have only the docs of Ple.
 
  05 May 2003
ok, here's the MEL script:


nurbsCube;

for (x = 0; x < 360; x += 10) {

duplicate;
rotate 0 $x 0;

}
__________________
Mark R. Wilkins
author of MEL Scripting for Maya Animators
 
  05 May 2003
Mark: when you duplicate, don't you end up with both the original and the new object selected?

if I may suggest a slight modification to your script:

$newNurbsCube = `nurbsCube`;
$myNurbsCube = $newNurbsCube[0];

for($x = 0; $x < 360; $x += 10)
{
select -r $myNurbsCube;
duplicate;
rotate 0 $x 0;
}
__________________
Hugh Macdonald
nvizible

Last edited by Hugh : 05 May 2003 at 11:00 AM.
 
  05 May 2003
Mark: when you duplicate, don't you end up with both the original and the new object selected?

nope, only the new one.

-- mark
__________________
Mark R. Wilkins
author of MEL Scripting for Maya Animators

Last edited by mark_wilkins : 05 May 2003 at 11:29 AM.
 
  05 May 2003
Ah yes - of course....

sorry 'bout that....

in which case, shouldn't the line be:

rotate 0 10 0;

as otherwise you'll be getting exponentially larger rotations from the base position....
__________________
Hugh Macdonald
nvizible
 
  05 May 2003
no, because by default rotate provides an absolute rotation.

However, one could replace

rotate 0 $x 0;

with

rotate -r 0 10 0;

-- Mark
__________________
Mark R. Wilkins
author of MEL Scripting for Maya Animators
 
  05 May 2003
'doh

Of course - you're right..... (there shouldn't have been any doubt!)


I've been so used to always using rotate -r that I didn't notice it wasn't there in yours....
__________________
Hugh Macdonald
nvizible
 
  05 May 2003
Thanx all and mark_wilkins, I understand errors in my script, I forgot the {} ;(

you need a certain textbook Yes, sure I need to buy a good book on Mel.
 
  01 January 2006
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:18 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.