diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-11-15 17:17:54 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-11-22 12:13:33 +0300 |
commit | e22ca0fb860ed945eb3438bfe6dba8040cfd7cf3 (patch) | |
tree | 0e7cfbecb035d9096559e1871796ca92ec6d3a99 /source | |
parent | 05306d97663b4281d4b17bfc7e1ed913ce07966f (diff) |
SceneRenderLayer > SceneLayer: Convert samples_override
Note: Cycles still need to handle its own doversion for theses cases and
(1) Remove the override as it is
(2) Add a new override (scene.cycles.samples) if scene.cycles.use_layer_samples != IGNORE
Respecting the expected behaviour when scene.cycles.use_layer_samples == BOUNDED.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_layer.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 9 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 10 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 5 |
5 files changed, 21 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h index ad2f196866f..d195c98396b 100644 --- a/source/blender/blenkernel/BKE_layer.h +++ b/source/blender/blenkernel/BKE_layer.h @@ -109,6 +109,7 @@ void BKE_layer_sync_object_unlink(const struct Scene *scene, struct SceneCollect /* override */ void BKE_override_scene_layer_datablock_add(struct SceneLayer *scene_layer, int id_type, const char *data_path, const struct ID *id); +void BKE_override_scene_layer_int_add(struct SceneLayer *scene_layer, int id_type, const char *data_path, const int value); /* engine settings */ typedef void (*EngineSettingsCB)(struct RenderEngine *engine, struct IDProperty *props); diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 3c9c110625b..f7866922c1c 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -1066,6 +1066,15 @@ void BKE_override_scene_layer_datablock_add(SceneLayer *scene_layer, int id_type TODO_LAYER_OVERRIDE; } +/** + * Add a new int override + */ +void BKE_override_scene_layer_int_add(SceneLayer *scene_layer, int id_type, const char *data_path, const int value) +{ + UNUSED_VARS(scene_layer, id_type, data_path, value); + TODO_LAYER_OVERRIDE; +} + /* ---------------------------------------------------------------------- */ /* Engine Settings */ diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index d38a9a12999..f6801d22a53 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -306,6 +306,16 @@ void do_versions_after_linking_280(Main *main) SceneLayer *scene_layer = BKE_scene_layer_add(scene, srl->name); + if (srl->samples != 0) { + /* It is up to the external engine to handle + * its own doversion in this case. */ + BKE_override_scene_layer_int_add( + scene_layer, + ID_SCE, + "samples", + srl->samples); + } + if (srl->mat_override) { BKE_override_scene_layer_datablock_add( scene_layer, diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 3e554bafdf2..7c93febc69f 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -184,7 +184,7 @@ typedef struct SceneRenderLayer { int passflag; /* pass_xor has to be after passflag */ int pass_xor; - int samples; + int samples DNA_DEPRECATED; /* Converted to SceneLayer override. */ float pass_alpha_threshold; IDProperty *prop; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index f653fcfa238..d62741d9383 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -3301,11 +3301,6 @@ void rna_def_render_layer_common(StructRNA *srna, int scene) else RNA_def_property_clear_flag(prop, PROP_EDITABLE); if (scene) { - prop = RNA_def_property(srna, "samples", PROP_INT, PROP_UNSIGNED); - RNA_def_property_ui_text(prop, "Samples", "Override number of render samples for this render layer, " - "0 will use the scene setting"); - RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - prop = RNA_def_property(srna, "pass_alpha_threshold", PROP_FLOAT, PROP_FACTOR); RNA_def_property_ui_text(prop, "Alpha Threshold", "Z, Index, normal, UV and vector passes are only affected by surfaces with " |