diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-03-30 18:01:23 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-03-30 18:01:23 +0300 |
commit | ce3c7e8ff515e5bfbf70d0f4f60557e26c9d98a1 (patch) | |
tree | 1062bd45d22a2a0aff4e4a227079154b78c42263 /source/blender/draw/modes/edit_mesh_mode.c | |
parent | 98e69631b0cf31b5b73c1d9afb9bd9fc81fc42be (diff) |
Layers: use IDProperty and override collection properties system
First this replace a custom data struct with IDProperty, and use
IDProperty group merge and copying functions. Which means that a collection
property setting is only created if necessary.
This implements the "Layer Collection settings" override system, as
suggested in the "Override Manifesto" document.
The core is working, with Scene, LayerCollection and Object using a
single IDProperty to store all the render settings data. Next step is to
migrate this to depsgraph.
Note: Clay engine "ssao_samples" was hardcoded to 32 for now. It will come
back as part of "Workspace Settings" later.
Many thanks for Bastien Montagne for the help with the UI template
nightmare ;)
Differential Revision: https://developer.blender.org/D2563
Diffstat (limited to 'source/blender/draw/modes/edit_mesh_mode.c')
-rw-r--r-- | source/blender/draw/modes/edit_mesh_mode.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c index 084e0eb89b7..713ae607ef4 100644 --- a/source/blender/draw/modes/edit_mesh_mode.c +++ b/source/blender/draw/modes/edit_mesh_mode.c @@ -367,7 +367,7 @@ static void EDIT_MESH_cache_populate(void *vedata, Object *ob) if (ob->type == OB_MESH) { if (ob == obedit) { - CollectionEngineSettings *ces_mode_ed = BKE_object_collection_engine_get(ob, COLLECTION_MODE_EDIT, ""); + IDProperty *ces_mode_ed = BKE_object_collection_engine_get(ob, COLLECTION_MODE_EDIT, ""); bool do_occlude_wire = BKE_collection_engine_property_value_get_bool(ces_mode_ed, "show_occlude_wire"); backwire_opacity = BKE_collection_engine_property_value_get_float(ces_mode_ed, "backwire_opacity"); /* Updating uniform */ @@ -446,15 +446,17 @@ static void EDIT_MESH_draw_scene(void *vedata) } } -void EDIT_MESH_collection_settings_create(CollectionEngineSettings *ces) +void EDIT_MESH_collection_settings_create(IDProperty *properties) { - BLI_assert(ces); - BKE_collection_engine_property_add_int(ces, "show_occlude_wire", false); - BKE_collection_engine_property_add_int(ces, "face_normals_show", false); - BKE_collection_engine_property_add_int(ces, "vert_normals_show", false); - BKE_collection_engine_property_add_int(ces, "loop_normals_show", false); - BKE_collection_engine_property_add_float(ces, "normals_length", 0.1); - BKE_collection_engine_property_add_float(ces, "backwire_opacity", 0.5); + BLI_assert(properties && + properties->type == IDP_GROUP && + properties->subtype == IDP_GROUP_SUB_MODE_EDIT); + BKE_collection_engine_property_add_int(properties, "show_occlude_wire", false); + BKE_collection_engine_property_add_int(properties, "face_normals_show", false); + BKE_collection_engine_property_add_int(properties, "vert_normals_show", false); + BKE_collection_engine_property_add_int(properties, "loop_normals_show", false); + BKE_collection_engine_property_add_float(properties, "normals_length", 0.1); + BKE_collection_engine_property_add_float(properties, "backwire_opacity", 0.5); } static void EDIT_MESH_engine_free(void) |