Revision: 38666
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38666
Author:   phabtar
Date:     2011-07-24 20:27:27 +0000 (Sun, 24 Jul 2011)
Log Message:
-----------
Blender profile for leaf_bone tip. (untested).

Modified Paths:
--------------
    branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp
    branches/soc-2011-pepper/source/blender/collada/ArmatureExporter.cpp
    branches/soc-2011-pepper/source/blender/collada/ArmatureExporter.h
    branches/soc-2011-pepper/source/blender/collada/DocumentImporter.cpp
    branches/soc-2011-pepper/source/blender/collada/DocumentImporter.h

Modified: branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp       
2011-07-24 18:06:23 UTC (rev 38665)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp       
2011-07-24 20:27:27 UTC (rev 38666)
@@ -415,7 +415,8 @@
 
                        float ctime = bsystem_time(scene, ob_arm, *it, 0.0f);
 
-                       BKE_animsys_evaluate_animdata(&ob_arm->id, ob_arm->adt, 
*it, ADT_RECALC_ANIM);
+                       //BKE_animsys_evaluate_animdata(&ob_arm->id, 
ob_arm->adt, *it, ADT_RECALC_ANIM);
+                       //BKE_animsys_evaluate_animdata(scene , &ob_arm->id, 
ob_arm->adt, ctime, ADT_RECALC_ANIM);
                        where_is_pose_bone(scene, ob_arm, pchan, ctime, 1);
 
                        // compute bone local mat

Modified: branches/soc-2011-pepper/source/blender/collada/ArmatureExporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/ArmatureExporter.cpp        
2011-07-24 18:06:23 UTC (rev 38665)
+++ branches/soc-2011-pepper/source/blender/collada/ArmatureExporter.cpp        
2011-07-24 20:27:27 UTC (rev 38666)
@@ -177,6 +177,9 @@
        node.setNodeName(node_name);
        node.setNodeSid(node_sid);
 
+       if ( bone->childbase.first == NULL )
+               add_blender_leaf_bone( bone, ob_arm , node );
+       else{
        node.start();
 
        add_bone_transform(ob_arm, bone, node);
@@ -186,8 +189,22 @@
        }
 
        node.end();
+       }
 }
 
+void ArmatureExporter::add_blender_leaf_bone(Bone *bone, Object *ob_arm, 
COLLADASW::Node& node)
+{
+       node.start();
+    
+       add_bone_transform(ob_arm, bone, node);
+    
+       node.addExtraTechniqueParameter("blender", "tip_x", bone->tail[0] );
+       node.addExtraTechniqueParameter("blender", "tip_y", bone->tail[1] );
+       node.addExtraTechniqueParameter("blender", "tip_z", bone->tail[2] );
+       
+       node.end();
+       
+}
 void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, 
COLLADASW::Node& node)
 {
        bPoseChannel *pchan = get_pose_channel(ob_arm->pose, bone->name);

Modified: branches/soc-2011-pepper/source/blender/collada/ArmatureExporter.h
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/ArmatureExporter.h  
2011-07-24 18:06:23 UTC (rev 38665)
+++ branches/soc-2011-pepper/source/blender/collada/ArmatureExporter.h  
2011-07-24 20:27:27 UTC (rev 38666)
@@ -92,6 +92,8 @@
 
        void add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW::Node& 
node);
 
+       void add_blender_leaf_bone(Bone *bone, Object *ob_arm, COLLADASW::Node& 
node);
+
        std::string get_controller_id(Object *ob_arm, Object *ob);
 
        // ob should be of type OB_MESH

Modified: branches/soc-2011-pepper/source/blender/collada/DocumentImporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/DocumentImporter.cpp        
2011-07-24 18:06:23 UTC (rev 38665)
+++ branches/soc-2011-pepper/source/blender/collada/DocumentImporter.cpp        
2011-07-24 20:27:27 UTC (rev 38666)
@@ -537,10 +537,7 @@
        
        this->uid_effect_map[cmat->getInstantiatedEffect()] = ma;
        this->uid_material_map[cmat->getUniqueId()] = ma;
-       this->matUidforEffect = &(cmat->getUniqueId());
-       /*COLLADAFW::Material * matCopy = new COLLADAFW::Material(&cmat);
-       this->FW_object_map[cmat->getUniqueId()] = matCopy;
-       *///matForEff = cmat;
+       
        return true;
 }
 

Modified: branches/soc-2011-pepper/source/blender/collada/DocumentImporter.h
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/DocumentImporter.h  
2011-07-24 18:06:23 UTC (rev 38665)
+++ branches/soc-2011-pepper/source/blender/collada/DocumentImporter.h  
2011-07-24 20:27:27 UTC (rev 38666)
@@ -158,8 +158,6 @@
        std::vector<const COLLADAFW::VisualScene*> vscenes;
        std::vector<Object*> libnode_ob;
        
-       const COLLADAFW::UniqueId *matUidforEffect;
-
        std::map<COLLADAFW::UniqueId, COLLADAFW::Node*> root_map; // find root 
joint by child joint uid, for bone tree evaluation during resampling
        std::map<COLLADAFW::UniqueId, const COLLADAFW::Object*> FW_object_map;
 

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

Reply via email to