no functional change: only check against OB_RECALC_ALL but don't use for assignment.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 17 Dec 2010 15:51:42 +0000 (15:51 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 17 Dec 2010 15:51:42 +0000 (15:51 +0000)
Makes adding new flags give ambiguous results and also makes it less easy to tell whats intended.
In some places it looks like OB_RECALC_TIME should be left out too.

16 files changed:
source/blender/blenkernel/intern/exotic.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/object.c
source/blender/blenloader/intern/readfile.c
source/blender/collada/DocumentImporter.cpp
source/blender/editors/animation/anim_deps.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_relations.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_snap.c
source/blender/makesdna/DNA_object_types.h
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_scene.c

index 51fd5e1..53c3534 100644 (file)
@@ -2376,7 +2376,7 @@ static void dxf_read(Scene *scene, const char *filename)
        
                                                ob->dupon= 1; ob->dupoff= 0;
                                                ob->dupsta= 1; ob->dupend= 100;
-                                               ob->recalc= OB_RECALC_ALL;      /* needed because of weird way of adding libdata directly */
+                                               ob->recalc= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; /* needed because of weird way of adding libdata directly */
                                                
                                                ob->data= obdata;
                                                ((ID*)ob->data)->us++;
index ce9e7dd..cac0b64 100644 (file)
@@ -450,7 +450,7 @@ void recalc_all_library_objects(Main *main)
        /* flag for full recalc */
        for(ob=main->object.first; ob; ob=ob->id.next)
                if(ob->id.lib)
-                       ob->recalc |= OB_RECALC_ALL;
+                       ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
 }
 
 /* note: MAX_LIBARRAY define should match this code */
index fba227e..54bc07b 100644 (file)
@@ -316,7 +316,7 @@ static void unlink_object__unlinkModifierLinks(void *userData, Object *ob, Objec
 
        if (*obpoin==unlinkOb) {
                *obpoin = NULL;
-               ob->recalc |= OB_RECALC_ALL; // XXX: should this just be OB_RECALC_DATA?
+               ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; // XXX: should this just be OB_RECALC_DATA?
        }
 }
 
@@ -357,7 +357,7 @@ void unlink_object(Object *ob)
                
                if(obt->parent==ob) {
                        obt->parent= NULL;
-                       obt->recalc |= OB_RECALC_ALL;
+                       obt->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                }
                
                modifiers_foreachObjectLink(obt, unlink_object__unlinkModifierLinks, ob);
@@ -367,15 +367,15 @@ void unlink_object(Object *ob)
 
                        if(cu->bevobj==ob) {
                                cu->bevobj= NULL;
-                               obt->recalc |= OB_RECALC_ALL;
+                               obt->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                        }
                        if(cu->taperobj==ob) {
                                cu->taperobj= NULL;
-                               obt->recalc |= OB_RECALC_ALL;
+                               obt->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                        }
                        if(cu->textoncurve==ob) {
                                cu->textoncurve= NULL;
-                               obt->recalc |= OB_RECALC_ALL;
+                               obt->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                        }
                }
                else if(obt->type==OB_ARMATURE && obt->pose) {
@@ -1078,7 +1078,7 @@ Object *add_object(struct Scene *scene, int type)
        
        base= scene_add_base(scene, ob);
        scene_select_base(scene, base);
-       ob->recalc |= OB_RECALC_ALL;
+       ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
 
        return ob;
 }
@@ -1538,7 +1538,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
        ob->proxy_group= gob;
        id_lib_extern(&target->id);
        
-       ob->recalc= target->recalc= OB_RECALC_ALL;
+       ob->recalc= target->recalc= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
        
        /* copy transform
         * - gob means this proxy comes from a group, just apply the matrix
index 6e3376c..9e63b1b 100644 (file)
@@ -2248,7 +2248,7 @@ static void lib_link_pose(FileData *fd, Object *ob, bPose *pose)
        }
        
        if(rebuild) {
-               ob->recalc= OB_RECALC_ALL;
+               ob->recalc= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                pose->flag |= POSE_RECALC;
        }
 }
@@ -3505,7 +3505,7 @@ static void lib_link_object(FileData *fd, Main *main)
                                        /* this triggers object_update to always use a copy */
                                        ob->proxy->proxy_from= ob;
                                        /* force proxy updates after load/undo, a bit weak */
-                                       ob->recalc= ob->proxy->recalc= OB_RECALC_ALL;
+                                       ob->recalc= ob->proxy->recalc= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                                }
                        }
                        ob->proxy_group= newlibadr(fd, ob->id.lib, ob->proxy_group);
