Re: [Maya-Python] Getting the original shader assignment

2016-10-15 Thread likage
After some trial and error around, I managed to come up with a 'hacky' way of renaming it by splitting the keys in the dict then creating a new dict which store the current connections (with the new naming) while comparing the last 2 elements in the scene to replace them. While I understand thi

Re: [Maya-Python] Getting the original shader assignment

2016-10-13 Thread Justin Israel
Maybe this suggestion doesn't work for your application, but is there any reason you can't store it as an attribute on each individual geo node, instead of building up some huge fullpath set on a locator? If it were stored on the geo, then you don't have to worry about tracking the renaming, right?

Re: [Maya-Python] Getting the original shader assignment

2016-10-13 Thread likage
Hi all, so I have managed to store the initial shaders connection and it is currently working by using the above example that I have linked where they are stored as an extra attribute in a locator. Currently I am stumped in an issue, where should the name of the said geo be changed, it should a

Re: [Maya-Python] Getting the original shader assignment

2016-10-13 Thread likage
Hi all, so I have managed to store the initial shaders connection and it is currently working by using the above example that I have linked where they are stored as an extra attribute in a locator. Currently I am stumped in an issue, where should the name of the said geo be changed, it should a

Re: [Maya-Python] Getting the original shader assignment

2016-10-07 Thread likage
@Justin Okay, I will try that out again. Did not saw your message as I was trying something from this link in which I create a locator and store the 'original' assignment under this new locators' extra attributes But still, it starts to fail very badly when I

Re: [Maya-Python] Getting the original shader assignment

2016-10-07 Thread zeth willie
I would look at message attributes. i.e. create a message attribute somewhere on the rig (top level?) and plug the "message" attr of the shader or shading group into that. Then it's persistent across maya sessions,etc. Should be pretty easy to add to your script, too. #create and connect messag

Re: [Maya-Python] Getting the original shader assignment

2016-10-07 Thread Justin Israel
On Sat, Oct 8, 2016 at 5:38 AM likage wrote: > Hey Justin, correct me if I am wrong on this.. > > So while I did try using global dictionary, it only works on the first try > too, but as soon as I close and reopen my UI, the original assignment is > gone.. Giving me the same issue as stated in my

Re: [Maya-Python] Getting the original shader assignment

2016-10-07 Thread likage
Hey Justin, correct me if I am wrong on this.. So while I did try using global dictionary, it only works on the first try too, but as soon as I close and reopen my UI, the original assignment is gone.. Giving me the same issue as stated in my thread. I must be doing something very wrong in my lo

Re: [Maya-Python] Getting the original shader assignment

2016-10-06 Thread Justin Israel
On Fri, Oct 7, 2016 at 2:08 PM likage wrote: > Was wondering if anyone has any good ways for approaching this problem of > mine... > > > I have a few rigs in which it is a reference. I am trying to do some > shader-assignment that targets for a certain name in these rigs. > > In my UI, if the use

[Maya-Python] Getting the original shader assignment

2016-10-06 Thread likage
Was wondering if anyone has any good ways for approaching this problem of mine... I have a few rigs in which it is a reference. I am trying to do some shader-assignment that targets for a certain name in these rigs. In my UI, if the user selects a certain color in the combobox, it will crea