diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-17 18:51:42 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-17 18:51:42 +0300 |
commit | f90a2123eedc6cb82cfe9ad1c2ab64ba2f1e0c38 (patch) | |
tree | 79d354ba89ded1c7e61f313300f646c5ecfcf347 /source | |
parent | 902b239aa8de92d559c7b431eaa4321d9dc2b7cf (diff) |
no functional change: only check against OB_RECALC_ALL but don't use for assignment.
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/exotic.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 14 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 8 | ||||
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_deps.c | 4 | ||||
-rw-r--r-- | source/blender/editors/animation/keyingsets.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_add.c | 8 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 16 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_object_types.h | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 2 |
16 files changed, 40 insertions, 39 deletions
diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index 51fd5e1e4c6..53c3534bce3 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -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++; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index ce9e7ddf0ce..cac0b64a6b6 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -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 */ diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index fba227eb479..54bc07b548d 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -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 diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 6e3376c8834..9e63b1be87d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -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 */ diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 818b78fdd6d..f7ee0dbd16d 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -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) diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index 8ea113cedb9..02d69fd61fa 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -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? } } diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 9c801d97ba8..61cf17adf81 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -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; } diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 5a4bbaf480c..fb0b18b011c 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -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; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 2c0f232b03c..78163fa4e1d 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -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); } diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 5f1e9b43990..2b45299aefa 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -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; } } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 4784f47218f..0dbcfd76ecc 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -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); } diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index f2beb5b1053..3cc50109778 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -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]); } diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index a5e8e1545b0..87f03aec06a 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -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 diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index bf77d73351c..1678dc6d520 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -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); } diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 3947e0366e6..a1b9af78983 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -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); } diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 48de2930bd0..2a705c39ec3 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -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); */ |