Beer glass scene creation
This course contains a little bit of everything with modeling, UVing, texturing and dynamics in Maya, as well as compositing multilayered EXR's in Photoshop.
# 1 08-06-2006 , 04:19 PM
Dann's Avatar
Registered User
Join Date: Feb 2003
Location: Los Angeles
Posts: 695

Does it exist?

I've written a little script that creates a master cube and a bunch of followers. Hard to explain the usage for this, but go with me. It actually works almost exactly as I need it to, but for one problem. The first time you use it, all it well. The second time though, it breaks. The peoblem is that much of the script depends on the master object's name. How can I force it to check and see if an object with that name already exists so it will increase the number at the end? Any thoughts?

Thanks.
-dann

Attached Files
File Type: mel followbars.mel (4.9 KB, 215 views)
# 2 08-06-2006 , 06:36 PM
Alan's Avatar
Moderator
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
if(`objExists $objName` == 0)
{
//doesn't exist
}
else
{
//does exist
}

maya automatically adds a number on the end to a non unique object in the same scope. Or it returns full path names to non-unique objects in different scopes.

user added image
A


Technical Director - Framestore

Currently working on: Your Highness

IMDB
# 3 08-06-2006 , 06:39 PM
Dann's Avatar
Registered User
Join Date: Feb 2003
Location: Los Angeles
Posts: 695
Thanks Pure,

I actually came up with a solution about 2 minutes ago. Basically what you suggested. I know Maya tries to annumerate new objects, but the problem is that it allows objects to have the same name if they're not at the same level heirarchically. You can see my solution if you so desire.

Thanks again.
-dann

Attached Files
File Type: mel followbars.mel (5.5 KB, 203 views)
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads