diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-02-15 20:54:31 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-02-15 20:54:31 +0300 |
commit | 883ef2c9cef5b25fb2da9233181e07cd2555c444 (patch) | |
tree | 67f3a2f5f8c575b70e03a0e0ce26549aeae0f29d | |
parent | 69b96e27ee9d0282b295081462e9ac0a2f75a30e (diff) |
Clay Engine: New collection settings (not working yet)
-rw-r--r-- | release/scripts/startup/bl_ui/properties_collection.py | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 5 | ||||
-rw-r--r-- | source/blender/draw/engines/clay/clay.c | 5 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_mode_pass.c | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 34 |
5 files changed, 30 insertions, 22 deletions
diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py index b838497b4e4..95401c016e6 100644 --- a/release/scripts/startup/bl_ui/properties_collection.py +++ b/release/scripts/startup/bl_ui/properties_collection.py @@ -139,7 +139,8 @@ class COLLECTION_PT_object_mode_settings(CollectionButtonsPanel, Panel): settings = collection.get_mode_settings('OBJECT') col = layout.column() - template_engine_settings(col, settings, "foo") + template_engine_settings(col, settings, "show_wire") + template_engine_settings(col, settings, "show_backface_culling") class COLLECTION_PT_edit_mode_settings(CollectionButtonsPanel, Panel): @@ -157,7 +158,7 @@ class COLLECTION_PT_edit_mode_settings(CollectionButtonsPanel, Panel): settings = collection.get_mode_settings('EDIT') col = layout.column() - template_engine_settings(col, settings, "bar") + template_engine_settings(col, settings, "show_occlude_wire") if __name__ == "__main__": # only for live edit. diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 3e69fa61d90..1fae242a644 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -808,7 +808,8 @@ static void layer_collection_create_mode_settings_object(ListBase *lb) ces->type = COLLECTION_MODE_OBJECT; /* properties */ - BKE_collection_engine_property_add_int(ces, "foo", 2); + BKE_collection_engine_property_add_int(ces, "show_wire", false); + BKE_collection_engine_property_add_int(ces, "show_backface_culling", false); } static void layer_collection_create_mode_settings_edit(ListBase *lb) @@ -820,7 +821,7 @@ static void layer_collection_create_mode_settings_edit(ListBase *lb) ces->type = COLLECTION_MODE_EDIT; /* properties */ - BKE_collection_engine_property_add_float(ces, "bar", 0.5); + BKE_collection_engine_property_add_int(ces, "show_occlude_wire", false); } static void collection_create_mode_settings(ListBase *lb) diff --git a/source/blender/draw/engines/clay/clay.c b/source/blender/draw/engines/clay/clay.c index 8c0dce78b80..699a393c4fe 100644 --- a/source/blender/draw/engines/clay/clay.c +++ b/source/blender/draw/engines/clay/clay.c @@ -558,7 +558,7 @@ static void override_setting(CollectionEngineSettings *ces, const char *name, vo CollectionEnginePropertyInt *prop = (CollectionEnginePropertyInt *)cep; *((int *)ret) = prop->value; } - else { + else if (cep->type == COLLECTION_PROP_TYPE_FLOAT) { CollectionEnginePropertyFloat *prop = (CollectionEnginePropertyFloat *)cep; *((float *)ret) = prop->value; } @@ -636,6 +636,9 @@ static void CLAY_create_cache(CLAY_PassList *passes, CLAY_StorageList *stl, cons continue; } + // CollectionEngineSettings *ces_mode_ob = BKE_object_collection_engine_get(ob, COLLECTION_MODE_OBJECT, ""); + // CollectionEngineSettings *ces_mode_ed = BKE_object_collection_engine_get(ob, COLLECTION_MODE_EDIT, ""); + struct Batch *geom; bool do_outlines; diff --git a/source/blender/draw/intern/draw_mode_pass.c b/source/blender/draw/intern/draw_mode_pass.c index 44a837e314f..8a632980de9 100644 --- a/source/blender/draw/intern/draw_mode_pass.c +++ b/source/blender/draw/intern/draw_mode_pass.c @@ -194,15 +194,12 @@ void DRW_pass_setup_common(DRWPass **wire_overlay, DRWPass **wire_outline, DRWPa if (non_meshes) { /* Non Meshes Pass (Camera, empties, lamps ...) */ - DRWShadingGroup *grp; struct Batch *geom; DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND; state |= DRW_STATE_WIRE; *non_meshes = DRW_pass_create("Non Meshes Pass", state); - GPUShader *sh = GPU_shader_get_builtin_shader(GPU_SHADER_3D_UNIFORM_COLOR); - /* Empties */ geom = DRW_cache_plain_axes_get(); plain_axes = shgroup_instance(*non_meshes, geom); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index c985e6fd429..ba542a457b2 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2427,7 +2427,7 @@ static void rna_LayerEngineSettings_##_ENGINE_##_##_NAME_##_set(PointerRNA *ptr, RNA_LAYER_ENGINE_GET_SET(int, Clay, COLLECTION_MODE_NONE, _NAME_) #define RNA_LAYER_ENGINE_CLAY_GET_SET_BOOL(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(int, Clay, COLLECTION_MODE_NONE, _NAME_) + RNA_LAYER_ENGINE_GET_SET(bool, Clay, COLLECTION_MODE_NONE, _NAME_) /* mode engines */ @@ -2450,7 +2450,6 @@ static void rna_LayerEngineSettings_##_ENGINE_##_##_NAME_##_set(PointerRNA *ptr, RNA_LAYER_ENGINE_GET_SET(bool, EditMode, COLLECTION_MODE_EDIT, _NAME_) /* clay engine */ - RNA_LAYER_ENGINE_CLAY_GET_SET_INT(type) RNA_LAYER_ENGINE_CLAY_GET_SET_INT(matcap_icon) RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(matcap_rotation) @@ -2461,12 +2460,13 @@ RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_factor_cavity) RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_factor_edge) RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_distance) RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_attenuation) -/* object engine */ -RNA_LAYER_MODE_OBJECT_GET_SET_INT(foo) +/* object engine */ +RNA_LAYER_MODE_OBJECT_GET_SET_BOOL(show_wire) +RNA_LAYER_MODE_OBJECT_GET_SET_BOOL(show_backface_culling) /* mesh engine */ -RNA_LAYER_MODE_EDIT_GET_SET_FLOAT(bar) +RNA_LAYER_MODE_EDIT_GET_SET_BOOL(show_occlude_wire) #undef RNA_LAYER_ENGINE_GET_SET #undef RNA_LAYER_ENGINE_USE_GET_SET @@ -5995,13 +5995,19 @@ static void rna_def_layer_collection_mode_settings_object(BlenderRNA *brna) /* see RNA_LAYER_ENGINE_GET_SET macro */ - prop = RNA_def_property(srna, "foo", PROP_INT, PROP_NONE); - RNA_def_property_ui_text(prop, "Foo", ""); - RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_ObjectMode_foo_get", "rna_LayerEngineSettings_ObjectMode_foo_set", NULL); - RNA_def_property_ui_text(prop, "Foo Object Setting", "Temporary settings"); + prop = RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Wire", "Add the object's wireframe over solid drawing"); + RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_ObjectMode_show_wire_get", "rna_LayerEngineSettings_ObjectMode_show_wire_set"); + RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); + RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_CollectionEngineSettings_update"); + RNA_LAYER_MODE_OBJECT_USE(show_wire) + + prop = RNA_def_property(srna, "show_backface_culling", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Backface Culling", ""); + RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_ObjectMode_show_backface_culling_get", "rna_LayerEngineSettings_ObjectMode_show_backface_culling_set"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_CollectionEngineSettings_update"); - RNA_LAYER_MODE_OBJECT_USE(foo) + RNA_LAYER_MODE_OBJECT_USE(show_backface_culling) } static void rna_def_layer_collection_mode_settings_edit(BlenderRNA *brna) @@ -6015,12 +6021,12 @@ static void rna_def_layer_collection_mode_settings_edit(BlenderRNA *brna) /* see RNA_LAYER_ENGINE_GET_SET macro */ - prop = RNA_def_property(srna, "bar", PROP_FLOAT, PROP_NONE); - RNA_def_property_ui_text(prop, "Bar Object Setting", "Temporary settings"); - RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_EditMode_bar_get", "rna_LayerEngineSettings_EditMode_bar_set", NULL); + prop = RNA_def_property(srna, "show_occlude_wire", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Hidden Wire", ""); + RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_EditMode_show_occlude_wire_get", "rna_LayerEngineSettings_EditMode_show_occlude_wire_set"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_CollectionEngineSettings_update"); - RNA_LAYER_MODE_EDIT_USE(bar) + RNA_LAYER_MODE_EDIT_USE(show_occlude_wire) } static void rna_def_layer_collection_mode_settings(BlenderRNA *brna) |