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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2021-08-18 22:27:52 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2021-08-18 22:27:52 +0300
commit55f9014616c9a45cb17eab325617e4912d58c10f (patch)
tree5c1f6b906c7e3995e1cd1dac737f2f0ce2ae9577
parent6b041ad3d025e5b8020d648405c8bc3c63560f8b (diff)
Alembic procedural: remove Generated attribute creation
The main reason for this is to speed up updates by avoid unnecessary copies as the Generated coordinates are a copy of the vertices. Creating this attribute may become optional in the future, with UI parameters to select which attribute to use from the Alembic archive as reference.
-rw-r--r--intern/cycles/render/alembic.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/intern/cycles/render/alembic.cpp b/intern/cycles/render/alembic.cpp
index 6713531c9b0..c1817016955 100644
--- a/intern/cycles/render/alembic.cpp
+++ b/intern/cycles/render/alembic.cpp
@@ -959,14 +959,6 @@ void AlembicProcedural::read_mesh(AlembicObject *abc_object, Abc::chrono_t frame
update_attributes(mesh->attributes, cached_data, frame_time);
- /* we don't yet support arbitrary attributes, for now add vertex
- * coordinates as generated coordinates if requested */
- if (mesh->need_attribute(scene_, ATTR_STD_GENERATED)) {
- Attribute *attr = mesh->attributes.add(ATTR_STD_GENERATED);
- memcpy(
- attr->data_float3(), mesh->get_verts().data(), sizeof(float3) * mesh->get_verts().size());
- }
-
if (mesh->is_modified()) {
bool need_rebuild = mesh->triangles_is_modified();
mesh->tag_update(scene_, need_rebuild);
@@ -1053,14 +1045,6 @@ void AlembicProcedural::read_subd(AlembicObject *abc_object, Abc::chrono_t frame
update_attributes(mesh->subd_attributes, cached_data, frame_time);
- /* we don't yet support arbitrary attributes, for now add vertex
- * coordinates as generated coordinates if requested */
- if (mesh->need_attribute(scene_, ATTR_STD_GENERATED)) {
- Attribute *attr = mesh->attributes.add(ATTR_STD_GENERATED);
- memcpy(
- attr->data_float3(), mesh->get_verts().data(), sizeof(float3) * mesh->get_verts().size());
- }
-
if (mesh->is_modified()) {
bool need_rebuild = (mesh->triangles_is_modified()) ||
(mesh->subd_num_corners_is_modified()) ||
@@ -1110,17 +1094,6 @@ void AlembicProcedural::read_curves(AlembicObject *abc_object, Abc::chrono_t fra
update_attributes(hair->attributes, cached_data, frame_time);
- /* we don't yet support arbitrary attributes, for now add first keys as generated coordinates if
- * requested */
- if (hair->need_attribute(scene_, ATTR_STD_GENERATED)) {
- Attribute *attr_generated = hair->attributes.add(ATTR_STD_GENERATED);
- float3 *generated = attr_generated->data_float3();
-
- for (size_t i = 0; i < hair->num_curves(); i++) {
- generated[i] = hair->get_curve_keys()[hair->get_curve(i).first_key];
- }
- }
-
const bool rebuild = (hair->curve_keys_is_modified() || hair->curve_radius_is_modified());
hair->tag_update(scene_, rebuild);
}