diff options
author | Fabian Schempp <fabianschempp@googlemail.com> | 2021-08-22 09:51:26 +0300 |
---|---|---|
committer | Fabian Schempp <fabianschempp@googlemail.com> | 2021-08-22 09:51:26 +0300 |
commit | 38b12c763f966ea685472f9d8faca3a299b07fb6 (patch) | |
tree | 960c60aa52522d87d805b89e8b31507b9b3da2e5 /intern/cycles/blender/blender_object.cpp | |
parent | 49a16a1ca874a2b3939b3eee8d4d2b0cacad8b96 (diff) | |
parent | 721fad37a1981a564404b5f708a405503dc18f45 (diff) |
Merge branch 'master' into soc-2021-porting-modifiers-to-nodes_allsoc-2021-porting-modifiers-to-nodes_all
Diffstat (limited to 'intern/cycles/blender/blender_object.cpp')
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 657ecdeeeb7..a7eae421b55 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -485,7 +485,9 @@ bool BlenderSync::sync_object_attributes(BL::DepsgraphObjectInstance &b_instance /* Object Loop */ -void BlenderSync::sync_procedural(BL::Object &b_ob, BL::MeshSequenceCacheModifier &b_mesh_cache) +void BlenderSync::sync_procedural(BL::Object &b_ob, + BL::MeshSequenceCacheModifier &b_mesh_cache, + bool has_subdivision_modifier) { #ifdef WITH_ALEMBIC BL::CacheFile cache_file = b_mesh_cache.cache_file(); @@ -521,6 +523,9 @@ void BlenderSync::sync_procedural(BL::Object &b_ob, BL::MeshSequenceCacheModifie procedural->set_scale(cache_file.scale()); + procedural->set_use_prefetch(cache_file.use_prefetch()); + procedural->set_prefetch_cache_size(cache_file.prefetch_cache_size()); + /* create or update existing AlembicObjects */ ustring object_path = ustring(b_mesh_cache.object_path()); @@ -534,6 +539,8 @@ void BlenderSync::sync_procedural(BL::Object &b_ob, BL::MeshSequenceCacheModifie abc_object->set_subd_dicing_rate(subd_dicing_rate); abc_object->set_subd_max_level(max_subdivisions); + abc_object->set_ignore_subdivision(!has_subdivision_modifier); + if (abc_object->is_modified() || procedural->is_modified()) { procedural->tag_update(scene); } @@ -601,13 +608,14 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph, if (b_instance.show_self()) { #ifdef WITH_ALEMBIC bool use_procedural = false; + bool has_subdivision_modifier = false; BL::MeshSequenceCacheModifier b_mesh_cache(PointerRNA_NULL); /* Experimental as Blender does not have good support for procedurals at the moment, also * only available in preview renders since currently do not have a good cache policy, the * data being loaded at once for all the frames. */ if (experimental && b_v3d) { - b_mesh_cache = object_mesh_cache_find(b_ob, false); + b_mesh_cache = object_mesh_cache_find(b_ob, false, &has_subdivision_modifier); use_procedural = b_mesh_cache && b_mesh_cache.cache_file().use_render_procedural(); } @@ -615,7 +623,7 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph, /* Skip in the motion case, as generating motion blur data will be handled in the * procedural. */ if (!motion) { - sync_procedural(b_ob, b_mesh_cache); + sync_procedural(b_ob, b_mesh_cache, has_subdivision_modifier); } } else |