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:
authorSybren A. Stüvel <sybren@stuvel.eu>2017-04-18 18:00:21 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2017-04-18 18:00:21 +0300
commit989080c4f644836ebbe085e5dddc812edc876ee7 (patch)
treebe188158cc465c709388abaa701fa0be7a9ea414 /source/blender/alembic/intern
parent5bdbc88ab81891eff0dafaabf7f58a9c865d6e48 (diff)
Alembic import: little fix for D2634
Now it doesn't crash any more when the Alembic curves object doesn't have any user properties.
Diffstat (limited to 'source/blender/alembic/intern')
-rw-r--r--source/blender/alembic/intern/abc_curves.cc15
1 files changed, 8 insertions, 7 deletions
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());