def _create_ik_properties(self, bone, object_): props = "" if utils.is_physic_bone(bone): armature_object = bpy.data.objects[object_.name[:-5]] pose_bone = armature_object.pose.bones[bone.name[:-5]] xIK, yIK, zIK = udp.get_bone_ik_max_min(pose_bone) damping, spring, spring_tension = udp.get_bone_ik_properties( pose_bone) props = join( xIK, '_xdamping={}'.format(damping[1]), '_xspringangle={}'.format(spring[1]), '_xspringtension={}'.format(spring_tension[1]), yIK, '_ydamping={}'.format(damping[0]), '_yspringangle={}'.format(spring[0]), '_yspringtension={}'.format(spring_tension[0]), zIK, '_zdamping={}'.format(damping[2]), '_zspringangle={}'.format(spring[2]), '_zspringtension={}'.format(spring_tension[2]) ) return props
def _write_bone_list(self, bones, object_, parent_node, group): scene = bpy.context.scene bone_names = [] for bone in bones: props_name = self._create_properties_name(bone, group) props_ik = self._create_ik_properties(bone, object_) bone_name = join(bone.name, props_name, props_ik) bone_names.append(bone_name) node = self._doc.createElement("node") node.setAttribute("id", bone_name) node.setAttribute("name", bone_name) node.setIdAttribute("id") fakebone = utils.get_fakebone(bone.name) if fakebone is not None: self._write_transforms(fakebone, node) bone_geometry = utils.get_bone_geometry(bone) if bone_geometry is not None: geo_name = utils.get_geometry_name(group, bone_geometry) instance = self._create_bone_instance( bone_geometry, geo_name) node.appendChild(instance) extra = self._create_physic_proxy_for_bone( object_.parent, bone) if extra is not None: node.appendChild(extra) elif utils.is_physic_bone(bone): bone_geometry = utils.get_bone_geometry(bone) if fakebone is not None: self._write_transforms(fakebone, node) parent_node.appendChild(node) if bone.children: self._write_bone_list(bone.children, object_, node, group)