gear_mc
 All Classes Namespaces Functions Variables
Functions
gear.xsi.envelope Namespace Reference

Functions

def createEnvelope
 ENVELOPE. More...
 
def freezeEnvelope
 Freeze the operator stack of given envelope. More...
 
def rebuiltEnvelope
 Rebuilt given envelope. More...
 
def copyEnvelopeWithGator
 Allows to copy envelope. More...
 
def copyMirrorEnvelope
 Copy the envelope to a mirror object. More...
 
def addStaticKineState
 Add a static kine state property to objects. More...
 
def isDeformer
 DEFORMERS. More...
 
def getDeformerIndex
 Get the deformer index. More...
 
def replaceDeformerInEnvelope
 Replace a collection of deformer with another one in the envelope. More...
 
def removeEnvDeformer
 Remove a Deformer from given envelope. More...
 
def getUnnormalizedPoints
 WEIGHTS. More...
 
def normalizeWeights
 Normalize the weight array to 100 for given point of given envelope op. More...
 
def normalizeToClosestPoint
 Normalize the point according to surronding values. More...
 
def normalizeToDeformer
 Add the missing weight of a point to given deformer. More...
 
def normalizeArray
 Normalize given array so the sum of the array is equal to 100. More...
 
def pruneWeights
 Remove the influence of deformers that are smaller than threshold. More...
 
def averageMirrorWeights
 This is for the central line of the mesh, it setthe weight properly splitted between right and left side. More...
 
def makeIslandRigid
 
def createSymmetryMappingTemplate
 Create a symmetry mapping template for given deformers using the naming convention for right and left objects. More...
 

Detailed Description

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

Function Documentation

def gear.xsi.envelope.addStaticKineState (   objs)

Add a static kine state property to objects.

Parameters
objsList or Collection of X3DObject - Objects to create a StaticKineState property on.
Returns
List of Property - the newly created properties.
def gear.xsi.envelope.averageMirrorWeights (   envelope_op,
  points 
)

This is for the central line of the mesh, it setthe weight properly splitted between right and left side.

Parameters
envelope_opEnvelope Operator - the envelope operator.
pointsList of Integer - list of point index to mirror.
def gear.xsi.envelope.copyEnvelopeWithGator (   mesh,
  source_meshes 
)

Allows to copy envelope.

Parameters
meshPolymsh.
source_meshes- XSICollection of Polymsh.
def gear.xsi.envelope.copyMirrorEnvelope (   source_mesh,
  target_mesh 
)

Copy the envelope to a mirror object.

Parameters
source_meshPolymsh.
target_meshPolymsh.
def gear.xsi.envelope.createEnvelope (   obj,
  deformers 
)

ENVELOPE.

createEnvelope ========================================= Apply envelope

Parameters
objto apply the envelope.
deformers,:List of deformers
Returns
def gear.xsi.envelope.createSymmetryMappingTemplate (   in_deformers)

Create a symmetry mapping template for given deformers using the naming convention for right and left objects.

Parameters
in_deformersXSICollection
Returns
Property - Mapping Template
def gear.xsi.envelope.freezeEnvelope (   envelope_op)

Freeze the operator stack of given envelope.

Parameters
envelope_opEnvelope Operator - the envelope operator to freeze.
Returns
def gear.xsi.envelope.getDeformerIndex (   envelope_op,
  obj 
)

Get the deformer index.

Parameters
envelope_opEnvelope Operator - the envelope operator.
objX3DObject - Object to check.
Returns
the index of the deformer in the envelope (-1 if it's not found).
def gear.xsi.envelope.getUnnormalizedPoints (   envelope_op,
  points = None,
  threshold = 1E-6 
)

WEIGHTS.

GetUnnormalizedPoints ================================= Return the indexes of unormalized points of the envelope.

Parameters
envelope_opEnvelope Operator - the envelope operator.
thresholdFloat - the threshold.
Returns
List of Integer - the list of unnormalized point index .
def gear.xsi.envelope.isDeformer (   envelope_op,
  obj 
)

DEFORMERS.

Is Deformer =========================================== Check if the object is a deformer of given envelope

Parameters
envelope_opEnvelope Operator - the envelope operator.
objX3DObject - Object to check.
Returns
true if the object is used as a deformer for the given envelope.
def gear.xsi.envelope.makeIslandRigid (   mesh)
Parameters
envelope_opEnvelope Operator - the envelope operator.
pointsList of Integer - list of point index to mirror.
def gear.xsi.envelope.normalizeArray (   a)

Normalize given array so the sum of the array is equal to 100.

Parameters
aList of Float - the array to normalize.
Returns
List of Float - the normalized array.
def gear.xsi.envelope.normalizeToClosestPoint (   envelope_op,
  weights,
  point_index 
)

Normalize the point according to surronding values.

Useful when a point weight is 0.

Parameters
envelope_opEnvelope Operator - the envelope operator.
weightsList of float - The weights of the envelope. We pass it as an argument for speed purpose.
point_indexInteger - Index of the point to normalize.
Returns
List of Float - The weight of the point.
def gear.xsi.envelope.normalizeToDeformer (   envelope_op,
  deformers,
  points = None,
  threshold = 1E-6 
)

Add the missing weight of a point to given deformer.

Parameters
envelope_opOperator - Envelope operator to normalize
deformersXSICollection - Collection of deformers
pointsList of Integer - Index of vertices to normalize
thresholdFloat
def gear.xsi.envelope.normalizeWeights (   envelope_op,
  points 
)

Normalize the weight array to 100 for given point of given envelope op.

Parameters
envelope_opOperator - Envelope operator to normalize
pointsList of Integer - Index of vertices to normalize
def gear.xsi.envelope.pruneWeights (   envelope_op,
  points = None,
  threshold = .1,
  remove = False,
  showPBar = False 
)

Remove the influence of deformers that are smaller than threshold.


Parameters
envelope_opEnvelope Operator - the envelope operator.
thresholdFloat - Minimum influence a deformer can have.
removeBoolean - Remove the unsued deformers.
showPBarBoolean - Display a progress bar.
Returns
Envelope Operator
def gear.xsi.envelope.rebuiltEnvelope (   envelope_op)

Rebuilt given envelope.

Parameters
envelope_opEnvelope Operator - the envelope operator.
Returns
Operator - the newly created envelope operator.
def gear.xsi.envelope.removeEnvDeformer (   envelope_op,
  obj 
)

Remove a Deformer from given envelope.

Parameters
envelope_opEnvelope Operator - the envelope operator.
deformerX3DObject - the deformer to remove from envelope.
Returns
Envelope Operator - The newly created envelope operator
def gear.xsi.envelope.replaceDeformerInEnvelope (   envelope_op,
  source_deformers,
  target_deformers,
  points = None 
)

Replace a collection of deformer with another one in the envelope.


This method don't replace the deformers from 1 source to 1 target deformer. Instead can replace 1 source deformer to x target deformers
or x source deformers to 1 target deformer. For this reason the envelopes will be regenerate.

Parameters
envelope_opEnvelope Operator - the envelope operator.
source_deformersXSICollection - Deformers we want to remove.
target_deformersXSICollection - Deformers we want to add.