@@ -7955,7 +7955,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        if(ob->type==OB_ARMATURE) {
                                if(ob->pose)
                                        ob->pose->flag |= POSE_RECALC;
-                               ob->recalc |= OB_RECALC_ALL;    // cannot call stuff now (pointers!), done in setup_app_data
+                               ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;       // cannot call stuff now (pointers!), done in setup_app_data
 
                                /* new generic xray option */
                                arm= newlibadr(fd, lib, ob->data);
@@ -12351,7 +12351,7 @@ static void give_base_to_groups(Main *mainvar, Scene *scene)
                        base= scene_add_base(scene, ob);
                        base->flag |= SELECT;
                        base->object->flag= base->flag;
-                       ob->recalc |= OB_RECALC_ALL;
+                       ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                        scene->basact= base;
 
                        /* assign the group */
index 818b78f..f7ee0db 100644 (file)
@@ -308,7 +308,7 @@ private:
        Object* DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Node *source_node, COLLADAFW::Node *instance_node, Scene *sce, bool is_library_node)
        {
                Object *obn = copy_object(source_ob);
-               obn->recalc |= OB_RECALC_ALL;
+               obn->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                scene_add_base(sce, obn);
 
                if (instance_node)
index 8ea113c..02d69fd 100644 (file)
@@ -90,7 +90,7 @@ void ANIM_list_elem_update(Scene *scene, bAnimListElem *ale)
        else {
                /* in other case we do standard depsgaph update, ideally
                   we'd be calling property update functions here too ... */
-               DAG_id_tag_update(id, OB_RECALC_ALL); // XXX or do we want something more restrictive?
+               DAG_id_tag_update(id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME); // XXX or do we want something more restrictive?
        }
 }
 
@@ -106,7 +106,7 @@ void ANIM_id_update(Scene *UNUSED(scene), ID *id)
                        adt->recalc |= ADT_RECALC_ANIM;
                        
                /* set recalc flags */
-               DAG_id_tag_update(id, OB_RECALC_ALL); // XXX or do we want something more restrictive?
+               DAG_id_tag_update(id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME); // XXX or do we want something more restrictive?
        }
 }
 
index 9c801d9..61cf17a 100644 (file)
@@ -926,7 +926,7 @@ int ANIM_apply_keyingset (bContext *C, ListBase *dsources, bAction *act, KeyingS
                                {
                                        Object *ob= (Object *)ksp->id;
                                        
-                                       ob->recalc |= OB_RECALC_ALL; // XXX: only object transforms only?
+                                       ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; // XXX: only object transforms only?
                                }
                                        break;
                        }
index 5a4bbaf..fb0b18b 100644 (file)
@@ -1066,7 +1066,7 @@ static Base *duplibase_for_convert(Scene *scene, Base *base, Object *ob)
        }
 
        obn= copy_object(ob);
-       obn->recalc |= OB_RECALC_ALL;
+       obn->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
 
        basen= MEM_mallocN(sizeof(Base), "duplibase");
        *basen= *base;
@@ -1150,7 +1150,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                                newob->data= copy_mesh(me);
                        } else {
                                newob = ob;
-                               ob->recalc |= OB_RECALC_ALL;
+                               ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                        }
 
                        /* make new mesh data from the original copy */
@@ -1211,7 +1211,7 @@ static int convert_exec(bContext *C, wmOperator *op)
                                        for(ob1= bmain->object.first; ob1; ob1=ob1->id.next) {
                                                if(ob1->data==ob->data) {
                                                        ob1->type= OB_CURVE;
-                                                       ob1->recalc |= OB_RECALC_ALL;
+                                                       ob1->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                                                }
                                        }
                                }
@@ -1404,7 +1404,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
        }
        else {
                obn= copy_object(ob);
-               obn->recalc |= OB_RECALC_ALL;
+               obn->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                
                basen= MEM_mallocN(sizeof(Base), "duplibase");
                *basen= *base;
index 2c0f232..78163fa 100644 (file)
@@ -460,7 +460,7 @@ void ED_object_enter_editmode(bContext *C, int flag)
                scene->obedit= ob;
                ED_armature_to_edit(ob);
                /* to ensure all goes in restposition and without striding */
-               DAG_id_tag_update(&ob->id, OB_RECALC_ALL); // XXX: should this be OB_RECALC_DATA?
+               DAG_id_tag_update(&ob->id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME); // XXX: should this be OB_RECALC_DATA?
 
                WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_EDITMODE_ARMATURE, scene);
        }
index 5f1e9b4..2b45299 100644 (file)
@@ -196,7 +196,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
        
        CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
                if(ob != obedit) {
-                       ob->recalc |= OB_RECALC_ALL;
+                       ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                        par= obedit->parent;
                        
                        while(par) {
@@ -343,7 +343,7 @@ static int make_proxy_exec (bContext *C, wmOperator *op)
                
                /* depsgraph flushes are needed for the new data */
                DAG_scene_sort(bmain, scene);
-               DAG_id_tag_update(&newob->id, OB_RECALC_ALL);
+               DAG_id_tag_update(&newob->id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME);
                WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, newob);
        }
        else {
@@ -434,7 +434,7 @@ static int parent_clear_exec(bContext *C, wmOperator *op)
                else if(type == 2)
                        unit_m4(ob->parentinv);
 
-               ob->recalc |= OB_RECALC_ALL;
+               ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
        }
        CTX_DATA_END;
        
@@ -894,7 +894,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op)
                
                /* remove track-object for old track */
                ob->track= NULL;
