Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2017-02-03 17:17:09 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-02-03 18:16:39 +0300
commit6644ff25f299288aa274b26665a4e2588f3d0222 (patch)
tree74fe777e5f2a3beb00bd29b70757d8301181d958
parent7f2da487a6016ddfa229d38e8d61bf5c333035f1 (diff)
Update collection engine setings when updating collection values
-rw-r--r--source/blender/makesrna/intern/rna_scene.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 9eb54e32049..f292042d35d 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2406,6 +2406,12 @@ RNA_LAYER_ENGINE_GET_SET_FLOAT(ssao_attenuation)
#undef RNA_LAYER_ENGINE_GET_SET_FLOAT
#undef RNA_LAYER_ENGINE_GET_SET
+static void rna_CollectionEngineSettings_update(bContext *C, PointerRNA *UNUSED(ptr))
+{
+ SceneLayer *sl = CTX_data_scene_layer(C);
+ BKE_scene_layer_engine_settings_recalculate(sl);
+}
+
/***********************************/
static void rna_LayerCollection_name_get(PointerRNA *ptr, char *value)
@@ -5773,63 +5779,73 @@ static void rna_def_layer_collection_engine_settings_clay(BlenderRNA *brna)
RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_type_get", "rna_LayerEngineSettings_type_set", NULL);
RNA_def_property_enum_items(prop, clay_matcap_type);
RNA_def_property_ui_text(prop, "Settings Type", "What settings to use for this material");
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL);
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
+ RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_CollectionEngineSettings_update");
prop = RNA_def_property(srna, "matcap_icon", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_matcap_icon_get", "rna_LayerEngineSettings_matcap_icon_set", NULL);
RNA_def_property_enum_items(prop, clay_matcap_items);
RNA_def_property_ui_text(prop, "Matcap", "Image to use for Material Capture by this material");
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL);
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
+ RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_CollectionEngineSettings_update");
prop = RNA_def_property(srna, "matcap_rotation", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_matcap_rotation_get", "rna_LayerEngineSettings_matcap_rotation_set", NULL);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Matcap Rotation", "Orientation of the matcap on the model");
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL);
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
+ RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_CollectionEngineSettings_update");
prop = RNA_def_property(srna, "matcap_hue", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_matcap_hue_get", "rna_LayerEngineSettings_matcap_hue_set", NULL);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Matcap Hue shift", "Hue correction of the matcap");
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL);
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
+ RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_CollectionEngineSettings_update");
prop = RNA_def_property(srna, "matcap_saturation", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_matcap_saturation_get", "rna_LayerEngineSettings_matcap_saturation_set", NULL);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Matcap Saturation", "Saturation correction of the matcap");
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL);
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
+ RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_CollectionEngineSettings_update");
prop = RNA_def_property(srna, "matcap_value", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_matcap_value_get", "rna_LayerEngineSettings_matcap_value_set", NULL);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Matcap Value", "Value correction of the matcap");
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL);
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
+ RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_CollectionEngineSettings_update");
prop = RNA_def_property(srna, "ssao_factor_cavity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_ssao_factor_cavity_get", "rna_LayerEngineSettings_ssao_factor_cavity_set", NULL);
RNA_def_property_ui_text(prop, "Cavity Strength", "Strength of the Cavity effect");
RNA_def_property_range(prop, 0.0f, 250.0f);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL);
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
+ RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_CollectionEngineSettings_update");
prop = RNA_def_property(srna, "ssao_factor_edge", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_ssao_factor_edge_get", "rna_LayerEngineSettings_ssao_factor_edge_set", NULL);
RNA_def_property_ui_text(prop, "Edge Strength", "Strength of the Edge effect");
RNA_def_property_range(prop, 0.0f, 250.0f);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL);
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
+ RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_CollectionEngineSettings_update");
prop = RNA_def_property(srna, "ssao_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_ssao_distance_get", "rna_LayerEngineSettings_ssao_distance_set", NULL);
RNA_def_property_ui_text(prop, "Distance", "Distance of object that contribute to the Cavity/Edge effect");
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL);
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
+ RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_CollectionEngineSettings_update");
prop = RNA_def_property(srna, "ssao_attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_ssao_attenuation_get", "rna_LayerEngineSettings_ssao_attenuation_set", NULL);
RNA_def_property_ui_text(prop, "Attenuation", "Attenuation constant");
RNA_def_property_range(prop, 1.0f, 100000.0f);
RNA_def_property_ui_range(prop, 1.0f, 100.0f, 1, 3);
- RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL);
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
+ RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_CollectionEngineSettings_update");
}
static void rna_def_layer_collection_engine_settings(BlenderRNA *brna)