Introduction to Maya - Modeling Fundamentals Vol 2
This course will look in the fundamentals of modeling in Maya with an emphasis on creating good topology. It's aimed at people that have some modeling experience in Maya but are having trouble with complex objects.
# 1 04-09-2007 , 06:50 PM
Registered User
Join Date: Apr 2005
Posts: 28

To the power of??

Hey, I've got a little problem that I want to solve using an expression. Without going into details about what I've done, I basicly have to write an expression using 'the power of' operator.
I read through the documentation in the maya help files, and i can run the example it gives 'pow 2 4' which = 16, but when i try to assign that to an attribute using the expression editor, it just gives me a syntax error. What im trying to do is:

Object.Attribute = (1.7 * ( pow PathLength.input1X -.73));
PathLength.input1X is a float

I cant see any syntax errors in that, but even having the line
Object.Attribute = pow 2 4; gives me a syntax error, which is copied straight from the documentation.

Is the syntax used in the expression editor different to that used in the script editor? and if so, how do I put a number to the power of another number? (i tried using the ^ and no dice)

Any help on this would be appreciated,
Thanks, Joel

# 2 04-09-2007 , 07:59 PM
t1ck135's Avatar
Registered User
Join Date: May 2004
Location: UK
Posts: 1,991
you need to use it like a standard function - the maya help doesnt help at all in showing that user added image

float $var = pow(2,4);
print $var

>> Gives
16

So your code would be:
Object.Attribute = 1.7 * ( pow(PathLength.input1X, -0.73));

EDIT: Looks like you asked about this elsewhere and got the right answer a few months ago:
https://www.highend2d.com/boards/lofi...p/t239400.html

Si


Examples of bTraffic - a traffic animation tool for Maya
bFlocking - a tool for Maya 8.5+ to generate flocking and swarming behaviours
Jan/Feb Challenge 2007 Entry and W.I.P
May/Jun Challenge 2006 Entry and W.I.P
Mar/Apr Challenge 2006 Entry and W.I.P
Jan/Feb Challenge 2006 Entry and W.I.P
Nov/Dec Challenge 2005 Entry and W.I.P
Sep/Oct Challenge 2005 Entry and W.I.P
Jul/Aug Challenge 2005 Entry
www.flash-fx.net

Last edited by t1ck135; 04-09-2007 at 08:08 PM.
# 3 04-09-2007 , 08:36 PM
Registered User
Join Date: Apr 2005
Posts: 28

Thanks

Thanks for the reply, I'm not sure how that happened, i posted the same question at highend 3d about 5 minutes after I did here, not sure why it said it was a few months ago. I didnt realise how quick I would get responses user added image.

Thanks for the help with that, im not sure why they wouldnt say that in the maya documentation, would have made life alot easier.

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads