mgear.core.primitive¶
Functions to create primitives (Non geometry)
-
mgear.core.primitive.
add2DChain
(parent, name, positions, normal, negate=False, vis=True)¶ Create a 2D joint chain. Like Softimage 2D chain.
Warning
This function will create un expected results if all the positions are not in the same 2D plane.
Parameters: - parent (dagNode) – The parent for the chain.
- name (str) – The node name.
- positions (list of vectors) – the positons to define the chain.
- normal (vector) – The normal vector to define the direction of the chain.
- negate (bool) – If True will negate the direction of the chain
- Returns;
- list of dagNodes: The list containg all the joints of the chain
>>> self.rollRef = pri.add2DChain( self.root, self.getName("rollChain"), self.guide.apos[:2], self.normal, self.negate)
-
mgear.core.primitive.
add2DChain2
(parent, name, positions, normal, negate=False, vis=True)¶ Experimental 2D Chain creation function.
Create a 2D joint chain. Like Softimage 2D chain.
Warning
This function is WIP and not ready for production.
Warning
This function will create un expected results if all the positions are not in the same 2D plane.
Parameters: - parent (dagNode) – The parent for the chain.
- name (str) – The node name.
- positions (list of vectors) – the positons to define the chain.
- normal (vector) – The normal vector to define the direction of the chain.
- negate (bool) – If True will negate the direction of the chain
- Returns;
- list of dagNodes: The list containg all the joints of the chain
>>> self.chain3bones = pri.add2DChain2( self.setup, self.getName("chain3bones%s_jnt"), self.guide.apos[0:4], self.normal, False)
-
mgear.core.primitive.
addIkHandle
(parent, name, chn, solver='ikRPsolver', poleV=None)¶ Creates and connect an IKhandle to a joints chain.
Parameters: - parent (dagNode) – The parent for the IKhandle.
- name (str) – The node name.
- chn (list) – List of joints.
- solver (str) – the solver to be use for the ikHandel. Default value is “ikRPsolver”
- poleV (dagNode) – Pole vector for the IKHandle
Returns: The IKHandle
Return type: dagNode
>>> self.ikHandleUpvRef = pri.addIkHandle( self.root, self.getName("ikHandleLegChainUpvRef"), self.legChainUpvRef, "ikSCsolver")
-
mgear.core.primitive.
addJoint
(parent, name, m=Matrix([[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]), vis=True)¶ Create a joint dagNode.
Note
I’m not using the joint() comand because this is parenting the newly created joint to current selection which might not be desired
Parameters: - parent (dagNode) – The parent for the node.
- name (str) – The node name.
- m (matrix) – The matrix for the node transformation (optional).
- vis (bool) – Set the visibility of the new joint.
Returns: The newly created node.
Return type: dagNode
-
mgear.core.primitive.
addJointFromPos
(parent, name, pos=dt.Vector([0.0, 0.0, 0.0]))¶ Create a joint dagNode.
Note
I’m not using the joint() comand because this is parenting the newly created joint to current selection which might not be desired
Parameters: - parent (dagNode) – The parent for the node.
- name (str) – The node name.
- pos (vector) – The vector for the node position (optional).
- vis (bool) – Set the visibility of the new joint.
Returns: The newly created node.
Return type: dagNode
-
mgear.core.primitive.
addLocator
(parent, name, m=Matrix([[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]), size=1)¶ Create a space locator dagNode.
Parameters: - parent (dagNode) – The parent for the node.
- name (str) – The Node name.
- m (matrix) – The matrix for the node transformation (optional).
- size (float) – The space locator shape size (optional).
Returns: The newly created node.
Return type: dagNode
-
mgear.core.primitive.
addLocatorFromPos
(parent, name, pos=dt.Vector([0.0, 0.0, 0.0]), size=1)¶ Create a space locator dagNode.
Parameters: - parent (dagNode) – The parent for the node.
- name (str) – The Node name.
- pos (vector) – The vector for the node position (optional).
- size (float) – The space locator shape size (optional).
Returns: The newly created node.
Return type: dagNode
-
mgear.core.primitive.
addTransform
(parent, name, m=Matrix([[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]))¶ Create a transform dagNode.
Parameters: - parent (dagNode) – The parent for the node.
- name (str) – The Node name.
- m (matrix) – The matrix for the node transformation (optional).
Returns: The newly created node.
Return type: dagNode
-
mgear.core.primitive.
addTransformFromPos
(parent, name, pos=dt.Vector([0.0, 0.0, 0.0]))¶ Create a transform dagNode.
Parameters: - parent (dagNode) – The parent for the node.
- name (str) – The Node name.
- pos (vector) – The vector for the node position (optional).
Returns: The newly created node.
Return type: dagNode