MAYA 创建脚本节点 自定义右键菜单 二(实例应用 FKIK无缝切换)

6 篇文章 0 订阅
5 篇文章 0 订阅

上次做了测试,这次自己绑了个角色。把自定义右键功能加上了。

 

实现了FKIK无缝切换

加上了showhide 控制器的功能

如果想给新创建的对象,添加默认自定右键。选中新的对象,然后在命令编辑窗口中输入"addJerryRigAttr"。它们就会被加上自定义的右键菜单。

想 下载 猛点我 

想看 演示视频 点我

//创建 jerryMarkMenu_Node 节点 执行条件 open/close
//创建 jerryExecuteOnFileLoad 节点 执行条件 open/close 内容:scriptNode -eb jerryMarkMenu_Node;
//(貌似有BUG所以用这句再执行一次,jerryMarkMenu_Node的内容才真正执行)

//创建自定义菜单
global proc int jerryMarkingMenu()
{
	string $selection[] = `ls -sl`;	

	//如果是头部控制器
	if ($selection[0]=="main_ctrl")
	{		
		menuItem
			-label "Body" 
			-divider 0
			-subMenu 0
			-command "showHideBody()" 
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-radialPosition "N" 
			-enableCommandRepeat 1
			-image "Body" 
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem8;

		menuItem
			-label "L arm" 
			-divider 0
			-subMenu 0
			-command "showHideLarm()" 
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-radialPosition "E" 
			-enableCommandRepeat 1
			-image "L arm" 
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem9;

		menuItem
			-label "L leg" 
			-divider 0
			-subMenu 0
			-command "showHideLleg()" 
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-radialPosition "SE" 
			-enableCommandRepeat 1
			-image "L leg" 
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem11;

		menuItem
			-label "FKIK" 
			-divider 0
			-subMenu 0
			-command "showHideFKIK()" 
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-radialPosition "S" 
			-enableCommandRepeat 1
			-image "FKIK" 
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem13;

		menuItem
			-label "R leg" 
			-divider 0
			-subMenu 0
			-command "showHideRleg()" 
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-radialPosition "SW" 
			-enableCommandRepeat 1
			-image "R leg" 
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem12;

		menuItem
			-label "R arm" 
			-divider 0
			-subMenu 0
			-command "showHideRarm()" 
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-radialPosition "W" 
			-enableCommandRepeat 1
			-image "R arm" 
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem10;

		menuItem
			-label "Show Hide All" 
			-divider 0
			-subMenu 0
			-command "showHideAll()" 
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-enableCommandRepeat 1
			-image "Show Hide All" 
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem7;

		setParent -m ..;
	}
	else
	{
		//如果控制器上有属性 jerryRigAttrFKIK 就显示FKIK菜单
		if (`attributeExists "jerryRigAttrFKIK" $selection[0]`)
		{	
			menuItem
				-label "FKIK" 
				-divider 0
				-subMenu 1
				-tearOff 0
				-enable 1
				-data 0
				-radialPosition "N" 
				-allowOptionBoxes 1
				-postMenuCommandOnce 0
				-italicized 0
				-boldFont 0
				menuEditorMenuItem1;

			menuItem
				-label "FKIK_Switch" 
				-divider 0
				-subMenu 0
				-command "FKIK_Switch();" 
				-altModifier 0
				-optionModifier 0
				-commandModifier 0
				-ctrlModifier 0
				-shiftModifier 0
				-optionBox 0
				-enable 1
				-data 0
				-radialPosition "N" 
				-enableCommandRepeat 1
				-image "FKIK_Switch" 
				-echoCommand 0
				-italicized 0
				-boldFont 0
				menuEditorMenuItem2;

			menuItem
				-label "FK ==>>  IK" 
				-divider 0
				-subMenu 0
				-command "fk2ik();" 
				-altModifier 0
				-optionModifier 0
				-commandModifier 0
				-ctrlModifier 0
				-shiftModifier 0
				-optionBox 0
				-enable 1
				-data 0
				-radialPosition "E" 
				-enableCommandRepeat 1
				-image "FK ==>>  IK" 
				-echoCommand 0
				-italicized 0
				-boldFont 0
				menuEditorMenuItem4;

			menuItem
				-label "FK <<==  IK" 
				-divider 0
				-subMenu 0
				-command "ik2fk();" 
				-altModifier 0
				-optionModifier 0
				-commandModifier 0
				-ctrlModifier 0
				-shiftModifier 0
				-optionBox 0
				-enable 1
				-data 0
				-radialPosition "W" 
				-enableCommandRepeat 1
				-image "FK <<==  IK" 
				-echoCommand 0
				-italicized 0
				-boldFont 0
				menuEditorMenuItem3;

		setParent -m ..;
		}

		//如果是头部控制器
		if ($selection[0]=="head_ctrl")
			{	
			menuItem
				-label "Ctrl Visibility" 
				-divider 0
				-subMenu 1
				-tearOff 0
				-enable 1
				-data 0
				-radialPosition "N" 
				-allowOptionBoxes 1
				-postMenuCommandOnce 0
				-italicized 0
				-boldFont 0
				menuEditorMenuItem1;

			menuItem
				-label "face ctrl" 
				-divider 0
				-subMenu 0
				-command ("setAttr (\"" + "head_ctrl.face_ctrl_visibility\"" + ") (!`getAttr \"" + "head_ctrl.face_ctrl_visibility\"`)") 
				-altModifier 0
				-optionModifier 0
				-commandModifier 0
				-ctrlModifier 0
				-shiftModifier 0
				-optionBox 0
				-enable 1
				-data 0
				-radialPosition "N" 
				-enableCommandRepeat 1
				-image "face ctrl" 
				-echoCommand 0
				-italicized 0
				-boldFont 0
				menuEditorMenuItem2;

			menuItem
				-label "eyes ctrl" 
				-divider 0
				-subMenu 0
				-command ("setAttr (\"" + "head_ctrl.eyes_ctrl_visbility\"" + ") (!`getAttr \"" + "head_ctrl.eyes_ctrl_visbility\"`)") 
				-altModifier 0
				-optionModifier 0
				-commandModifier 0
				-ctrlModifier 0
				-shiftModifier 0
				-optionBox 0
				-enable 1
				-data 0
				-radialPosition "E" 
				-enableCommandRepeat 1
				-image "eyes ctrl" 
				-echoCommand 0
				-italicized 0
				-boldFont 0
				menuEditorMenuItem4;

			menuItem
				-label "neck mid ctrl" 
				-divider 0
				-subMenu 0
				-command ("setAttr (\"" + "head_ctrl.neck_mid_ctrl\"" + ") (!`getAttr \"" + "head_ctrl.neck_mid_ctrl\"`)") 				
				-altModifier 0
				-optionModifier 0
				-commandModifier 0
				-ctrlModifier 0
				-shiftModifier 0
				-optionBox 0
				-enable 1
				-data 0
				-radialPosition "W" 
				-enableCommandRepeat 1
				-image "neck mid ctrl" 
				-echoCommand 0
				-italicized 0
				-boldFont 0
				menuEditorMenuItem3;

			menuItem
				-label "Subctrl"
				-divider 0
				-subMenu 0
				-command ("setAttr (\"" + "head_ctrl.face_subCtrl\"" + ") (!`getAttr \"" + "head_ctrl.face_subCtrl\"`)") 	
				-altModifier 0
				-optionModifier 0
				-commandModifier 0
				-ctrlModifier 0
				-shiftModifier 0
				-optionBox 0
				-enable 1
				-data 0
				-radialPosition "S"
				-enableCommandRepeat 1
				-image "Subctrl"
				-echoCommand 0
				-italicized 0
				-boldFont 0
				menuEditorMenuItem5;
			setParent -m ..;
		}

	//如果是手指主控制
		if ($selection[0]=="L_Finger_ctrl" || $selection[0]=="R_Finger_ctrl")
			{	
			menuItem
				-label "Ctrl Visibility" 
				-divider 0
				-subMenu 1
				-tearOff 0
				-enable 1
				-data 0
				-radialPosition "N" 
				-allowOptionBoxes 1
				-postMenuCommandOnce 0
				-italicized 0
				-boldFont 0
				menuEditorMenuItem1;

			menuItem
				-label "fingers ctrl" 
				-divider 0
				-subMenu 0
				-command ("setAttr (\"" + $selection[0]+ ".fingers_visibility\"" + ") (!`getAttr \"" + $selection[0]+ ".fingers_visibility\"`)" ) 
				-altModifier 0
				-optionModifier 0
				-commandModifier 0
				-ctrlModifier 0
				-shiftModifier 0
				-optionBox 0
				-enable 1
				-data 0
				-radialPosition "N" 
				-enableCommandRepeat 1
				-image "fingers ctrl" 
				-echoCommand 0
				-italicized 0
				-boldFont 0
				menuEditorMenuItem2;
		 setParent -m ..;
		}
	//脚掌自由旋转 loc
		if ($selection[0]=="L_footPiv_ctrl" || $selection[0]=="R_footPiv_ctrl")
			{	
			menuItem
				-label "Ctrl Visibility" 
				-divider 0
				-subMenu 1
				-tearOff 0
				-enable 1
				-data 0
				-radialPosition "N" 
				-allowOptionBoxes 1
				-postMenuCommandOnce 0
				-italicized 0
				-boldFont 0
				menuEditorMenuItem1;

			menuItem
				-label "foot piv loc" 
				-divider 0
				-subMenu 0
				-command ("setAttr (\"" + $selection[0]+ ".footPivVisibe\"" + ") (!`getAttr \"" + $selection[0]+ ".footPivVisibe\"`)" ) 
				-altModifier 0
				-optionModifier 0
				-commandModifier 0
				-ctrlModifier 0
				-shiftModifier 0
				-optionBox 0
				-enable 1
				-data 0
				-radialPosition "N" 
				-enableCommandRepeat 1
				-image "foot piv loc" 
				-echoCommand 0
				-italicized 0
				-boldFont 0
				menuEditorMenuItem2;
		 setParent -m ..;
		}
		//基本菜单
		menuItem
			-label "Clear Ctrl"
			-divider 0
			-subMenu 0
			-command "//清零控制器数值\r\nproc int clear_selectedCtrl()\r\n{\r\n\tstring $selection[] = `ls -sl`;\r\n\tfor($sel in $selection)\r\n\t{\r\n\t\tstring $channelBoxAttrs[] = `listAttr  -k -u $sel`;\r\n\t\tfor ($attr in $channelBoxAttrs)\r\n\t\t{\r\n\t\t\tif ($attr != \"IK_FK\" && $attr != \"scaleX\" && $attr != \"scaleY\" && $attr != \"scaleZ\" && $attr != \"visibility\")\r\n\t\t\t{\r\n\t\t\t\tcatch(`setAttr ($sel + \".\" + $attr) 0`);\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t}\r\n\tselect -r $selection;\r\n\treturn 1;\r\n} clear_selectedCtrl();"
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-radialPosition "E"
			-enableCommandRepeat 1
			-image "commandButton.xpm"
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem4;

		menuItem
			-label "Graph Editor"
			-divider 0
			-subMenu 0
			-command "GraphEditor;"
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-radialPosition "S"
			-enableCommandRepeat 1
			-image "Graph Editor"
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem5;

		menuItem
			-label "Outliner"
			-divider 0
			-subMenu 0
			-command "OutlinerWindow;"
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-radialPosition "W"
			-enableCommandRepeat 1
			-image "Outliner"
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem6;
		//手脚的parent菜单
		parentMenu();
		setParent -m ..;
	}
	return 1;
}

