Fix T75964: changing object's viewport display color does not update

cycles

Caused by rB00466e756e33.

While that commit sounds logical, Cycles uses is_updated_transform() to
detect updates.

Now introduce is_updated_shading() and use that on top.

Maniphest Tasks: T75964

Differential Revision: https://developer.blender.org/D7493
This commit is contained in:
Philipp Oeser 2020-04-22 13:50:21 +02:00
parent 9aeb475e99
commit 6c9a882340
Notes: blender-bot 2023-02-14 03:21:27 +01:00
Referenced by issue #75964, changing an object's viewport display color does not auto update in viewport render mode.
2 changed files with 12 additions and 1 deletions

View File

@ -142,7 +142,7 @@ void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d
BL::Object b_ob(b_id);
const bool updated_geometry = b_update->is_updated_geometry();
if (b_update->is_updated_transform()) {
if (b_update->is_updated_transform() || b_update->is_updated_shading()) {
object_map.set_recalc(b_ob);
light_map.set_recalc(b_ob);
}

View File

@ -203,6 +203,12 @@ static bool rna_DepsgraphUpdate_is_updated_transform_get(PointerRNA *ptr)
return ((id->recalc & ID_RECALC_TRANSFORM) != 0);
}
static bool rna_DepsgraphUpdate_is_updated_shading_get(PointerRNA *ptr)
{
ID *id = ptr->data;
return ((id->recalc & ID_RECALC_SHADING) != 0);
}
static bool rna_DepsgraphUpdate_is_updated_geometry_get(PointerRNA *ptr)
{
ID *id = ptr->data;
@ -601,6 +607,11 @@ static void rna_def_depsgraph_update(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Geometry", "Object geometry is updated");
RNA_def_property_boolean_funcs(prop, "rna_DepsgraphUpdate_is_updated_geometry_get", NULL);
prop = RNA_def_property(srna, "is_updated_shading", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Shading", "Object shading is updated");
RNA_def_property_boolean_funcs(prop, "rna_DepsgraphUpdate_is_updated_shading_get", NULL);
}
static void rna_def_depsgraph(BlenderRNA *brna)