Home Website Youtube GitHub

Rename roots and npo groups

I am building a vehicle template and would like to add some offset groups for steering, suspension, and rotation. I am able to add npo groups with the help of previous posts. However, when I run the custom step in the post, I get error on roots ( for example, wheel_L1_root) because it also exist in the guides. It works but I get the errors. Is there are way to rename these roots and npo group in the rig in the custom steps.


What I always do is reference the control, and then climb the hierarchy to get the parent that I need.

For example:

import pymel.core as pm
theControl = pm.PyNode('wheel_L1_ctl')
theRoot = theControl.getParent()

Then you can run rigbits.addNPO on theRoot. No need to rename anything, as long as you can find a unique path to it.

Or theControl.getParent(2) if the root is higher up in the hierarchy. The number is how many nodes to climb, so getParent(0) would be the node itself. getParent(1) is the direct parent, etc.


@chrislesage Thanks :). Really helpful. I will try it out

Scripting is working better now. There is no name clash now.
However, I was wondering if we could rename npo groups. Because if I would like to add more, then it will get really confusing. For example, if I would like to make wheel_R1_fk0_npo_npo to wheel_R1_fk0_drive_npo or wheel_R1_fk0_suspension_npo. Is it a good idea.

Another question would be, is it better to create npo on root control or on wheel_R1_fk0_npo

Yeah it should be perfectly fine, especially for nodes you are creating.

There is no right answer. It depends on your rig and your constraints or connections.

1 Like