Last active
August 29, 2015 14:25
-
-
Save boredstiff/3d53721db42c9c3d6995 to your computer and use it in GitHub Desktop.
fkikblendnodes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'Alex' | |
""" | |
FK: If attribute FKIKBlend attr is < 1, turn on vis. | |
IK: If attribute FKIKBlend attr is > 0, turn on vis. | |
""" | |
import pymel.core as pmc | |
LIKControlOff = pmc.PyNode('Nice_L_arm_IK_CTRL_WORLD_offset') | |
RIKControlOff = pmc.PyNode('Nice_R_arm_IK_CTRL_WORLD_offset') | |
LFKControlOff = pmc.PyNode('Nice_L_upperArm_FK_CTRL_offset') | |
RFKControlOff = pmc.PyNode('Nice_R_upperArm_FK_CTRL_offset') | |
LIKMainControl = pmc.PyNode('Nice_L_finger_ANIM_CTRL') | |
RIKMainControl = pmc.PyNode('Nice_R_finger_ANIM_CTRL') | |
RIKHandControl = pmc.PyNode('Nice_R_hand_CTRL_offset') | |
LIKHandControl = pmc.PyNode('Nice_L_hand_CTRL_offset') | |
controls = [LIKControlOff, RIKControlOff, LFKControlOff, RFKControlOff, LIKMainControl, RIKMainControl, RIKHandControl, | |
LIKHandControl] | |
for each in controls: | |
pmc.setAttr(each + '.visibility', l=False, k=True) | |
LIKCOND = pmc.shadingNode('condition', n='Nice_L_arm_IK_COND', au=True) | |
LIKMainControl.FKIKBlend >> LIKCOND.firstTerm | |
LIKCOND.secondTerm.set(0.01) | |
LIKCOND.operation.set(3) | |
LIKCOND.colorIfTrueR.set(1) | |
LIKCOND.colorIfFalseR.set(0) | |
LIKCOND.outColorR >> LIKControlOff.visibility | |
LFKCOND = pmc.shadingNode('condition', n='Nice_L_arm_FK_COND', au=True) | |
LIKMainControl.FKIKBlend >> LFKCOND.firstTerm | |
LFKCOND.secondTerm.set(0.99) | |
LFKCOND.operation.set(5) | |
LFKCOND.colorIfTrueR.set(1) | |
LFKCOND.colorIfFalseR.set(0) | |
LFKCOND.outColorR >> LFKControlOff.visibility | |
#LFKCOND.outColorR >> LIKHandControl.visibility | |
RIKCOND = pmc.shadingNode('condition', n='Nice_R_arm_IK_COND', au=True) | |
RIKMainControl.FKIKBlend >> RIKCOND.firstTerm | |
RIKCOND.secondTerm.set(0.01) | |
RIKCOND.operation.set(3) | |
RIKCOND.colorIfTrueR.set(1) | |
RIKCOND.colorIfFalseR.set(0) | |
RIKCOND.outColorR >> RIKControlOff.visibility | |
RFKCOND = pmc.shadingNode('condition', n='Nice_R_arm_FK_COND', au=True) | |
RIKMainControl.FKIKBlend >> RFKCOND.firstTerm | |
RFKCOND.secondTerm.set(0.99) | |
RFKCOND.operation.set(5) | |
RFKCOND.colorIfTrueR.set(1) | |
RFKCOND.colorIfFalseR.set(0) | |
RFKCOND.outColorR >> RFKControlOff.visibility | |
#RFKCOND.outColorR >> RIKHandControl.visibility | |
for each in controls: | |
pmc.setAttr(each + '.visibility', l=True, k=False) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment