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:
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface_templates.c25
-rw-r--r--source/blender/editors/render/render_update.c14
2 files changed, 39 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 47ff0c9fd3c..f0d50985237 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -84,6 +84,8 @@
#include "ED_screen.h"
#include "ED_undo.h"
+#include "RE_engine.h"
+
#include "RNA_access.h"
#include "WM_api.h"
@@ -6463,6 +6465,29 @@ void uiTemplateCacheFile(uiLayout *layout,
row = uiLayoutRow(layout, false);
uiItemR(row, &fileptr, "is_sequence", 0, NULL, ICON_NONE);
+ /* Only enable render procedural option if the active engine supports it. */
+ const struct RenderEngineType *engine_type = CTX_data_engine_type(C);
+
+ Scene *scene = CTX_data_scene(C);
+ const bool engine_supports_procedural = RE_engine_supports_alembic_procedural(engine_type, scene);
+
+ if (!engine_supports_procedural) {
+ row = uiLayoutRow(layout, false);
+ /* For Cycles, verify that experimental features are enabled. */
+ if (BKE_scene_uses_cycles(scene) && !BKE_scene_uses_cycles_experimental_features(scene)) {
+ uiItemL(row,
+ "The Cycles Alembic Procedural is only available with the experimental feature set",
+ ICON_INFO);
+ }
+ else {
+ uiItemL(row, "The active render engine does not have an Alembic Procedural", ICON_INFO);
+ }
+ }
+
+ row = uiLayoutRow(layout, false);
+ uiLayoutSetActive(row, engine_supports_procedural);
+ uiItemR(row, &fileptr, "use_render_procedural", 0, NULL, ICON_NONE);
+
row = uiLayoutRowWithHeading(layout, true, IFACE_("Override Frame"));
sub = uiLayoutRow(row, true);
uiLayoutSetPropDecorate(sub, false);
diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c
index fb9d11feb63..6db148eb4e1 100644
--- a/source/blender/editors/render/render_update.c
+++ b/source/blender/editors/render/render_update.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <string.h>
+#include "DNA_cachefile_types.h"
#include "DNA_light_types.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
@@ -204,6 +205,19 @@ void ED_render_engine_changed(Main *bmain, const bool update_scene_data)
ntreeCompositUpdateRLayers(scene->nodetree);
}
}
+
+ /* Update CacheFiles to ensure that procedurals are properly taken into account. */
+ LISTBASE_FOREACH (CacheFile *, cachefile, &bmain->cachefiles) {
+ /* Only update cachefiles which are set to use a render procedural. We do not use
+ * BKE_cachefile_uses_render_procedural here as we need to update regardless of the current
+ * engine or its settings. */
+ if (cachefile->use_render_procedural) {
+ DEG_id_tag_update(&cachefile->id, ID_RECALC_COPY_ON_WRITE);
+ /* Rebuild relations so that modifiers are reconnected to or disconnected from the cachefile.
+ */
+ DEG_relations_tag_update(bmain);
+ }
+ }
}
void ED_render_view_layer_changed(Main *bmain, bScreen *screen)