After this code below runs, it unselects all but one object.
So you can not continue to run the script on the previous multiple object selection.
I will have a Watch Dog hooked up to the script.
Code: Select all
function Execute(params)
{
var Shear_X = params.ConValue('Shear_X');
var Shear_Y = params.ConValue('Shear_Y');
var Shear_Z = params.ConValue('Shear_Z');
sel = Node.Selection();
for (i = 0; i < Node.SelectionLength(sel); i++)
{Node.Select(Node.SelectionGetAt(sel, i)); ApplyShear(Node.SelectionGetAt(sel, i))};
}
function ApplyShear(sel)
{
var Shear_X = Node.NearValue('', 'Shear_X')
var Shear_Y = Node.NearValue('', 'Shear_Y')
var Shear_Z = Node.NearValue('', 'Shear_Z')
if(Node.IsLight(sel)) { return; }
if(Node.IsCamera(sel)) { return; }
if(!sel) { return; }
if(!Node.ConExists(sel,"WldMatrix")) { return; }
Space.NodeMatrixElement(sel,'shx') = Shear_X;
Space.NodeMatrixElement(sel,'shy') = Shear_Y;
Space.NodeMatrixElement(sel,'shz') = Shear_Z;
}