Revision: 39534
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39534
Author:   phabtar
Date:     2011-08-18 19:16:36 +0000 (Thu, 18 Aug 2011)
Log Message:
-----------
Blender tip profile for bones with 2 or more children.

Modified Paths:
--------------
    branches/soc-2011-pepper/source/blender/collada/ArmatureExporter.cpp
    branches/soc-2011-pepper/source/blender/collada/ArmatureImporter.cpp

Modified: branches/soc-2011-pepper/source/blender/collada/ArmatureExporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/ArmatureExporter.cpp        
2011-08-18 19:07:37 UTC (rev 39533)
+++ branches/soc-2011-pepper/source/blender/collada/ArmatureExporter.cpp        
2011-08-18 19:16:36 UTC (rev 39534)
@@ -177,7 +177,7 @@
        node.setNodeName(node_name);
        node.setNodeSid(node_sid);
 
-       if ( bone->childbase.first == NULL )
+       if ( bone->childbase.first == NULL || 
BLI_countlist(&(bone->childbase))>=2)
                add_blender_leaf_bone( bone, ob_arm , node );
        else{
        node.start();
@@ -202,6 +202,9 @@
        node.addExtraTechniqueParameter("blender", "tip_y", bone->tail[1] );
        node.addExtraTechniqueParameter("blender", "tip_z", bone->tail[2] );
        
+       for (Bone *child = (Bone*)bone->childbase.first; child; child = 
child->next) {
+               add_bone_node(child, ob_arm);
+       }
        node.end();
        
 }

Modified: branches/soc-2011-pepper/source/blender/collada/ArmatureImporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/ArmatureImporter.cpp        
2011-08-18 19:07:37 UTC (rev 39533)
+++ branches/soc-2011-pepper/source/blender/collada/ArmatureImporter.cpp        
2011-08-18 19:16:36 UTC (rev 39534)
@@ -83,14 +83,11 @@
                                 float parent_mat[][4], Object * ob_arm)
 {
        float mat[4][4];
-   float obmat[4][4];
+    float obmat[4][4];
 
        // object-space
        get_node_mat(obmat, node, NULL, NULL);
 
-       // get world-space
-       
-
        EditBone *bone = ED_armature_edit_bone_add((bArmature*)ob_arm->data, 
(char*)bc_get_joint_name(node));
        totbone++;
        
@@ -151,7 +148,6 @@
 
        // in second case it's not a leaf bone, but we handle it the same way
        if (!children.getCount() || children.getCount() > 1) {
-
                add_leaf_bone(mat, bone, node);
        }
 
@@ -659,7 +655,7 @@
        }
        
        //for bones without skins
-       create_armature_bones();
+       //create_armature_bones();
 }
 
 #if 0

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to