From f75bf20c817d9e09b23513d007bc8cc69ff00d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juha=20M=C3=A4ki-Kanto?= Date: Sat, 18 Feb 2012 16:55:41 +0000 Subject: Fix rest of #27022, collada export: add bone parenting of objects - SceneExporter collects a list of child-objects for armature-object and passes it onto ArmatureExporter - SceneExporter's writeNodes is then called from ArmatureExporter for matching child-objects for bone. - ArmatureExporter removes written child-objects from list, objects not exported as being bone parented are exported as direct children of the armature-node. - Should play nice with current Second Life-compatibility. A nicer implementation would require some design changes, will have to wait. --- source/blender/collada/ArmatureExporter.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source/blender/collada/ArmatureExporter.h') diff --git a/source/blender/collada/ArmatureExporter.h b/source/blender/collada/ArmatureExporter.h index 9d64664fa63..e9ee38d36cf 100644 --- a/source/blender/collada/ArmatureExporter.h +++ b/source/blender/collada/ArmatureExporter.h @@ -28,6 +28,7 @@ #ifndef __ARMATUREEXPORTER_H__ #define __ARMATUREEXPORTER_H__ +#include #include //#include @@ -47,6 +48,8 @@ #include "ExportSettings.h" +class SceneExporter; + // XXX exporter writes wrong data for shared armatures. A separate // controller should be written for each armature-mesh binding how do // we make controller ids then? @@ -56,7 +59,8 @@ public: ArmatureExporter(COLLADASW::StreamWriter *sw, const ExportSettings *export_settings); // write bone nodes - void add_armature_bones(Object *ob_arm, Scene *sce); + void add_armature_bones(Object *ob_arm, Scene* sce, SceneExporter* se, + std::list& child_objects); bool is_skinned_mesh(Object *ob); @@ -85,8 +89,10 @@ private: std::string get_joint_sid(Bone *bone, Object *ob_arm); - // parent_mat is armature-space - void add_bone_node(Bone *bone, Object *ob_arm); + // Scene, SceneExporter and the list of child_objects + // are required for writing bone parented objects + void add_bone_node(Bone *bone, Object *ob_arm, Scene* sce, SceneExporter* se, + std::list& child_objects); void add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW::Node& node); -- cgit v1.2.3