diff options
author | Jacques Lucke <jacques@blender.org> | 2020-10-01 18:58:43 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-10-01 18:59:04 +0300 |
commit | 365bf103d1f66824180a592c11cb4181c5791719 (patch) | |
tree | db0907d006e4491c7c12dd69f82dc327c96626d3 /source/blender/makesrna/intern/rna_scene.c | |
parent | 5b8503425a491f94f526d1f65cefea1599cafd92 (diff) |
Volumes: support lower resolution in viewport
The adds a new option to simplify volumes in the viewport.
The setting can be found in the Simplify panel in the render properties.
Volume objects use OpenVDB grids, which are sparse. For rendering,
we have to convert sparse grids to dense grids (for now). Those require
significantly more memory. Therefore, it's often a good idea to reduce
the resolution of volumes in the viewport.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D9040
Ref T73201.
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index bf97e4fcc0f..8e09de86529 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -44,6 +44,7 @@ #include "BKE_armature.h" #include "BKE_editmesh.h" #include "BKE_paint.h" +#include "BKE_volume.h" #include "ED_gpencil.h" #include "ED_object.h" @@ -1888,6 +1889,10 @@ static void object_simplify_update(Object *ob) } FOREACH_COLLECTION_OBJECT_RECURSIVE_END; } + + if (ob->type == OB_VOLUME) { + DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); + } } static void rna_Scene_use_simplify_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) @@ -6473,6 +6478,12 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop, "Simplify Child Particles", "Global child particles percentage during rendering"); RNA_def_property_update(prop, 0, "rna_Scene_simplify_update"); + prop = RNA_def_property(srna, "simplify_volumes", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_range(prop, 0.0, 1.0f); + RNA_def_property_ui_text( + prop, "Simplify Volumes", "Resolution percentage of volume objects in viewport"); + RNA_def_property_update(prop, 0, "rna_Scene_simplify_update"); + /* Grease Pencil - Simplify Options */ prop = RNA_def_property(srna, "simplify_gpencil", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "simplify_gpencil", SIMPLIFY_GPENCIL_ENABLE); |