Hi Chantelle,
In my opinion, the goal is to have the rig completely built with no manual steps afterwards. If I have to do manual steps, it just means I might forget to do it sometimes. So to answer your question, yes I believe you should try to script it. It will make your life easier.
Notes:
-
rigbits.addNPO()
is the function you want.
- I often prefix PyNodes with “o” to mean object. As opposed to parameters or strings, or other data. That is just my scripting style.
- You need to pass PyNodes to addNPO, not string names.
import pymel.core as pm
from mgear import rigbits
oControl = pm.PyNode('brow_L0_ctl')
# addNPO returns a list, so if you just add a root to a single control, you can
# use [0] at the end to get the first one, if you need to access oRoot later in your script.
oRoot = rigbits.addNPO(each)[0]
ALSO, addNPO can take a list of objects all at once.
It will add a root to each of the objects in the list.
allMyControls = pm.ls('brow_L0_ctl', 'brow_L1_ctl', 'brow_L2_ctl', 'brow_R0_ctl', 'brow_R1_ctl', 'brow_R2_ctl')
oRoots = rigbits.addNPO(allMyControls)
print(oRoots)
# Will give you a list of all the new NPO roots:
[nt.Transform(u'brow_L0_ctl_npo'), nt.Transform(u'brow_L1_ctl_npo'), nt.Transform(u'brow_L2_ctl_npo'), nt.Transform(u'brow_R0_ctl_npo'), nt.Transform(u'brow_R1_ctl_npo'), nt.Transform(u'brow_R2_ctl_npo')]