[Bf-blender-cvs] [989080c4f64] master: Alembic import: little fix for D2634
Sybren A. Stüvel
noreply at git.blender.org
Tue Apr 18 17:00:27 CEST 2017
Commit: 989080c4f644836ebbe085e5dddc812edc876ee7
Author: Sybren A. Stüvel
Date: Tue Apr 18 17:00:21 2017 +0200
Branches: master
https://developer.blender.org/rB989080c4f644836ebbe085e5dddc812edc876ee7
Alembic import: little fix for D2634
Now it doesn't crash any more when the Alembic curves object doesn't
have any user properties.
===================================================================
M source/blender/alembic/intern/abc_curves.cc
===================================================================
diff --git a/source/blender/alembic/intern/abc_curves.cc b/source/blender/alembic/intern/abc_curves.cc
index c096ac036b4..bf485c7ef61 100644
--- a/source/blender/alembic/intern/abc_curves.cc
+++ b/source/blender/alembic/intern/abc_curves.cc
@@ -217,16 +217,17 @@ void AbcCurveReader::readObjectData(Main *bmain, float time)
cu->flag |= CU_DEFORM_FILL | CU_3D;
cu->actvert = CU_ACT_NONE;
+ cu->resolu = 1;
const ISampleSelector sample_sel(time);
+
ICompoundProperty user_props = m_curves_schema.getUserProperties();
- const PropertyHeader *header = user_props.getPropertyHeader(ABC_CURVE_RESOLUTION_U_PROPNAME);
- if (header != NULL && header->isScalar() && IInt16Property::matches(*header)) {
- IInt16Property resolu(user_props, header->getName());
- cu->resolu = resolu.getValue(sample_sel);
- }
- else {
- cu->resolu = 1;
+ if (user_props) {
+ const PropertyHeader *header = user_props.getPropertyHeader(ABC_CURVE_RESOLUTION_U_PROPNAME);
+ if (header != NULL && header->isScalar() && IInt16Property::matches(*header)) {
+ IInt16Property resolu(user_props, header->getName());
+ cu->resolu = resolu.getValue(sample_sel);
+ }
}
m_object = BKE_object_add_only_object(bmain, OB_CURVE, m_object_name.c_str());
More information about the Bf-blender-cvs
mailing list