Home Website Youtube GitHub

Rotation isolation on FK component

Hey,

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.

isolate_rotation

2 Likes

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

Cheers

1 Like

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
pm.select(isolate_constrain_grp, r=True)
isolate_grp = pm.group(n=isolate_constrain_grp.name() + '_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'])
con.interpType.set(2)

# 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]
10 Likes

@Torben_Sottrup thanks for sharing this! :smiley:

This is exactly what I was looking for! Thnx so much for making this.

1 Like

I am reviving this old conversation as I am not sure there has been any updates on the topic, were they?

Thanks for sharing @Torben_Sottrup

At the same time, I started thinking about something and realised that we could probably also simply use the shoulder_01 component for the neck since it is also used to isolate the FK arm, then connect a control_01 component as head joint.

I then proceeded to tweak the shoulder_01 init and guide python scripts by just renaming few things and create the mighty_neck component which I could share if anyone is interested.

Here is a little demo and let me know if you have some thoughts, I am very new to mGear so maybe there is something I am not aware of.

image

3 Likes