Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/alembic/intern/abc_reader_curves.cc
| Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| if (!Alembic::AbcGeom::ICurves::matches(alembic_header)) { | if (!Alembic::AbcGeom::ICurves::matches(alembic_header)) { | ||||
| *err_str = | *err_str = | ||||
| "Object type mismatch, Alembic object path pointed to Curves when importing, but not any " | "Object type mismatch, Alembic object path pointed to Curves when importing, but not any " | ||||
| "more."; | "more."; | ||||
| return false; | return false; | ||||
| } | } | ||||
| if (ob->type != OB_CURVE) { | if (ob->type != OB_CURVES_LEGACY) { | ||||
| *err_str = "Object type mismatch, Alembic object path points to Curves."; | *err_str = "Object type mismatch, Alembic object path points to Curves."; | ||||
| return false; | return false; | ||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| void AbcCurveReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) | void AbcCurveReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) | ||||
| { | { | ||||
| Curve *cu = BKE_curve_add(bmain, m_data_name.c_str(), OB_CURVE); | Curve *cu = BKE_curve_add(bmain, m_data_name.c_str(), OB_CURVES_LEGACY); | ||||
| cu->flag |= CU_3D; | cu->flag |= CU_3D; | ||||
| cu->actvert = CU_ACT_NONE; | cu->actvert = CU_ACT_NONE; | ||||
| cu->resolu = 1; | cu->resolu = 1; | ||||
| ICompoundProperty user_props = m_curves_schema.getUserProperties(); | ICompoundProperty user_props = m_curves_schema.getUserProperties(); | ||||
| if (user_props) { | if (user_props) { | ||||
| const PropertyHeader *header = user_props.getPropertyHeader(ABC_CURVE_RESOLUTION_U_PROPNAME); | const PropertyHeader *header = user_props.getPropertyHeader(ABC_CURVE_RESOLUTION_U_PROPNAME); | ||||
| if (header != nullptr && header->isScalar() && IInt16Property::matches(*header)) { | if (header != nullptr && header->isScalar() && IInt16Property::matches(*header)) { | ||||
| IInt16Property resolu(user_props, header->getName()); | IInt16Property resolu(user_props, header->getName()); | ||||
| cu->resolu = resolu.getValue(sample_sel); | cu->resolu = resolu.getValue(sample_sel); | ||||
| } | } | ||||
| } | } | ||||
| m_object = BKE_object_add_only_object(bmain, OB_CURVE, m_object_name.c_str()); | m_object = BKE_object_add_only_object(bmain, OB_CURVES_LEGACY, m_object_name.c_str()); | ||||
| m_object->data = cu; | m_object->data = cu; | ||||
| read_curve_sample(cu, m_curves_schema, sample_sel); | read_curve_sample(cu, m_curves_schema, sample_sel); | ||||
| if (m_settings->always_add_cache_reader || has_animations(m_curves_schema, m_settings)) { | if (m_settings->always_add_cache_reader || has_animations(m_curves_schema, m_settings)) { | ||||
| addCacheModifier(); | addCacheModifier(); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||