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, 03:39 PM   #1
Registered User
Join Date: Nov 2017
Posts: 1
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 10:10 AM
Convert Camera Translation to Object rotation? jimvfx Animation 0 28-01-2015 09:06 PM
Bend only a part of object (tail) BAD COMMAND Animation 1 03-10-2014 05:22 PM
trouble opening maya scene jooleyinboots Technical Issues 2 03-02-2014 08:11 PM
parent one object to another mickhah Maya Basics & Newbie Lounge 9 24-08-2012 05:05 PM