proc int parentMenu()
{
	string $selection[] = `ls -sl`;	
	if (`attributeExists "parent" $selection[0]`)//size($selection) == 1)
	{	
		menuItem
			-label "main" 
			-divider 0
			-subMenu 0
			-command ("setAttr (\"" + $selection[0]+ ".parent\"" + ") 0")
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-enableCommandRepeat 1
			-image "main" 
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem7;

		menuItem
			-label "root" 
			-divider 0
			-subMenu 0
			-command ("setAttr (\"" + $selection[0]+ ".parent\"" + ") 1")
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-enableCommandRepeat 1
			-image "root" 
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem8;

		menuItem
			-label "waist" 
			-divider 0
			-subMenu 0
			-command ("setAttr (\"" + $selection[0]+ ".parent\"" + ") 2")
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-enableCommandRepeat 1
			-image "waist" 
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem9;

		menuItem
			-label "spine" 
			-divider 0
			-subMenu 0
			-command ("setAttr (\"" + $selection[0]+ ".parent\"" + ") 3") 
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-enableCommandRepeat 1
			-image "spine" 
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem10;

		menuItem
			-label "chest" 
			-divider 0
			-subMenu 0
			-command ("setAttr (\"" + $selection[0]+ ".parent\"" + ") 4") 
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-enableCommandRepeat 1
			-image "chest" 
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem11;

		menuItem
			-label "clavicle" 
			-divider 0
			-subMenu 0
			-command ("setAttr (\"" + $selection[0]+ ".parent\"" + ") 5") 
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-enableCommandRepeat 1
			-image "clavicle" 
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem12;

		menuItem
			-label "head" 
			-divider 0
			-subMenu 0
			-command ("setAttr (\"" + $selection[0]+ ".parent\"" + ") 6") 
			-altModifier 0
			-optionModifier 0
			-commandModifier 0
			-ctrlModifier 0
			-shiftModifier 0
			-optionBox 0
			-enable 1
			-data 0
			-enableCommandRepeat 1
			-image "head" 
			-echoCommand 0
			-italicized 0
			-boldFont 0
			menuEditorMenuItem13;
		}
	return 1;
}
//main_ctrl 右键隐显控制器函数
proc int showHideAll()
{
//	setAttr "main_ctrl.root" (!`getAttr "main_ctrl.root"`);
//	setAttr "main_ctrl.spine" (!`getAttr "main_ctrl.spine"`);
//	setAttr "main_ctrl.head" (!`getAttr "main_ctrl.head"`);
//	setAttr "main_ctrl.L_clavicle" (!`getAttr "main_ctrl.L_clavicle"`);
//	setAttr "main_ctrl.L_arm_fk" (!`getAttr "main_ctrl.L_arm_fk"`);
//	setAttr "main_ctrl.L_arm_ik" (!`getAttr "main_ctrl.L_arm_ik"`);
//	setAttr "main_ctrl.L_arm_finger" (!`getAttr "main_ctrl.L_arm_finger"`);
//	setAttr "main_ctrl.L_arm_FKIK" (!`getAttr "main_ctrl.L_arm_FKIK"`);
//	setAttr "main_ctrl.L_leg_fk" (!`getAttr "main_ctrl.L_leg_fk"`);
//	setAttr "main_ctrl.L_leg_ik" (!`getAttr "main_ctrl.L_leg_ik"`);
//	setAttr "main_ctrl.L_leg_FKIK" (!`getAttr "main_ctrl.L_leg_FKIK"`);
//	setAttr "main_ctrl.R_clavicle" (!`getAttr "main_ctrl.R_clavicle"`);
//	setAttr "main_ctrl.R_arm_fk" (!`getAttr "main_ctrl.R_arm_fk"`);
//	setAttr "main_ctrl.R_arm_ik" (!`getAttr "main_ctrl.R_arm_ik"`);;
//	setAttr "main_ctrl.R_arm_finger" (!`getAttr "main_ctrl.R_arm_finger"`);
//	setAttr "main_ctrl.R_arm_FKIK" (!`getAttr "main_ctrl.R_arm_FKIK"`);
//	setAttr "main_ctrl.R_leg_fk" (!`getAttr "main_ctrl.R_leg_fk"`);
//	setAttr "main_ctrl.R_leg_ik" (!`getAttr "main_ctrl.R_leg_ik"`);
//	setAttr "main_ctrl.R_leg_FKIK" (!`getAttr "main_ctrl.R_leg_FKIK"`);
	if (`getAttr "main_ctrl.root"` == 0)
	{
		setAttr "main_ctrl.root" 1;
		setAttr "main_ctrl.spine" 1;
		setAttr "main_ctrl.head" 1;
		setAttr "main_ctrl.L_clavicle" 1;
		setAttr "main_ctrl.L_arm_fk" 1;
		setAttr "main_ctrl.L_arm_ik" 1;
		setAttr "main_ctrl.L_arm_finger" 1;
		setAttr "main_ctrl.L_arm_FKIK" 1;
		setAttr "main_ctrl.L_leg_fk" 1;
		setAttr "main_ctrl.L_leg_ik" 1;
		setAttr "main_ctrl.L_leg_FKIK" 1;
		setAttr "main_ctrl.R_clavicle" 1;
		setAttr "main_ctrl.R_arm_fk" 1;
		setAttr "main_ctrl.R_arm_ik" 1;
		setAttr "main_ctrl.R_arm_finger" 1;
		setAttr "main_ctrl.R_arm_FKIK" 1;
		setAttr "main_ctrl.R_leg_fk" 1;
		setAttr "main_ctrl.R_leg_ik" 1;
		setAttr "main_ctrl.R_leg_FKIK" 1;
	}else{	
		setAttr "main_ctrl.root" 0;
		setAttr "main_ctrl.spine" 0;
		setAttr "main_ctrl.head" 0;
		setAttr "main_ctrl.L_clavicle" 0;
		setAttr "main_ctrl.L_arm_fk" 0;
		setAttr "main_ctrl.L_arm_ik" 0;
		setAttr "main_ctrl.L_arm_finger" 0;
		setAttr "main_ctrl.L_arm_FKIK" 0;
		setAttr "main_ctrl.L_leg_fk" 0;
		setAttr "main_ctrl.L_leg_ik" 0;
		setAttr "main_ctrl.L_leg_FKIK" 0;
		setAttr "main_ctrl.R_clavicle" 0;
		setAttr "main_ctrl.R_arm_fk" 0;
		setAttr "main_ctrl.R_arm_ik" 0;
		setAttr "main_ctrl.R_arm_finger" 0;
		setAttr "main_ctrl.R_arm_FKIK" 0;
		setAttr "main_ctrl.R_leg_fk" 0;
		setAttr "main_ctrl.R_leg_ik" 0;
		setAttr "main_ctrl.R_leg_FKIK" 0;
	}
	return 1;
}
proc int showHideBody()
{
	if (`getAttr "main_ctrl.root"` == 0)
	{
		setAttr "main_ctrl.root" 1;
		setAttr "main_ctrl.spine" 1;
		setAttr "main_ctrl.head" 1;
	}else{	
		setAttr "main_ctrl.root" 0;
		setAttr "main_ctrl.spine" 0;
		setAttr "main_ctrl.head" 0;
	}
	return 1;
}
proc int showHideLarm()
{
	setAttr "main_ctrl.L_clavicle" (!`getAttr "main_ctrl.L_clavicle"`);
	setAttr "main_ctrl.L_arm_fk" (!`getAttr "main_ctrl.L_arm_fk"`);
	setAttr "main_ctrl.L_arm_ik" (!`getAttr "main_ctrl.L_arm_ik"`);
	setAttr "main_ctrl.L_arm_finger" (!`getAttr "main_ctrl.L_arm_finger"`);
	return 1;
}
proc int showHideRarm()
{
	setAttr "main_ctrl.R_clavicle" (!`getAttr "main_ctrl.R_clavicle"`);
	setAttr "main_ctrl.R_arm_fk" (!`getAttr "main_ctrl.R_arm_fk"`);
	setAttr "main_ctrl.R_arm_ik" (!`getAttr "main_ctrl.R_arm_ik"`);;
	setAttr "main_ctrl.R_arm_finger" (!`getAttr "main_ctrl.R_arm_finger"`);
	return 1;
}
proc int showHideLleg()
{
	setAttr "main_ctrl.L_leg_fk" (!`getAttr "main_ctrl.L_leg_fk"`);
	setAttr "main_ctrl.L_leg_ik" (!`getAttr "main_ctrl.L_leg_ik"`);
	return 1;
}
proc int showHideRleg()
{
	setAttr "main_ctrl.R_leg_fk" (!`getAttr "main_ctrl.R_leg_fk"`);
	setAttr "main_ctrl.R_leg_ik" (!`getAttr "main_ctrl.R_leg_ik"`);
	return 1;
}
proc int showHideFKIK()
{
	setAttr "main_ctrl.L_arm_FKIK" (!`getAttr "main_ctrl.L_arm_FKIK"`);
	setAttr "main_ctrl.L_leg_FKIK" (!`getAttr "main_ctrl.L_leg_FKIK"`);
	setAttr "main_ctrl.R_arm_FKIK" (!`getAttr "main_ctrl.R_arm_FKIK"`);
	setAttr "main_ctrl.R_leg_FKIK" (!`getAttr "main_ctrl.R_leg_FKIK"`);
	return 1;
}

//把所选对象加上 jerryRigAttr 。从而对它实现右键菜单自定义
global proc int addJerryRigAttr()
{
	string $selection[] = `ls -sl`;
	for($sel in $selection)
	{
		if (!`attributeExists "jerryRigAttr" $sel`)
		{
			addAttr -ln "jerryRigAttr"  -dt "string" $sel;
			setAttr -lock 0 -keyable 0 -channelBox 1 ($sel+".jerryRigAttr");
		}
	};
	return 1;
}

