library to easily apply operators This is not a UI to create operator within xsi but make the scripting easier. More...
Functions | |
| def | pathCns |
| BUILT IN OPERATORS APPLY. More... | |
| def | poseCns |
| Apply a pose constraint. More... | |
| def | positionCns |
| Apply a Position constraint. More... | |
| def | obj2ClsCns |
| Apply a Object to cluster constraint. More... | |
| def | symmetryCns |
| Apply a Symmetry constraint. More... | |
| def | dirCns |
| Apply a direction constraint. More... | |
| def | twoPointsCns |
| Apply a pose constraint. More... | |
| def | clsCtrOp |
| Apply a cluster center operator. More... | |
| def | smoothOp |
| def | chainUpvOp |
| Apply a chain upv operator. More... | |
| def | copyOp |
| Apply a cluster center operator. More... | |
| def | spinePointAtOp |
| Apply a SpinePointAt operator. More... | |
| def | sn_xfspring_op |
| Apply a sn_xfspring_op operator. More... | |
| def | sn_rotspring_op |
| Apply a sn_rotspring_op operator. More... | |
| def | sn_ik2bone_op |
| Apply a sn_ik2bone_op operator. More... | |
| def | sn_ikfk2bone_op |
| Apply a sn_ikfk2bone_op operator. More... | |
| def | sn_stretchChain_op |
| Apply a sn_stretchChain_op operator. More... | |
| def | sn_stretchChainMulti_op |
| Apply a sn_stretchChainMulti_op operator. More... | |
| def | sn_interLocalOri_op |
| Apply a sn_interLocalOri_op operator. More... | |
| def | sn_interpose_op |
| Apply a sn_interpose_op operator. More... | |
| def | sn_splinekine_op |
| Apply a sn_splinekine_op operator. More... | |
| def | sn_rollsplinekine_op |
| Apply a sn_rollsplinekine_op operator. More... | |
| def | sn_curveslide_op |
| Apply a sn_curveslide_op operator. More... | |
| def | sn_curveslide2_op |
| Apply a sn_curveslide2_op operator. More... | |
| def | sn_curvelength_op |
| Apply a sn_curvelength_op operator. More... | |
| def | sn_squashstretch_op |
| Apply a sn_squashstretch_op operator. More... | |
| def | sn_squashstretch2_op |
| Apply a sn_squashstretch2_op operator. More... | |
| def | sn_null2curve_op |
| Apply a sn_null2curve_op operator. More... | |
| def | sn_null2surface_op |
| Apply a sn_null2surface_op operator. More... | |
| def | sn_inverseRotorder_op |
| Apply a sn_inverseRotorder_op operator. More... | |
| def | sn_pointAt_op |
| Apply a sn_pointAt_op operator. More... | |
| def | gear_slerp_op |
| Apply a gear_slerp operator. More... | |
| def | gear_resampler_op |
| Apply a gear_curveResampler operator. More... | |
| def | gear_pointAtObjectAxis |
| Apply a gear_pointAtObjectAxis_op operator. More... | |
| def | gear_dualUpVDirCns |
| def | gear_rotationToPose |
| def | gear_zipper_op |
| Apply a gear_zipper operator. More... | |
| def | gear_pathdriver_op |
| Apply a pathdriver operator. More... | |
| def | createJSOpFromFile |
| MISC. More... | |
Variables | |
| int | CPP = 0 |
| int | JSCRIPT = 1 |
| int | PYTHON = 2 |
| tuple | JSOPPATH = os.path.join(os.path.dirname(__file__), "jsop") |
library to easily apply operators This is not a UI to create operator within xsi but make the scripting easier.
This file is part of GEAR_mc.
GEAR_mc is a fork of Jeremie Passerin's GEAR project.
GEAR is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/lgpl.html>.
Author: Jeremie Passerin geerem@hotmail.com www.jeremiepasserin.com
Fork Author: Miquel Campos hello@miqueltd.com www.miqueltd.com
Date: 2013 / 08 / 16
| def gear.xsi.applyop.chainUpvOp | ( | chain, | |
| upv | |||
| ) |
Apply a chain upv operator.
| chain | X3DObject - Bone Chain to apply the Up vector. |
| upv | X3DObject - Upvector object. |
| def gear.xsi.applyop.clsCtrOp | ( | obj, | |
| center, | |||
| pointIndexes | |||
| ) |
Apply a cluster center operator.
| obj | Geometry - A Polymesh, NurbMesh or NurbCurve to be constrained. |
| center | X3DObject - Constraining Object. |
| pointIndexes | List of Integer - List of point index to constraint. |
| def gear.xsi.applyop.copyOp | ( | obj, | |
| ref | |||
| ) |
Apply a cluster center operator.
| obj | Geometry - A Polymesh, NurbMesh or NurbCurve to be constrained. |
| ref | Geometry - A Geometry of same type as previously. |
| def gear.xsi.applyop.createJSOpFromFile | ( | name, | |
| path, | |||
| outputPorts, | |||
| inputPorts, | |||
paramDefs = [] |
|||
| ) |
MISC.
======================================================== Create a JScript operator from given file
| name | String - Name of the operator |
| path | String - Path to the file that define the operator |
| outputPorts | List of Objects - Object to be connected as outputs |
| inputPorts | List of Objects - Object to be connected as inputs |
| paramDefs | List of Parameter Definition to create |
| def gear.xsi.applyop.dirCns | ( | obj, | |
| master, | |||
upv = None, |
|||
comp = False, |
|||
axis = "xy" |
|||
| ) |
Apply a direction constraint.
| obj | X3DObject - Constrained object. |
| master | X3DObject - Constraining Object. |
| upv | X3DObject - None of you don't want to use up vector |
| comp | Boolean - Active constraint compensation. |
| axis | String - Define pointing axis and upvector axis |
| def gear.xsi.applyop.gear_pathdriver_op | ( | out, | |
| max, | |||
| min, | |||
| perc, | |||
| driver | |||
| ) |
Apply a pathdriver operator.
| def gear.xsi.applyop.gear_pointAtObjectAxis | ( | cns, | |
| ref, | |||
axis = [0 |
|||
| ) |
Apply a gear_pointAtObjectAxis_op operator.
| cns | Constraint - Direction, Path, Curve, 2Point Constraint |
| ref | X3DObject - The object that will be use as reference |
| axis | List of Double - The vector that will be use as reference |
| def gear.xsi.applyop.gear_resampler_op | ( | out_crv, | |
crv = None, |
|||
start = 0, |
|||
end = 1, |
|||
parametric = 0, |
|||
mode = 0 |
|||
| ) |
Apply a gear_curveResampler operator.
| out_crv | Curve - The resampled Curve. |
| crv | Curve - The reference curve (if None, reference is same as target) |
| start | Double - Start Percentage (0 to 1) |
| end | Double - End Percentage (0 to 1) |
| def gear.xsi.applyop.gear_slerp_op | ( | out, | |
| refA, | |||
| refB, | |||
blend = .5 |
|||
| ) |
Apply a gear_slerp operator.
| out | X3DObject |
| crv | Curve - The reference curve (if None, reference is same as target) |
| start | Double - Start Percentage (0 to 1) |
| end | Double - End Percentage (0 to 1) |
| def gear.xsi.applyop.gear_zipper_op | ( | crv0, | |
| crv1 | |||
| ) |
Apply a gear_zipper operator.
| def gear.xsi.applyop.obj2ClsCns | ( | obj, | |
| cls, | |||
comp = False |
|||
| ) |
Apply a Object to cluster constraint.
| obj | X3DObject - Constrained object. |
| cls | X3DObject - Constraining cluster. |
| comp | Boolean - Active constraint compensation. |
| def gear.xsi.applyop.pathCns | ( | obj, | |
| curve, | |||
cnsType = 0, |
|||
u = 0, |
|||
tangent = False, |
|||
upv = None, |
|||
comp = False |
|||
| ) |
BUILT IN OPERATORS APPLY.
PathCns ================================================ Apply a path constraint or curve constraint.
| obj | X3DObject - Constrained object. |
| curve | Nurbcurve - Constraining Curve. |
| cnsType | Integer - 0 for Path Constraint ; 1 for Curve Constraint (Parametric). |
| u | Double - Position of the object on the curve (from 0 to 100 for path constraint, from 0 to 1 for Curve cns). |
| tangent | Boolean - Active tangent. |
| upv | X3DObject - Object that act as up vector. |
| comp | Boolean - Active constraint compensation. |
| def gear.xsi.applyop.poseCns | ( | obj, | |
| master, | |||
comp = False, |
|||
position = True, |
|||
orientation = True, |
|||
scaling = True, |
|||
affbyori = True, |
|||
affbyscl = True |
|||
| ) |
Apply a pose constraint.
| obj | X3DObject - Constrained object. |
| master | X3DObject - Constraining Object. |
| comp | Boolean - Active constraint compensation. |
| position | - Boolean - Active position constraint. |
| orientation | - Boolean - Active orientation constraint. |
| scaling | - Boolean - Active scaling constraint. |
| def gear.xsi.applyop.positionCns | ( | obj, | |
| master, | |||
comp = False |
|||
| ) |
Apply a Position constraint.
| obj | X3DObject - Constrained object. |
| master | X3DObject - Constraining Object. |
| comp | Boolean - Active constraint compensation. |
| def gear.xsi.applyop.sn_curvelength_op | ( | out, | |
| crv | |||
| ) |
Apply a sn_curvelength_op operator.
| out | Parameter - The output of the curve length value. |
| crv | NurbeCurve - In Curve. |
| def gear.xsi.applyop.sn_curveslide2_op | ( | outcrv, | |
| incrv, | |||
position = 0, |
|||
maxstretch = 1, |
|||
maxsquash = 1, |
|||
softness = 0, |
|||
lang = CPP |
|||
| ) |
Apply a sn_curveslide2_op operator.
| outcrv | NurbeCurve - Out Curve. |
| incrv | NurbeCurve - In Curve. |
| position | Double - Default position value (from 0 to 1). |
| maxstretch | Double - Default maxstretch value (from 1 to infinite). |
| maxsquash | Double - Default maxsquash value (from 0 to 1). |
| softness | Double - Default softness value (from 0 to 1). |
| def gear.xsi.applyop.sn_curveslide_op | ( | crv | ) |
Apply a sn_curveslide_op operator.
| crv | NurbeCurve - In / Out curve. |
| def gear.xsi.applyop.sn_ik2bone_op | ( | out = [], |
|
root = None, |
|||
eff = None, |
|||
upv = None, |
|||
lengthA = 5, |
|||
lengthB = 3, |
|||
negate = False |
|||
| ) |
Apply a sn_ik2bone_op operator.
| out | List of X3DObject - The constrained outputs order must be respected (BoneA, BoneB, Center, CenterN, Eff), set it to None if you don't want one of the output. |
| root | X3DObject - Object that will act as the root of the chain. |
| eff | X3DObject - Object that will act as the eff controler of the chain. |
| upv | X3DObject - Object that will act as the up vector of the chain. |
| lengthA | Double - Length of first bone. |
| lengthB | Double - Length of second bone. |
| negate | Boolean - Use with negative Scale. |
| def gear.xsi.applyop.sn_ikfk2bone_op | ( | out = [], |
|
root = None, |
|||
eff = None, |
|||
upv = None, |
|||
fk0 = None, |
|||
fk1 = None, |
|||
fk2 = None, |
|||
lengthA = 5, |
|||
lengthB = 3, |
|||
negate = False, |
|||
blend = 0, |
|||
lang = CPP |
|||
| ) |
Apply a sn_ikfk2bone_op operator.
| out | List of X3DObject - The constrained outputs order must be respected (BoneA, BoneB, Center, CenterN, Eff), set it to None if you don't want one of the output. |
| root | X3DObject - Object that will act as the root of the chain. |
| eff | X3DObject - Object that will act as the eff controler of the chain. |
| upv | X3DObject - Object that will act as the up vector of the chain. |
| fk0 | X3DObject - Object that will act as the first fk controler of the chain. |
| fk1 | X3DObject - Object that will act as the second fk controler of the chain. |
| fk2 | X3DObject - Object that will act as the fk effector controler of the chain. |
| lengthA | Double - Length of first bone. |
| lengthB | Double - Length of second bone. |
| negate | Boolean - Use with negative Scale. |
| blend | Double - Default blend value (0 for full ik, 1 for full fk). |
| def gear.xsi.applyop.sn_interLocalOri_op | ( | out, | |
| refA, | |||
| refB, | |||
blend = 0 |
|||
| ) |
Apply a sn_interLocalOri_op operator.
| out | X3DObject - constrained Object. |
| refA | X3DObject - |
| refB | X3DObject - |
| blend | Double - |
| def gear.xsi.applyop.sn_interpose_op | ( | out, | |
| objA, | |||
| objB | |||
| ) |
Apply a sn_interpose_op operator.
| out | X3DObject - constrained Object. |
| objA | and objB X3DObject - Objects that will act as controler . |
| def gear.xsi.applyop.sn_inverseRotorder_op | ( | out_obj, | |
| in_obj | |||
| ) |
Apply a sn_inverseRotorder_op operator.
| out | X3DObject - Constrained object. |
| in | X3DObject - Constrained object. |
| def gear.xsi.applyop.sn_null2curve_op | ( | out, | |
| driver, | |||
| upv, | |||
| crv0, | |||
crv1 = None |
|||
| ) |
Apply a sn_null2curve_op operator.
| out | X3DObject - Constrained object. |
| driver | X3DObject - Driving object. |
| upv | X3DObject - Up Vector. |
| crv0 | NurbsCurve - Curve to constraint the object on. |
| crv1 | NurbsCurve - Curve Use as reference (if None, crv0 is used). |
| def gear.xsi.applyop.sn_null2surface_op | ( | out, | |
| driver, | |||
| upv, | |||
| srf0, | |||
srf1 = None |
|||
| ) |
Apply a sn_null2surface_op operator.
| out | X3DObject - Constrained object. |
| driver | X3DObject - Driving object. |
| upv | X3DObject - Up Vector. |
| srf0 | NurbsSurface - NurbsSurface to constraint the object on. |
| srf1 | NurbsSurface - NurbsSurface Use as reference (if None, srf0 is used). |
| def gear.xsi.applyop.sn_pointAt_op | ( | out_obj, | |
| target, | |||
| upv | |||
| ) |
Apply a sn_pointAt_op operator.
| out_obj | X3DObject - Constrained object. |
| target | X3DObject |
| upv | X3DObject |
| def gear.xsi.applyop.sn_rollsplinekine_op | ( | out, | |
ctrl = [], |
|||
u = .5 |
|||
| ) |
Apply a sn_rollsplinekine_op operator.
| out | X3DObject - constrained Object. |
| ctrl | List of X3DObject - Objects that will act as controler of the bezier curve. Objects must have a parent that will be used as an input for the operator. |
| u | Double - Position of the object on the bezier curve (from 0 to 1). |
| def gear.xsi.applyop.sn_rotspring_op | ( | out | ) |
Apply a sn_rotspring_op operator.
| out | X3DObject - |
| def gear.xsi.applyop.sn_splinekine_op | ( | out, | |
ctrl = [], |
|||
u = .5 |
|||
| ) |
Apply a sn_splinekine_op operator.
| out | X3DObject - constrained Object. |
| ctrl | List of X3DObject - Objects that will act as controler of the bezier curve. |
| u | Double - Position of the object on the bezier curve (from 0 to 1). |
| def gear.xsi.applyop.sn_squashstretch2_op | ( | out, | |
| sclref, | |||
length = 5, |
|||
axis = "x" |
|||
| ) |
Apply a sn_squashstretch2_op operator.
| out | X3DObject - Constrained object. |
| sclref | X3DObject - Global scaling reference object. |
| length | Double - Rest Length of the S&S. |
| axis | String - 'x' for scale all except x axis... |
| def gear.xsi.applyop.sn_squashstretch_op | ( | out, | |
u = .5, |
|||
length = 5 |
|||
| ) |
Apply a sn_squashstretch_op operator.
| out | X3DObject - Constrained object. |
| u | Double - Position of the object on the S&S curve. |
| length | Double - Rest Length of the S&S. |
| def gear.xsi.applyop.sn_stretchChain_op | ( | root, | |
| ik_ctl | |||
| ) |
Apply a sn_stretchChain_op operator.
| root | ChainRoot - Root of the chain to apply the operator to. |
| ik_ctl | X3DObject - Object that will act as the eff controler of the chain. |
| def gear.xsi.applyop.sn_stretchChainMulti_op | ( | root, | |
| ik_ctl | |||
| ) |
Apply a sn_stretchChainMulti_op operator.
| root | ChainRoot - Root of the chain to apply the operator to. |
| ik_ctl | X3DObject - Object that will act as the eff controler of the chain. |
| def gear.xsi.applyop.sn_xfspring_op | ( | out, | |
mode = 2 |
|||
| ) |
Apply a sn_xfspring_op operator.
| out | X3DObject - constrained Object. |
| mode | Integer - 0 Scaling, 1 Rotation, 2 Translation, 3 SR, 4 RT, 5 ST, 6 SRT |
| def gear.xsi.applyop.spinePointAtOp | ( | cns, | |
| startobj, | |||
| endobj, | |||
blend = .5 |
|||
| ) |
Apply a SpinePointAt operator.
| cns | Constraint - The constraint to apply the operator on (must be a curve, path or direction constraint) |
| startobj | X3DObject - Start Reference. |
| endobj | X3DObject -End Reference. |
| blend | Double - Blend influence value from 0 to 1. |
| def gear.xsi.applyop.symmetryCns | ( | obj, | |
| master, | |||
comp = False, |
|||
symplane = 2, |
|||
position = True, |
|||
orientation = True, |
|||
scaling = True |
|||
| ) |
Apply a Symmetry constraint.
| obj | X3DObject - Constrained object. |
| master | X3DObject - Constraining Object. |
| comp | Boolean - Active constraint compensation. |
| position | - Boolean - Active position constraint. |
| orientation | - Boolean - Active orientation constraint. |
| scaling | - Boolean - Active scaling constraint. |
| def gear.xsi.applyop.twoPointsCns | ( | obj, | |
| master0, | |||
| master1, | |||
comp = False |
|||
| ) |
Apply a pose constraint.
| obj | X3DObject - Constrained object. |
| master0 | X3DObject - First constraining Object. |
| master1 | X3DObject - Last constraining Object. |
| comp | Boolean - Active constraint compensation. |
1.8.5