SimplyMaya Forums

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

Home / forum / Animation / Mel Scripts & Programming / Variable to implement number in object name?
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 29-11-2017, 04:39 PM   #1
cbernadet
Registered User
 
Join Date: Nov 2017
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Variable to implement number in object name?

Hi everyone!

I have this simple task, where I want to offset the values on multiple animation curves on différent objects.
Objects names are: MPath01_uValue, MPath02_uValue, etc....

I use a for loop, so I would like to apply the offset on the MPath01_uValue in the first loop, then apply the offset on the MPath02_uValue, etc...

Can we make the 01, 02... in the names variable???
Don't know how, I'm still new to programming...
I tried to make an int $OffAnim = 1; place the variable in the name like: MPath0($OffAnim)_uValue which of course doesn't work at all!

any help please?

here's my script:

float $uvMin = 0;
float $uvMax = 1;
for( $OffAnim=1; $OffAnim<26; ++$OffAnim )
{
selectKey -add -k -f 0 MPath($OffAnim)_uValue ;
keyframe -animation keys -absolute -valueChange $uvMin ;
selectKey -add -k -f 1 MPath($OffAnim)_uValue ;
keyframe -animation keys -absolute -valueChange $uvMax ;
$uvMin = $uvMin + 0.04;
$uvMax = $uvMax + 0.04;
}
cbernadet 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Attributes to drive an object? tomundrwd Animation 0 08-08-2015 11:10 AM
Convert Camera Translation to Object rotation? jimvfx Animation 0 28-01-2015 10:06 PM
Bend only a part of object (tail) BAD COMMAND Animation 1 03-10-2014 06:22 PM
trouble opening maya scene jooleyinboots Technical Issues 2 03-02-2014 09:11 PM
parent one object to another mickhah Maya Basics & Newbie Lounge 9 24-08-2012 06:05 PM

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.