what is the difference with what justin suggested? his example passes chrome but it could pass plastic. are you asking for help on the maya side or how to structure the program. originally i thought your question was how to structure and make functions. If thats the case, the easiest way to understand it is to abstract from maya and do something with plain strings
On Wed, Apr 17, 2013 at 10:33 PM, Daz <[email protected]> wrote: > Heya > > Thanks for fast reply! > > Humh I dont know how to explain it in more simple way. I want to put all > code that is repetitive in to 1 function so that I dont have to duplicate > it for each new function I do... Like in the "Not Working" example. I tried > to make a function that would remove objects from sets and it was being run > every time I tried to apply a different material. Unfortunately it didn't > remove objects from sets, but only keep on adding them. > > So atm the working script does this as I want it to : > > I select 10 objects > I click on chrome set > 10 objects ADD to chrome Set > I select 5 objects out of the 10 objects > I click on plastic Set > 5 object are removed from all sets > 5 object ADD to plastic Set > > Now the not working script does this: > > I select 10 objects > I click on chrome set > 10 objects ADD to chrome Set > I select 5 objects out of the 10 objects > I click on plastic Set > 5 object ADD to plastic Set > > Which mean that 10 objects are in chrome set from which 5 are in both > chrome and plastic. Which is incorrect as they can only be in 1 set. > > So for some reason when I run this command > > http://pastebin.com/C14d0D5H > > and then I run the same command but with different set name - so lets say > plastic. > > The object that were 1st added to chrome if selected again would also be > added to plastic set but would not be removed from chrome set. > > > > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
