PDA

View Full Version : Change Character clothes using Mel.


mcbridecasey
12-07-2010, 08:21 PM
I am new to scripting so I hope im heading in the right direction. I am trying to create a attribute to change my characters clothing texture through an expression.


I have an "Outfit" attribute on my "RigMoveScale_ctrl" object that has a min and a max of 1 and 2 and a default of 1.

I have this expression on my "RigMoveScale_ctrl" object.


if (RigMoveScale_ctrl.Outfit == 1){
setAttr -type "string" body_color_tex.fileTextureName "sourceimages/Outfit_color_1.jpg";

setAttr -type "string" body_bump_tex.fileTextureName "sourceimages/Outfit_bump_1.jpg";

setAttr -type "string" body_spec_tex.fileTextureName "sourceimages/Outfit_spec_1.jpg";

}

else if (RigMoveScale_ctrl.Outfit == 2)

{

setAttr -type "string" body_color_tex.fileTextureName "sourceimages/Outfit_color_2.jpg";

setAttr -type "string" body_bump_tex.fileTextureName "sourceimages/Outfit_bump_2.jpg";

setAttr -type "string" body_spec_tex.fileTextureName "sourceimages/Outfit_spec_2.jpg";

}



It is creating the expression but it has no effect on my scene, and when I change the Outfit attribute to 2 still no change.

CGTalk Moderation
12-07-2010, 08:21 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.