//如果所选对象有IK_FK属性,反转它
proc int FKIK_Switch()
{
	string $fkikCtrl,$selection[] = `ls -sl`;
	for($sel in $selection)
	{
		if (`attributeExists "jerryRigAttrFKIK" $sel`)
		{
			$fkikCtrl = (`getAttr ($sel+".jerryRigAttrFKIK") $sel` + "_ctrl");
			//查出 属性最大值
			$attrMaxValue = `attributeQuery -node $fkikCtrl -max "FKIK_blend"`;

			if (`getAttr ($fkikCtrl + ".FKIK_blend")` == 0)
			{
				catch(`setAttr ($fkikCtrl + ".FKIK_blend") $attrMaxValue[0]`);
			}else
			{
				catch(`setAttr ($fkikCtrl + ".FKIK_blend") 0`);
			}				 
		}
	}
	select -r $fkikCtrl;
	return 1;
}
//FKIK切换
proc int FKIK_align(string $blend, string $fk_shoulder, string $fk_elbow, string $fk_wrist, string $ik_wrist, string $ik_pole, string $fk_wrist_loc, string $ik_shoulder_loc, string $ik_elbow_loc, string $ik_wrist_loc)
{
	if ($blend == "fk2ik")
	{
		$l_ik_t = `xform -q -ws -t $fk_wrist_loc`;
		xform -ws -t $l_ik_t[0] $l_ik_t[1] $l_ik_t[2] $ik_wrist;
		
		//极向量约束定位
		$tempLoc1=`spaceLocator`;
		$tempConstraint=`pointConstraint $fk_shoulder $fk_wrist $tempLoc1[0]`;
		delete $tempConstraint[0];
		$tempConstraint=`aimConstraint -aimVector 1 0 0 $fk_elbow $tempLoc1[0]`;
		$tempLoc2=`spaceLocator`;
		parent $tempLoc2[0] $tempLoc1[0];
		setAttr -type float3 ($tempLoc2[0]+".translate") (2*`getAttr spine_ikCurve_curveInfo.arcLength`) 0 0;
		$tempFloat=`xform -q -ws -t $tempLoc2[0]`;
		xform -ws -t $tempFloat[0] $tempFloat[1] $tempFloat[2] $ik_pole;
		delete $tempLoc1;
	 
		$l_ik_ro = `xform -q -ws -ro $fk_wrist_loc`;
		xform -ws -ro $l_ik_ro[0] $l_ik_ro[1] $l_ik_ro[2] $ik_wrist;
	}
	else if ($blend == "ik2fk")
	{
		$l_fk_ro1 = `xform -q -ws -ro $ik_shoulder_loc`;
		xform -ws -ro $l_fk_ro1 [0] $l_fk_ro1 [1] $l_fk_ro1 [2] $fk_shoulder;
	 
		$l_fk_ro2 = `xform -q -ws -ro $ik_elbow_loc`;
		xform -ws -ro $l_fk_ro2 [0] $l_fk_ro2 [1] $l_fk_ro2 [2] $fk_elbow;
	 
		$l_fk_ro3 = `xform -q -ws -ro $ik_wrist_loc`;
		xform -ws -ro $l_fk_ro3 [0] $l_fk_ro3 [1] $l_fk_ro3 [2] $fk_wrist;
	}
	return 1;
}
//判断控制器,调用相应FKIK切换
proc int fk2ik()
{
	string $attr,$selection[] = `ls -sl`;
	for($sel in $selection)
	{
		if (`attributeExists "jerryRigAttrFKIK" $sel`)
		{
			$attr = `getAttr ($sel+".jerryRigAttrFKIK")`;
			switch ($attr)
			{
				case "L_arm_FKIK":
					FKIK_align("fk2ik","L_Shoulder_fk_ctrl", "L_Elbow_fk_ctrl", "L_Wrist_fk_ctrl", "L_Hand_IK_ctrl", "L_ElbowPole_ctrl", "L_fk_w_loc", "L_ik_s_loc", "L_ik_e_loc", "L_ik_w_loc");
				break;
				case "R_arm_FKIK":
					FKIK_align("fk2ik","R_Shoulder_fk_ctrl", "R_Elbow_fk_ctrl", "R_Wrist_fk_ctrl", "R_Hand_IK_ctrl", "R_ElbowPole_ctrl", "R_fk_w_loc", "R_ik_s_loc", "R_ik_e_loc", "R_ik_w_loc");
				break;
				case "L_leg_FKIK":
					FKIK_align("fk2ik","L_UpLeg_fkJoint_ctrl", "L_Leg_fkJoint_ctrl", "L_Foot_fkJoint_ctrl", "L_Foot_IK_ctrl", "L_KneePole_ctrl", "L_fk_foot_loc", "L_ik_upLeg_loc", "L_ik_leg_loc", "L_ik_foot_loc");
				break;
				case "R_leg_FKIK":
					FKIK_align("fk2ik","R_UpLeg_fkJoint_ctrl", "R_Leg_fkJoint_ctrl", "R_Foot_fkJoint_ctrl", "R_Foot_IK_ctrl", "R_KneePole_ctrl", "R_fk_foot_loc", "R_ik_upLeg_loc", "R_ik_leg_loc", "R_ik_foot_loc");
				break;
				default:
					;
				break;
			}
		}
	}
	return 1;
}
proc int ik2fk()
{
	string $attr,$selection[] = `ls -sl`;
	for($sel in $selection)
	{
		if (`attributeExists "jerryRigAttrFKIK" $sel`)
		{
			$attr = `getAttr ($sel+".jerryRigAttrFKIK")`;
			switch ($attr)
			{
				case "L_arm_FKIK":
					FKIK_align("ik2fk","L_Shoulder_fk_ctrl", "L_Elbow_fk_ctrl", "L_Wrist_fk_ctrl", "L_Hand_IK_ctrl", "L_ElbowPole_ctrl", "L_fk_w_loc", "L_ik_s_loc", "L_ik_e_loc", "L_ik_w_loc");
				break;
				case "R_arm_FKIK":
					FKIK_align("ik2fk","R_Shoulder_fk_ctrl", "R_Elbow_fk_ctrl", "R_Wrist_fk_ctrl", "R_Hand_IK_ctrl", "R_ElbowPole_ctrl", "R_fk_w_loc", "R_ik_s_loc", "R_ik_e_loc", "R_ik_w_loc");
				break;
				case "L_leg_FKIK":
					FKIK_align("ik2fk","L_UpLeg_fkJoint_ctrl", "L_Leg_fkJoint_ctrl", "L_Foot_fkJoint_ctrl", "L_Foot_IK_ctrl", "L_KneePole_ctrl", "L_fk_foot_loc", "L_ik_upLeg_loc", "L_ik_leg_loc", "L_ik_foot_loc");
				break;
				case "R_leg_FKIK":
					FKIK_align("ik2fk","R_UpLeg_fkJoint_ctrl", "R_Leg_fkJoint_ctrl", "R_Foot_fkJoint_ctrl", "R_Foot_IK_ctrl", "R_KneePole_ctrl", "R_fk_foot_loc", "R_ik_upLeg_loc", "R_ik_leg_loc", "R_ik_foot_loc");
				break;
				default:
					warning ($sel + " NO fkik Syestem!");
				break;
			}
		}
	}
	return 1;
}
//判断是否自定菜单物体
proc int objCondition(string $shortName)
{
	string $attr[] = `listAttr -st "jerryRigAttr" $shortName`;

    if(size($attr))
	return 1;
	else
	return 0;
}

//调用自定义菜单函数
global proc customMenu (string $shortName)
{
		jerryMarkingMenu();
}

//==============================================================================================================
//除了 dagMenuProc 处(搜 “objCondition” 方便定位到行号),加了if外,其它原版未动,因作用域问题,所以在这加载一遍
//if 中用了判断 objCondition 符合条件的才加载自定义右键
//==============================================================================================================

// Copyright (C) 1997-2006 Autodesk, Inc., and/or its licensors.
// All rights reserved.
//
// The coded instructions, statements, computer programs, and/or related
// material (collectively the "Data") in these files contain unpublished
// information proprietary to Autodesk, Inc. ("Autodesk") and/or its licensors,
// which is protected by U.S. and Canadian federal copyright law and by
// international treaties.
//
// The Data is provided for use exclusively by You. You have the right to use,
// modify, and incorporate this Data into other products for purposes authorized
// by the Autodesk software license agreement, without fee.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. AUTODESK
// DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTIES
// INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF NON-INFRINGEMENT,
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, OR ARISING FROM A COURSE
// OF DEALING, USAGE, OR TRADE PRACTICE. IN NO EVENT WILL AUTODESK AND/OR ITS
// LICENSORS BE LIABLE FOR ANY LOST REVENUES, DATA, OR PROFITS, OR SPECIAL,
// DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK AND/OR ITS
// LICENSORS HAS BEEN ADVISED OF THE POSSIBILITY OR PROBABILITY OF SUCH DAMAGES.

//  Alias Script File
//  MODIFY THIS AT YOUR OWN RISK
//
//  Creation Date:  Dec 3, 1996
//
//
//  Description:
//      This script describes the contents of the context sensitive menus.
//
//  Input Arguments:
//      None.
//
//  Return Value:
//      None.
//

global proc maintainActiveChangeSelectMode( string $item )
{
	hilite -unHilite $item;

	int $aa = `selectPref -q -affectsActive`;
	if (1 == $aa)
		selectPref -affectsActive 0;

	changeSelectMode -object;

	if (1 == $aa)
		selectPref -affectsActive 1;
}

proc optionalDagMenuProc( string $parent, string $item )
{
	// Look at the shape child of this object
	//
	string $object[] = `listRelatives -path -s $item`;

	string $shape = "";
	int $gotVisible = 0;

	if( size($object) < 1 ) return;

	for( $i=0; $i<size($object); $i+=1) {
		if( (0 == getAttr($object[$i] + ".io")) &&
			getAttr($object[$i] + ".v") ) {
			$shape = $object[$i];
			$gotVisible = 1;
			break;
		}
	}

	if( !$gotVisible ) {
		for( $i=0; $i<size($object); $i+=1) {
			if( 0 == getAttr($object[$i] + ".io")) {
				$shape = $object[$i];
				break;
			}
		}
	}

	if( "" != $shape ) {
		string $nt = `nodeType $shape`;
		switch( $nt ) {
		  case "subdiv":
			subdOptionalDagMenuProc( $parent, $item );
			menuItem -d true;
			break;

		  default:
			// Check to make sure we have a kPlugin prefix
			string $apiNt = `nodeType -api $shape`;
			if ( startsWith( $apiNt, "kPlugin" ) ) {
				string $nodeMenuCommand = $nt + "DagMenuProc";
				string $nodeMenuCommandWithArgs = $nodeMenuCommand + "(\"" + $parent + "\" , \"" + $item + "\" )";
				if ( exists( $nodeMenuCommand ) ) {
				   eval( $nodeMenuCommandWithArgs );
				}
			}
			break;
		}
	}
}

proc int objectIsTrimmed(string $item)
// Return true if this is a trimmed surface
{
	string $command = ("getAttr -size " + $item + ".trimFace");
	int $trimCount = eval($command);

	return ($trimCount != 0);
}


proc string getControlledHandle(string $item)
{
	string $handle;
	if (size(`ls ($item+".ikBlend")`)) {
		string $connHandles[] =
			`listConnections -type ikHandle ($item+".ikBlend")`;
		if (size($connHandles)) {
			$handle = $connHandles[0];
		}
	}
	return $handle;
}

proc int isIKcontroller(string $item)
{
	string $handle = getControlledHandle($item);
	return (size($handle) > 0);
}

