User avatar
By deadalvs
#196820
ok let's discuss that again with global definitions of vars.

example: (an easy one for SunlightRocker, :) )

* * *

// correct example 1

global proc A()
{
global string $A = "word A\n";
}

global proc B()
{
global string $B = "word B\n";
}

global proc C()
{
global int $N = 5;
}

global proc D()
{

global string $A;
global string $B;
global int $N;

print $A;
print $B;
print $N;

}

A;
B;
C;
D;

//result: word A word B, 5






//example 2

global proc A()
{
global string $A = "word A\n";
}

global proc B()
{
global string $B = "word B\n";
}

global proc C()
{
int $N = 5;
}

global proc D()
{

global string $A;
global string $B;

int $N;

print $A;
print $B;
print $N;

}

A;
B;
C;
D;

//result: word A word B, 0 because the new int $N is a new variable and
//not the global one.






//example 3

global proc A()
{
global string $A = "word A\n";
}

global proc B()
{
global string $B = "word B\n";
}

global proc C()
{
int $N = 5;
}

global proc D()
{

global string $A;
global string $B;

print $A;
print $B;
print $N;

}

A;
B;
C;
D;

//result: "$N" is an undeclared variable.


* * *

deadalvs
User avatar
By SunlightRocker
#196834
hehe. Thanks deadalvs, I think I understand that one. :D

Anyway, know of any good MEL-book for beginners? I got programming experiences, but I can no MEL. So, a book for beginners would be great.

I would like to learn how to do simple stuff like repeating loops with randomness and simple stuff like that. Anyone?
User avatar
By deadalvs
#196835
my learning stuff...

it's great to learn from !!!

--> official alias training guide «learning maya 6 MEL fundamentals» (newer available by alias.)
ISBN: 1-894893-72-7

--> David A. Gould: «Complete Maya Programming» Vol. II (i need book I because book II is more advanced and not usable to learn MEL. book I should be perfect.)

ISBN-13 of volume II: 978-0-12-088482-7
ISBN-10 of volume II: 0-12-088482-8

--> Kevin Mannens: «MEL 101: Fundamentals» by the gnomon workshop
http://www.thegnomonworkshop.com/
(actually the best shop i know !)

* * *

just ask if You need simple samples... :)

* * *

deadalvs
User avatar
By deadalvs
#196836
begin with:

//
sphere;
//

or

//
print "hello world !";
//

:)

* * *

deadalvs
User avatar
By DrMerman
#196840
The absolute BEST thing you can do mate, is just have the script editor open when you are working. You quickly begin to grasp most of the basic commands :)
User avatar
By deadalvs
#196841
ok. try this.

i'm getting on with the script... it's cool to play around.

-->
in this folder:
http://www.jumpgates.com/matthias/MEL/
there's this file:
http://www.jumpgates.com/matthias/MEL/t ... ript_7.mel

- just create two equal NURBS planes (degree 1 !) with the same amount of patches for both NURBS (example u = 5 and v = 10 patches)
- pay attention that You create two new planes, don't duplicate one !
(who am i actually talking to ??)
- create one nurbs circle (normal axis == z !!)

* * *

1) run the script.
2) select the two nurbs planes and hit the button «Get two Nurbs Planes»
3) select the circle and hit the button «Get Profile»
4) hit «Normal Truss» and wait a second.
5) hit «Delete all trusses» to get rid of all again
6) deform the nurbs planes and repeat 1) to 4)

* * *

deadalvs
User avatar
By deadalvs
#196842
DrMerman wrote:The absolute BEST thing you can do mate, is just have the script editor open when you are working. You quickly begin to grasp most of the basic commands :)
well... that's really the best... ! i second that a lot !

* * *

deadalvs
User avatar
By Joss
#196873
Yep, script editor and Maya online help is the best guides.
Actually list of MEL commands in online help also contains some examples at the end of each article which is very useful.
Help with swimming pool water

Hi Andreas " I would say the above "fake[…]

render engines and Maxwell

Other rendering engines are evolving day by day, m[…]