Assorted fixes - compile + drivers:
authorJoshua Leung <aligorith@gmail.com>
Wed, 25 Nov 2009 09:25:58 +0000 (09:25 +0000)
committerJoshua Leung <aligorith@gmail.com>
Wed, 25 Nov 2009 09:25:58 +0000 (09:25 +0000)
* Fixed a few compile warnings for scons+mingw
* Driver variables are now added with the ID-type set to ID_OB (objects) by default since this is more convenient

source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/sequence.c
source/blender/editors/animation/drivers.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/object/object_vgroup.c
source/blender/python/intern/bpy_rna.c

index c451168a005494615d0275259612993365708eef..e90fccf6b29205002fcfc1f8c581858c2c209474 100644 (file)
@@ -731,6 +731,9 @@ DriverTarget *driver_add_new_target (ChannelDriver *driver)
        dtar= MEM_callocN(sizeof(DriverTarget), "DriverTarget");
        BLI_addtail(&driver->targets, dtar);
        
+       /* make the default ID-type ID_OB, since most driver targets refer to objects */
+       dtar->idtype= ID_OB;
+       
        /* give the target a 'unique' name */
        strcpy(dtar->name, "var");
        BLI_uniquename(&driver->targets, dtar, "var", '_', offsetof(DriverTarget, name), 64);
index 07969704521c91fa529796d51233e563514074b6..1920e82b4ab8a83684d2eb614e9c945229064abb 100644 (file)
@@ -2007,7 +2007,7 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
                        }
                }
        } else if(seq->type == SEQ_SCENE) {     // scene can be NULL after deletions
-               Scene *sce= seq->scene, *oldsce= scene;
+               Scene *sce= seq->scene;// *oldsce= scene;
                Render *re;
                RenderResult rres;
                char scenename[64];
index e731faaf1037d5e0aae12b5a554554b4f2b192ff..d7d3c21607f5e58d246f75c0e7e8623fdf6dd28b 100644 (file)
@@ -53,6 +53,7 @@
 #include "BKE_animsys.h"
 #include "BKE_action.h"
 #include "BKE_constraint.h"
+#include "BKE_depsgraph.h"
 #include "BKE_fcurve.h"
 #include "BKE_utildefines.h"
 #include "BKE_context.h"
@@ -175,14 +176,17 @@ short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short fla
                fcu= verify_driver_fcurve(id, rna_path, array_index, 1);
                
                if (fcu && fcu->driver) {
-                       fcu->driver->type= type;
+                       ChannelDriver *driver= fcu->driver;
+                       
+                       /* set the type of the driver */
+                       driver->type= type;
                        
                        /* fill in current value for python */
                        if (type == DRIVER_TYPE_PYTHON) {
                                PropertyType proptype= RNA_property_type(prop);
                                int array= RNA_property_array_length(&ptr, prop);
-                               char *expression= fcu->driver->expression;
-                               int val, maxlen= sizeof(fcu->driver->expression);
+                               char *expression= driver->expression;
+                               int val, maxlen= sizeof(driver->expression);
                                float fval;
                                
                                if (proptype == PROP_BOOLEAN) {
index 92bbd1c6573948eedbbc3f1fb3305b89e3a27f61..762ec541bffc3bfa4c25a5ff00e4d5a6f7f378d1 100644 (file)
@@ -468,8 +468,8 @@ void ui_draw_but_IMAGE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
        extern char datatoc_splash_png[];
        extern int datatoc_splash_png_size;
        ImBuf *ibuf;
-       GLint scissor[4];
-       int w, h;
+       //GLint scissor[4];
+       //int w, h;
        
        /* hardcoded to splash, loading and freeing every draw, eek! */
        ibuf= IMB_ibImageFromMemory((int *)datatoc_splash_png, datatoc_splash_png_size, IB_rect);
index 99bfea38c4937b43456150f4d6e13ddfa971cb81..d9c21a9c9a53356266b1eece0b913f14e3cdcf17 100644 (file)
@@ -1786,4 +1786,5 @@ void OBJECT_OT_vertex_group_set_active(wmOperatorType *ot)
        /* properties */
        prop= RNA_def_enum(ot->srna, "group", vgroup_items, 0, "Group", "Vertex group to set as active.");
        RNA_def_enum_funcs(prop, vgroup_itemf);
-}
\ No newline at end of file
+}
+
index 1693268a19c330057810249a7b33827989537b98..56981e0fe0a0c5ac2d455f950b6d2f13bcc53918 100644 (file)
@@ -1473,7 +1473,7 @@ static PyObject *pyrna_struct_path_to_id(BPy_StructRNA *self, PyObject *args)
 static PyObject *pyrna_prop_path_to_id(BPy_PropertyRNA *self)
 {
        char *path;
-       PropertyRNA *prop;
+       PropertyRNA *prop = self->prop;
        PyObject *ret;
 
        path= RNA_path_from_ID_to_property(&self->ptr, self->prop);