proc
createFBIKmenuItems(string $parent,
					string $item,
					string $ikReachModeLocation,
					string $keyBodyPartLocation,
					string $keyAllLocation,
					string $keySelectedLocation)
{
	string $reachKeyingMode = (uiRes("m_dagMenuProc.kReachMode"));
	string $reachKeyingModeIK = (uiRes("m_dagMenuProc.kIkReachMode"));
	string $reachKeyingModeFK = (uiRes("m_dagMenuProc.kFkReachMode"));
	string $reachKeyingModeSimple = (uiRes("m_dagMenuProc.kSimpleeachMode"));
	if (!`optionVar -exists fbikKeyOption`) {
	    //3 == simple key
		optionVar -intValue fbikKeyOption 3;
	}
	int $rkm = `optionVar -q fbikKeyOption`;
	switch ($rkm)
	{
		case 1:
			$reachKeyingMode = $reachKeyingModeIK;
			break;
		case 2:
			$reachKeyingMode = $reachKeyingModeFK;
			break;
		case 3:
			$reachKeyingMode = $reachKeyingModeSimple;
			break;
	}

	menuItem -rp $ikReachModeLocation -label $reachKeyingMode
		-subMenu true
		-annotation (uiRes("m_dagMenuProc.kDetermineHowAnnot")) ;

		menuItem -rp "S" -label (uiRes("m_dagMenuProc.kIK"))
			-command FBIKReachKeyingOptionIK;

		menuItem -rp "N" -label (uiRes("m_dagMenuProc.kFK"))
			-command FBIKReachKeyingOptionFK;

		menuItem -rp "E" -label (uiRes("m_dagMenuProc.kSimpleNoReach"))
			-command FBIKReachKeyingOptionSimple;

	setParent -m $parent;

	string $bodyPartKeyingModeStr;
	int $bodyPartKeyingMode = 1; // 1 == full body
	if (`optionVar -exists keyFullBody`) {

		$bodyPartKeyingMode = `optionVar -query keyFullBody`;
	}
	else {
	    optionVar -intValue keyFullBody 1;
	}

	if($bodyPartKeyingMode == 1) { //full body
	    menuItem -label (uiRes("m_dagMenuProc.kKeyAllSel"))
		    -echoCommand true
		    -c ("optionVar -intValue keyFullBody 1; fbikDoSelectionChanged();headsUpDisplay -refresh HUDFbikKeyingMode;")
		    -rp $keyAllLocation
		    keyAllItem;
    }
    else {
	    menuItem -label (uiRes("m_dagMenuProc.kKeyAll"))
		    -echoCommand true
		    -c ("optionVar -intValue keyFullBody 1; fbikDoSelectionChanged();headsUpDisplay -refresh HUDFbikKeyingMode;")
		    -rp $keyAllLocation
		    keyAllItem;
    }

	if($bodyPartKeyingMode == 2) { //body part
	    menuItem -label (uiRes("m_dagMenuProc.kKeyBodyPartSel"))
		    -echoCommand true
		    -c ("optionVar -intValue keyFullBody 2; fbikDoSelectionChanged();headsUpDisplay -refresh HUDFbikKeyingMode;")
		    -rp $keyBodyPartLocation
		    keyBodyPartItem;
    }
    else {
	    menuItem -label (uiRes("m_dagMenuProc.kKeyBodyPart"))
		    -echoCommand true
		    -c ("optionVar -intValue keyFullBody 2; fbikDoSelectionChanged();headsUpDisplay -refresh HUDFbikKeyingMode;")
		    -rp $keyBodyPartLocation
		    keyBodyPartItem;
    }

	if($bodyPartKeyingMode == 3) { //key selected
	    menuItem -label (uiRes("m_dagMenuProc.kKeySelectedSel"))
		    -echoCommand true
		    -c ("optionVar -intValue keyFullBody 3; fbikDoSelectionChanged();headsUpDisplay -refresh HUDFbikKeyingMode;")
		    -rp $keySelectedLocation
		    keySelectedItem;
	}
	else {
	    menuItem -label (uiRes("m_dagMenuProc.kKeySelected"))
		    -echoCommand true
		    -c ("optionVar -intValue keyFullBody 3; fbikDoSelectionChanged();headsUpDisplay -refresh HUDFbikKeyingMode;")
		    -rp $keySelectedLocation
		    keySelectedItem;
    }
}
proc checkForSkinInfluenceItem(string $item, string $quadrant)
{
	int $isJoint = (nodeType($item) == "joint");

	// Check if the current context is the skinPaint context
	// and the the joint is connected to a skinCluster
	//
	string  $currContext = `currentCtx`;
	string  $currTool    = "";
	if(`contextInfo -ex $currContext`) {
		$currTool = `contextInfo -c $currContext`;
	}
	string $paintWeights = (uiRes("m_dagMenuProc.kPaintWeights"));
	if ( $currTool == "artAttrSkin" ) {
		string $whichTool = `artAttrCtx -q -whichTool $currContext`;
		if ( $whichTool == "skinWeights" )  {
			string $connL[] = `listConnections ($item+".worldMatrix")`;
			string $conn;
			for($conn in $connL) {
				if (`nodeType $conn` == "skinCluster")
				{
					// select the surface (not the joint) and set
					// the joint as the current influence
					//
					string $currSel[] = `ls -sl`;
					string $currSelString;
					if (size($currSel) > 0) {
						string $currObj;
						$currSelString = "select -r ";
						for ($currObj in $currSel) {
							$currSelString += ($currObj+" ");
						}
					}
					menuItem -label $paintWeights
						-echoCommand true
						-c ($currSelString+"; setSmoothSkinInfluence " + $item)
						-rp $quadrant
						paintWeightItem;
					break;
				}
			}
		}
	}		// menu for skinCluster paint
	// Check if the current context is the clusterPaint context
	// and the the joint is connected to a jointCluster
	//
	else if ( $isJoint && ($currTool == "artAttr") ) {
		string $whichTool = `artAttrCtx -q -whichTool $currContext`;
		if ( $whichTool == "general" )  {
			string $connL[] = `listConnections ($item+".worldMatrix")`;
			string $conn;
			for($conn in $connL) {
				if (`nodeType $conn` == "jointCluster")
				{
					string $artCommand = "artAttrCtx" ;
					string $attribute = "cluster." + $conn +  ".weights" ;
					menuItem -label $paintWeights
						-echoCommand true
						// the following command doesnot update the UI hence we use the next one
						//-c ("artAttrCtx -e -pas \"cluster." + $conn +  ".weights\" `currentCtx`")
						-c ("artSetToolAndSelectAttr( \"" + $artCommand + "\", \"" + $attribute + "\" )")
						-rp "N"
						paintWeightItem;
					break;
				}
			}
		}
	}
	// menu for joint-set paint
	// Check if the current context is the setPaint context
	// and the the joint is connected to a objectSet via jointCluster
	//
	else if ( $isJoint && ($currTool == "artSetPaint") ) {
		string $connL[] = `listConnections ($item+".worldMatrix")`;
		string $conn;
		for($conn in $connL) {
			if (`nodeType $conn` == "jointCluster") {
				string $connS[] = `listConnections ($conn+".message")`;
				for($set in $connS) {
					if (`nodeType $set` == "objectSet") {
						menuItem -label (uiRes("m_dagMenuProc.kPaintSetMembership"))
							-echoCommand true
							// the following command doesnot update the UI hence we use the next one
							//-c ("artSetPaintCtx -e -settomodify " + $set + " `currentCtx`")
							-c ("artSetPaintSelectSet( \"" + $set + "\" )")
							-rp "N"
							paintWeightItem;
						break;
					}
				}
			}
		}
	}
}

global proc string[] objectSelectMasks(string $item)
// Returns the component selection masks that apply to this object
{
	string $maskList[];
	string $shape = $item;
	int $i;

	// Look at the shape child of this object
	//
	string $object[] = `listRelatives -path -s $item`;

	int $gotVisible = 0;

	for ($i = 0; $i < size($object); ++$i) {
		if( (0 == getAttr($object[$i] + ".io")) &&
			getAttr($object[$i] + ".v") ) {
			$shape = $object[$i];
			$gotVisible = 1;
			break;
		}
	}

	if( !$gotVisible ) {
		for ($i = 0; $i < size($object); ++$i)
		{
			if (getAttr($object[$i] + ".io") == 0)
			{
				$shape = $object[$i];
				break;
			}
		}
	}

	string $nt = `nodeType $shape`;

	switch ($nt) {
		case "lattice":
			$maskList[0] = "latticePoint";
			break;
		case "locator":
			$maskList[0] = "locator";
			break;
		case "nurbsCurve":
			$maskList[0] = "curveParameterPoint";
			$maskList[1] = "controlVertex";
			$maskList[2] = "editPoint";
			$maskList[3] = "hull";
			break;
		case "nurbsSurface":
			$maskList[0] = "isoparm";
			$maskList[1] = "controlVertex";
			$maskList[2] = "surfaceParameterPoint";
			$maskList[3] = "hull";
			$maskList[4] = "surfaceFace";
			$maskList[5] = "surfaceUV";
			if (objectIsTrimmed($shape)) {
				$maskList[6] = "surfaceEdge";
			}
			break;
		case "mesh":
			$maskList[0] = "edge";
			$maskList[1] = "vertex";
			$maskList[2] = "facet";
			$maskList[3] = "puv";
			$maskList[4] = "pvf";
			$maskList[5] = "meshComponents";
			break;
		case "joint":
			$maskList[0] = "joint";		// special case
			break;
		case "ikHandle":
			$maskList[0] = "ikHandle";	// special case
			break;
		case "hikEffector":
		// fall through
		case "hikFloorContactMarker":
			$maskList[0] = "hikEffector";	// special case
			break;
		case "particle":
			$maskList[0] = "particle";	// only one choice
			break;
		case "nParticle":
			$maskList[0] = "particle";	// only one choice
			break;
		case "spring":
			$maskList[0] = "springComponent";	// only one choice
			break;
		case "subdiv":
 			$maskList[0] = "subdivMeshPoint";
 			$maskList[1] = "subdivMeshEdge";
 			$maskList[2] = "subdivMeshFace";
 			$maskList[3] = "subdivMeshUV";
			break;
	}

	if (isIKcontroller($item)) {
		$maskList[size($maskList)] = "ikfkHandle";
	}

	return $maskList;
}


global proc string dagMenuProc_selectionMask_melToUI( string $mel )
{
	string $result = $mel;

	switch ($mel)
	{
		case "latticePoint":
			$result = (uiRes("m_dagMenuProc.kLatticePoint"));
			break;
		case "locator":
			$result = (uiRes("m_dagMenuProc.kLocator"));
			break;
		case "controlVertex":
			$result = (uiRes("m_dagMenuProc.kControlVertex"));
			break;
		case "editPoint":
			$result = (uiRes("m_dagMenuProc.kEditPoint"));
			break;
		case "hull":
			$result = (uiRes("m_dagMenuProc.kHull"));
			break;
		case "isoparm":
			$result = (uiRes("m_dagMenuProc.kIsoparm"));
			break;
		case "subdivMeshEdge":
			// fall through
		case "edge":
			$result = (uiRes("m_dagMenuProc.kEdge"));
			break;
		case "subdivMeshPoint":
			// fall through
		case "vertex":
			$result = (uiRes("m_dagMenuProc.kVertex"));
			break;
		case "joint":
			$result = (uiRes("m_dagMenuProc.kJoint"));
			break;
		case "ikHandle":
			$result = (uiRes("m_dagMenuProc.kIkHandle"));
			break;
		case "hikEffector":
			$result = (uiRes("m_dagMenuProc.kHikEffector"));
			break;
		case "ikfkHandle":
			$result = (uiRes("m_dagMenuProc.kIkfkHandle"));
			break;
		case "surfaceUV":
			$result = (uiRes("m_dagMenuProc.kSurfaceUV"));
			break;
		case "surfaceParameterPoint":
			$result = (uiRes("m_dagMenuProc.kSurfacePoint"));
			break;
		case "curveParameterPoint":
			$result = (uiRes("m_dagMenuProc.kCurvePoint"));
			break;
		case "surfaceEdge":
			$result = (uiRes("m_dagMenuProc.kTrimEdge"));
			break;
		case "surfaceFace":
			$result = (uiRes("m_dagMenuProc.kSurfacePatch"));
			break;
		case "subdivMeshUV":
			// fall through
		case "puv":
			$result = (uiRes("m_dagMenuProc.kUV"));
			break;
		case "subdivMeshFace":
			// fall through
		case "facet":
			$result = (uiRes("m_dagMenuProc.kFace"));
			break;
		case "pvf":
			$result = (uiRes("m_dagMenuProc.kVertexFace"));
			break;
		case "nParticle":
		case "particle":
			$result = (uiRes("m_dagMenuProc.kParticle"));
			break;
		case "springComponent":
			$result = (uiRes("m_dagMenuProc.kSpring"));
			break;
		case "meshComponents":
			$result = (uiRes("m_dagMenuProc.kMultiComp"));
			break;
		default:
			uiToMelMsg( "dagMenuProc_selectionMask_melToUI", $mel, 1 );
			break;
	}

	return $result;
}

