gear_mc
 All Classes Namespaces Functions Variables
Functions | Variables
gear.xsi.applyop Namespace Reference

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")
 

Detailed Description

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
Author
Jeremie Passerin, Miquel Campos

Function Documentation

def gear.xsi.applyop.chainUpvOp (   chain,
  upv 
)

Apply a chain upv operator.

Parameters
chainX3DObject - Bone Chain to apply the Up vector.
upvX3DObject - Upvector object.
Returns
the newly created operator.
def gear.xsi.applyop.clsCtrOp (   obj,
  center,
  pointIndexes 
)

Apply a cluster center operator.

Parameters
objGeometry - A Polymesh, NurbMesh or NurbCurve to be constrained.
centerX3DObject - Constraining Object.
pointIndexesList of Integer - List of point index to constraint.
Returns
the newly created operator.
def gear.xsi.applyop.copyOp (   obj,
  ref 
)

Apply a cluster center operator.

Parameters
objGeometry - A Polymesh, NurbMesh or NurbCurve to be constrained.
refGeometry - A Geometry of same type as previously.
Returns
the newly created operator.
def gear.xsi.applyop.createJSOpFromFile (   name,
  path,
  outputPorts,
  inputPorts,
  paramDefs = [] 
)

MISC.

======================================================== Create a JScript operator from given file

Parameters
nameString - Name of the operator
pathString - Path to the file that define the operator
outputPortsList of Objects - Object to be connected as outputs
inputPortsList of Objects - Object to be connected as inputs
paramDefsList of Parameter Definition to create
Returns
the newly created operator.
def gear.xsi.applyop.dirCns (   obj,
  master,
  upv = None,
  comp = False,
  axis = "xy" 
)

Apply a direction constraint.

Parameters
objX3DObject - Constrained object.
masterX3DObject - Constraining Object.
upvX3DObject - None of you don't want to use up vector
compBoolean - Active constraint compensation.
axisString - Define pointing axis and upvector axis
Returns
the newly created constraint.
def gear.xsi.applyop.gear_pathdriver_op (   out,
  max,
  min,
  perc,
  driver 
)

Apply a pathdriver operator.

