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.
This commit is contained in:
Campbell Barton 2010-12-17 15:51:42 +00:00
parent 902b239aa8
commit f90a2123ee
Notes: blender-bot 2023-02-14 10:29:30 +01:00
Referenced by commit bb69e62710, Fix T68396: Unable to change any Collision input value after it has been keyframed
Referenced by issue #68396, Unable to change any Collision input value after it has been keyframed
16 changed files with 40 additions and 39 deletions

View 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++;

View 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 */

View 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

View 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 */

View 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)

View 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?
}
}

View 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;
}

View 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;

View 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);
}

View 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;
}
}

View 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);
}

View 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]);
}

View 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

View 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);
}

View 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);
}

View 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); */