global proc createSelectMenuItems(string $parent, string $item)
// Create a menu that shows the dag parenting for this object
{
	string $maskList[] = `objectSelectMasks($item)`;

	string $radialPosition[];
	string $uiName;

	int $i;
	int $isNurbObject     = false;
	int $isPolyObject     = false;
	int $isLatticeObject  = false;
	int $isJointObject    = false;
	int $isHikEffector	  = false;
	int $isIkHandleObject = false;
	int $isIkFkHandleObject = false;
	int $isParticleObject = false;
	int $isSpringObject   = false;
	int $isSubdivObject   = false;
	int $isLocatorObject  = false;
	int $hasComponents	  = false;

	//	Comparing an element in an empty array will increase the array
	//	to accomodate that element.
	//
	//	To avoid this, first test the size of the array before comparing
	//	elements that may not exist.
	//
	if (1 <= size($maskList)) {
		$isLatticeObject = ($maskList[0] == "latticePoint");
		$isJointObject = ($maskList[0] == "joint");
		$isHikEffector = ($maskList[0] == "hikEffector");
		$isIkHandleObject = ($maskList[0] == "ikHandle");
		$isParticleObject = ($maskList[0] == "particle");
		$isSpringObject = ($maskList[0] == "springComponent");
		$isSubdivObject = ($maskList[0] == "subdivMeshPoint");
		$isLocatorObject = ($maskList[0] == "locator");
	}
	if (2 <= size($maskList)) {
		$isNurbObject = ($maskList[1] == "controlVertex");
		$isPolyObject = ($maskList[1] == "vertex");
	}

	// $maxRadialPos keeps track of how many octants of the
	// RMB marking menu will be populated
	//
	int $maskSize = size($maskList);
	int $maxRadialPos = size($maskList);

	if (($maskSize > 0) && ($maskList[$maskSize-1] == "ikfkHandle")) {
		$isIkFkHandleObject = true;
		$maxRadialPos--; // ikfkHandle does not populate like other masks
	}

	$hasComponents = $isLatticeObject ||
					 $isParticleObject ||
					 $isSubdivObject ||
					 $isSpringObject ||
					 $isNurbObject ||
					 $isPolyObject;

	// NOTE:
	//			If the object has selectable components, then the
	//		radial position "NE" will be used for the menuItem:
	//		"Revert back to object mode."
	//
	setParent -menu $parent;
	$radialPosition[0] = "N";
	$radialPosition[1] = "W";
	$radialPosition[2] = "S";
	$radialPosition[3] = "E";
	$radialPosition[4] = "SW";
	$radialPosition[5] = "SE";
	$radialPosition[6] = "NW";
	$radialPosition[7] = "NE";

    string $disableikHandle = (uiRes("m_dagMenuProc.kDisableIkHandle"));
    string $enableIkHandle  = (uiRes("m_dagMenuProc.kEnableIkHandle"));
	string $setPreferred	= (uiRes("m_dagMenuProc.kSetPreferredAngle"));
	string $assumePreferred = (uiRes("m_dagMenuProc.kAssumePreferredAngle"));

	if ($isNurbObject) {
		for ($i = 0; $i < size($maskList); $i++) {
			  $uiName = `dagMenuProc_selectionMask_melToUI $maskList[$i]`;
			if ($maskList[$i] != "ikfkHandle") {
				menuItem -label $uiName
					-ecr false
					-c ( "doMenuNURBComponentSelection(\"" +
						 $item + "\", \"" +  $maskList[$i] + "\")")
					-rp $radialPosition[$i];
			}
		}

		// Check if the current context is the skinPaint context
		// and the the nurbs is connected to a skinCluster. If so, add
		// Paint Skin Weights to north ("NW") quadrant
		//
		checkForSkinInfluenceItem($item, "NW");

	} else if ($isPolyObject) {
		for ($i = 0; $i < size($maskList); $i++) {
				$uiName = `dagMenuProc_selectionMask_melToUI $maskList[$i]`;
			if ($maskList[$i] != "ikfkHandle") {
				menuItem -label $uiName
					-ecr false
					-c ( "doMenuComponentSelection(\"" +
						 $item + "\", \"" +  $maskList[$i] + "\")")
					-rp $radialPosition[$i];
			}
		}

		// Check if the current context is the skinPaint context
		// and the the poly is connected to a skinCluster. If so, add
		// Paint Skin Weights to north ("NW") quadrant
		//
		checkForSkinInfluenceItem($item, "NW");

	} else if ($isLatticeObject) {
		for ($i = 0; $i < size($maskList); $i++) {
			if ($maskList[$i] != "ikfkHandle") {
				$uiName = `dagMenuProc_selectionMask_melToUI $maskList[$i]`;
				menuItem -label $uiName
					-ecr false
					-c ( "doMenuLatticeComponentSelection(\"" +
						 $item + "\", \"" +  $maskList[$i] + "\")")
					-rp $radialPosition[$i];
			}
		}
	} else if ($isJointObject) {
		string $setCmd = `performSetPrefAngle 2`;
		string $assumeCmd = `performAssumePrefAngle 2`;
		$setCmd += (" "+$item);
		$assumeCmd += (" "+$item);
		string $jts[] = `ls -sl -type joint`;
		for ($jointItem in $jts) {
			if ($jointItem != $item) {
				$setCmd += (" "+$jointItem);
				$assumeCmd += (" "+$jointItem);
			}
		}
		menuItem -label $setPreferred
			-echoCommand true
			-c ($setCmd)
			-rp "N"
			setPrefAngleItem;

		menuItem -label $assumePreferred
			-echoCommand true
			-c ($assumeCmd)
			-rp "S"
			assumePrefAngleItem;

		string $hikHandle[] = `listConnections -type hikHandle $item`;
		int $isFBIKjoint = (size($hikHandle) > 0);
		if ($isFBIKjoint) {
			createFBIKmenuItems($parent, $item,"W","NE","E","SE");
		}

		// Check if the current context is the skinPaint context
		// and the the joint is connected to a skinCluster. If so, add
		// Paint Skin Weights to north ("N") quadrant
		//
		checkForSkinInfluenceItem($item, "N");

	} else if ($isHikEffector){
		if (nodeType($item) == "hikFloorContactMarker") {
			string $parentItems[] = `listRelatives -pa -p $item`;
			if (size($parentItems) &&
				nodeType($parentItems[0]) == "hikEffector") {
				$item = $parentItems[0];
			} else {
				$isHikEffector = false;
			}
		}

		if ($isHikEffector) {
		    string $pivotOffsetPlug = $item + ".pivotOffset";
		    float $pivotOffset[] = `getAttr $pivotOffsetPlug`;
		    int $enablePin = (equivalentTol($pivotOffset[0],0.0,0.001) &&
		                      equivalentTol($pivotOffset[1],0.0,0.001) &&
		                      equivalentTol($pivotOffset[2],0.0,0.001));

			// set pinning for hikEffectors
			menuItem -label (uiRes("m_dagMenuProc.kPinBoth"))
				-echoCommand true
				-c ("doPinHikEffectors 1 {\"3\",\"" + $item + "\"};")
				-enable $enablePin
				-rp "N"
				pinAllItem;

			menuItem -label (uiRes("m_dagMenuProc.kPinTranslate"))
				-echoCommand true
				-c ("doPinHikEffectors 1 {\"1\",\"" + $item + "\"};")
				-enable $enablePin
				-rp "NW"
				pinTransItem;

			menuItem -label (uiRes("m_dagMenuProc.kPinRotate"))
				-echoCommand true
				-c ("doPinHikEffectors 1 {\"2\",\"" + $item + "\"};")
				-enable $enablePin
				-rp "SW"
				pinRotItem;

			menuItem -label (uiRes("m_dagMenuProc.kUnpin"))
				-echoCommand true
				-c ("doPinHikEffectors 1 {\"0\",\"" + $item + "\"};")
				-rp "S"
				unpinItem;

			createFBIKmenuItems($parent, $item,"W","NE","E","SE");
		}
	} else if ($isLocatorObject) {
		// Check if the current context is the skinPaint context
		// and the the joint is connected to a skinCluster. If so, add
		// Paint Skin Weights to north ("N") quadrant
		//
		checkForSkinInfluenceItem($item, "N");

	} else if ($isIkHandleObject) {
		string $selectikHandlesJointsAnnot = (uiRes("m_dagMenuProc.kSelectikHandlesAnnot"));
		string $selectikHandlesAnnot = (uiRes("m_dagMenuProc.kEnableIKHandlesAnnot"));
		menuItem -label $setPreferred
			-annotation $selectikHandlesJointsAnnot
			-echoCommand true
			-c (`performSetPrefAngle 2` + " " + $item)
			-rp "W"
			setPrefAngleItem;

		menuItem -label $assumePreferred
			-annotation $selectikHandlesJointsAnnot
			-echoCommand true
			-c (`performAssumePrefAngle 2` + " " + $item)
			-rp "E"
			assumePrefAngleItem;

		menuItem -label $enableIkHandle
			-annotation $selectikHandlesAnnot
			-echoCommand true
			-c ("ikHandle -e -eh " + $item)
			-rp "N"
			enableIKHandlesItem;

		menuItem -label $disableikHandle
			-annotation $selectikHandlesAnnot
			-echoCommand true
			-c ("ikHandle -e -dh " + $item)
			-rp "S"
			disableIKHandlesItem;

		menuItem -label (uiRes("m_dagMenuProc.kEnableSnap"))
			-annotation $selectikHandlesAnnot
			-echoCommand true
			-c ("ikHandle -e -see " + $item + ";" +
				"ikHandle -e -shf on " + $item)
			-rp "SE"
			enableIKHandlesSnapItem;

		menuItem -label (uiRes("m_dagMenuProc.kDisableSnap"))
			-annotation $selectikHandlesAnnot
			-echoCommand true
			-c ("ikHandle -e -shf off " + $item)
			-rp "SW"
			disableIKHandlesSnapItem;

		$maxRadialPos = 6;
	} else if ($isParticleObject) {
		for ($i = 0; $i < size($maskList); $i++) {
			   $uiName = `dagMenuProc_selectionMask_melToUI $maskList[$i]`;
			menuItem -label $uiName
				-ecr false
				-c ( "doMenuParticleComponentSelection(\"" +
					$item + "\", \"" +  $maskList[$i] + "\")")
				-rp $radialPosition[$i];
		}
	} else if ($isSpringObject) {
		for ($i = 0; $i < size($maskList); $i++) {
			   $uiName = `dagMenuProc_selectionMask_melToUI $maskList[$i]`;
			menuItem -label $uiName
				-ecr false
				-c ( "doMenuSpringComponentSelection(\"" +
					$item + "\", \"" +  $maskList[$i] + "\")")
				-rp $radialPosition[$i];
		}
	} else if ($isSubdivObject) {
		subdDagMenuProc( 0, $item, $maskList );
	} else {
		for ($i = 0; $i < size($maskList); $i++) {
			if ($maskList[$i] == "ikfkHandle") {
				continue;
			}

			$uiName = `dagMenuProc_selectionMask_melToUI $maskList[$i]`;
			menuItem -label $uiName
				-ecr false
				-c ( "doMenuComponentSelection(\"" +
					$item + "\", \"" +  $maskList[$i] + "\")")
				-rp $radialPosition[$i];
		}
	}

	// If components are present, provide the ability to
	// get back to object mode...
	//
	if ($hasComponents) {
		menuItem -label (uiRes("m_dagMenuProc.kObjectMode"))
				-ecr false
				-c ("maintainActiveChangeSelectMode " + $item + ";")
				-rp "NE";
	}

	// Since any object can be an ikfk handle, we only populate the ikfk items
	// in slots that are not already in use.
	//
	if ($isIkFkHandleObject) {
		string $handle = getControlledHandle($item);

		if ($maxRadialPos < 8) {
			menuItem -label (uiRes("m_dagMenuProc.kSetIKFKKey"))
				-echoCommand true
				-annotation (uiRes("m_dagMenuProc.kSetKeysAnnot"))
				-rp $radialPosition[7]
				-command ("select -r "+$item+"; SetIKFKKeyframe");
		}

		if ($maxRadialPos < 7) {
			menuItem -label (uiRes("m_dagMenuProc.kMoveIKToFK"))
				-echoCommand true
				-annotation (uiRes("m_dagMenuProc.kSelectAnIKHandleOrIKFKAnnot"))
				-rp $radialPosition[6]
				-command ("select -r "+$item+"; MoveIKtoFK");
		}

		if ($maxRadialPos < 5) {
			menuItem -label $disableikHandle
				-annotation (uiRes("m_dagMenuProc.kDisableIKHandleAnnot"))
				-echoCommand true
				-c ("ikHandle -e -dh " + $handle)
				-rp $radialPosition[5];

			menuItem -label $enableIkHandle
				-annotation (uiRes("m_dagMenuProc.kEnableIKHandleAnnot"))
				-echoCommand true
				-c ("ikHandle -e -eh " + $handle)
				-rp $radialPosition[4];
		}
	}


//	for ($i = 0; $i < size($maskList); $i++) {
//       $itemName = "SELM" + string($i);
//			setParent -menu $parent;
//			menuItem
//				-c ("doMenuComponentSelection(\"" +
//					$item + "\", \"" +  $maskList[$i] + "\")")
//				-label $maskList[$i]
//				-rp $radialPosition[$i]
//				$itemName;
//	}
	setParent -menu $parent;
}

