Home Website Youtube GitHub

controlBuffer sticking around when outside of hierarchy of export selected

hello, i have a rig that is built in mgear, where the controlBuffer transforms are under a top level transform named ‘guides’ and the finished rig is under its own top level transform ‘rig’. if i select rig and do an export selected (preserve references & include inputs (history, channels, connections, constraints & texture info are slected) the control buffers export with the rig. there are no connections that i can tell to the control buffers. is there something i am missing with the way these rigs are built? doesn’t make sense to me, any ideas?

regards, mark

When the controlBuffer gets extracted (as of mGear 3.6, I haven’t tested this in 3.7 yet) the control gets duplicated, and thus ends up inside the same objectSets that the controls were in.

If you graph this in the Node Editor, you should see a connection to the set. And this might be what is causing it to get exported.

This should be fixed in the extract command.

In the meantime, here is a rough script that removes any node that ends with “controlBuffer” from every single objectSet.

import pymel.core as pm
for each in pm.ls(type='objectSet'):
    objectsToRemove = [ctl for ctl in each.members() if ctl.name().endswith('controlBuffer')]
    if objectsToRemove:
        each.removeMembers(objectsToRemove)

edit: I added a new issue for this in Github: guide_manager.extract_control leaves the duplicated controlBuffer node in the objectSet · Issue #118 · mgear-dev/shifter · GitHub

1 Like

Thanks Chris, however, like I said, there are no connections. i have even gone as far as removing all the sets and the controlBuffers still go with the rig. I am using mgear 3.6.

Yeah I see what you mean. Happens to me too.

But I notice that there are connections to the shape nodes in my rigs.

  • Some of them have an input from a reverse node, maybe corresponding to the invert mirror option.
  • If I had any that were connected to controls to toggle visibility, they still have that input connection as well.
  • If I had any controls that were surfaces with materials, they are connected to the materials.

yes, i wrote a function to check for and break those connections, as well as remove from any sets, however the controlBuffers are still surviving an export selected of the rig_

here were the connections that were disconnected.

there were no set memberships, the extract command had already been fixed here by a co-worker.

[u’arm_L0_armTangentA_ctl_controlBuffer|arm_L0_armTangentA_ctlShape.visibility’, u’armUI_L0_ctl.arm_Tangent_vis’]
[u’arm_L0_armTangentB_ctl_controlBuffer|arm_L0_armTangentB_ctlShape.visibility’, u’armUI_L0_ctl.arm_Tangent_vis’]
[u’arm_L0_elbowTangent_ctl_controlBuffer|arm_L0_elbowTangent_ctlShape.visibility’, u’armUI_L0_ctl.arm_Tangent_vis’]
[u’arm_L0_fk0_ctl_controlBuffer|arm_L0_fk0_ctlShape.visibility’, u’reverse18.outputX’]
[u’arm_L0_fk1_ctl_controlBuffer|arm_L0_fk1_ctlShape.visibility’, u’reverse18.outputX’]
[u’arm_L0_fk2_ctl_controlBuffer|arm_L0_fk2_ctlShape.visibility’, u’reverse18.outputX’]
[u’arm_L0_forearmTangentA_ctl_controlBuffer|arm_L0_forearmTangentA_ctlShape.visibility’, u’armUI_L0_ctl.arm_Tangent_vis’]
[u’arm_L0_forearmTangentB_ctl_controlBuffer|arm_L0_forearmTangentB_ctlShape.visibility’, u’armUI_L0_ctl.arm_Tangent_vis’]
[u’arm_L0_ik_ctl_controlBuffer|arm_L0_ik_ctlShape.visibility’, u’armUI_L0_ctl.arm_blend’]
[u’arm_L0_upv_ctl_controlBuffer|arm_L0_upv_ctlShape.visibility’, u’armUI_L0_ctl.arm_blend’]
[u’arm_R0_armTangentA_ctl_controlBuffer|arm_R0_armTangentA_ctlShape.visibility’, u’armUI_R0_ctl.arm_Tangent_vis’]
[u’arm_R0_armTangentB_ctl_controlBuffer|arm_R0_armTangentB_ctlShape.visibility’, u’armUI_R0_ctl.arm_Tangent_vis’]
[u’arm_R0_elbowTangent_ctl_controlBuffer|arm_R0_elbowTangent_ctlShape.visibility’, u’armUI_R0_ctl.arm_Tangent_vis’]
[u’arm_R0_fk0_ctl_controlBuffer|arm_R0_fk0_ctlShape.visibility’, u’reverse19.outputX’]
[u’arm_R0_fk1_ctl_controlBuffer|arm_R0_fk1_ctlShape.visibility’, u’reverse19.outputX’]
[u’arm_R0_fk2_ctl_controlBuffer|arm_R0_fk2_ctlShape.visibility’, u’reverse19.outputX’]
[u’arm_R0_forearmTangentA_ctl_controlBuffer|arm_R0_forearmTangentA_ctlShape.visibility’, u’armUI_R0_ctl.arm_Tangent_vis’]
[u’arm_R0_forearmTangentB_ctl_controlBuffer|arm_R0_forearmTangentB_ctlShape.visibility’, u’armUI_R0_ctl.arm_Tangent_vis’]
[u’arm_R0_ik_ctl_controlBuffer|arm_R0_ik_ctlShape.visibility’, u’armUI_R0_ctl.arm_blend’]
[u’arm_R0_upv_ctl_controlBuffer|arm_R0_upv_ctlShape.visibility’, u’armUI_R0_ctl.arm_blend’]
[u’foot_L0_bk0_ctl_controlBuffer|foot_L0_bk0_ctlShape.visibility’, u’leg_L0_ikoff_ctl|foot_L0_root.blend’]
[u’foot_L0_bk0_ctl_controlBuffer|foot_L0_bk0_ctlShape1.visibility’, u’leg_L0_ikoff_ctl|foot_L0_root.blend’]
[u’foot_L0_bk0_ctl_controlBuffer|foot_L0_bk0_ctlShape2.visibility’, u’leg_L0_ikoff_ctl|foot_L0_root.blend’]
[u’foot_L0_bk1_ctl_controlBuffer|foot_L0_bk1_ctlShape.visibility’, u’leg_L0_ikoff_ctl|foot_L0_root.blend’]
[u’foot_L0_bk1_ctl_controlBuffer|foot_L0_bk1_ctlShape1.visibility’, u’leg_L0_ikoff_ctl|foot_L0_root.blend’]
[u’foot_L0_bk1_ctl_controlBuffer|foot_L0_bk1_ctlShape2.visibility’, u’leg_L0_ikoff_ctl|foot_L0_root.blend’]
[u’foot_L0_bk2_ctl_controlBuffer|foot_L0_bk2_ctlShape.visibility’, u’leg_L0_ikoff_ctl|foot_L0_root.blend’]
[u’foot_L0_bk2_ctl_controlBuffer|foot_L0_bk2_ctlShape1.visibility’, u’leg_L0_ikoff_ctl|foot_L0_root.blend’]
[u’foot_L0_bk2_ctl_controlBuffer|foot_L0_bk2_ctlShape2.visibility’, u’leg_L0_ikoff_ctl|foot_L0_root.blend’]
[u’foot_L0_heel_ctl_controlBuffer|foot_L0_heel_ctlShape.visibility’, u’leg_L0_ikoff_ctl|foot_L0_root.blend’]
[u’foot_L0_heel_ctl_controlBuffer|foot_L0_heel_ctlShape1.visibility’, u’leg_L0_ikoff_ctl|foot_L0_root.blend’]
[u’foot_L0_heel_ctl_controlBuffer|foot_L0_heel_ctlShape2.visibility’, u’leg_L0_ikoff_ctl|foot_L0_root.blend’]
[u’foot_L0_roll_ctl_controlBuffer|foot_L0_roll_ctlShape.visibility’, u’leg_L0_ikoff_ctl|foot_L0_root.blend’]
[u’foot_L0_tip_ctl_controlBuffer|foot_L0_tip_ctlShape.visibility’, u’leg_L0_ikoff_ctl|foot_L0_root.blend’]
[u’foot_R0_bk0_ctl_controlBuffer|foot_R0_bk0_ctlShape.visibility’, u’leg_R0_ikoff_ctl|foot_R0_root.blend’]
[u’foot_R0_bk0_ctl_controlBuffer|foot_R0_bk0_ctlShape1.visibility’, u’leg_R0_ikoff_ctl|foot_R0_root.blend’]
[u’foot_R0_bk0_ctl_controlBuffer|foot_R0_bk0_ctlShape2.visibility’, u’leg_R0_ikoff_ctl|foot_R0_root.blend’]
[u’foot_R0_bk1_ctl_controlBuffer|foot_R0_bk1_ctlShape.visibility’, u’leg_R0_ikoff_ctl|foot_R0_root.blend’]
[u’foot_R0_bk1_ctl_controlBuffer|foot_R0_bk1_ctlShape1.visibility’, u’leg_R0_ikoff_ctl|foot_R0_root.blend’]
[u’foot_R0_bk1_ctl_controlBuffer|foot_R0_bk1_ctlShape2.visibility’, u’leg_R0_ikoff_ctl|foot_R0_root.blend’]
[u’foot_R0_bk2_ctl_controlBuffer|foot_R0_bk2_ctlShape.visibility’, u’leg_R0_ikoff_ctl|foot_R0_root.blend’]
[u’foot_R0_bk2_ctl_controlBuffer|foot_R0_bk2_ctlShape1.visibility’, u’leg_R0_ikoff_ctl|foot_R0_root.blend’]
[u’foot_R0_bk2_ctl_controlBuffer|foot_R0_bk2_ctlShape2.visibility’, u’leg_R0_ikoff_ctl|foot_R0_root.blend’]
[u’foot_R0_heel_ctl_controlBuffer|foot_R0_heel_ctlShape.visibility’, u’leg_R0_ikoff_ctl|foot_R0_root.blend’]
[u’foot_R0_heel_ctl_controlBuffer|foot_R0_heel_ctlShape1.visibility’, u’leg_R0_ikoff_ctl|foot_R0_root.blend’]
[u’foot_R0_heel_ctl_controlBuffer|foot_R0_heel_ctlShape2.visibility’, u’leg_R0_ikoff_ctl|foot_R0_root.blend’]
[u’foot_R0_roll_ctl_controlBuffer|foot_R0_roll_ctlShape.visibility’, u’leg_R0_ikoff_ctl|foot_R0_root.blend’]
[u’foot_R0_tip_ctl_controlBuffer|foot_R0_tip_ctlShape.visibility’, u’leg_R0_ikoff_ctl|foot_R0_root.blend’]
[u’leg_L0_fk0_ctl_controlBuffer|leg_L0_fk0_ctlShape.visibility’, u’reverse20.outputX’]
[u’leg_L0_fk1_ctl_controlBuffer|leg_L0_fk1_ctlShape.visibility’, u’reverse20.outputX’]
[u’leg_L0_fk2_ctl_controlBuffer|leg_L0_fk2_ctlShape.visibility’, u’reverse20.outputX’]
[u’leg_L0_ik_ctl_controlBuffer|leg_L0_ik_ctlShape.visibility’, u’legUI_L0_ctl.leg_blend’]
[u’leg_L0_kneeTangent_ctl_controlBuffer|leg_L0_kneeTangent_ctlShape.visibility’, u’legUI_L0_ctl.leg_Tangent_vis’]
[u’leg_L0_lowlegTangentA_ctl_controlBuffer|leg_L0_lowlegTangentA_ctlShape.visibility’, u’legUI_L0_ctl.leg_Tangent_vis’]
[u’leg_L0_lowlegTangentB_ctl_controlBuffer|leg_L0_lowlegTangentB_ctlShape.visibility’, u’legUI_L0_ctl.leg_Tangent_vis’]
[u’leg_L0_uplegTangentA_ctl_controlBuffer|leg_L0_uplegTangentA_ctlShape.visibility’, u’legUI_L0_ctl.leg_Tangent_vis’]
[u’leg_L0_uplegTangentB_ctl_controlBuffer|leg_L0_uplegTangentB_ctlShape.visibility’, u’legUI_L0_ctl.leg_Tangent_vis’]
[u’leg_L0_upv_ctl_controlBuffer|leg_L0_upv_ctlShape.visibility’, u’legUI_L0_ctl.leg_blend’]
[u’leg_R0_fk0_ctl_controlBuffer|leg_R0_fk0_ctlShape.visibility’, u’reverse21.outputX’]
[u’leg_R0_fk1_ctl_controlBuffer|leg_R0_fk1_ctlShape.visibility’, u’reverse21.outputX’]
[u’leg_R0_fk2_ctl_controlBuffer|leg_R0_fk2_ctlShape.visibility’, u’reverse21.outputX’]
[u’leg_R0_ik_ctl_controlBuffer|leg_R0_ik_ctlShape.visibility’, u’legUI_R0_ctl.leg_blend’]
[u’leg_R0_kneeTangent_ctl_controlBuffer|leg_R0_kneeTangent_ctlShape.visibility’, u’legUI_R0_ctl.leg_Tangent_vis’]
[u’leg_R0_lowlegTangentA_ctl_controlBuffer|leg_R0_lowlegTangentA_ctlShape.visibility’, u’legUI_R0_ctl.leg_Tangent_vis’]
[u’leg_R0_lowlegTangentB_ctl_controlBuffer|leg_R0_lowlegTangentB_ctlShape.visibility’, u’legUI_R0_ctl.leg_Tangent_vis’]
[u’leg_R0_uplegTangentA_ctl_controlBuffer|leg_R0_uplegTangentA_ctlShape.visibility’, u’legUI_R0_ctl.leg_Tangent_vis’]
[u’leg_R0_uplegTangentB_ctl_controlBuffer|leg_R0_uplegTangentB_ctlShape.visibility’, u’legUI_R0_ctl.leg_Tangent_vis’]
[u’leg_R0_upv_ctl_controlBuffer|leg_R0_upv_ctlShape.visibility’, u’legUI_R0_ctl.leg_blend’]
[u’neck_C0_ik_ctl_controlBuffer|neck_C0_ik_ctlShape.visibility’, u’spineUI_C0_ctl.neck_blend’]
[u’spine_C0_ik0_ctl_controlBuffer|spine_C0_ik0_ctlShape.visibility’, u’spineUI_C0_ctl.spine_blend’]
[u’spine_C0_ik1_ctl_controlBuffer|spine_C0_ik1_ctlShape.visibility’, u’spineUI_C0_ctl.spine_blend’]
[u’spine_C0_spinePosition_ctl_controlBuffer|spine_C0_spinePosition_ctlShape.visibility’, u’spineUI_C0_ctl.spine_blend’]

regards, mark

well… this is odd.

import pymel.core as pm
for each in pm.PyNode('controllers_org').getChildren(ad=True, type='shape'):
    print(each.isInstanced())

It’s True for every one of my controlBuffer curves. They are instanced! :flushed: Are your controls as well? Which is odd, since the extract_control() just seems to be using pm.duplicate(x)


Edit: It’s in mgear/shifter/component/__init__.py line 465. ctl.addChild(). That command is what instances the controlBuffer onto the rig control.

        fullName = self.getName(name)
        bufferName = fullName + "_controlBuffer"
        if bufferName in self.rig.guide.controllers.keys():
            ctl_ref = self.rig.guide.controllers[bufferName]
            ctl = primitive.addTransform(parent, fullName, m)
            for shape in ctl_ref.getShapes():
                ctl.addChild(shape, shape=True, add=True)
                pm.rename(shape, fullName + "Shape")
            icon.setcolor(ctl, color)
        else:
            ctl = icon.create(
                parent, fullName, m, color, iconShape, **kwargs)
1 Like

thanks, that was the key to the problem.

regards, mark