Home Coding, Scripting, Shaders

scripting help

polycounter lvl 13
Offline / Send Message
artquest polycounter lvl 13
Hi,

I'm trying to write a script for maya to replace a set of objects that are already in a hierarchy with a new set of geometry that have the same names. The goal is to take several .obj files which have been edited outside maya and place them back into their original groups in the Maya scene and retain the original names and pivots, I've done some scripting but I'm a little lost on where to begin on this one as it requires way to store an array of object names, match those names against another set of objects that are the same and then parent them back under the group of the original.

Would you guys suggest solving the duplicate name issue with a namespace or by adding a suffix to the names of the newly imported pieces before running the script? I know how to do the very basics like write the for loop and cycle through each piece but I'm definitely fuzzy on how to store a list of two sets of names and then check them against each other in maya. I'm an artist with what I consider somewhat limited scripting experience so forgive me if this seems like a n00b question!

Thanks! 

Replies

  • ylke
    Options
    Offline / Send Message
    ylke polycounter lvl 6
    Hi, I think that it might be better if you use a suffix for the duplicated pieces. So what you can do is have a script that would run through the duplicated geometries, then get the name without the suffix. Next to just have to match the translate,rotate and scale. If you did not freeze transform the original geometries, then I think it should be fine.

    If you need help with the script, I can help you get a rough script out for you.
Sign In or Register to comment.