global proc doMenuNURBComponentSelection(string $item, string $mask)
//
// Change the selection/display state to allow selection of NURB components
//
{
	string $selectCmd;
	string $warn = (uiRes("m_dagMenuProc.kEditUVModeWarn"));

	if (`selectMode -q -object`) {
		hilite $item;
		selectType -ocm -alc false;
		$selectCmd = "selectType -ocm -" + $mask + " true;";

		// Test for implicit UVs - If we are in implicit UV mode
		// UVs are not selectable. So issue a warning.
		//
		if( $mask == "surfaceUV" )
		{
			int $isExplicit[] = `nurbsUVSet -q -ue $item`;
			if( !$isExplicit[0] )
			{
				warning(`format -s $item $warn`);
			}
		}
	} else {
		selectType -alc false;
		$selectCmd = "selectType -" + $mask + " true;";
		if (`selectMode -q -preset`) {
			$selectCmd = $selectCmd +"selectPriority -allComponents 1;";
			$selectCmd = $selectCmd +"selectPriority -isoparm 2;";
			$selectCmd = $selectCmd +"selectPriority -" + $mask + " 3;";
			switch ($mask) {
				case "surfaceUV":
					$selectCmd = $selectCmd +
						"toggle -state true -uv " + $item + ";";
					$selectCmd = $selectCmd +
						"toggle -state false -hull " + $item + ";";
					$selectCmd = $selectCmd +
						"toggle -state false -controlVertex " + $item + ";";
					$selectCmd = $selectCmd +
						"toggle -state false -editPoint " + $item + ";";

					// Test for implicit UVs - If we are in implicit UV mode
					// UVs are not selectable. So issue a warning.
					//
					int $isExplicit[] = `nurbsUVSet -q -ue $item`;
					if( !$isExplicit[0] )
					{
						warning(`format -s $item $warn`);
					}
					break;
				case "editPoint":
					$selectCmd = $selectCmd +
						"toggle -state true -" + $mask + " " + $item +";";
					$selectCmd = $selectCmd +
						"toggle -state false -hull " + $item + ";";
					$selectCmd = $selectCmd +
						"toggle -state false -controlVertex " + $item + ";";
					$selectCmd = $selectCmd +
						"toggle -state false -uv " + $item + ";";
					break;
				case "controlVertex":
					$selectCmd = $selectCmd +
						"toggle -state true -" + $mask + " " + $item +";";
					$selectCmd = $selectCmd +
						"toggle -state false -hull " + $item + ";";
					$selectCmd = $selectCmd +
						"toggle -state false -editPoint " + $item + ";";
					$selectCmd = $selectCmd +
						"toggle -state false -uv " + $item + ";";
					break;
				case "hull":
					$selectCmd = $selectCmd +
						"toggle -state true -" + $mask + " " + $item + ";";
					$selectCmd = $selectCmd +
						"toggle -state false -controlVertex " + $item + ";";
					$selectCmd = $selectCmd +
						"toggle -state false -editPoint " + $item + ";";
					$selectCmd = $selectCmd +
						"toggle -state false -uv " + $item + ";";
					break;
				default:
					$selectCmd = $selectCmd +
						"toggle -state false -hull " + $item + ";";
					$selectCmd = $selectCmd +
						"toggle -state false -controlVertex " + $item + ";";
					$selectCmd = $selectCmd +
						"toggle -state false -editPoint " + $item + ";";
					$selectCmd = $selectCmd +
						"toggle -state false -uv " + $item + ";";
					break;
			}
		} else {
			$selectCmd = $selectCmd + "hilite " + $item + ";";

			// Test for implicit UVs - If we are in implicit UV mode
			// UVs are not selectable. So issue a warning.
			//
			int $isExplicit[] = `nurbsUVSet -q -ue $item`;
			if( !$isExplicit[0] )
			{
			    warning(`format -s $item $warn`);
			}
		}
	}

	eval $selectCmd;
}

global proc doMenuLatticeComponentSelection(string $item, string $mask)
//
// Changes the selection/display state on this object to allow
// selection of the Lattice control points
{
	string $selectCmd;

	if (`selectMode -q -object`) {
		hilite $item;
		selectType -ocm -alc false;
		$selectCmd = "selectType -ocm -" + $mask + " true;";
	} else {
		selectType -ocm -alc false;
		$selectCmd = "selectType -" + $mask + " true;";
		if (!`selectMode -q -preset`) {
			$selectCmd = $selectCmd + "hilite " + $item + ";";
		} else {
			$selectCmd = $selectCmd + "toggle -" + $mask + ";";
		}
	}
	eval $selectCmd;
}


global proc doMenuParticleComponentSelection(string $item, string $mask)
//
// Change the selection/display state to allow selection of particle
// components
//
{
	string $selectCmd;

	if (`selectMode -q -object`) {
		hilite $item;
		selectType -ocm -alc false;
		$selectCmd = "selectType -ocm -" + $mask + " true;";
	} else {
		selectType -ocm -alc false;
		$selectCmd = "selectType -" + $mask + " true;";
		if (`selectMode -q -preset`) {
			$selectCmd = $selectCmd +"selectPriority -allComponents 1;";
			$selectCmd = $selectCmd +"selectPriority -particle 2;";
			$selectCmd = $selectCmd +"selectPriority -" + $mask + " 3;";
			switch ($mask) {
				case "particle":
					$selectCmd = $selectCmd +
						"toggle -state true -" + $mask + " " + $item +";";
					break;
				default:
					$selectCmd = $selectCmd +
						"toggle -state false -particle " + $item + ";";
					break;
			}
		} else {
			$selectCmd = $selectCmd + "hilite " + $item + ";";
		}
	}

	eval $selectCmd;
}


global proc doMenuSpringComponentSelection(string $item, string $mask)
//
// Change the selection/display state to allow selection of spring
// components
//
{
	string $selectCmd;

	if (`selectMode -q -object`) {
		hilite $item;
		selectType -ocm -alc false;
		$selectCmd = "selectType -ocm -" + $mask + " true;";
	} else {
		selectType -ocm -alc false;
		$selectCmd = "selectType -" + $mask + " true;";
		if (`selectMode -q -preset`) {
			$selectCmd = $selectCmd +"selectPriority -allComponents 1;";
			$selectCmd = $selectCmd +"selectPriority -springComponent 2;";
			$selectCmd = $selectCmd +"selectPriority -" + $mask + " 3;";
			switch ($mask) {
				case "springComponent":
					$selectCmd = $selectCmd +
						"toggle -state true -" + $mask + " " + $item +";";
					break;
				default:
					$selectCmd = $selectCmd +
						"toggle -state false -springComponent " + $item + ";";
					break;
			}
		} else {
			$selectCmd = $selectCmd + "hilite " + $item + ";";
		}
	}

	eval $selectCmd;
}


global proc doMenuComponentSelection(string $item, string $mask)
//
// Changes the selection/display state on this object to allow
// selection of the specified selection mask type.
{
	string $selectCmd;

	if (`selectMode -q -object`) {
		hilite $item;
		selectType -ocm -alc false;
		$selectCmd = "selectType -ocm -" + $mask + " true;";
	} else {
		selectType -ocm -alc false;
		$selectCmd = "selectType -" + $mask + " true;";
		if (!`selectMode -q -preset`) {
			$selectCmd = $selectCmd + "hilite " + $item + ";";
		}
	}
	eval $selectCmd;
}

global proc undoMenuComponentSelection(string $item, string $mask)
{
	string $selectCmd;

	if (`selectMode -q -object`) {
		$selectCmd = "selectType -ocm -" + $mask + " false;";
	} else {
		$selectCmd = "selectType -" + $mask + " false;";
	}

	eval $selectCmd;
}

global proc toggleBoundingBoxDisplay ( string $parent )
//
// For each shape under the selected parent object, toggle the
// state of bounding box display mode.
//
{
	string $shapes[] = `listRelatives -shapes $parent`;

	string $shape;

	for ( $shape in $shapes ) {
		int $overrideOn = `getAttr ( $shape + ".overrideEnabled")`;
		int $lodMode =    `getAttr ( $shape + ".overrideLevelOfDetail")`;
		int $enabled =     $overrideOn && $lodMode == 1;

		if ( $enabled ) {
			// Don't reset the overrideEnabled attribute. It
			// is used for more than just bounding box display
			// and turning if off will mess things up of you
			// have temporarily enabled bounding box display
			// of an object in a layer.
			setAttr ( $shape + ".overrideLevelOfDetail" ) 0;
		} else {
			setAttr ( $shape + ".overrideEnabled") 1;
			setAttr ( $shape + ".overrideLevelOfDetail") 1;
		}

	}
}

global proc createActionsMenuItems(string $parent, string $item)
//
// Creates a menu with common operations to perform on an object
//
{
	popupMenu -e -dai $parent;
	setParent -menu $parent;

	menuItem -label (uiRes("m_dagMenuProc.kTemplate"))  -c ("toggle -template -state on " + $item);
	menuItem -label (uiRes("m_dagMenuProc.kUntemplate"))  -c ("toggle -template -state off " + $item);
	menuItem -label (uiRes("m_dagMenuProc.kUnparent"))  -c ("parent -w " + $item);
	menuItem -label (uiRes("m_dagMenuProc.kBoundingBox"))  -c ("toggleBoundingBoxDisplay " + $item);
}


global proc showSG(string $item)
//
//	Display the Attribute Editor and show the tab for the
//	shading group that is on the object $item.
//
//  If would have been nicer to be able to use the
//	showShadingGroupAttributeEditor command, but it only
//  acts on the	selected object.
//
{
	//check selection list for faces (polys, subds, nurbs)
	string $shader = "";
	string $selection[] = `filterExpand -sm 34 -sm 38 -sm 72`;

	// If there are components selected, try to find a component shader
	if( size( $selection ) > 0)
	{
		string $nameBuffer[];

		int $numComps = size( $selection );
		int $comp;
		for( $comp = 0; $comp < $numComps; $comp++)
		{
			tokenize $selection[ $comp] "." $nameBuffer;

			//if the selected component is on the object under the pointer
			//get it's shader
			if ($nameBuffer[0] == $item) {
				$shader = `getComponentShader $selection[$comp]`;

				//check if the shader is already selected - only toggle
				//selection if it is not selected
				string $shaderSelected[] = `ls -selection $shader`;
				if ( size( $shaderSelected ) == 0){
					select -tgl $shader;

				}
				break;
			}
		}
	}

	// If we didn't find a component level shader, try for an object level one
	if( size( $shader ) == 0 ) {
		string $allNodes[] = (`listHistory -f true $item` );
		string $node = "";
		for ($node in $allNodes) {
			if(`nodeType $node` == "shadingEngine") {

				$shader = $node;
				break;
			}
		}
	}

	// If we found a shader, show it
	if( size( $shader ) > 0)
	{
		showEditor $shader;
	}
}

global proc showBakeSets(string $item, string $type)
//
//	Display the Attribute Editor and show the tab for the
//	first bake set of the specified $type that the object $item is in.
//  If there is no this $type of bake set in the scene, creates the
//  initial bake set of this type and show it in the attribute editor.
//
//  If would have been nicer to be able to use the
//	showBakeSetAttributeEditor command, but it only
//  acts on the	selected object.
//
{
	string $possibleBakeSets[] = (`listHistory -f true $item` );
	string $node = "";
    int $bakeSetExists = false;
	for ($node in $possibleBakeSets) {
		if(`nodeType $node` == $type)
        {
			showEditor $node;
            $bakeSetExists = true;
			break;
		}
	}

    // If no bake set exists for the $item, then create the
    // initial bake set of that $type and assign it to the $item.
    //
    if (!$bakeSetExists)
    {
        string $initialBakeSet = "";
		if($type == "vertexBakeSet")
        {
            $initialBakeSet = "initialVertexBakeSet";
        }
        else if($type == "textureBakeSet")
        {
            $initialBakeSet = "initialTextureBakeSet";
		}
        else
        {
            string $errorMsg = (uiRes("m_dagMenuProc.kBakeSetError"));
            error   -showLineNumber true
                (`format -s $type $errorMsg`);
            return;
        }

        // Create it if it does not exist yet.
        //
        if  ( size(`ls $initialBakeSet`) < 1)
        {
            createBakeSet($initialBakeSet, $type);
        }

        // Assign the initial bake set to the item.
        //
        assignBakeSet($initialBakeSet, $item);

        // Show the initial bake set.
        //
        showBakeSetAE($initialBakeSet);
    }
}

