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
  12 December 2017
Mel Script Problem

I have three objects in scene
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;
button -label"Rename" -c RenameObj;
showWindow Testing;
proc RenameObj() {
rename "A" "A1";
rename "B" "B1";
rename "C" "C1";
rename "D" "D1";
  12 December 2017
You should try to think about your code a bit and maybe write it down in pseudocode:


 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.
__________________ -
  12 December 2017
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
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 04:52 PM.

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