37 using Alembic::AbcGeom::OCompoundProperty;
38 using Alembic::AbcGeom::OCurves;
39 using Alembic::AbcGeom::OCurvesSchema;
40 using Alembic::AbcGeom::OInt16Property;
41 using Alembic::AbcGeom::ON3fGeomParam;
42 using Alembic::AbcGeom::OV2fGeomParam;
56 abc_curve_schema_ = abc_curve_.getSchema();
59 OCompoundProperty user_props = abc_curve_schema_.getUserProperties();
61 user_prop_resolu.set(cu->
resolu);
78 std::vector<Imath::V3f>
verts;
79 std::vector<int32_t> vert_counts;
80 std::vector<float> widths;
81 std::vector<float> weights;
82 std::vector<float> knots;
83 std::vector<uint8_t> orders;
86 Alembic::AbcGeom::BasisType curve_basis = Alembic::AbcGeom::kNoBasis;
87 Alembic::AbcGeom::CurveType curve_type = Alembic::AbcGeom::kVariableOrder;
88 Alembic::AbcGeom::CurvePeriodicity periodicity = Alembic::AbcGeom::kNonPeriodic;
91 for (; nurbs; nurbs = nurbs->
next) {
93 curve_basis = Alembic::AbcGeom::kNoBasis;
94 curve_type = Alembic::AbcGeom::kVariableOrder;
96 const int totpoint = nurbs->
pntsu * nurbs->
pntsv;
100 for (
int i = 0; i < totpoint; i++, point++) {
102 verts.push_back(temp_vert);
103 weights.push_back(point->
vec[3]);
104 widths.push_back(point->
radius);
107 else if (nurbs->
bezt) {
108 curve_basis = Alembic::AbcGeom::kBezierBasis;
109 curve_type = Alembic::AbcGeom::kCubic;
111 const int totpoint = nurbs->
pntsu;
116 for (
int i = 0; i < totpoint; i++, bezier++) {
118 verts.push_back(temp_vert);
119 widths.push_back(bezier->
radius);
124 periodicity = Alembic::AbcGeom::kNonPeriodic;
127 periodicity = Alembic::AbcGeom::kPeriodic;
133 for (
int i = 0; i < nurbs->
orderu; i++) {
138 if (nurbs->
knotsu !=
nullptr) {
139 const size_t num_knots =
KNOTSU(nurbs);
143 knots.resize(num_knots + 2);
145 for (
int i = 0; i < num_knots; i++) {
146 knots[i + 1] = nurbs->
knotsu[i];
150 knots[0] = nurbs->
knotsu[0];
151 knots[num_knots - 1] = nurbs->
knotsu[num_knots - 1];
154 knots[0] = (2.0f * nurbs->
knotsu[0] - nurbs->
knotsu[1]);
155 knots[num_knots - 1] = (2.0f * nurbs->
knotsu[num_knots - 1] -
156 nurbs->
knotsu[num_knots - 2]);
160 orders.push_back(nurbs->
orderu);
161 vert_counts.push_back(
verts.size());
164 Alembic::AbcGeom::OFloatGeomParam::Sample width_sample;
165 width_sample.setVals(widths);
172 OV2fGeomParam::Sample(),
173 ON3fGeomParam::Sample(),
181 abc_curve_schema_.set(
sample);
192 if (mesh_eval !=
nullptr) {
struct Mesh * BKE_mesh_new_nomain_from_curve(struct Object *ob)
General operations, lookup, etc. for blender objects.
struct Mesh * BKE_object_get_evaluated_mesh(struct Object *object)
#define CLOG_INFO(clg_ref, level,...)
Object is a sort of wrapper for general info.
Alembic::Abc::OCompoundProperty abc_schema_prop_for_custom_props(T abc_schema)
uint32_t timesample_index_
Imath::Box3d bounding_box_
const ABCWriterConstructorArgs args_
virtual void update_bounding_box(Object *object)
virtual Mesh * get_export_mesh(Object *object_eval, bool &r_needsfree) override
ABCCurveMeshWriter(const ABCWriterConstructorArgs &args)
virtual Alembic::Abc::OObject get_alembic_object() const override
ABCCurveWriter(const ABCWriterConstructorArgs &args)
virtual void create_alembic_objects(const HierarchyContext *context) override
virtual void do_write(HierarchyContext &context) override
Alembic::Abc::OCompoundProperty abc_prop_for_custom_props() override
static void sample(SocketReader *reader, int x, int y, float color[4])
BLI_INLINE void copy_yup_from_zup(float yup[3], const float zup[3])
const std::string ABC_CURVE_RESOLUTION_U_PROPNAME
struct SELECTID_Context context
Alembic::Abc::OObject abc_parent