Website Youtube GitHub

Rotation isolation on FK component



I am going to build a neck and head control using the FK component or the FK spring component. I have used other rigs that have isolation on the rotation, as shown in the example GIF. In this example I created it in a post script but I am curious to know if I am missing something and it is already there in the component.

I think it is part of the mgear neck component, but it generates too many controls for my needs. That’s why I am using FK instead.



Hi @Torben_Sottrup I think you are doing it right using a custom step in post. :slight_smile:



Thanks @Miquel
If anyone needs this kind of functionality here is the script I used:

import pymel.core as pm

print 'POST: Head isolate script'

# control to isolate
isolate_ctrl = pm.PyNode('neck_C0_fk0_ctl')

# spaces to add to isolation
global_ctrl = pm.PyNode('cog_C0_ctl')
parent_ctrl = pm.PyNode('spine_C0_ik1_ctl')

isolate_constrain_grp = pm.PyNode('neck_C0_fk0_npo')
isolate_attr_holder = pm.PyNode('neckSettings_C0_ctl')

# create extra top group for isolate constrain, r=True)
isolate_grp = + '_isolate', empty=True, world=True)
pm.delete(pm.parentConstraint(isolate_ctrl, isolate_grp, mo=False))

isolate_constrain_grp_parent = isolate_constrain_grp.getParent()
pm.parent(isolate_constrain_grp, isolate_grp)
pm.parent(isolate_grp, isolate_constrain_grp_parent)

# add orientConstraint
con = pm.parentConstraint(global_ctrl, parent_ctrl, isolate_grp, mo=True, weight=0, skipTranslate=['x', 'y', 'z'])

# add attribute for switching spaces
pm.addAttr(isolate_attr_holder, type='float', min=0, max=1, dv=0, longName='isolate_rotation', keyable=True)

# connect attr to constraint target weights
isolate_attr_holder.isolate_rotation >> con.getWeightAliasList()[0]

rev_node = pm.createNode('reverse')
isolate_attr_holder.isolate_rotation >> rev_node.inputX
rev_node.outputX >> con.getWeightAliasList()[1]


@Torben_Sottrup thanks for sharing this! :smiley: