Revision: 48040
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48040
Author:   aramis_acg
Date:     2012-06-18 14:18:25 +0000 (Mon, 18 Jun 2012)
Log Message:
-----------
- bf_assimp: fix rna path for regular node anims.

Modified Paths:
--------------
    branches/soc-2012-bratwurst/source/blender/assimp/AnimationImporter.cpp
    branches/soc-2012-bratwurst/source/blender/assimp/AnimationImporter.h

Modified: 
branches/soc-2012-bratwurst/source/blender/assimp/AnimationImporter.cpp
===================================================================
--- branches/soc-2012-bratwurst/source/blender/assimp/AnimationImporter.cpp     
2012-06-18 14:08:54 UTC (rev 48039)
+++ branches/soc-2012-bratwurst/source/blender/assimp/AnimationImporter.cpp     
2012-06-18 14:18:25 UTC (rev 48040)
@@ -144,7 +144,7 @@
        // 10 curves: rotation_quaternion, location and scale
        FCurve *newcu[10] = {0};
 
-       setup_empty_fcurves(newcu,anim);
+       setup_empty_fcurves(newcu,anim,NULL);
        populate_fcurves(newcu,anim);
 
        // setup correct rotation mode
@@ -182,7 +182,10 @@
        // 10 curves: rotation_quaternion, location and scale
        FCurve *newcu[10] = {0};
 
-       setup_empty_fcurves(newcu,anim);
+       char joint_path[200];
+       
get_rna_path_for_joint(joint_path,sizeof(joint_path),anim.mNodeName.C_Str());
+
+       setup_empty_fcurves(newcu,anim,joint_path);
        populate_fcurves(newcu,anim);
 
        // setup correct rotation mode for pose
@@ -202,11 +205,8 @@
 }
 
 
-void AnimationImporter::setup_empty_fcurves(FCurve* curves_out[10], const 
aiNodeAnim& anim)
+void AnimationImporter::setup_empty_fcurves(FCurve* curves_out[10], const 
aiNodeAnim& anim, const char* rna_base_path)
 {
-       char joint_path[200];
-       
get_rna_path_for_joint(joint_path,sizeof(joint_path),anim.mNodeName.C_Str());
-
        for (int i = 0; i < 10; i++) {
                int axis = i;
 
@@ -249,8 +249,14 @@
                }
 
                char rna_path[200];
-               BLI_snprintf(rna_path, sizeof(rna_path), "%s.%s", joint_path, 
rna_postfix);             
 
+               if(rna_base_path) {
+                       BLI_snprintf(rna_path, sizeof(rna_path), "%s.%s", 
rna_base_path, rna_postfix);          
+               }
+               else {
+                       BLI_strncpy(rna_path, rna_postfix, sizeof(rna_path));
+               }
+
                curves_out[i] = create_fcurve(axis, rna_path);
                curves_out[i]->totvert = vcount;
        }

Modified: branches/soc-2012-bratwurst/source/blender/assimp/AnimationImporter.h
===================================================================
--- branches/soc-2012-bratwurst/source/blender/assimp/AnimationImporter.h       
2012-06-18 14:08:54 UTC (rev 48039)
+++ branches/soc-2012-bratwurst/source/blender/assimp/AnimationImporter.h       
2012-06-18 14:18:25 UTC (rev 48040)
@@ -66,7 +66,7 @@
        void convert_node_anim_for_bobject(const aiNodeAnim& anim, const 
aiNode& nd, Object& ob);
        void convert_node_anim_for_bone(const aiNodeAnim& anim, Bone& bone);
 
-       void setup_empty_fcurves(FCurve* curves_out[10], const aiNodeAnim& 
anim);
+       void setup_empty_fcurves(FCurve* curves_out[10], const aiNodeAnim& 
anim, const char* rna_path);
        void populate_fcurves(FCurve* const curves_out[10], const aiNodeAnim& 
anim);
 
 public:

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

Reply via email to