Mirror on X with Transforms-> just scaling to -1 won't preserve transforms, needs some extra - my attempt is SetExpression
where it's usefull -> to transform multiple objects to preserve scaling -1 I have to go to edit mode, select all and apply a transform, ok for low poly count, when model comes from zbrush or other heavy objects - selecting all takes some time
unsolved
1. multiple selection (now works only on 1 object)
2. I'm not sure about set expression - > a. after running script pops-up setexperssion ppg, b. script runs slow, c. after closing set exp editor pops up an error
Code: Select all
ResetTransform(null, siCtr, siSRT, siXYZ);
var sel = Selection(0);
var c = Clone(null, null, 1, 1, 0, 0, 1, 0, 1, null, null, null, null, null, null, null, null, null, null);
Scale(null, -1, 1, 1, siAbsolute, siPivotCOG, siObj, siX, null, null, null, null, null, null, null, 0, null);
//position
AddExpr(c + ".kine.local.posx", "", null);
SetExpr(c + ".kine.local.posx", "-"+sel + ".kine.local.posx", null);
AddExpr(c + ".kine.local.posy", "", null);
SetExpr(c + ".kine.local.posy", sel + ".kine.local.posy", null);
AddExpr(c + ".kine.local.posz", "", null);
SetExpr(c + ".kine.local.posz", sel + ".kine.local.posz ", null);
//rotation
AddExpr(c + ".kine.global.rotx", "", null);
SetExpr(c + ".kine.global.rotx", sel + ".kine.global.rotx", null);
AddExpr(c + ".kine.global.roty", "", null);
SetExpr(c + ".kine.global.roty", "-"+sel + ".kine.global.roty", null);
AddExpr(c + ".kine.global.rotz", "", null);
SetExpr(c + ".kine.global.rotz", "-"+ sel + ".kine.global.rotz ", null);
//scale
AddExpr(c + ".kine.local.sclx", "", null);
SetExpr(c + ".kine.local.sclx", "-"+ sel + ".kine.local.sclx", null);
AddExpr(c + ".kine.local.scly", "", null);
SetExpr(c + ".kine.local.scly", sel + ".kine.local.scly", null);
AddExpr(c + ".kine.local.sclz", "", null);
SetExpr(c + ".kine.local.sclz", sel + ".kine.local.sclz ", null);
MoveCtr2Vertices(sel, true);
SelectObj(sel, null, true);