diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-08-23 16:20:21 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-08-23 16:27:16 +0300 |
commit | c32bb58e5b44421cb2450b10a475e25b6c15135e (patch) | |
tree | b6031cdb28f7eebcc39ad34b7ab5e7a7f9608f33 /source/blender/makesrna | |
parent | a87d3edb9898bc6b285e5b3742566f6783ea6d92 (diff) |
Depsgraph: use more fine grained update tags for scenes
Ref D15710, this avoids unnecessary sequencer updates for some operations.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_internal.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 46 |
2 files changed, 24 insertions, 24 deletions
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 370455302b6..3d5c1810558 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -355,7 +355,7 @@ void rna_FreestyleSettings_module_remove(struct ID *id, void rna_Scene_use_view_map_cache_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr); -void rna_Scene_glsl_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr); +void rna_Scene_render_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr); void rna_Scene_freestyle_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr); void rna_ViewLayer_name_set(struct PointerRNA *ptr, const char *value); void rna_ViewLayer_material_override_update(struct Main *bmain, diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 1e5291759d7..be387efea93 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -853,12 +853,12 @@ void rna_Scene_set_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) Scene *scene = (Scene *)ptr->owner_id; DEG_relations_tag_update(bmain); - DEG_id_tag_update_ex(bmain, &scene->id, 0); + DEG_id_tag_update_ex(bmain, &scene->id, ID_RECALC_BASE_FLAGS); if (scene->set != NULL) { /* Objects which are pulled into main scene's depsgraph needs to have * their base flags updated. */ - DEG_id_tag_update_ex(bmain, &scene->set->id, 0); + DEG_id_tag_update_ex(bmain, &scene->set->id, ID_RECALC_BASE_FLAGS); } } @@ -1680,18 +1680,18 @@ static bool rna_RenderSettings_use_spherical_stereo_get(PointerRNA *ptr) return BKE_scene_use_spherical_stereo(scene); } -void rna_Scene_glsl_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +void rna_Scene_render_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Scene *scene = (Scene *)ptr->owner_id; - DEG_id_tag_update(&scene->id, 0); + DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE); } static void rna_Scene_world_update(Main *bmain, Scene *scene, PointerRNA *ptr) { Scene *screen = (Scene *)ptr->owner_id; - rna_Scene_glsl_update(bmain, scene, ptr); + rna_Scene_render_update(bmain, scene, ptr); WM_main_add_notifier(NC_WORLD | ND_WORLD, &screen->id); DEG_relations_tag_update(bmain); } @@ -1707,21 +1707,21 @@ static void rna_Scene_mesh_quality_update(Main *bmain, Scene *UNUSED(scene), Poi } FOREACH_SCENE_OBJECT_END; - rna_Scene_glsl_update(bmain, scene, ptr); + rna_Scene_render_update(bmain, scene, ptr); } void rna_Scene_freestyle_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Scene *scene = (Scene *)ptr->owner_id; - DEG_id_tag_update(&scene->id, 0); + DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE); } void rna_Scene_use_freestyle_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Scene *scene = (Scene *)ptr->owner_id; - DEG_id_tag_update(&scene->id, 0); + DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE); if (scene->nodetree) { ntreeCompositUpdateRLayers(scene->nodetree); @@ -1761,7 +1761,7 @@ static void rna_SceneRenderView_name_set(PointerRNA *ptr, const char *value) void rna_ViewLayer_material_override_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { Scene *scene = (Scene *)ptr->owner_id; - rna_Scene_glsl_update(bmain, scene, ptr); + rna_Scene_render_update(bmain, scene, ptr); DEG_relations_tag_update(bmain); } @@ -1798,7 +1798,7 @@ void rna_ViewLayer_pass_update(Main *bmain, Scene *activescene, PointerRNA *ptr) } } - rna_Scene_glsl_update(bmain, activescene, ptr); + rna_Scene_render_update(bmain, activescene, ptr); } static char *rna_ViewLayerEEVEE_path(const PointerRNA *ptr) @@ -1955,7 +1955,7 @@ static void rna_Scene_use_simplify_update(Main *bmain, Scene *UNUSED(scene), Poi WM_main_add_notifier(NC_GEOM | ND_DATA, NULL); WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); - DEG_id_tag_update(&sce->id, 0); + DEG_id_tag_update(&sce->id, ID_RECALC_COPY_ON_WRITE); } static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -2308,7 +2308,7 @@ FreestyleLineSet *rna_FreestyleSettings_lineset_add(ID *id, Scene *scene = (Scene *)id; FreestyleLineSet *lineset = BKE_freestyle_lineset_add(bmain, (FreestyleConfig *)config, name); - DEG_id_tag_update(&scene->id, 0); + DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE); WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL); return lineset; @@ -2329,7 +2329,7 @@ void rna_FreestyleSettings_lineset_remove(ID *id, RNA_POINTER_INVALIDATE(lineset_ptr); - DEG_id_tag_update(&scene->id, 0); + DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE); WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL); } @@ -2366,7 +2366,7 @@ FreestyleModuleConfig *rna_FreestyleSettings_module_add(ID *id, FreestyleSetting Scene *scene = (Scene *)id; FreestyleModuleConfig *module = BKE_freestyle_module_add((FreestyleConfig *)config); - DEG_id_tag_update(&scene->id, 0); + DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE); WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL); return module; @@ -2395,7 +2395,7 @@ void rna_FreestyleSettings_module_remove(ID *id, RNA_POINTER_INVALIDATE(module_ptr); - DEG_id_tag_update(&scene->id, 0); + DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE); WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL); } @@ -2426,7 +2426,7 @@ static ViewLayer *rna_ViewLayer_new(ID *id, Scene *UNUSED(sce), Main *bmain, con Scene *scene = (Scene *)id; ViewLayer *view_layer = BKE_view_layer_add(scene, name, NULL, VIEWLAYER_ADD_NEW); - DEG_id_tag_update(&scene->id, 0); + DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); DEG_relations_tag_update(bmain); WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL); @@ -4467,7 +4467,7 @@ void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool sce RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY); RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer"); if (scene) { - RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update"); } else { RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -4477,7 +4477,7 @@ void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool sce RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_AO); RNA_def_property_ui_text(prop, "Ambient Occlusion", "Render Ambient Occlusion in this Layer"); if (scene) { - RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update"); } else { RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -6354,7 +6354,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop, "Transparent", "World background is transparent, for compositing the render over another background"); - RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update"); prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -6385,14 +6385,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR); RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update"); prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "blurfac"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 2); RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close"); - RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update"); prop = RNA_def_property(srna, "motion_blur_shutter_curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "mblur_shutter_curve"); @@ -6404,13 +6404,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop = RNA_def_property(srna, "hair_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, hair_shape_type_items); RNA_def_property_ui_text(prop, "Curves Shape Type", "Curves shape type"); - RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update"); prop = RNA_def_property(srna, "hair_subdiv", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 3); RNA_def_property_ui_text( prop, "Additional Subdivision", "Additional subdivision along the curves"); - RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update"); /* Performance */ prop = RNA_def_property(srna, "use_high_quality_normals", PROP_BOOLEAN, PROP_NONE); |