// Description:  This procedure is called to refresh the baking
//  attribute menu items.
//
global proc refreshBakingAttributeMenu (string $parent, string $item)
{
    setParent -menu $parent;

    int $suitable = bakeSetTypeSuitableForItem("textureBakeSet", $item);
    menuItem -edit -enable $suitable textureBakingAttributeItem;
    $suitable = bakeSetTypeSuitableForItem("vertexBakeSet", $item);
    menuItem -edit -enable $suitable vertexBakingAttributeItem;
}

// Description:  This procedure is called to create the
//  baking attribute menu.
//
proc createBakingAttributeMenu(string $parent, string $item)
{
    setParent -menu $parent;

	menuItem -label (uiRes("m_dagMenuProc.kEditAttributes"))
        -subMenu true
        -tearOff true
        -postMenuCommand ("refreshBakingAttributeMenu \""
                            +$parent+"|editAttributeItem\" \""
                            +$item+"\"")
        editAttributeItem;


        menuItem -label (uiRes("m_dagMenuProc.kTexture"))
            -c ("showBakeSets \""+$item+"\" \"textureBakeSet\"")
            textureBakingAttributeItem;
        menuItem -label (uiRes("m_dagMenuProc.kVertexMenuLabel"))
            -c ("showBakeSets \""+$item+"\" \"vertexBakeSet\"")
            vertexBakingAttributeItem;

    setParent -menu ..;
}

// Description:  This procedure is called to create the baking
//  menu items.
//
global proc createBakingMenuItems(string $parent, string $item)
//
//	Create the Baking menus for the RMB popup menu.
//
{
	popupMenu -e -deleteAllItems $parent;
	setParent -menu $parent;

    createBakingAttributeMenu($parent, $item);
	menuItem -d true;

	if (!`about -evalVersion`) {
		buildBakingMenus($item);
	}
}

// Description:  This procedure is called to create the switch proxy
//  menu items.
//
global proc createSwitchProxyMenuItems(string $parent, string $item, string $refNode)
//
//	Create the switch proxy submenu for the RMB popup menu.
//
{
	popupMenu -e -deleteAllItems $parent;
	setParent -menu $parent;

	string $proxyNodes[] = `getRelatedProxies $refNode`;
	int $i;
	string $proxyLabel;
	string $proxyTag;
	for( $i=0; $i<size($proxyNodes); $i+=1) {
		$proxyTag = `getAttr ($proxyNodes[$i] + ".proxyTag")`;

		menuItem -label $proxyTag -c ("proxySwitch " + $proxyNodes[$i]);
	}
}

global proc createHistoryMenuItems(string $parent, string $item)
//
// Creates a menu on the toolbar that shows a list of
// all operations that took place to create/modify
// the currently selected object.  Note that the list
// is not being filtered yet to get rid of things that
// users won't really care about, nor are the operations
// being listed as operations - their DG node names are
// simply being stuck into the menu.  This should
// change.
//
// Also note that the chain of operations limit is being
// hardcoded to 20 here, for the sake of speed.
//
{
	//
	// Delete all menu entries currently in the popup
	//
	popupMenu -e -dai $parent;
	setParent -menu $parent;

	historyPopupFill( $item, false, 1 );
}

global proc createFutureMenuItems(string $parent, string $item)
//
// Creates a menu on the toolbar that shows a list of
// all operations that took place to create/modify
// the currently selected object.  Note that the list
// is not being filtered yet to get rid of things that
// users won't really care about, nor are the operations
// being listed as operations - their DG node names are
// simply being stuck into the menu.  This should
// change.
//
// Also note that the chain of operations limit is being
// hardcoded to 20 here, for the sake of speed.
//
{
	//
	// Delete all menu entries currently in the popup
	//
	popupMenu -e -dai $parent;
	setParent -menu $parent;

	historyPopupFill( $item, true, 1 );
}

global proc string objectHandlesUvSets(string $item)
{
	string $maskList[];
	string $shape = $item;
	int $i;

	// Look at the shape child of this object
	//
	string $object[] = `listRelatives -path -s $item`;
	int $gotVisible = 0;

	for ($i = 0; $i < size($object); ++$i) {
		if( (0 == getAttr($object[$i] + ".io")) &&
			getAttr($object[$i] + ".v") ) {
			$shape = $object[$i];
			$gotVisible = 1;
			break;
		}
	}

	if( !$gotVisible ) {
		for ($i = 0; $i < size($object); ++$i)
		{
			if (getAttr($object[$i] + ".io") == 0)
			{
				$shape = $object[$i];
				break;
			}
		}
	}
	string $nt = `nodeType $shape`;

	if ($nt == "mesh")
		return $shape;
	return "";
}

global proc createUVsetMenuItems(string $parent, string $item,
								 string $shape)
{
	popupMenu -e -dai $parent;
	setParent -menu $parent;

	string $cmd = "polyUVSet -currentUVSet -uvSet ";
	string $curSetPI[] = `polyUVSet -q -currentPerInstanceUVSet $shape`;
	string $curSet[] = `polyUVSet -perInstance 1 -q -currentUVSet $shape`;
	string $names[] = `polyUVSet -perInstance true -q -allUVSets $shape`;
	int $numNames = size($names);
	for ($ii = 0; $ii < $numNames; $ii++) {
		string $perInst[] = `polyUVSet -uvSet $names[$ii] -q -pi $shape`;
		if (size($perInst) > 0 && size($perInst[0]) > 0) {
			$names[$ii] = $perInst[0];
		}
	}

	string $allProjects[] = `polyUVSet -pr -q $shape`;
	string $setClearCmd = "";
	if (size($allProjects))
	{
		$setClearCmd = "select -d ";
		for ($p=0; $p<size($allProjects); $p++)
			$setClearCmd += (" " + $allProjects[$p]);
		$setClearCmd += ";";
	}

	// Add in a menu to do uv-linking
	if ($numNames > 0)
	{
		string $ann = `getRunTimeCommandAnnotation "UVCentricUVLinkingEditor"`;
		string $cmd = "UVCentricUVLinkingEditor; " + "select -r " + $item;
		menuItem -label (uiRes("m_dagMenuProc.kUVLinking"))
			-c $cmd
			-annotation $ann;

		menuItem -label (uiRes("m_dagMenuProc.kUVSetEditor"))
			-c "UVSetEditor"
			-ann (getRunTimeCommandAnnotation("UVSetEditor"))
			;
		menuItem -divider true;
	}

	for ($i=0; $i<$numNames; $i++)
	{
		string $uvEditname = ("\"" + $names[$i] + "\"");
		string $uvname = $names[$i];
		string $setCurCmd = $cmd + $uvEditname + " " + $shape + ";";

		// Find any projections associated with the uvset
		string $projs[];
		$projs = `polyUVSet -pr -uvs $uvname -q $shape`;
		string $projCmd;

		// Add a divider between items
		if ($i > 0)
			menuItem -divider true;

		if ($uvname == $curSet[0] || $uvname == $curSetPI[0])
		{
			menuItem -label ($uvname) -c $setClearCmd -checkBox true;
			for ($j=0; $j<size($projs); $j++)
			{
				$projCmd = ($setClearCmd + "select -add "+ $projs[$j] + ";setToolTo ShowManips;");
				menuItem -label $projs[$j] -c $projCmd;
				if ($j >= 5)
					break;
			}
		}
		else
		{
			menuItem -label ($uvname) -c ($setClearCmd + $setCurCmd) -checkBox false;
			for ($j=0; $j<size($projs); $j++)
			{
				$projCmd = ($setCurCmd + $setClearCmd + "select -add "+ $projs[$j] + ";setToolTo ShowManips;");
				menuItem -label $projs[$j] -c $projCmd;
				if ($j >= 5)
					break;
			}
		}
	}
}

//
global proc string objectHandlesColorSets(string $item)
{
	string $maskList[];
	string $shape = $item;
	int $i;

	// Look at the shape child of this object
	//
	string $object[] = `listRelatives -path -s $item`;
	int $gotVisible = 0;

	for ($i = 0; $i < size($object); ++$i) {
		if( (0 == getAttr($object[$i] + ".io")) &&
			getAttr($object[$i] + ".v") ) {
			$shape = $object[$i];
			$gotVisible = 1;
			break;
		}
	}

	if( !$gotVisible ) {
		for ($i = 0; $i < size($object); ++$i)
		{
			if (getAttr($object[$i] + ".io") == 0)
			{
				$shape = $object[$i];
				break;
			}
		}
	}
	string $nt = `nodeType $shape`;

	if ($nt == "mesh")
		return $shape;

	return "";
}

global proc createColorSetMenuItems(string $parent, string $item,
								 string $shape)
{
	popupMenu -e -dai $parent;
	setParent -menu $parent;

	string $cmd = "polyColorSet -currentColorSet -colorSet ";
	string $curSet[] = `polyColorSet -q -currentColorSet $shape`;
	string $curSetPI[] = `polyColorSet -perInstance true -q -currentPerInstanceSet $shape`;
	string $names[] = `polyColorSet -perInstance true -q -acs $shape`;
	string $rep[] = `polyColorSet -q -acs -representation $shape`;

	int $numNames = size($names);
	for ($ii = 0; $ii < $numNames; $ii++) {
		string $perInst[] = `polyColorSet -colorSet $names[$ii] -q -pi $shape`;
		if (size($perInst) > 0 && size($perInst[0]) > 0) {
			$names[$ii] = $perInst[0];
		}
	}

	// Add in a menu to access color set editor
	menuItem -label (uiRes("m_dagMenuProc.kColorSetEditor"))
		-ann (getRunTimeCommandAnnotation("ColorSetEditor"))
		-command "colorSetEditor"
		;
	if ($numNames > 0)
	{
	menuItem -divider true;
	}

	string $tool = `currentCtx`;

	for ($i=0; $i < $numNames; $i++)
	{
		string $colorEditname = ("\"" + $names[$i] + "\"");
		string $colorname = $names[$i];
		string $setCurCmd = $cmd + $colorEditname + " " + $shape + ";";

		// 302288: ensuring a consistent UI w.r.t. color set selection
		//
		if ($tool == "artAttrColorPerVertexContext")
		{
			$setCurCmd = $setCurCmd + " artAttrColorPerVertexValues(\"artAttrColorPerVertexContext\");";
		}

		// Add a divider between items
		if ($i > 0)
			menuItem -divider true;

		if ($colorname == $curSet[0] || $colorname == $curSetPI[0])
		{
			$colorname += "(" + $rep[2*$i+1] + ")";
			menuItem -label ($colorname) -checkBox true;
		}
		else
		{
			$colorname += "(" + $rep[2*$i+1] + ")";
			menuItem -label ($colorname) -c ($setCurCmd) -checkBox false;
		}
	}
}

global proc createArtAttrMenuItems(
	string 		$parent,
	string 		$item
)
//
//	Description:
// 		Creates a menu that shows all the paintable attributes.
//
//	NOTE: paintAttr are sorted by the paintable node type.
//
{
	popupMenu -e -dai $parent;
	setParent -menu $parent;

	// add default items which are always displayed in the context menu
	menuItem -p $parent -label (uiRes("m_dagMenuProc.kPaintSelect"))  -command "ArtPaintSelectToolOptions" ;
	menuItem -p $parent -label (uiRes("m_dagMenuProc.kThreeDPaint"))  -command "Art3dPaintToolOptions" ;
	menuItem -p $parent -label (uiRes("m_dagMenuProc.kSculpt"))  -command "SculptGeometryToolOptions" ;

	// Get all paintable attributes
	string $paintAttr = `artBuildPaintMenu $item`;
	string $paint = (uiRes("m_dagMenuProc.kPaint"));

	if ($paintAttr != "")
	{
		// if the menu item has not been created, create it.
		if( $parent == "" )
			$parent = `menuItem -subMenu true -aob true -label $paint `;


		// create special purpose painting menu items for objects
		// such as cloth
		//
		string $excludeNodes[] = createPaintingMenuItems( $parent, $item );

		// Create the menu.
		artAttrCreateMenuItems( $parent, $paintAttr, $excludeNodes );

	}
}

