Revision: 24079
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24079
Author:   kazanbas
Date:     2009-10-25 11:52:18 +0100 (Sun, 25 Oct 2009)

Log Message:
-----------
Fixed collada code so it compiles. Brought menu items back.

Modified Paths:
--------------
    branches/soc-2009-chingachgook/release/scripts/ui/space_info.py
    branches/soc-2009-chingachgook/source/blender/collada/DocumentExporter.cpp
    branches/soc-2009-chingachgook/source/blender/collada/DocumentImporter.cpp
    
branches/soc-2009-chingachgook/source/blender/windowmanager/intern/wm_operators.c

Modified: branches/soc-2009-chingachgook/release/scripts/ui/space_info.py
===================================================================
--- branches/soc-2009-chingachgook/release/scripts/ui/space_info.py     
2009-10-25 10:43:03 UTC (rev 24078)
+++ branches/soc-2009-chingachgook/release/scripts/ui/space_info.py     
2009-10-25 10:52:18 UTC (rev 24079)
@@ -98,13 +98,13 @@
        __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"

Modified: 
branches/soc-2009-chingachgook/source/blender/collada/DocumentExporter.cpp
===================================================================
--- branches/soc-2009-chingachgook/source/blender/collada/DocumentExporter.cpp  
2009-10-25 10:43:03 UTC (rev 24078)
+++ branches/soc-2009-chingachgook/source/blender/collada/DocumentExporter.cpp  
2009-10-25 10:52:18 UTC (rev 24079)
@@ -82,12 +82,11 @@
 #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 @@
                axis[2] = q[3] / divisor;
        }
 }
+#endif
 
 char *CustomData_get_layer_name(const struct CustomData *data, int type, int n)
 {
@@ -2031,7 +2031,7 @@
                                        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];
                                        

Modified: 
branches/soc-2009-chingachgook/source/blender/collada/DocumentImporter.cpp
===================================================================
--- branches/soc-2009-chingachgook/source/blender/collada/DocumentImporter.cpp  
2009-10-25 10:43:03 UTC (rev 24078)
+++ branches/soc-2009-chingachgook/source/blender/collada/DocumentImporter.cpp  
2009-10-25 10:52:18 UTC (rev 24079)
@@ -505,7 +505,7 @@
                                        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 @@
                                        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 @@
 
        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 @@
                                        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 @@
                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 @@
                                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 @@
 
                bPoseChannel *pchan;
                for (pchan = (bPoseChannel*)ob->pose->chanbase.first; pchan; 
pchan = pchan->next) {
-                       pchan->rotmode = PCHAN_ROT_QUAT;
+                       pchan->rotmode = ROT_MODE_QUAT;
                }
        }       
 };

Modified: 
branches/soc-2009-chingachgook/source/blender/windowmanager/intern/wm_operators.c
===================================================================
--- 
branches/soc-2009-chingachgook/source/blender/windowmanager/intern/wm_operators.c
   2009-10-25 10:43:03 UTC (rev 24078)
+++ 
branches/soc-2009-chingachgook/source/blender/windowmanager/intern/wm_operators.c
   2009-10-25 10:52:18 UTC (rev 24079)
@@ -1305,8 +1305,7 @@
        //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 @@
 {
        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 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 @@
        
        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 @@
 {
        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 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 @@
        
        ot->flag= 0;
        
-       RNA_def_property(ot->srna, "filename", PROP_STRING, PROP_FILEPATH);
+       RNA_def_property(ot->srna, "path", PROP_STRING, PROP_FILEPATH);
 }
 
 #endif


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

Reply via email to