Hi Guys,
I'm having some difficulty solving this issue with a mel script I'm trying to run. I'm using a tutorial and the guy uses this code:
///Joint on Object
//Create a Procedure that can be run from the Command Line
proc oJnt()
//Query selection of objects
string $selObjs[] = ls -sl
;
//For Loop - "for every object selected in ($selObjs), run the following commands"
for ($objs in $selobjs){
//Create and Point Constrain a joint to it's respective object
select $objs;
string $jnt = joint
;
string $ptCnJnt[] = pointConstraint -offset 0 0 0 -weight 1 $objs $jnt
;
//Find and delete the Point Constraint of each joint
string $findPtCn[] = listRelatives -typ pointConstraint $jnt
;
select $findPtCn[0]; doDelete;
//Unparent joint from object
parent -w $jnt;
//Delete objects that joints were aligned to - [NOTE: this part of the code is useful for deleting objects that are only a point of reference to snap a joint to, i.e., a cluster]
select $objs; doDelete;
}
}
//Run the Procedure
oJnt;
I copied this from the tutorial word for word and character for character and I can't get it to work. The instructor got it to work on one go. Here's the errors I'm getting:
// Error: for ($objs in $selobjs){ // // Error: Line 7.23: "$selobjs" is an undeclared variable. // // Error: select $objs; // // Error: Line 9.17: "$objs" is an undeclared variable. // // Error: string $ptCnJnt[] = pointConstraint -offset 0 0 0 -weight 1 $objs $jnt
; // // Error: Line 13.72: "$objs" is an undeclared variable. // // Error: select $objs; doDelete; // // Error: Line 21.17: "$objs" is an undeclared variable. //
Please help. Thank you