Tripple-I
12-24-2007, 09:23 PM
umm, so I searched and searched and im finally aggravated enough to post and ask for help.
this is probably a stupid question, as im learning mel and this is my first macro.
Im writing an automatic leg setup that has ik/fk switch, no flip knee (cgtk style), reverse foot, and stretchyness. This is where im getting stopped:
//////////////////////////////////// No Flip Knee /////////////////////////////////////////////////////////
//Create Ik handles
select -r ("Ankle.rotatePivot") ;
select -add ("Ball.rotatePivot") ;
ikHandle -n ("BallIk") -sol ikSCsolver -s 0;
select -r ("Ball.rotatePivot") ;
select -add ("Toe.rotatePivot") ;
ikHandle -n ("ToeIk") -sol ikSCsolver -s 0;
select -r ("Hip.rotatePivot") ;
select -add ("Ankle.rotatePivot") ;
ikHandle -n ("LegIk") -sol ikRPsolver -s 0;
setAttr ("LegIk.stickiness") 1;
setAttr ("LegIk.poleVectorX") .1;
setAttr ("LegIk.poleVectorY") 0;
setAttr ("LegIk.poleVectorZ") 0;
setAttr ("LegIk.twist") 90;
//Create plus/minus average node
shadingNode -asUtility plusMinusAverage;
//connect knee attr to +/- input 1D[0]
select -r ("footControl")
connectAttr -force ("footControl.knee") ("plusMinusAverage1.input1D[0]");
//connect offset attr to +/- input 1D[1]
connectAttr -force ("footControl.offset") (" plusMinusAverage1.input1D[1]");
//connect output 1D to IK twist attr
connectAttr -force ("plusMinusAverage1.output1D") ("LegIk.twist")
//change offset to 90, lock and hide
setAttr ("footControl.offset") 90;
setAttr -lock true -keyable false ("footControl.offset");
//parent Constrain IK's to foot control
select -r ("footControl") ;
select -tgl ("LegIk") ;
parentConstraint -mo -weight 1;
select -r ("footControl") ;
select -tgl ("BallIk") ;
parentConstraint -mo -weight 1;
select -r ("footControl") ;
select -tgl ("ToeIk") ;
parentConstraint -mo -weight 1;
Instead of being helpful, maya selects the plusMinusAverage node and spits out
// Error: No object matches name: connectAttr
Maybe that is helpful, i ain't gettin' it.
this is probably a stupid question, as im learning mel and this is my first macro.
Im writing an automatic leg setup that has ik/fk switch, no flip knee (cgtk style), reverse foot, and stretchyness. This is where im getting stopped:
//////////////////////////////////// No Flip Knee /////////////////////////////////////////////////////////
//Create Ik handles
select -r ("Ankle.rotatePivot") ;
select -add ("Ball.rotatePivot") ;
ikHandle -n ("BallIk") -sol ikSCsolver -s 0;
select -r ("Ball.rotatePivot") ;
select -add ("Toe.rotatePivot") ;
ikHandle -n ("ToeIk") -sol ikSCsolver -s 0;
select -r ("Hip.rotatePivot") ;
select -add ("Ankle.rotatePivot") ;
ikHandle -n ("LegIk") -sol ikRPsolver -s 0;
setAttr ("LegIk.stickiness") 1;
setAttr ("LegIk.poleVectorX") .1;
setAttr ("LegIk.poleVectorY") 0;
setAttr ("LegIk.poleVectorZ") 0;
setAttr ("LegIk.twist") 90;
//Create plus/minus average node
shadingNode -asUtility plusMinusAverage;
//connect knee attr to +/- input 1D[0]
select -r ("footControl")
connectAttr -force ("footControl.knee") ("plusMinusAverage1.input1D[0]");
//connect offset attr to +/- input 1D[1]
connectAttr -force ("footControl.offset") (" plusMinusAverage1.input1D[1]");
//connect output 1D to IK twist attr
connectAttr -force ("plusMinusAverage1.output1D") ("LegIk.twist")
//change offset to 90, lock and hide
setAttr ("footControl.offset") 90;
setAttr -lock true -keyable false ("footControl.offset");
//parent Constrain IK's to foot control
select -r ("footControl") ;
select -tgl ("LegIk") ;
parentConstraint -mo -weight 1;
select -r ("footControl") ;
select -tgl ("BallIk") ;
parentConstraint -mo -weight 1;
select -r ("footControl") ;
select -tgl ("ToeIk") ;
parentConstraint -mo -weight 1;
Instead of being helpful, maya selects the plusMinusAverage node and spits out
// Error: No object matches name: connectAttr
Maybe that is helpful, i ain't gettin' it.