-               ob->recalc |= OB_RECALC_ALL;
+               ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                
                /* also remove all tracking constraints */
                for (con= ob->constraints.last; con; con= pcon) {
@@ -961,7 +961,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
 
                                data = con->data;
                                data->tar = obact;
-                               ob->recalc |= OB_RECALC_ALL;
+                               ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                                
                                /* Lamp and Camera track differently by default */
                                if (ob->type == OB_LAMP || ob->type == OB_CAMERA)
@@ -980,7 +980,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
 
                                data = con->data;
                                data->tar = obact;
-                               ob->recalc |= OB_RECALC_ALL;
+                               ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                                
                                /* Lamp and Camera track differently by default */
                                if (ob->type == OB_LAMP || ob->type == OB_CAMERA) {
@@ -1001,7 +1001,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
 
                                data = con->data;
                                data->tar = obact;
-                               ob->recalc |= OB_RECALC_ALL;
+                               ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                                
                                /* Lamp and Camera track differently by default */
                                if (ob->type == OB_LAMP || ob->type == OB_CAMERA) {
@@ -1289,7 +1289,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
                                        break;
                                case MAKE_LINKS_MODIFIERS:
                                        object_link_modifiers(obt, ob);
-                                       obt->recalc |= OB_RECALC_ALL;
+                                       obt->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                                        break;
                                }
                        }
index 4784f47..0dbcfd7 100644 (file)
@@ -4872,7 +4872,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
                        // fixme... some of this stuff is not good
                        if (ob) {
                                if (ob->pose || ob_get_key(ob))
-                                       DAG_id_tag_update(&ob->id, OB_RECALC_ALL);
+                                       DAG_id_tag_update(&ob->id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME);
                                else
                                        DAG_id_tag_update(&ob->id, OB_RECALC_OB);
                        }
index f2beb5b..3cc5010 100644 (file)
@@ -261,7 +261,7 @@ void applyProject(TransInfo *t)
                        }
                        else if (t->flag & T_OBJECT)
                        {
-                               td->ob->recalc |= OB_RECALC_ALL;
+                               td->ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
                                object_handle_update(t->scene, td->ob);
                                VECCOPY(iloc, td->ob->obmat[3]);
                        }
index a5e8e15..87f03ae 100644 (file)
@@ -437,7 +437,8 @@ extern Object workob;
 #define OB_RECALC_DATA         2
                /* time flag is set when time changes need recalc, so baked systems can ignore it */
 #define OB_RECALC_TIME         4
-#define OB_RECALC_ALL          7
+               /* only use for matching any flag, NOT as an argument since more flags may be added. */
+#define OB_RECALC_ALL          (OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME)
 
 /* controller state */
 #define OB_MAX_STATES          30
index bf77d73..1678dc6 100644 (file)
@@ -1282,7 +1282,7 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR
        else {
                /* WARNING! This is so property drivers update the display!
                 * not especially nice  */
-               DAG_id_tag_update(ptr->id.data, OB_RECALC_ALL);
+               DAG_id_tag_update(ptr->id.data, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME);
                WM_main_add_notifier(NC_WINDOW, NULL);
        }
 
index 3947e03..a1b9af7 100644 (file)
@@ -480,7 +480,7 @@ static void rna_FieldSettings_update(Main *bmain, Scene *scene, PointerRNA *ptr)
                        part->pd2->tex= 0;
                }
 
-               DAG_id_tag_update(&part->id, OB_RECALC_ALL|PSYS_RECALC_RESET);
+               DAG_id_tag_update(&part->id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME|PSYS_RECALC_RESET);
                WM_main_add_notifier(NC_OBJECT|ND_DRAW, NULL);
 
        }
@@ -522,7 +522,7 @@ static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA
 static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
        if(particle_id_check(ptr)) {
-               DAG_id_tag_update((ID*)ptr->id.data, OB_RECALC_ALL|PSYS_RECALC_RESET);
+               DAG_id_tag_update((ID*)ptr->id.data, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME|PSYS_RECALC_RESET);
        }
        else {
                Object *ob= (Object*)ptr->id.data;
@@ -539,7 +539,7 @@ static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, Point
                DAG_scene_sort(bmain, scene);
 
                if(ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE)
-                       DAG_id_tag_update(&ob->id, OB_RECALC_ALL);
+                       DAG_id_tag_update(&ob->id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME);
                else
                        DAG_id_tag_update(&ob->id, OB_RECALC_OB);
 
@@ -649,7 +649,7 @@ static void rna_CollisionSettings_update(Main *bmain, Scene *scene, PointerRNA *
 {
        Object *ob= (Object*)ptr->id.data;
 
-       DAG_id_tag_update(&ob->id, OB_RECALC_ALL);
+       DAG_id_tag_update(&ob->id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME);
        WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
 }
 
index 48de293..2a705c3 100644 (file)
@@ -224,7 +224,7 @@ static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *report
        if(scene == scene_act)
                ob->lay= base->lay;
 
-       ob->recalc |= OB_RECALC_ALL;
+       ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
 
        /* slows down importers too much, run scene.update() */
        /* DAG_scene_sort(G.main, scene); */