Returns
the newly created operator.
def gear.xsi.applyop.gear_pointAtObjectAxis (   cns,
  ref,
  axis = [0 
)

Apply a gear_pointAtObjectAxis_op operator.

Parameters
cnsConstraint - Direction, Path, Curve, 2Point Constraint
refX3DObject - The object that will be use as reference
axisList of Double - The vector that will be use as reference
Returns
the newly created operator.
def gear.xsi.applyop.gear_resampler_op (   out_crv,
  crv = None,
  start = 0,
  end = 1,
  parametric = 0,
  mode = 0 
)

Apply a gear_curveResampler operator.

Parameters
out_crvCurve - The resampled Curve.
crvCurve - The reference curve (if None, reference is same as target)
startDouble - Start Percentage (0 to 1)
endDouble - End Percentage (0 to 1)
Returns
the newly created operator.
def gear.xsi.applyop.gear_slerp_op (   out,
  refA,
  refB,
  blend = .5 
)

Apply a gear_slerp operator.

Parameters
outX3DObject
crvCurve - The reference curve (if None, reference is same as target)
startDouble - Start Percentage (0 to 1)
endDouble - End Percentage (0 to 1)
Returns
the newly created operator.
def gear.xsi.applyop.gear_zipper_op (   crv0,
  crv1 
)

Apply a gear_zipper operator.

Returns
the newly created operator.
def gear.xsi.applyop.obj2ClsCns (   obj,
  cls,
  comp = False 
)

Apply a Object to cluster constraint.

Parameters
objX3DObject - Constrained object.
clsX3DObject - Constraining cluster.
compBoolean - 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.

Parameters
objX3DObject - Constrained object.
curveNurbcurve - Constraining Curve.
cnsTypeInteger - 0 for Path Constraint ; 1 for Curve Constraint (Parametric).
uDouble - Position of the object on the curve (from 0 to 100 for path constraint, from 0 to 1 for Curve cns).
tangentBoolean - Active tangent.
upvX3DObject - Object that act as up vector.
compBoolean - Active constraint compensation.
Returns
the newly created constraint.
def gear.xsi.applyop.poseCns (   obj,
  master,
  comp = False,
  position = True,
  orientation = True,
  scaling = True,
  affbyori = True,
  affbyscl = True 
)

Apply a pose constraint.

Parameters
objX3DObject - Constrained object.
masterX3DObject - Constraining Object.
compBoolean - Active constraint compensation.
position- Boolean - Active position constraint.
orientation- Boolean - Active orientation constraint.
scaling- Boolean - Active scaling constraint.
Returns
the newly created constraint.
def gear.xsi.applyop.positionCns (   obj,
  master,
  comp = False 
)

Apply a Position constraint.

Parameters
objX3DObject - Constrained object.
masterX3DObject - Constraining Object.
compBoolean - Active constraint compensation.
def gear.xsi.applyop.sn_curvelength_op (   out,
  crv 
)

Apply a sn_curvelength_op operator.

Parameters
outParameter - The output of the curve length value.
crvNurbeCurve - In Curve.
Returns
the newly created operator.
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.

Parameters
outcrvNurbeCurve - Out Curve.
incrvNurbeCurve - In Curve.
positionDouble - Default position value (from 0 to 1).
maxstretchDouble - Default maxstretch value (from 1 to infinite).
maxsquashDouble - Default maxsquash value (from 0 to 1).
softnessDouble - Default softness value (from 0 to 1).
Returns
the newly created operator.
def gear.xsi.applyop.sn_curveslide_op (   crv)

Apply a sn_curveslide_op operator.

Parameters
crvNurbeCurve - In / Out curve.
Returns
the newly created operator.
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.

Parameters
outList 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.
rootX3DObject - Object that will act as the root of the chain.
effX3DObject - Object that will act as the eff controler of the chain.
upvX3DObject - Object that will act as the up vector of the chain.
lengthADouble - Length of first bone.
lengthBDouble - Length of second bone.
negateBoolean - Use with negative Scale.
Returns
the newly created operator.
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.

Parameters
outList 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.
rootX3DObject - Object that will act as the root of the chain.
effX3DObject - Object that will act as the eff controler of the chain.
upvX3DObject - Object that will act as the up vector of the chain.
fk0X3DObject - Object that will act as the first fk controler of the chain.
fk1X3DObject - Object that will act as the second fk controler of the chain.
fk2X3DObject - Object that will act as the fk effector controler of the chain.
lengthADouble - Length of first bone.
lengthBDouble - Length of second bone.
negateBoolean - Use with negative Scale.
blendDouble - Default blend value (0 for full ik, 1 for full fk).
Returns
the newly created operator.
def gear.xsi.applyop.sn_interLocalOri_op (   out,
  refA,
  refB,
  blend = 0 
)

Apply a sn_interLocalOri_op operator.

Parameters
outX3DObject - constrained Object.
refAX3DObject -
refBX3DObject -
blendDouble -
Returns
the newly created operator.
def gear.xsi.applyop.sn_interpose_op (   out,
  objA,
  objB 
)

Apply a sn_interpose_op operator.

Parameters
outX3DObject - constrained Object.
objAand objB X3DObject - Objects that will act as controler .
Returns
the newly created operator.
def gear.xsi.applyop.sn_inverseRotorder_op (   out_obj,
  in_obj 
)

Apply a sn_inverseRotorder_op operator.

Parameters
outX3DObject - Constrained object.
inX3DObject - Constrained object.
Returns
the newly created operator.
def gear.xsi.applyop.sn_null2curve_op (   out,
  driver,
  upv,
  crv0,
  crv1 = None 
)

Apply a sn_null2curve_op operator.

Parameters
outX3DObject - Constrained object.
driverX3DObject - Driving object.
upvX3DObject - Up Vector.
crv0NurbsCurve - Curve to constraint the object on.
crv1NurbsCurve - Curve Use as reference (if None, crv0 is used).
Returns
the newly created operator.
def gear.xsi.applyop.sn_null2surface_op (   out,
  driver,
  upv,
  srf0,
  srf1 = None 
)

Apply a sn_null2surface_op operator.

Parameters
outX3DObject - Constrained object.
driverX3DObject - Driving object.
upvX3DObject - Up Vector.
srf0NurbsSurface - NurbsSurface to constraint the object on.
srf1NurbsSurface - NurbsSurface Use as reference (if None, srf0 is used).
Returns
the newly created operator.
def gear.xsi.applyop.sn_pointAt_op (   out_obj,
  target,
  upv 
)

Apply a sn_pointAt_op operator.

Parameters
out_objX3DObject - Constrained object.
targetX3DObject
upvX3DObject
Returns
the newly created operator.
def gear.xsi.applyop.sn_rollsplinekine_op (   out,
  ctrl = [],
  u = .5 
)

Apply a sn_rollsplinekine_op operator.

Parameters
outX3DObject - constrained Object.
ctrlList 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.
uDouble - Position of the object on the bezier curve (from 0 to 1).
Returns
the newly created operator.
def gear.xsi.applyop.sn_rotspring_op (   out)

Apply a sn_rotspring_op operator.

Parameters
outX3DObject -
Returns
the newly created operator.
def gear.xsi.applyop.sn_splinekine_op (   out,
  ctrl = [],
  u = .5 
)

Apply a sn_splinekine_op operator.

Parameters
outX3DObject - constrained Object.
ctrlList of X3DObject - Objects that will act as controler of the bezier curve.
uDouble - Position of the object on the bezier curve (from 0 to 1).
Returns
the newly created operator.
def gear.xsi.applyop.sn_squashstretch2_op (   out,
  sclref,
  length = 5,
  axis = "x" 
)

Apply a sn_squashstretch2_op operator.

Parameters
outX3DObject - Constrained object.
sclrefX3DObject - Global scaling reference object.
lengthDouble - Rest Length of the S&S.
axisString - 'x' for scale all except x axis...
Returns
the newly created operator.
def gear.xsi.applyop.sn_squashstretch_op (   out,
  u = .5,
  length = 5 
)

Apply a sn_squashstretch_op operator.

Parameters
outX3DObject - Constrained object.
uDouble - Position of the object on the S&S curve.
lengthDouble - Rest Length of the S&S.
Returns
the newly created operator.
def gear.xsi.applyop.sn_stretchChain_op (   root,
  ik_ctl 
)

Apply a sn_stretchChain_op operator.

Parameters
rootChainRoot - Root of the chain to apply the operator to.
ik_ctlX3DObject - Object that will act as the eff controler of the chain.
Returns
the newly created operator.
def gear.xsi.applyop.sn_stretchChainMulti_op (   root,
  ik_ctl 
)

Apply a sn_stretchChainMulti_op operator.

Parameters
rootChainRoot - Root of the chain to apply the operator to.
ik_ctlX3DObject - Object that will act as the eff controler of the chain.
Returns
the newly created operator.
def gear.xsi.applyop.sn_xfspring_op (   out,
  mode = 2 
)

Apply a sn_xfspring_op operator.

Parameters
outX3DObject - constrained Object.
modeInteger - 0 Scaling, 1 Rotation, 2 Translation, 3 SR, 4 RT, 5 ST, 6 SRT
Returns
the newly created operator.
def gear.xsi.applyop.spinePointAtOp (   cns,
  startobj,
  endobj,
  blend = .5 
)

Apply a SpinePointAt operator.

Parameters
cnsConstraint - The constraint to apply the operator on (must be a curve, path or direction constraint)
startobjX3DObject - Start Reference.
endobjX3DObject -End Reference.
blendDouble - Blend influence value from 0 to 1.
Returns
the newly created operator.
def gear.xsi.applyop.symmetryCns (   obj,
  master,
  comp = False,
  symplane = 2,
  position = True,
  orientation = True,
  scaling = True 
)

Apply a Symmetry constraint.

Parameters
objX3DObject - Constrained object.
masterX3DObject - Constraining Object.
compBoolean - Active constraint compensation.
position- Boolean - Active position constraint.
orientation- Boolean - Active orientation constraint.
scaling- Boolean - Active scaling constraint.
Returns
the newly created constraint.
def gear.xsi.applyop.twoPointsCns (   obj,
  master0,
  master1,
  comp = False 
)

Apply a pose constraint.

Parameters
objX3DObject - Constrained object.
master0X3DObject - First constraining Object.
master1X3DObject - Last constraining Object.
compBoolean - Active constraint compensation.
Returns
the newly created constraint.