[Bf-blender-cvs] [465aa80ce65] cycles_procedural_api: make the procedural an experimental feature
Kévin Dietrich
noreply at git.blender.org
Sun Dec 6 06:26:29 CET 2020
Commit: 465aa80ce657f6fc8a9db2182dfe0241a1e4a47e
Author: Kévin Dietrich
Date: Thu Dec 3 19:57:27 2020 +0100
Branches: cycles_procedural_api
https://developer.blender.org/rB465aa80ce657f6fc8a9db2182dfe0241a1e4a47e
make the procedural an experimental feature
===================================================================
M intern/cycles/blender/blender_object.cpp
M source/blender/editors/interface/interface_templates.c
M source/blender/makesdna/DNA_cachefile_types.h
M source/blender/makesrna/intern/rna_cachefile.c
M source/blender/modifiers/intern/MOD_meshsequencecache.c
===================================================================
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index c00fd0eaa5c..862e94a231e 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -607,7 +607,8 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
BL::MeshSequenceCacheModifier b_mesh_cache = object_alembic_cache_find(b_ob);
/* only for viewport renders at the moment as we are loading the entire archive in memory */
- if (b_mesh_cache && b_v3d) {
+ if (b_mesh_cache && b_v3d && experimental &&
+ b_mesh_cache.cache_file().use_cycles_procedural()) {
sync_procedural(b_ob, b_mesh_cache, b_depsgraph.scene().frame_current(), motion_time);
}
else
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index c1b47eea2b7..86534aac9b0 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -7208,6 +7208,19 @@ void uiTemplateCacheFile(uiLayout *layout,
row = uiLayoutRow(layout, false);
uiItemR(row, &fileptr, "is_sequence", 0, NULL, ICON_NONE);
+ /* Check for presence of Cycles and Experimental feature set to display the use_cycles_procedural
+ * option. */
+ Scene *scene = CTX_data_scene(C);
+ PointerRNA scene_ptr;
+ RNA_id_pointer_create(&scene->id, &scene_ptr);
+ if (BKE_scene_uses_cycles(scene)) {
+ PointerRNA cycles_ptr = RNA_pointer_get(&scene_ptr, "cycles");
+ if (RNA_enum_get(&cycles_ptr, "feature_set") == 1) { /* EXPERIMENTAL */
+ row = uiLayoutRow(layout, false);
+ uiItemR(row, &fileptr, "use_cycles_procedural", 0, NULL, ICON_NONE);
+ }
+ }
+
row = uiLayoutRowWithHeading(layout, true, IFACE_("Override Frame"));
sub = uiLayoutRow(row, true);
uiLayoutSetPropDecorate(sub, false);
diff --git a/source/blender/makesdna/DNA_cachefile_types.h b/source/blender/makesdna/DNA_cachefile_types.h
index 165bdae4783..7027848edb0 100644
--- a/source/blender/makesdna/DNA_cachefile_types.h
+++ b/source/blender/makesdna/DNA_cachefile_types.h
@@ -86,7 +86,9 @@ typedef struct CacheFile {
/** Animation flag. */
short flag;
- char _pad;
+ /** Use the Cycles Alembic procedural for rendering, also disables loading the data in the
+ * modifiers. */
+ char use_cycles_procedural;
char velocity_unit;
/* Name of the velocity property in the Alembic file. */
diff --git a/source/blender/makesrna/intern/rna_cachefile.c b/source/blender/makesrna/intern/rna_cachefile.c
index 807c1a29e10..9b9bc5fb3f4 100644
--- a/source/blender/makesrna/intern/rna_cachefile.c
+++ b/source/blender/makesrna/intern/rna_cachefile.c
@@ -105,6 +105,14 @@ static void rna_def_cachefile(BlenderRNA *brna)
prop, "Sequence", "Whether the cache is separated in a series of files");
RNA_def_property_update(prop, 0, "rna_CacheFile_update");
+ prop = RNA_def_property(srna, "use_cycles_procedural", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_ui_text(
+ prop,
+ "Cycles Procedural",
+ "Load the Alembic data at render time using the Cycles procedural, instead of loading data "
+ "from Blender (only available for viewport renders)");
+ RNA_def_property_update(prop, 0, "rna_CacheFile_update");
+
/* ----------------- For Scene time ------------------- */
prop = RNA_def_property(srna, "override_frame", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.c b/source/blender/modifiers/intern/MOD_meshsequencecache.c
index 44714f32695..11d67b044bc 100644
--- a/source/blender/modifiers/intern/MOD_meshsequencecache.c
+++ b/source/blender/modifiers/intern/MOD_meshsequencecache.c
@@ -123,7 +123,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
const float time = BKE_cachefile_time_offset(cache_file, frame, FPS);
const char *err_str = NULL;
- if (check_rendered_viewport_visible(bmain) || (ctx->flag & MOD_APPLY_RENDER)) {
+ if (cache_file->use_cycles_procedural && check_rendered_viewport_visible(bmain)) {
return mesh;
}
More information about the Bf-blender-cvs
mailing list