diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-12-06 19:52:37 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-12-07 13:37:38 +0300 |
commit | 79312c1912b4fdb830e38a856cf88bfca8e4703d (patch) | |
tree | 74d5b262de9cd5d044e1963df13f2cbe73c3b796 /source/blender/makesrna/intern/rna_ID.c | |
parent | 989fbff16f49204ca31a67f56f87c2221e0246f4 (diff) |
Depsgraph: Remove duplicated sets of recalc/update flags
There were at least three copies of those:
- OB_RECALC* family of flags, which are rudiment of an old
dependency graph system.
- PSYS_RECALC* which were used by old dependency graph system
as a separate set since the graph itself did not handle
particle systems.
- DEG_TAG_* which was used to tag IDs.
Now there is a single set, which defines what can be tagged
and queried for an update. It also has some aggregate flags
to make queries simpler.
Lets once and for all solve the madness of those flags, stick
to a single set, which will not overlap with anything or require
any extra conversion.
Technically, shouldn't be measurable user difference, but some
of the agregate flags for few dependency graph components did
change.
Fixes T58632: Particle don't update rotation settings
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index b550b4043e3..2221c63d6b7 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -157,7 +157,7 @@ void rna_ID_name_set(PointerRNA *ptr, const char *value) if (GS(id->name) == ID_OB) { Object *ob = (Object *)id; if (ob->type == OB_MBALL) { - DEG_id_tag_update(&ob->id, DEG_TAG_GEOMETRY); + DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); } } } @@ -404,7 +404,11 @@ static void rna_ID_update_tag(ID *id, ReportList *reports, int flag) /* ensure flag us correct for the type */ switch (GS(id->name)) { case ID_OB: - if (flag & ~(OB_RECALC_ALL)) { + /* TODO(sergey): This is kind of difficult to predict since different + * object types supports different flags. Maybe does not worth checking + * for this at all. Or maybe let dependency graph to return whether + * the tag was valid or not. */ + if (flag & ~(ID_RECALC_ALL)) { BKE_report(reports, RPT_ERROR, "'Refresh' incompatible with Object ID type"); return; } @@ -536,7 +540,7 @@ static Material *rna_IDMaterials_pop_id( return NULL; } - DEG_id_tag_update(id, OB_RECALC_DATA); + DEG_id_tag_update(id, ID_RECALC_GEOMETRY); WM_main_add_notifier(NC_OBJECT | ND_DRAW, id); WM_main_add_notifier(NC_OBJECT | ND_OB_SHADING, id); @@ -547,7 +551,7 @@ static void rna_IDMaterials_clear_id(ID *id, Main *bmain, bool remove_material_s { BKE_material_clear_id(bmain, id, remove_material_slot); - DEG_id_tag_update(id, OB_RECALC_DATA); + DEG_id_tag_update(id, ID_RECALC_GEOMETRY); WM_main_add_notifier(NC_OBJECT | ND_DRAW, id); WM_main_add_notifier(NC_OBJECT | ND_OB_SHADING, id); } @@ -1154,9 +1158,9 @@ static void rna_def_ID(BlenderRNA *brna) PropertyRNA *prop, *parm; static const EnumPropertyItem update_flag_items[] = { - {OB_RECALC_OB, "OBJECT", 0, "Object", ""}, - {OB_RECALC_DATA, "DATA", 0, "Data", ""}, - {OB_RECALC_TIME, "TIME", 0, "Time", ""}, + {ID_RECALC_TRANSFORM, "OBJECT", 0, "Object", ""}, + {ID_RECALC_GEOMETRY, "DATA", 0, "Data", ""}, + {ID_RECALC_ANIMATION, "TIME", 0, "Time", ""}, {0, NULL, 0, NULL, NULL} }; |