[Bf-blender-cvs] [8e7eefbf32d] temp-T50725-alembic-export-custom-properties: Alembic export: Use correct time sampling for custom properties

Sybren A. Stüvel noreply at git.blender.org
Thu Sep 10 19:45:39 CEST 2020


Commit: 8e7eefbf32dc87058c2ca774f7acd8473f6d2a79
Author: Sybren A. Stüvel
Date:   Thu Sep 10 12:34:34 2020 +0200
Branches: temp-T50725-alembic-export-custom-properties
https://developer.blender.org/rB8e7eefbf32dc87058c2ca774f7acd8473f6d2a79

Alembic export: Use correct time sampling for custom properties

===================================================================

M	source/blender/io/alembic/exporter/abc_custom_props.cc
M	source/blender/io/alembic/exporter/abc_custom_props.h
M	source/blender/io/alembic/exporter/abc_writer_transform.cc

===================================================================

diff --git a/source/blender/io/alembic/exporter/abc_custom_props.cc b/source/blender/io/alembic/exporter/abc_custom_props.cc
index a9d69db64c7..97cd314f6e4 100644
--- a/source/blender/io/alembic/exporter/abc_custom_props.cc
+++ b/source/blender/io/alembic/exporter/abc_custom_props.cc
@@ -51,8 +51,8 @@ using Alembic::Abc::OStringProperty;
 namespace blender::io::alembic {
 
 CustomPropertiesExporter::CustomPropertiesExporter(
-    Alembic::Abc::OCompoundProperty abc_compound_prop)
-    : abc_compound_prop_(abc_compound_prop)
+    Alembic::Abc::OCompoundProperty abc_compound_prop, uint32_t timesample_index)
+    : abc_compound_prop_(abc_compound_prop), timesample_index_(timesample_index)
 {
 }
 
@@ -91,6 +91,7 @@ void CustomPropertiesExporter::set_scalar_property(const StringRef property_name
 {
   auto create_callback = [this, property_name]() -> OArrayProperty {
     ABCPropertyType abc_property(abc_compound_prop_, property_name);
+    abc_property.setTimeSampling(timesample_index_);
     return abc_property;
   };
 
@@ -110,7 +111,7 @@ void CustomPropertiesExporter::write(IDProperty *id_property)
       break;
     }
     case IDP_INT: {
-      set_scalar_property<OInt64ArrayProperty, int>(id_property->name, IDP_Int(id_property));
+      set_scalar_property<OInt64ArrayProperty, uint64_t>(id_property->name, IDP_Int(id_property));
       break;
     }
     case IDP_FLOAT: {
diff --git a/source/blender/io/alembic/exporter/abc_custom_props.h b/source/blender/io/alembic/exporter/abc_custom_props.h
index 9a86b61c2c8..e1981ead2ef 100644
--- a/source/blender/io/alembic/exporter/abc_custom_props.h
+++ b/source/blender/io/alembic/exporter/abc_custom_props.h
@@ -49,8 +49,11 @@ class CustomPropertiesExporter {
    * scalar properties as single-element arrays. */
   Map<std::string, Alembic::Abc::OArrayProperty> abc_properties_;
 
+  uint32_t timesample_index_;
+
  public:
-  CustomPropertiesExporter(Alembic::Abc::OCompoundProperty abc_compound_prop);
+  CustomPropertiesExporter(Alembic::Abc::OCompoundProperty abc_compound_prop,
+                           uint32_t timesample_index);
   virtual ~CustomPropertiesExporter();
 
   void write_all(IDProperty *group);
diff --git a/source/blender/io/alembic/exporter/abc_writer_transform.cc b/source/blender/io/alembic/exporter/abc_writer_transform.cc
index b4db3e78b07..3177a4dc879 100644
--- a/source/blender/io/alembic/exporter/abc_writer_transform.cc
+++ b/source/blender/io/alembic/exporter/abc_writer_transform.cc
@@ -52,8 +52,8 @@ void ABCTransformWriter::create_alembic_objects(const HierarchyContext * /*conte
   abc_xform_ = OXform(args_.abc_parent, args_.abc_name, timesample_index_);
   abc_xform_schema_ = abc_xform_.getSchema();
 
-  custom_props_ = std::make_unique<CustomPropertiesExporter>(
-      abc_xform_schema_.getUserProperties());
+  custom_props_ = std::make_unique<CustomPropertiesExporter>(abc_xform_schema_.getUserProperties(),
+                                                             timesample_index_);
 }
 
 void ABCTransformWriter::do_write(HierarchyContext &context)



More information about the Bf-blender-cvs mailing list