Fixed collada code so it compiles. Brought menu items back.
authorArystanbek Dyussenov <arystan.d@gmail.com>
Sun, 25 Oct 2009 10:52:18 +0000 (10:52 +0000)
committerArystanbek Dyussenov <arystan.d@gmail.com>
Sun, 25 Oct 2009 10:52:18 +0000 (10:52 +0000)
release/scripts/ui/space_info.py
source/blender/collada/DocumentExporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/windowmanager/intern/wm_operators.c

index 634e9653da9d73a9e6dc1b837ec08bfe71acf3e5..a30d77a575ac19cdaa78a01bc4df2e6c795724e1 100644 (file)
@@ -98,13 +98,13 @@ class INFO_MT_file_import(dynamic_menu.DynMenu):
        __label__ = "Import"
 
        def draw(self, context):
-               pass # dynamic menu
+               self.layout.itemO("WM_OT_collada_import", text="COLLADA (.dae)...")
 
 class INFO_MT_file_export(dynamic_menu.DynMenu):
        __label__ = "Export"
 
        def draw(self, context):
-               pass # dynamic menu
+               self.layout.itemO("WM_OT_collada_export", text="COLLADA (.dae)...")
 
 class INFO_MT_file_external_data(bpy.types.Menu):
        __label__ = "External Data"
index 6aa062ec88ec6a3c21f00f301ebf26983d6a915b..18a956a6334833be68ac3b1699b8becf7f13ad01 100644 (file)
@@ -82,12 +82,11 @@ extern "C"
 #include <vector>
 #include <algorithm> // std::find
 
-// TODO: this can handy in BLI_arith.b
+// arithb.c now has QuatToAxisAngle too
+#if 0
 // This function assumes that quat is normalized.
 // The following document was used as reference:
 // http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm
-
-
 void QuatToAxisAngle(float *q, float *axis, float *angle)
 {
        // quat to axis angle
@@ -106,6 +105,7 @@ void QuatToAxisAngle(float *q, float *axis, float *angle)
                axis[2] = q[3] / divisor;
        }
 }
+#endif
 
 char *CustomData_get_layer_name(const struct CustomData *data, int type, int n)
 {
@@ -2031,7 +2031,7 @@ public:
                                        continue;
                                
                                // if rotation mode is euler - no need to convert it
-                               if (pchan->rotmode == PCHAN_ROT_XYZ) {
+                               if (pchan->rotmode == ROT_MODE_EUL) {
                                        
                                        std::vector<FCurve*> &rotfcurves = rotfcurves_actionGroup_map[grp];
                                        
index 9a8a776b67778af5c22ad28f4893781541fc3fa9..f31ac7d5b0b0fa067618babae8359d91fe7190b2 100644 (file)
@@ -505,7 +505,7 @@ private:
                                        name = get_joint_name(joint_by_uid[(*it).joint_uid]);
                                }
 
-                               add_defgroup_name(ob, (char*)name);
+                               ED_vgroup_add_name(ob, (char*)name);
                        }
 
                        // <vcount> - number of joints per vertex - joints_per_vertex
@@ -529,7 +529,7 @@ private:
                                        if (joint != -1) {
                                                bDeformGroup *def = (bDeformGroup*)BLI_findlink(&ob->defbase, joint);
 
-                                               add_vert_to_defgroup(ob, def, vertex, weights[joint_weight], WEIGHT_REPLACE);
+                                               ED_vgroup_vert_add(ob, def, vertex, weights[joint_weight], WEIGHT_REPLACE);
                                        }
                                }
                        }
