SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / question on expressions
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 21-06-2006, 06:54 PM   #1
mike_bonifacio
Registered User
 
Join Date: Mar 2005
Location: New York
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Post question on expressions

when i try to write an expression in maya, i keep getting an error

attributes must be of float, integer, or boolean types filmTranslate.

film translate in what im trying to do the expression on.

any ideas or websites i can go for help?
thanks
mike_bonifacio is offline   Reply With Quote
Old 21-06-2006, 07:27 PM   #2
skywola
Registered User
 
skywola's Avatar
 
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your question is unclear, what are you trying to do, and could you post the part of the code that is giving you the message . . .
__________________
"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
skywola is offline   Reply With Quote
Old 21-06-2006, 07:40 PM   #3
mike_bonifacio
Registered User
 
Join Date: Mar 2005
Location: New York
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

im taking a box, and using it to drive the film translate attribute in a camera


zoom_camShape.filmTranslate = pan640x480.translateX;

the box is named pan640x480.

basically, when i move the box, teh film translate attribute will change and my focus on what im looking at will change.
i need to do it to the x and y coordinates.

i'll tell you right now, i have about a week of experience with expressions. the other half of this project i figured out myself. but i don't know much of the language for what i want or can do.

i had an "if" statement earlier but it didn't help, and i got the same error message.

thanks
mike_bonifacio is offline   Reply With Quote
Old 21-06-2006, 08:47 PM   #4
skywola
Registered User
 
skywola's Avatar
 
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Best I can tell, by looking at the Maya help file, (always useful when you hit a brick wall) :headbang: is that the filmTranslate attribute is looking for TWO numbers . . .

From Help file :

filmTranslate (ct) double2 0.0, 0.0
Post projection translation component. Translate the film back by the given values.
The values are normalized with respect to viewing area.

filmTranslateH (fth) double 0.0
Translate in horizontal direction.

filmTranslateV (ftv) double 0.0
Translate in vertical direction.

So evidently it needs you to either supply it with two numbers,
and I'm not so sure how to do that without a little more research that I am to lazy to do, or break it down to :

zoom_camShape.filmTranslateH = pan640x480.translateX;
zoom_camShape.filmTranslateV = pan640x480.translateY;
__________________
"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
skywola is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

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

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.