Home Website Youtube GitHub

Replace a mgear node with another

hi,

now that we have the mgear-spring-gravity, i want to replace the “old” mgear-spring-node on existing rigs with the new one…
is that possible in maya maybe with a python script?
and if yes, how to replace a maya node with another one, so that input/output connections are preserved?
any hints?

If the guide signature is the same (That is, all the same attributes and settings are found on the component), then all you have to do is:

  • Select the component’s root node
  • Go into the attribute editor.
  • Find “Comp Type” or “.comp_type” and change the value to the new component you want to use.

If the guides are compatible, the next time you open the component settings, you’ll see the correct settings for the mgear-spring-gravity component, and it will build as a mgear-spring-gravity component.

If they are not compatible, you’ll likely get an error when opening the settings, or when building saying certain attributes are missing. Then I don’t know of any built-in way to just swap it out. It would certainly be possible with Python. Match all guide transforms, and settings, and then delete the old, and rename the new one.

2 Likes

hi chris,

thank you very much for the reply and the hint…
but i dont meant the guide, i meant on a already builded rig.so swapping the builded “mgearspring-node” with the new one…

i think i got it work, by using the python command “copyAttr”