//
//	Description:
// 		Creates RMB menu for the ViewCube
//
global proc createViewCubeMenuItems(
	string 		$parent
)
{
	popupMenu -e -dai $parent;
	setParent -menu $parent;

	// (Menu item) Set view to home view
	menuItem -p $parent -label (uiRes("m_dagMenuProc.kViewCubeHome"))
		-command "viewManip -goHome";

	menuItem -divider true;

	// (Menu item) Toggles the selection lock.
	// This item is enabled if the selection lock is currently on or if
	// there is currently geometry selected.
	int $lockOn = `viewManip -q -toggleSelectionLock`;
	int $enabled = $lockOn;

	if (!$enabled)
	{
		string	$sel[] = `ls -sl -dag -geometry`;
		$enabled = (size($sel) > 0);
	}

	menuItem -p $parent -enable $enabled  -checkBox $lockOn
		-label (uiRes("m_dagMenuProc.kViewCubeSelectionLock"))
		-command "viewManip -toggleSelectionLock";

	menuItem -divider true;

	// (Menu item) Sets current view as the (scene) Home view
	menuItem -p $parent -label (uiRes("m_dagMenuProc.kViewCubeSetHome"))
		-command "viewManip -setHome";

	// (Menu item) Reset the Home view to its default
	menuItem -p $parent -label (uiRes("m_dagMenuProc.kViewCubeResetHome"))
		-enable `viewManip -q -setHome`
		-command "viewManip -resetHome";

	// (Menu item) Sets current view as the (scene) Front view
	menuItem -p $parent -label (uiRes("m_dagMenuProc.kViewCubeSetFront"))
		-command "viewManip -setFront";

	// (Menu item) Reset the Front view to its default
	menuItem -p $parent -label (uiRes("m_dagMenuProc.kViewCubeResetFront"))
		-enable `viewManip -q -setFront`
		-command "viewManip -resetFront";

	menuItem -divider true;

	// (Menu item) Opens preferences window to the ViewCube properties tab
	menuItem -p $parent -label (uiRes("m_dagMenuProc.kViewCubeProperties"))
		 -command "preferencesWnd \"viewCube\";";

	menuItem -divider true;

	// (Menu item) Show help on the ViewCube
	menuItem -p $parent -label (uiRes("m_dagMenuProc.kHelpViewCube"))
		-command "showHelp ViewCube";
}

// This has been called because a menu press happened on a DAG object
// So find the Object submenu and add the DAG specific items to it.
//
global proc dagMenuProc(string $parent, string $object)
{
	global string $artSelectObject ;
	string $mode = "";

	if (`optionVar -exists currentMenuBarTab`) {
		$mode = `optionVar -q currentMenuBarTab`;
	} else {
		optionVar -sv currentMenuBarTab $mode;
	}

	if (($object == "CubeCompass"))
	{
		createViewCubeMenuItems($parent);
		return;
	}

	if (`popupMenu -e -exists $parent`) {
		setParent -m $parent;

		// label the object
		string $shortName = `substitute ".*|" $object ""`;
		//=================================================================================
	    if(objCondition($shortName))//|| $shortName==”L_elbow_JNT” || $shortName==”L_shoulder_JNT”)
		{
			customMenu $shortName;
		}
		//=================================================================================
		else//
		{
			menuItem -label ($shortName + "...") -c ("showEditor "+$object);
			menuItem -divider true;
			menuItem -divider true;

			// Create the list of selection masks
			createSelectMenuItems($parent, $object);

			menuItem -d true;

			menuItem -label (uiRes("m_dagMenuProc.kSelect"))  -c ("select -r " + $object);
			menuItem -label (uiRes("m_dagMenuProc.kSelectHierarchy"))  -c ("select -hierarchy " + $object);
			string $container = `container -q -fc $object`;
			if( $container != "" ){
				menuItem -label (uiRes("m_dagMenuProc.kSelectContainer")) -c ("select -r " + $container);
			}

			menuItem -d true;

			optionalDagMenuProc( $parent, $object );

			// Create the dg traversal menu
			//
			string $menu = `menuItem -subMenu true -aob true -label (uiRes("m_dagMenuProc.kDGTraversal")) `;
			menu -e
				-pmc ( "createTraversalMenuItems \""+$menu+"\" "+$object ) $menu;
			setParent -m $parent;

			// create the history menu
			//
			string $menu = `menuItem -subMenu true -aob true -label (uiRes("m_dagMenuProc.kInputs")) `;
			menu -e
				-pmc ( "createHistoryMenuItems \""+$menu+"\" "+$object ) $menu;
			setParent -m $parent;

			$menu = `menuItem -subMenu true -aob true -label (uiRes("m_dagMenuProc.kOutputs")) `;
			menu -e -pmc ( "createFutureMenuItems \""+$menu+"\" "+$object ) $menu;
			setParent -m $parent;

			// Look at the shape child of this object
			//
			string $shapes[] = `listRelatives -path -s $object`;

			// get current selection of shapes
			string $currentSel[] = `ls -sl -dagObjects -shapes` ;

			string $paintParent = "" ;
			int $selIndex  ;

			int $i;
			for ($i = 0; $i < size($shapes); ++$i)
			{
				string $nodeType = `nodeType $shapes[$i]` ;

				if ( ( $nodeType == "nurbsSurface") ||
					 ( $nodeType == "mesh") ||
					 ( $nodeType == "subdiv"))
				{
					// save the object name if it is not already selected by the user
					// We use this info to select the object if user chooses a paint option
					//
					// If user has selected multiple objects and is using context menu on one of them
					// we do not change the selection list as user may want to paint some attribute
					// on all of them. (It is the way it has been working all along...we don't want to
					// break it )

					int $found = 0 ;
					for( $selIndex  = 0 ; $selIndex  < size( $currentSel ); ++$selIndex  )
					{
						if( $shapes[$i] == $currentSel[ $selIndex  ] )
						{
							$found = 1 ;
							break ;
						}
					}

					if( $found )
					{
						$artSelectObject = "" ;
					}
					else
					{
						// check if the object is in component selection mode
						// and if it is, do not do any further selection.
						// We are assuming that if the object is in hilite mode
						// then the user is in component selection mode.

						$currentSel = `ls -hilite` ;
						for( $selIndex  = 0 ; $selIndex  < size( $currentSel ); ++$selIndex  )
						{
							if( $object == $currentSel[ $selIndex  ] )
							{
								$found = 1 ;
								break ;
							}
						}

						if( !$found )
							$artSelectObject = $object ;
						else
							$artSelectObject = "" ;
					}

					$paintParent = `menuItem -subMenu true -aob true -label (uiRes("m_dagMenuProc.kPaintSubmenu")) `;
					menu -e	-pmc ( "createArtAttrMenuItems \""+ $paintParent +"\" "+$object ) $paintParent ;
					setParent -m $parent;
					break ;
				}
			}

			$menu = `menuItem -subMenu true -label (uiRes("m_dagMenuProc.kActions")) `;
			menu -e -pmc ( "createActionsMenuItems \""+$menu+"\" "+$object ) $menu;

			setParent -m $parent;

			// If the object can handle uv sets then add the uvset menu
			//
			string $shape = objectHandlesUvSets( $object );
			if ($shape != "")
			{
				$menu = `menuItem -subMenu true -label (uiRes("m_dagMenuProc.kUVSets")) `;
				menu -e
					-pmc ( "createUVsetMenuItems \""+$menu+"\" " +$object + " "+ $shape )
					$menu;
				setParent -m $parent;
			}

			string $shape = objectHandlesColorSets( $object );
			if ($shape != "")
			{
				$menu = `menuItem -subMenu true -label (uiRes("m_dagMenuProc.kColorSets")) `;
				menu -e
					-pmc ( "createColorSetMenuItems \""+$menu+"\" " +$object + " "+ $shape )
					$menu;
				setParent -m $parent;
			}

			// Shader menu to be able to quickly assign existing shaders
			// to the object under the pointer.
			//
			menuItem -d true;

			menuItem -label (uiRes("m_dagMenuProc.kMaterialAttributes")) -c ("showSG "+$object);

			menuItem -d true;

			buildShaderMenus($object);

			menuItem -d true;

			menuItem -divider true;

			string $removeOverrideMenuItem = `menuItem
				-label (uiRes("m_dagMenuProc.kRemoveMaterialOverride"))
				-subMenu true`;
			menuItem -edit -postMenuCommand
				("buildMaterialRemoveOverrideMenu -surface "+$object+" "+$removeOverrideMenuItem)
				$removeOverrideMenuItem;
			setParent -m ..;

			int $mentalIsLoaded = 0;
			string $renderer;
			for ($renderer in `renderer -query -namesOfAvailableRenderers`) {
				if( $renderer == "mentalRay" ) {
					$mentalIsLoaded = 1;
					break;
				}
			}

			if ($mentalIsLoaded) {
				$menu = `menuItem -subMenu true -label (uiRes("m_dagMenuProc.kBaking")) `;
				menu -e
					-pmc ( "createBakingMenuItems \""+$menu+"\" "+$object )
					$menu;
				setParent -m $parent;
			}

	//		{
	// 			$menu = `menuItem -subMenu true -label $paint `;
	//			menu -e
	//				-pmc ( "createPaintingMenuItems \""+$menu+"\" "+$object )
	//				$menu;
	// 			setParent -m $parent;
	//		}

			if ($mode == "dynamicsMenuSet") {
				menuItem -d true;
				menuItem -label (uiRes("m_dagMenuProc.kConnectField"))  -c ("connectDynamic -f " + $object);
				menuItem -label (uiRes("m_dagMenuProc.kConnectEmitter"))  -c ("connectDynamic -em " + $object);
				menuItem -label (uiRes("m_dagMenuProc.kConnectCollision"))  -c ("connectDynamic -c " + $object);
			}

			// is there a reference associated with the object ?
			// and if so, is it in a loaded or unloaded state?
			string $refNode = `getRelatedReference $object`;
			if( size($refNode) > 0) {
				menuItem -d true;
				if( `file -rfn $refNode -q -dr` ) {
					menuItem -label (uiRes("m_dagMenuProc.kLoadRelatedReference"))  -c ("loadRelatedReference " + $object);
				} else {
					menuItem -label (uiRes("m_dagMenuProc.kReloadRelatedReference"))  -c ("loadRelatedReference " + $object);
					menuItem -label (uiRes("m_dagMenuProc.kUnloadRelatedReference"))  -c ("unloadRelatedReference " + $object);
				}
				// Is this reference a proxy? If so, add proxy switch submenu
				//
				string $proxyNodes[] = `getRelatedProxies $refNode`;
				if(size($proxyNodes) > 0) {
					$menu = `menuItem -subMenu true -label (uiRes("m_dagMenuProc.kReloadProxy")) `;
					menu -e
						-pmc ( "createSwitchProxyMenuItems \""+$menu+"\" "+$object + " " + $refNode )
						$menu;
					setParent -m $parent;
				}
			}
		setParent -m $parent;
		}		//=================================================================================
	} else {
		string $warn = (uiRes("m_dagMenuProc.kMenuWarn"));
		warning(`format -s $parent $warn`);
	}
}

在我做FKIK无缝时,一开始总是有抖动。很小。可能是因为我加了极向量约束后,又无知的去调约束控制器造成的。

总的来说。

创建三个loc用来获取ik的旋转。手腕那个我P给的IK控制器。

创建一个loc用来获取FK的手腕。

极向量,用的是ADV的方法。创建一个loc用肩和腕点约束,然后肘目标约束。loc的方向就对上了。然后创建loc2放在loc中,沿目标约束的方向,移动些距离。

这时的位置就是极向量约束器的位置。

在最初就应该用这个方法来对位极向量的约束控制器。

最后,可能那些用来定位的loc,最好确认下它的初始正确。

比如三个loc的世界旋转分别与三个FK相等。P给fk的那个也是要与IK控制器的世界位置旋转相等。

OK 算是记下了。以后忘记了好查。

 

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

笑虾

多情黯叹痴情癫。情癫苦笑多情难

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值