Mel Script Problem

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Search this Thread Display Modes
  1 Week Ago
Mel Script Problem

Hello
I have three objects in scene
A
B
D
I want to rename Objects by underlying melscript. But When i click on UI Button"Rename"of window, Object A and B rename successfully to A1 and B1 but doesn`t name D to D1 because of missing of C Object.
I want a script in which if script will not find object in scene, not terminates the process. jump to next statement, finish the program successfully.

if (`window -ex Testing`) deleteUI Testing;
window Testing;
columnLayout;
button -label"Rename" -c RenameObj;
showWindow Testing;
proc RenameObj() {
rename "A" "A1";
rename "B" "B1";
rename "C" "C1";
rename "D" "D1";
}
 
  1 Week Ago
You should try to think about your code a bit and maybe write it down in pseudocode:


buildUI()
{
 createWindow
 createButton
}

pushButtonCommand()
{
 if object exists then rename it
}


With such a simple structure you should easily find a way to implement it e.g. a simple search for "object exists maya mel" will give your the command to check if an object exists.
__________________
www.renderwiki.com - www.openmaya.net
 
  1 Week Ago
Thanks, I hope it will helps me a lot.....
 
reply 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 05:46 PM.


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