getAttr makes me nuts!

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
Old 06 June 2003   #1
getAttr makes me nuts!

PLEEEAAASSEEEEE HELPPPPP MEEEEEE

i have a problem in an expression i'm writing. I need a variable like this

float $old_xpos = 'getAttr -t 100 nurbsCylinder1.translateX';

it keeps failing!

it just gives me a syntax error :(
__________________
Peter Hartwig
vfx sup at duckling
www.duckling.dk

me: www.idiotbarn.com
 
Old 06 June 2003   #2
Hi chips__ ,

try this:

float $old_xpos = `getAttr -t 100 nurbsCylinder1.translateX`;

you have to use backticks "`" (ALT+096) instead of " ' ".

ciao

marco

Last edited by marco : 06 June 2003 at 03:56 PM.
 
Old 06 June 2003   #3
YOU THE MAN!!!! thanks Marco
__________________
Peter Hartwig
vfx sup at duckling
www.duckling.dk

me: www.idiotbarn.com
 
Old 06 June 2003   #4
Note that you can use the frameCache node to do this without embedding a getAttr in your expression, though as of 4.5 it was still somewhat buggy. Depending on how your DG is set up, doing a getAttr like that can be very cheap or very very expensive.

(For example, if you constrain the object whose attribute you're getting to a point on a deforming surface, Maya will have to calculate everything upstream from that surface for the previous frame. In the worst case, this can nearly double - or worse! - your execution times per frame.)

Be careful out there...

-- Mark
__________________
Mark R. Wilkins
author of MEL Scripting for Maya Animators
 
Old 06 June 2003   #5
that's a really good idea! the stuff i'm doing is very simple, so it doesn't matter that much. but i know i should learn to code niceli though
i think i need to go get your book
__________________
Peter Hartwig
vfx sup at duckling
www.duckling.dk

me: www.idiotbarn.com
 
Old 06 June 2003   #6
btw I don't mean to say that doing what you're doing isn't the best way to go -- just that it can be dangerous if you don't carefully think through what Maya will have to calculate to get what you're asking it to get for you.

Also, the expression may or may not recalculate correctly depending on its other inputs... worry about this as it happens.

-- Mark
__________________
Mark R. Wilkins
author of MEL Scripting for Maya Animators
 
Old 06 June 2003   #7
I know. But seriously, i need to learn i've only used MEL for about five days now, while doing regular production, so i have alot to learn

Just picked up your book (company billing rocks!! hehe), it looks really good! I just have to finish David Goulds first, then on to yours
__________________
Peter Hartwig
vfx sup at duckling
www.duckling.dk

me: www.idiotbarn.com
 
Old 06 June 2003   #8
Quote: I just have to finish David Goulds first, then on to yours


Since David's book is a lot more rough for beginners, you might consider setting it aside and coming back to it later...

-- Mark
__________________
Mark R. Wilkins
author of MEL Scripting for Maya Animators
 
Old 06 June 2003   #9
well, i'm about halfway through it... i guess it's a good idea
__________________
Peter Hartwig
vfx sup at duckling
www.duckling.dk

me: www.idiotbarn.com
 
Old 06 June 2003   #10
yo' Mark-

what's up with this frameCache node anyway?!... last time I played around with it, it was giving some crazy strange results, so i abandoned using it alltogether :annoyed:

Any improvements in Maya 5 with this??


David
 
Old 06 June 2003   #11
i don't know, I haven't had great results with it either, but sometimes it does work...

-- Mark
__________________
Mark R. Wilkins
author of MEL Scripting for Maya Animators
 
Old 06 June 2003   #12
Haha! is that was computing has come to .... but sometimes it works ... hehehe
__________________
Peter Hartwig
vfx sup at duckling
www.duckling.dk

me: www.idiotbarn.com
 
Old 01 January 2006   #13
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:39 PM.


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