@@ -709,7 +709,7 @@ private:
 
        void set_euler_rotmode()
        {
-               // just set rotmode = PCHAN_ROT_XYZ on pose channel for each joint
+               // just set rotmode = ROT_MODE_EUL on pose channel for each joint
 
                std::map<COLLADAFW::UniqueId, COLLADAFW::Node*>::iterator it;
 
@@ -726,7 +726,7 @@ private:
                                        bPoseChannel *pchan = skin.get_pose_channel_from_node(joint);
 
                                        if (pchan) {
-                                               pchan->rotmode = PCHAN_ROT_XYZ;
+                                               pchan->rotmode = ROT_MODE_EUL;
                                        }
                                        else {
                                                fprintf(stderr, "Cannot find pose channel for %s.\n", get_joint_name(joint));
@@ -813,9 +813,9 @@ private:
                fix_leaf_bones();
 
                // exit armature edit mode
-               ED_armature_from_edit(scene, ob_arm);
+               ED_armature_from_edit(ob_arm);
                ED_armature_edit_free(ob_arm);
-               DAG_object_flush_update(scene, ob_arm, OB_RECALC_OB|OB_RECALC_DATA);
+               DAG_id_flush_update(&ob_arm->id, OB_RECALC_OB|OB_RECALC_DATA);
 
                set_leaf_bone_shapes(ob_arm);
 
@@ -2213,7 +2213,7 @@ public:
                                free_fcurve(eulcu[i]);
                        }
 
-                       get_pose_channel(ob->pose, grp->name)->rotmode = PCHAN_ROT_QUAT;
+                       get_pose_channel(ob->pose, grp->name)->rotmode = ROT_MODE_QUAT;
 
                        for (i = 0; i < 4; i++)
                                action_groups_add_channel(act, grp, quatcu[i]);
@@ -2221,7 +2221,7 @@ public:
 
                bPoseChannel *pchan;
                for (pchan = (bPoseChannel*)ob->pose->chanbase.first; pchan; pchan = pchan->next) {
-                       pchan->rotmode = PCHAN_ROT_QUAT;
+                       pchan->rotmode = ROT_MODE_QUAT;
                }
        }       
 };
index 376a98e208878a525ce0810778c9771125eac812..35216e9ec0e81458f9c56505377ba7001f77a201 100644 (file)
@@ -1305,8 +1305,7 @@ static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *event)
        //BLI_strncpy(name, G.sce, FILE_MAX);
        //untitled(name);
 
-       // XXX: temporary
-       RNA_string_set(op->ptr, "filename", "/tmp/test.dae");
+       /* RNA_string_set(op->ptr, "path", "/tmp/test.dae"); */
        
        WM_event_add_fileselect(C, op);
 
@@ -1318,8 +1317,8 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
 {
        char filename[FILE_MAX];
        
-       if(RNA_property_is_set(op->ptr, "filename"))
-               RNA_string_get(op->ptr, "filename", filename);
+       if(RNA_property_is_set(op->ptr, "path"))
+               RNA_string_get(op->ptr, "path", filename);
        else {
                BLI_strncpy(filename, G.sce, FILE_MAX);
                untitled(filename);
@@ -1335,7 +1334,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
 
 static void WM_OT_collada_export(wmOperatorType *ot)
 {
-       ot->name= "Collada Export";
+       ot->name= "Export COLLADA";
        ot->idname= "WM_OT_collada_export";
        
        ot->invoke= wm_collada_export_invoke;
@@ -1344,13 +1343,12 @@ static void WM_OT_collada_export(wmOperatorType *ot)
        
        ot->flag= 0;
        
-       RNA_def_property(ot->srna, "filename", PROP_STRING, PROP_FILEPATH);
+       RNA_def_property(ot->srna, "path", PROP_STRING, PROP_FILEPATH);
 }
 
 static int wm_collada_import_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
-       // XXX: temporary
-       RNA_string_set(op->ptr, "filename", "/tmp/test.dae");
+       /* RNA_string_set(op->ptr, "path", "/tmp/test.dae"); */
        
        WM_event_add_fileselect(C, op);
 
@@ -1362,8 +1360,8 @@ static int wm_collada_import_exec(bContext *C, wmOperator *op)
 {
        char filename[FILE_MAX];
        
-       if(RNA_property_is_set(op->ptr, "filename"))
-               RNA_string_get(op->ptr, "filename", filename);
+       if(RNA_property_is_set(op->ptr, "path"))
+               RNA_string_get(op->ptr, "path", filename);
        else {
                BLI_strncpy(filename, G.sce, FILE_MAX);
                untitled(filename);
@@ -1379,7 +1377,7 @@ static int wm_collada_import_exec(bContext *C, wmOperator *op)
 
 static void WM_OT_collada_import(wmOperatorType *ot)
 {
-       ot->name= "Collada Import";
+       ot->name= "Import COLLADA";
        ot->idname= "WM_OT_collada_import";
        
        ot->invoke= wm_collada_import_invoke;
@@ -1388,7 +1386,7 @@ static void WM_OT_collada_import(wmOperatorType *ot)
        
        ot->flag= 0;
        
-       RNA_def_property(ot->srna, "filename", PROP_STRING, PROP_FILEPATH);
+       RNA_def_property(ot->srna, "path", PROP_STRING, PROP_FILEPATH);
 }
 
 #endif