def transferRigifyToFk(rig, context, delim): from rig_ui import fk2ik_arm, fk2ik_leg scn = context.scene frames = getActiveFramesBetweenMarkers(rig, scn) nFrames = len(frames) for n, frame in enumerate(frames): showProgress(n, frame, nFrames) scn.frame_set(frame) updateScene() if scn.McpFkIkArms: for suffix in [".L", ".R"]: # @ssq NOT_CHANGED uarm = "upper_arm" + delim + "fk" + suffix farm = "forearm" + delim + "fk" + suffix hand = "hand" + delim + "fk" + suffix uarmi = "MCH-upper_arm" + delim + "ik" + suffix farmi = "MCH-forearm" + delim + "ik" + suffix handi = "hand" + delim + "ik" + suffix fk = [uarm, farm, hand] ik = [uarmi, farmi, handi] fk2ik_arm(rig, fk, ik) setRotation(uarm, rig) setRotation(farm, rig) setRotation(hand, rig) if scn.McpFkIkLegs: for suffix in [".L", ".R"]: # @ssq NOT_CHANGED thigh = "thigh" + delim + "fk" + suffix shin = "shin" + delim + "fk" + suffix foot = "foot" + delim + "fk" + suffix mfoot = "MCH-foot" + suffix thighi = "MCH-thigh" + delim + "ik" + suffix shini = "MCH-shin" + delim + "ik" + suffix footi = "foot" + delim + "ik" + suffix mfooti = "MCH-foot" + suffix + ".001" fk = [thigh, shin, foot, mfoot] ik = [thighi, shini, footi, mfooti] fk2ik_leg(rig, fk, ik) setRotation(thigh, rig) setRotation(shin, rig) setRotation(foot, rig) setInterpolation(rig) for suffix in [".L", ".R"]: if scn.McpFkIkArms: rig.pose.bones["hand.ik" + suffix]["ikfk_switch"] = 0.0 if scn.McpFkIkLegs: rig.pose.bones["foot.ik" + suffix]["ikfk_switch"] = 0.0
def transferRigifyToFk(rig, scn): from rig_ui import fk2ik_arm, fk2ik_leg frames = getActiveFramesBetweenMarkers(rig, scn) nFrames = len(frames) for n,frame in enumerate(frames): showProgress(n, frame, nFrames) scn.frame_set(frame) updateScene() if scn.McpFkIkArms: for suffix in [".L", ".R"]: uarm = "upper_arm.fk"+suffix farm = "forearm.fk"+suffix hand = "hand.fk"+suffix uarmi = "MCH-upper_arm.ik"+suffix farmi = "MCH-forearm.ik"+suffix handi = "hand.ik"+suffix fk = [uarm,farm,hand] ik = [uarmi,farmi,handi] fk2ik_arm(rig, fk, ik) setRotation(uarm, rig) setRotation(farm, rig) setRotation(hand, rig) if scn.McpFkIkLegs: for suffix in [".L", ".R"]: thigh = "thigh.fk"+suffix shin = "shin.fk"+suffix foot = "foot.fk"+suffix mfoot = "MCH-foot"+suffix thighi = "MCH-thigh.ik"+suffix shini = "MCH-shin.ik"+suffix footi = "foot.ik"+suffix mfooti = "MCH-foot"+suffix+".001" fk = [thigh,shin,foot,mfoot] ik = [thighi,shini,footi,mfooti] fk2ik_leg(rig, fk, ik) setRotation(thigh, rig) setRotation(shin, rig) setRotation(foot, rig) setInterpolation(rig) for suffix in [".L", ".R"]: if scn.McpFkIkArms: rig.pose.bones["hand.ik"+suffix]["ikfk_switch"] = 0.0 if scn.McpFkIkLegs: rig.pose.bones["foot.ik"+suffix]["ikfk_switch"] = 0.0