| 
									
										
										
										
											2003-07-12 18:02:54 +00:00
										 |  |  | # Blender.Armature module and the Armature PyType object | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | """
 | 
					
						
							|  |  |  | The Blender.Armature submodule. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Armature | 
					
						
							|  |  |  | ======== | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This module provides access to B{Armature} objects in Blender.  These are | 
					
						
							|  |  |  | "skeletons", used to deform and animate other objects -- meshes, for | 
					
						
							|  |  |  | example. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Example:: | 
					
						
							|  |  |  |   import Blender | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   from Blender import Armature as A | 
					
						
							|  |  |  |   from Blender.Mathutils import * | 
					
						
							| 
									
										
										
										
											2003-07-12 18:02:54 +00:00
										 |  |  |   # | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   arms = A.Get() | 
					
						
							|  |  |  |   for arm in arms.values(): | 
					
						
							|  |  |  |     arm.drawType = A.STICK #set the draw type | 
					
						
							|  |  |  |     arm.makeEditable() #enter editmode | 
					
						
							| 
									
										
										
										
											2003-07-12 18:02:54 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |     #generating new editbone | 
					
						
							|  |  |  |     eb = A.Editbone() | 
					
						
							|  |  |  |     eb.roll = 10 | 
					
						
							|  |  |  |     eb.parent = arm.bones['Bone.003'] | 
					
						
							|  |  |  |     eb.head = Vector(1,1,1) | 
					
						
							|  |  |  |     eb.tail = Vector(0,0,1) | 
					
						
							|  |  |  |     eb.options = [A.HINGE, A.CONNECTED] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     #add the bone | 
					
						
							|  |  |  |     arm.bones['myNewBone'] = eb | 
					
						
							|  |  |  |    | 
					
						
							|  |  |  |     #delete an old bone | 
					
						
							|  |  |  |     del arm.bones['Bone.002'] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     arm.update()  #save changes | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     for bone in arm.bones.values(): | 
					
						
							|  |  |  |       #print bone.matrix['ARMATURESPACE'] | 
					
						
							|  |  |  |       print bone.parent, bone.name | 
					
						
							|  |  |  |       print bone.children, bone.name | 
					
						
							|  |  |  |       print bone.options, bone.name | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-07-01 12:03:44 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | Example:: | 
					
						
							|  |  |  | 	# Adds emptys for every bone in the selected armature, an example of getting worldspace locations for bones. | 
					
						
							|  |  |  | 	from Blender import * | 
					
						
							|  |  |  | 	def test_arm(): | 
					
						
							|  |  |  | 		scn= Scene.GetCurrent() | 
					
						
							|  |  |  | 		arm_ob= scn.getActiveObject() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if not arm_ob or arm_ob.getType() != 'Armature': | 
					
						
							|  |  |  | 			Draw.PupMenu('not an armature object') | 
					
						
							|  |  |  | 			return | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		# Deselect all | 
					
						
							|  |  |  | 		for ob in scn.getChildren(): | 
					
						
							|  |  |  | 			ob.sel= 0 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		arm_mat= arm_ob.matrixWorld | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		arm_data= arm_ob.getData() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		bones= arm_data.bones.values() | 
					
						
							|  |  |  | 		for bone in bones: | 
					
						
							|  |  |  | 			bone_mat= bone.matrix['ARMATURESPACE'] | 
					
						
							|  |  |  | 			bone_mat_world= bone_mat*arm_mat | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			ob_empty= Object.New('Empty', bone.name) | 
					
						
							|  |  |  | 			scn.link(ob_empty) | 
					
						
							|  |  |  | 			ob_empty.setMatrix(bone_mat_world) | 
					
						
							|  |  |  | 			ob_empty.sel= 1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		# Select then de-select keeps us active | 
					
						
							|  |  |  | 		arm_ob.sel= 1 | 
					
						
							|  |  |  | 		arm_ob.sel= 0 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	test_arm() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  | @var CONNECTED: Connect this bone to parent | 
					
						
							|  |  |  | @type CONNECTED: Constant | 
					
						
							|  |  |  | @var HINGE: Don't inherit rotation or scale from parent | 
					
						
							|  |  |  | @type HINGE: Constant | 
					
						
							|  |  |  | @var NO_DEFORM: If bone will not deform geometry | 
					
						
							|  |  |  | @type NO_DEFORM: Constant | 
					
						
							|  |  |  | @var MULTIPLY: Multiply bone with vertex group | 
					
						
							|  |  |  | @type MULTIPLY: Constant | 
					
						
							|  |  |  | @var HIDDEN_EDIT: Bone is hidden in editmode | 
					
						
							|  |  |  | @type HIDDEN_EDIT: Constant | 
					
						
							|  |  |  | @var ROOT_SELECTED: Root of the Bone is selected | 
					
						
							|  |  |  | @type ROOT_SELECTED: Constant | 
					
						
							|  |  |  | @var BONE_SELECTED: Bone is selected | 
					
						
							|  |  |  | @type BONE_SELECTED: Constant | 
					
						
							|  |  |  | @var TIP_SELECTED: Tip of the Bone is selected | 
					
						
							|  |  |  | @type TIP_SELECTED: Constant | 
					
						
							|  |  |  | @var OCTAHEDRON: Bones drawn as octahedrons | 
					
						
							|  |  |  | @type OCTAHEDRON: Constant | 
					
						
							|  |  |  | @var STICK: Bones drawn as a line | 
					
						
							|  |  |  | @type STICK: Constant | 
					
						
							|  |  |  | @var BBONE: Bones draw as a segmented B-spline | 
					
						
							|  |  |  | @type BBONE: Constant | 
					
						
							|  |  |  | @var ENVELOPE: Bones draw as a stick with envelope influence | 
					
						
							|  |  |  | @type ENVELOPE: Constant | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  | """
 | 
					
						
							| 
									
										
										
										
											2003-07-12 18:02:54 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | def Get (name = None): | 
					
						
							|  |  |  |   """
 | 
					
						
							|  |  |  |   Get the Armature object(s) from Blender. | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |   @type name: string, nothing, or list of strings | 
					
						
							|  |  |  |   @param name: The string name of an armature. | 
					
						
							| 
									
										
										
										
											2003-07-12 18:02:54 +00:00
										 |  |  |   @rtype: Blender Armature or a list of Blender Armatures | 
					
						
							|  |  |  |   @return: It depends on the I{name} parameter: | 
					
						
							|  |  |  |       - (name): The Armature object with the given I{name}; | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |       - (name, name, ...): A list of Armature objects | 
					
						
							| 
									
										
										
										
											2003-07-12 18:02:54 +00:00
										 |  |  |       - ():     A list with all Armature objects in the current scene. | 
					
						
							|  |  |  |   """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  | class Armature: | 
					
						
							| 
									
										
										
										
											2003-07-12 18:02:54 +00:00
										 |  |  |   """
 | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   The Armature object | 
					
						
							|  |  |  |   =================== | 
					
						
							| 
									
										
										
										
											2003-07-12 18:02:54 +00:00
										 |  |  |     This object gives access to Armature-specific data in Blender. | 
					
						
							| 
									
										
										
										
											2005-06-15 06:22:26 +00:00
										 |  |  |   @ivar name: The Armature name. | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   @type name: String | 
					
						
							|  |  |  |   @ivar bones: A Dictionary of Bones (BonesDict) that make up this armature. | 
					
						
							|  |  |  |   @type bones: BonesDict Object | 
					
						
							|  |  |  |   @ivar vertexGroups: Whether vertex groups define deformation | 
					
						
							|  |  |  |   @type vertexGroups: Bool | 
					
						
							|  |  |  |   @ivar envelopes: Whether bone envelopes define deformation | 
					
						
							|  |  |  |   @type envelopes: Bool | 
					
						
							|  |  |  |   @ivar restPosition: Show rest position (no posing possible) | 
					
						
							|  |  |  |   @type restPosition: Bool | 
					
						
							|  |  |  |   @ivar delayDeform: Dont deform children when manipulating bones | 
					
						
							|  |  |  |   @type delayDeform: Bool | 
					
						
							|  |  |  |   @ivar drawAxes: Draw bone axes | 
					
						
							|  |  |  |   @type drawAxes: Bool | 
					
						
							|  |  |  |   @ivar drawNames: Draw bone names | 
					
						
							|  |  |  |   @type drawNames: Bool | 
					
						
							| 
									
										
										
										
											2005-11-21 20:54:29 +00:00
										 |  |  |   @ivar ghost: Draw ghosts around frame for current Action | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   @type ghost: Bool | 
					
						
							| 
									
										
										
										
											2005-11-21 20:54:29 +00:00
										 |  |  |   @ivar ghostStep: Number of frames between ghosts | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   @type ghostStep: Int | 
					
						
							| 
									
										
										
										
											2005-11-21 21:26:09 +00:00
										 |  |  |   @ivar drawType: The drawing type that is used to display the armature | 
					
						
							|  |  |  |   Acceptable values are: | 
					
						
							|  |  |  |       - Armature.OCTAHEDRON: bones drawn as octahedrons | 
					
						
							|  |  |  |       - Armature.STICK: bones drawn as sticks | 
					
						
							|  |  |  |       - Armature.BBONE: bones drawn as b-bones | 
					
						
							|  |  |  |       - Armature.ENVELOPE: bones drawn as sticks with envelopes | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   @type drawType: Constant Object | 
					
						
							|  |  |  |   @ivar mirrorEdit: X-axis mirrored editing | 
					
						
							|  |  |  |   @type mirrorEdit: Bool | 
					
						
							|  |  |  |   @ivar autoIK: Adds temporary IK chains while grabbing bones | 
					
						
							|  |  |  |   @type autoIK: Bool | 
					
						
							| 
									
										
										
										
											2003-07-12 18:02:54 +00:00
										 |  |  |   """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-21 15:44:59 +00:00
										 |  |  |   def __init__(name = 'myArmature'): | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |     Initializer for the Armature TypeObject. | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |     Example:: | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |         myNewArmature = Blender.Armature.Armature('AR_1') | 
					
						
							| 
									
										
										
										
											2005-11-21 15:44:59 +00:00
										 |  |  |     @param name: The name for the new armature | 
					
						
							|  |  |  |     @type name: string | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |     @return: New Armature Object | 
					
						
							|  |  |  |     @rtype: Armature Object | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-21 20:22:08 +00:00
										 |  |  |    | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |   def makeEditable(): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     Put the armature into EditMode for editing purposes. | 
					
						
							|  |  |  |     @warning: The armature should not be in manual editmode | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |     prior to calling this method. The armature must be parented | 
					
						
							|  |  |  |     to an object prior to editing. | 
					
						
							|  |  |  |     @rtype: None | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2003-07-12 18:02:54 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   def update(): | 
					
						
							| 
									
										
										
										
											2003-07-12 18:02:54 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |     Save all changes and update the armature. | 
					
						
							| 
									
										
										
										
											2005-11-21 15:44:59 +00:00
										 |  |  |     @note: Must have called makeEditable() first. | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |     @rtype: None | 
					
						
							| 
									
										
										
										
											2003-07-12 18:02:54 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | class BonesDict: | 
					
						
							|  |  |  |   """
 | 
					
						
							|  |  |  |   The BonesDict object | 
					
						
							| 
									
										
										
										
											2005-11-21 15:44:59 +00:00
										 |  |  |   ==================== | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |     This object gives gives dictionary like access to the bones in an armature.  | 
					
						
							|  |  |  |     It is internal to blender but is called as 'Armature.bones' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Removing a bone:  | 
					
						
							|  |  |  |     Example:: | 
					
						
							|  |  |  |       del myArmature.bones['bone_name'] | 
					
						
							|  |  |  |     Adding a bone: | 
					
						
							|  |  |  |     Example:: | 
					
						
							|  |  |  |       myEditBone = Armature.Editbone() | 
					
						
							|  |  |  |       myArmature.bones['bone_name'] = myEditBone | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |   """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def items(): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     Retun the key, value pairs in this dictionary | 
					
						
							|  |  |  |     @rtype: string, BPy_bone | 
					
						
							|  |  |  |     @return: All strings, and py_bones in the armature (in that order) | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def keys(): | 
					
						
							| 
									
										
										
										
											2004-04-06 01:01:34 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |     Retun the keys in this dictionary | 
					
						
							|  |  |  |     @rtype: string | 
					
						
							|  |  |  |     @return: All strings representing the bone names | 
					
						
							| 
									
										
										
										
											2004-04-06 01:01:34 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def values(): | 
					
						
							| 
									
										
										
										
											2004-04-06 01:01:34 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |     Retun the values in this dictionary | 
					
						
							|  |  |  |     @rtype: BPy_bone | 
					
						
							|  |  |  |     @return: All BPy_bones in this dictionary | 
					
						
							| 
									
										
										
										
											2005-06-15 06:22:26 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  | class Bone: | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |   """
 | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   The Bone object | 
					
						
							|  |  |  |   =============== | 
					
						
							|  |  |  |     This object gives access to Bone-specific data in Blender. This object | 
					
						
							|  |  |  |     cannot be instantiated but is returned by BonesDict when the armature is not in editmode. | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |   @ivar name: The name of this Bone. | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   @type name: String | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |   @ivar roll: This Bone's roll value. | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |     Keys are: | 
					
						
							|  |  |  |        - 'ARMATURESPACE' - this roll in relation to the armature | 
					
						
							|  |  |  |        - 'BONESPACE' - the roll in relation to itself  | 
					
						
							|  |  |  |   @type roll: Dictionary | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |   @ivar head: This Bone's "head" ending position when in rest state. | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |     Keys are: | 
					
						
							|  |  |  |        - 'ARMATURESPACE' - this head position in relation to the armature | 
					
						
							|  |  |  |        - 'BONESPACE' - the head position in relation to itself  | 
					
						
							|  |  |  |   @type head: Dictionary | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |   @ivar tail: This Bone's "tail" ending position when in rest state. | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |     Keys are: | 
					
						
							|  |  |  |        - 'ARMATURESPACE' - this tail position in relation to the armature | 
					
						
							|  |  |  |        - 'BONESPACE' - the tail position in relation to itself  | 
					
						
							|  |  |  |   @type tail: Dictionary | 
					
						
							|  |  |  |   @ivar matrix: This Bone's matrix. This cannot be set. | 
					
						
							|  |  |  |     Keys are: | 
					
						
							|  |  |  |        - 'ARMATURESPACE' - this matrix of the bone in relation to the armature | 
					
						
							|  |  |  |        - 'BONESPACE' - the matrix of the bone in relation to itself  | 
					
						
							|  |  |  |   @type matrix: Matrix Object | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |   @ivar parent: The parent Bone. | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   @type parent: Bone Object | 
					
						
							| 
									
										
										
										
											2006-01-13 15:27:23 +00:00
										 |  |  |   @ivar children: The children directly attached to this bone. | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   @type children: List of Bone Objects | 
					
						
							|  |  |  |   @ivar weight: The bone's weight. | 
					
						
							|  |  |  |   @type weight: Float | 
					
						
							|  |  |  |   @ivar options: Various bone options which can be: | 
					
						
							|  |  |  |        - Armature.CONNECTED: IK to parent | 
					
						
							|  |  |  |        - Armature.HINGE: No parent rotation or scaling | 
					
						
							|  |  |  |        - Armature.NO_DEFORM: The bone does not deform geometetry | 
					
						
							|  |  |  |        - Armature.MULTIPLY: Multiply vgroups by envelope | 
					
						
							|  |  |  |        - Armature.HIDDEN_EDIT: Hide bones in editmode | 
					
						
							|  |  |  |        - Armature.ROOT_SELECTED: Selection of root ball of bone | 
					
						
							|  |  |  |        - Armature.BONE_SELECTED: Selection of bone | 
					
						
							|  |  |  |        - Armature.TIP_SELECTED: Selection of tip ball of bone | 
					
						
							|  |  |  |   @type options: List of Constants | 
					
						
							|  |  |  |   @ivar subdivision: The number of bone subdivisions. | 
					
						
							|  |  |  |   @type subdivision: Int | 
					
						
							|  |  |  |   @ivar deformDist: The deform distance of the bone | 
					
						
							|  |  |  |   @type deformDist: Float | 
					
						
							|  |  |  |   @ivar length: The length of the bone. This cannot be set. | 
					
						
							|  |  |  |   @type length: Float | 
					
						
							|  |  |  |   """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def hasParent(): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     Whether or not this bone has a parent | 
					
						
							|  |  |  |     @rtype: Bool | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def hasChildren(): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     Whether or not this bone has children | 
					
						
							|  |  |  |     @rtype: Bool | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-01-13 15:27:23 +00:00
										 |  |  |   def getAllChildren(): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     Gets all the children under this bone including the children's children. | 
					
						
							|  |  |  |     @rtype: List of Bone object | 
					
						
							|  |  |  |     @return: all bones under this one | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  | class Editbone: | 
					
						
							|  |  |  |   """
 | 
					
						
							|  |  |  |   The Editbone Object | 
					
						
							|  |  |  |   =================== | 
					
						
							|  |  |  |     This object is a wrapper for editbone data and is used only in the manipulation | 
					
						
							|  |  |  |     of the armature in editmode. | 
					
						
							|  |  |  |   @ivar name: The name of this Bone. | 
					
						
							|  |  |  |   @type name: String | 
					
						
							|  |  |  |   @ivar roll: This Bone's roll value (armaturespace). | 
					
						
							|  |  |  |   @type roll: Float | 
					
						
							|  |  |  |   @ivar head: This Bone's "head" ending position when in rest state (armaturespace). | 
					
						
							|  |  |  |   @type head: Vector Object | 
					
						
							|  |  |  |   @ivar tail: This Bone's "tail" ending position when in rest state (armaturespace). | 
					
						
							|  |  |  |   @type tail: Vector Object | 
					
						
							| 
									
										
										
										
											2006-01-11 20:44:24 +00:00
										 |  |  |   @ivar matrix: This Bone's matrix. (armaturespace) | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   @type matrix: Matrix Object | 
					
						
							|  |  |  |   @ivar parent: The parent Bone. | 
					
						
							|  |  |  |   @type parent: Editbone Object | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |   @ivar weight: The bone's weight. | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   @type weight: Float | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |   @ivar options: Various bone options which can be: | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |        - Armature.CONNECTED: IK to parent | 
					
						
							|  |  |  |        - Armature.HINGE: No parent rotation or scaling | 
					
						
							|  |  |  |        - Armature.NO_DEFORM: The bone does not deform geometetry | 
					
						
							|  |  |  |        - Armature.MULTIPLY: Multiply vgroups by envelope | 
					
						
							|  |  |  |        - Armature.HIDDEN_EDIT: Hide bones in editmode | 
					
						
							|  |  |  |        - Armature.ROOT_SELECTED: Selection of root ball of bone | 
					
						
							|  |  |  |        - Armature.BONE_SELECTED: Selection of bone | 
					
						
							|  |  |  |        - Armature.TIP_SELECTED: Selection of tip ball of bone | 
					
						
							|  |  |  |   @type options: List of Constants | 
					
						
							| 
									
										
										
										
											2005-11-21 15:36:36 +00:00
										 |  |  |   @ivar subdivision: The number of bone subdivisions. | 
					
						
							| 
									
										
										
										
											2005-12-12 20:12:50 +00:00
										 |  |  |   @type subdivision: Int | 
					
						
							|  |  |  |   @ivar deformDist: The deform distance of the bone | 
					
						
							|  |  |  |   @type deformDist: Float | 
					
						
							|  |  |  |   @ivar length: The length of the bone. This cannot be set. | 
					
						
							|  |  |  |   @type length: Float | 
					
						
							|  |  |  |   """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def hasParent(): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     Whether or not this bone has a parent | 
					
						
							|  |  |  |     @rtype: Bool | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def clearParent(): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     Set the parent to None | 
					
						
							|  |  |  |     @rtype: None | 
					
						
							|  |  |  |     """
 |