diff options
Diffstat (limited to 'source/blender/io')
46 files changed, 366 insertions, 10 deletions
diff --git a/source/blender/io/alembic/exporter/abc_export_capi.cc b/source/blender/io/alembic/exporter/abc_export_capi.cc index 3f8e95a6128..e330a2e4fdb 100644 --- a/source/blender/io/alembic/exporter/abc_export_capi.cc +++ b/source/blender/io/alembic/exporter/abc_export_capi.cc @@ -49,6 +49,8 @@ extern "C" { #include "WM_types.h" } +using namespace blender::io::alembic; + struct ExportJobData { ViewLayer *view_layer; Main *bmain; diff --git a/source/blender/io/alembic/exporter/abc_exporter.cc b/source/blender/io/alembic/exporter/abc_exporter.cc index 0de6c393e5a..a3f13e31300 100644 --- a/source/blender/io/alembic/exporter/abc_exporter.cc +++ b/source/blender/io/alembic/exporter/abc_exporter.cc @@ -67,6 +67,10 @@ using Alembic::Abc::TimeSamplingPtr; /* ************************************************************************** */ +namespace blender { +namespace io { +namespace alembic { + ExportSettings::ExportSettings() : scene(NULL), view_layer(NULL), @@ -671,3 +675,7 @@ void AbcExporter::setCurrentFrame(Main *bmain, double t) m_settings.scene->r.subframe = static_cast<float>(t) - m_settings.scene->r.cfra; BKE_scene_graph_update_for_newframe(m_settings.depsgraph, bmain); } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/exporter/abc_exporter.h b/source/blender/io/alembic/exporter/abc_exporter.h index c1c54cb2208..f3ca1710e33 100644 --- a/source/blender/io/alembic/exporter/abc_exporter.h +++ b/source/blender/io/alembic/exporter/abc_exporter.h @@ -28,10 +28,6 @@ #include "intern/abc_util.h" -class AbcObjectWriter; -class AbcTransformWriter; -class ArchiveWriter; - struct Base; struct Depsgraph; struct Main; @@ -39,6 +35,14 @@ struct Object; struct Scene; struct ViewLayer; +namespace blender { +namespace io { +namespace alembic { + +class AbcObjectWriter; +class AbcTransformWriter; +class ArchiveWriter; + struct ExportSettings { ExportSettings(); @@ -124,4 +128,8 @@ class AbcExporter { void setCurrentFrame(Main *bmain, double t); }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_EXPORTER_H__ */ diff --git a/source/blender/io/alembic/exporter/abc_writer_archive.cc b/source/blender/io/alembic/exporter/abc_writer_archive.cc index 40926532f85..741a3697b38 100644 --- a/source/blender/io/alembic/exporter/abc_writer_archive.cc +++ b/source/blender/io/alembic/exporter/abc_writer_archive.cc @@ -40,6 +40,10 @@ using Alembic::Abc::ErrorHandler; using Alembic::Abc::kWrapExisting; using Alembic::Abc::OArchive; +namespace blender { +namespace io { +namespace alembic { + /* This kinda duplicates CreateArchiveWithInfo, but Alembic does not seem to * have a version supporting streams. */ static OArchive create_archive(std::ostream *ostream, @@ -96,3 +100,7 @@ OArchive &ArchiveWriter::archive() { return m_archive; } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/exporter/abc_writer_archive.h b/source/blender/io/alembic/exporter/abc_writer_archive.h index 737717c1710..81dd387e720 100644 --- a/source/blender/io/alembic/exporter/abc_writer_archive.h +++ b/source/blender/io/alembic/exporter/abc_writer_archive.h @@ -32,6 +32,10 @@ struct Main; struct Scene; +namespace blender { +namespace io { +namespace alembic { + /* Wrappers around input and output archives. The goal is to be able to use * streams so that unicode paths work on Windows (T49112), and to make sure that * the stream objects remain valid as long as the archives are open. @@ -47,4 +51,8 @@ class ArchiveWriter { Alembic::Abc::OArchive &archive(); }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_WRITER_ARCHIVE_H__ */ diff --git a/source/blender/io/alembic/exporter/abc_writer_camera.cc b/source/blender/io/alembic/exporter/abc_writer_camera.cc index 07ae81e584f..ef6d1512a96 100644 --- a/source/blender/io/alembic/exporter/abc_writer_camera.cc +++ b/source/blender/io/alembic/exporter/abc_writer_camera.cc @@ -27,6 +27,10 @@ using Alembic::AbcGeom::OCamera; using Alembic::AbcGeom::OFloatProperty; +namespace blender { +namespace io { +namespace alembic { + AbcCameraWriter::AbcCameraWriter(Object *ob, AbcTransformWriter *parent, uint32_t time_sampling, @@ -77,3 +81,7 @@ void AbcCameraWriter::do_write() m_camera_sample.setLensSqueezeRatio(1.0); m_camera_schema.set(m_camera_sample); } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/exporter/abc_writer_camera.h b/source/blender/io/alembic/exporter/abc_writer_camera.h index 3b515911a48..44b80984411 100644 --- a/source/blender/io/alembic/exporter/abc_writer_camera.h +++ b/source/blender/io/alembic/exporter/abc_writer_camera.h @@ -25,6 +25,10 @@ /* ************************************************************************** */ +namespace blender { +namespace io { +namespace alembic { + class AbcCameraWriter : public AbcObjectWriter { Alembic::AbcGeom::OCameraSchema m_camera_schema; Alembic::AbcGeom::CameraSample m_camera_sample; @@ -42,4 +46,8 @@ class AbcCameraWriter : public AbcObjectWriter { virtual void do_write(); }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_WRITER_CAMERA_H__ */ diff --git a/source/blender/io/alembic/exporter/abc_writer_curves.cc b/source/blender/io/alembic/exporter/abc_writer_curves.cc index 3f9a53cffc6..7c2acb9e0c9 100644 --- a/source/blender/io/alembic/exporter/abc_writer_curves.cc +++ b/source/blender/io/alembic/exporter/abc_writer_curves.cc @@ -40,6 +40,10 @@ using Alembic::AbcGeom::OInt16Property; using Alembic::AbcGeom::ON3fGeomParam; using Alembic::AbcGeom::OV2fGeomParam; +namespace blender { +namespace io { +namespace alembic { + AbcCurveWriter::AbcCurveWriter(Object *ob, AbcTransformWriter *parent, uint32_t time_sampling, @@ -186,3 +190,7 @@ Mesh *AbcCurveMeshWriter::getEvaluatedMesh(Scene * /*scene_eval*/, r_needsfree = true; return BKE_mesh_new_nomain_from_curve(ob_eval); } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/exporter/abc_writer_curves.h b/source/blender/io/alembic/exporter/abc_writer_curves.h index 83f0289dd2d..35fb063c4a5 100644 --- a/source/blender/io/alembic/exporter/abc_writer_curves.h +++ b/source/blender/io/alembic/exporter/abc_writer_curves.h @@ -27,6 +27,10 @@ #include "abc_writer_mesh.h" #include "abc_writer_object.h" +namespace blender { +namespace io { +namespace alembic { + class AbcCurveWriter : public AbcObjectWriter { Alembic::AbcGeom::OCurvesSchema m_schema; Alembic::AbcGeom::OCurvesSchema::Sample m_sample; @@ -52,4 +56,8 @@ class AbcCurveMeshWriter : public AbcGenericMeshWriter { Mesh *getEvaluatedMesh(Scene *scene_eval, Object *ob_eval, bool &r_needsfree); }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_WRITER_CURVES_H__ */ diff --git a/source/blender/io/alembic/exporter/abc_writer_hair.cc b/source/blender/io/alembic/exporter/abc_writer_hair.cc index ceb2eb7d316..304aa7a5ff8 100644 --- a/source/blender/io/alembic/exporter/abc_writer_hair.cc +++ b/source/blender/io/alembic/exporter/abc_writer_hair.cc @@ -44,6 +44,10 @@ using Alembic::AbcGeom::OV2fGeomParam; /* ************************************************************************** */ +namespace blender { +namespace io { +namespace alembic { + AbcHairWriter::AbcHairWriter(Object *ob, AbcTransformWriter *parent, uint32_t time_sampling, @@ -289,3 +293,7 @@ void AbcHairWriter::write_hair_child_sample(Mesh *mesh, } } } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/exporter/abc_writer_hair.h b/source/blender/io/alembic/exporter/abc_writer_hair.h index 67d1b7b3d23..b6860926d44 100644 --- a/source/blender/io/alembic/exporter/abc_writer_hair.h +++ b/source/blender/io/alembic/exporter/abc_writer_hair.h @@ -23,9 +23,14 @@ #include "abc_writer_object.h" +struct Mesh; struct ParticleSettings; struct ParticleSystem; +namespace blender { +namespace io { +namespace alembic { + class AbcHairWriter : public AbcObjectWriter { ParticleSystem *m_psys; @@ -59,4 +64,8 @@ class AbcHairWriter : public AbcObjectWriter { std::vector<int32_t> &hvertices); }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_WRITER_HAIR_H__ */ diff --git a/source/blender/io/alembic/exporter/abc_writer_mball.cc b/source/blender/io/alembic/exporter/abc_writer_mball.cc index 3593acf18b0..8ae3bb64390 100644 --- a/source/blender/io/alembic/exporter/abc_writer_mball.cc +++ b/source/blender/io/alembic/exporter/abc_writer_mball.cc @@ -33,6 +33,10 @@ #include "BLI_utildefines.h" +namespace blender { +namespace io { +namespace alembic { + AbcMBallWriter::AbcMBallWriter(Main *bmain, Object *ob, AbcTransformWriter *parent, @@ -93,3 +97,7 @@ bool AbcMBallWriter::isBasisBall(Scene *scene, Object *ob) Object *basis_ob = BKE_mball_basis_find(scene, ob); return ob == basis_ob; } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/exporter/abc_writer_mball.h b/source/blender/io/alembic/exporter/abc_writer_mball.h index e3ac1e69cae..f527b2b02a0 100644 --- a/source/blender/io/alembic/exporter/abc_writer_mball.h +++ b/source/blender/io/alembic/exporter/abc_writer_mball.h @@ -27,6 +27,10 @@ struct Main; struct Object; +namespace blender { +namespace io { +namespace alembic { + /* AbcMBallWriter converts the metaballs to meshes at every frame, * and defers to AbcGenericMeshWriter to perform the writing * to the Alembic file. Only the basis balls are exported, as this @@ -53,4 +57,8 @@ class AbcMBallWriter : public AbcGenericMeshWriter { bool isAnimated() const override; }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_WRITER_MBALL_H__ */ diff --git a/source/blender/io/alembic/exporter/abc_writer_mesh.cc b/source/blender/io/alembic/exporter/abc_writer_mesh.cc index b17e123b426..512768bcd98 100644 --- a/source/blender/io/alembic/exporter/abc_writer_mesh.cc +++ b/source/blender/io/alembic/exporter/abc_writer_mesh.cc @@ -58,6 +58,10 @@ using Alembic::AbcGeom::OSubDSchema; using Alembic::AbcGeom::OV2fGeomParam; using Alembic::AbcGeom::UInt32ArraySample; +namespace blender { +namespace io { +namespace alembic { + /* NOTE: Alembic's polygon winding order is clockwise, to match with Renderman. */ static void get_vertices(struct Mesh *mesh, std::vector<Imath::V3f> &points) @@ -589,3 +593,7 @@ Mesh *AbcMeshWriter::getEvaluatedMesh(Scene *scene_eval, { return mesh_get_eval_final(m_settings.depsgraph, scene_eval, ob_eval, &CD_MASK_MESH); } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/exporter/abc_writer_mesh.h b/source/blender/io/alembic/exporter/abc_writer_mesh.h index 264696333a3..e4095758ba9 100644 --- a/source/blender/io/alembic/exporter/abc_writer_mesh.h +++ b/source/blender/io/alembic/exporter/abc_writer_mesh.h @@ -27,6 +27,10 @@ struct Mesh; struct ModifierData; +namespace blender { +namespace io { +namespace alembic { + /* Writer for Alembic meshes. Does not assume the object is a mesh object. */ class AbcGenericMeshWriter : public AbcObjectWriter { protected: @@ -88,4 +92,8 @@ class AbcMeshWriter : public AbcGenericMeshWriter { virtual Mesh *getEvaluatedMesh(Scene *scene_eval, Object *ob_eval, bool &r_needsfree) override; }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_WRITER_MESH_H__ */ diff --git a/source/blender/io/alembic/exporter/abc_writer_nurbs.cc b/source/blender/io/alembic/exporter/abc_writer_nurbs.cc index c856f894f0e..fa37c1eac59 100644 --- a/source/blender/io/alembic/exporter/abc_writer_nurbs.cc +++ b/source/blender/io/alembic/exporter/abc_writer_nurbs.cc @@ -35,6 +35,10 @@ using Alembic::AbcGeom::OCompoundProperty; using Alembic::AbcGeom::ONuPatch; using Alembic::AbcGeom::ONuPatchSchema; +namespace blender { +namespace io { +namespace alembic { + AbcNurbsWriter::AbcNurbsWriter(Object *ob, AbcTransformWriter *parent, uint32_t time_sampling, @@ -168,3 +172,7 @@ void AbcNurbsWriter::do_write() m_nurbs_schema[count].set(sample); } } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/exporter/abc_writer_nurbs.h b/source/blender/io/alembic/exporter/abc_writer_nurbs.h index c6a3c399b66..006024c4d2f 100644 --- a/source/blender/io/alembic/exporter/abc_writer_nurbs.h +++ b/source/blender/io/alembic/exporter/abc_writer_nurbs.h @@ -23,6 +23,10 @@ #include "abc_writer_object.h" +namespace blender { +namespace io { +namespace alembic { + class AbcNurbsWriter : public AbcObjectWriter { std::vector<Alembic::AbcGeom::ONuPatchSchema> m_nurbs_schema; bool m_is_animated; @@ -39,4 +43,8 @@ class AbcNurbsWriter : public AbcObjectWriter { bool isAnimated() const; }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_WRITER_NURBS_H__ */ diff --git a/source/blender/io/alembic/exporter/abc_writer_object.cc b/source/blender/io/alembic/exporter/abc_writer_object.cc index 3d280d9f0a4..97cac3a1af9 100644 --- a/source/blender/io/alembic/exporter/abc_writer_object.cc +++ b/source/blender/io/alembic/exporter/abc_writer_object.cc @@ -24,6 +24,10 @@ #include "BKE_object.h" +namespace blender { +namespace io { +namespace alembic { + AbcObjectWriter::AbcObjectWriter(Object *ob, uint32_t time_sampling, ExportSettings &settings, @@ -85,3 +89,7 @@ void AbcObjectWriter::write() do_write(); m_first_frame = false; } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/exporter/abc_writer_object.h b/source/blender/io/alembic/exporter/abc_writer_object.h index 830c4aee903..0496c6a3624 100644 --- a/source/blender/io/alembic/exporter/abc_writer_object.h +++ b/source/blender/io/alembic/exporter/abc_writer_object.h @@ -28,11 +28,15 @@ #include "DNA_ID.h" -class AbcTransformWriter; - struct Main; struct Object; +namespace blender { +namespace io { +namespace alembic { + +class AbcTransformWriter; + class AbcObjectWriter { protected: Object *m_object; @@ -66,4 +70,8 @@ class AbcObjectWriter { virtual void do_write() = 0; }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_WRITER_OBJECT_H__ */ diff --git a/source/blender/io/alembic/exporter/abc_writer_points.cc b/source/blender/io/alembic/exporter/abc_writer_points.cc index 27f51586f47..4d7f5d11c36 100644 --- a/source/blender/io/alembic/exporter/abc_writer_points.cc +++ b/source/blender/io/alembic/exporter/abc_writer_points.cc @@ -42,6 +42,10 @@ using Alembic::AbcGeom::OPointsSchema; /* ************************************************************************** */ +namespace blender { +namespace io { +namespace alembic { + AbcPointsWriter::AbcPointsWriter(Object *ob, AbcTransformWriter *parent, uint32_t time_sampling, @@ -120,3 +124,7 @@ void AbcPointsWriter::do_write() m_schema.set(m_sample); } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/exporter/abc_writer_points.h b/source/blender/io/alembic/exporter/abc_writer_points.h index e5c1b81f266..5763808d6a7 100644 --- a/source/blender/io/alembic/exporter/abc_writer_points.h +++ b/source/blender/io/alembic/exporter/abc_writer_points.h @@ -31,6 +31,10 @@ struct ParticleSystem; /* ************************************************************************** */ +namespace blender { +namespace io { +namespace alembic { + class AbcPointsWriter : public AbcObjectWriter { Alembic::AbcGeom::OPointsSchema m_schema; Alembic::AbcGeom::OPointsSchema::Sample m_sample; @@ -46,4 +50,8 @@ class AbcPointsWriter : public AbcObjectWriter { void do_write(); }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_WRITER_POINTS_H__ */ diff --git a/source/blender/io/alembic/exporter/abc_writer_transform.cc b/source/blender/io/alembic/exporter/abc_writer_transform.cc index 46130cb8675..fa808c1b75b 100644 --- a/source/blender/io/alembic/exporter/abc_writer_transform.cc +++ b/source/blender/io/alembic/exporter/abc_writer_transform.cc @@ -32,6 +32,10 @@ using Alembic::AbcGeom::OObject; using Alembic::AbcGeom::OXform; +namespace blender { +namespace io { +namespace alembic { + AbcTransformWriter::AbcTransformWriter(Object *ob, const OObject &abc_parent, AbcTransformWriter *parent, @@ -122,3 +126,7 @@ bool AbcTransformWriter::hasAnimation(Object * /*ob*/) const { return true; } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/exporter/abc_writer_transform.h b/source/blender/io/alembic/exporter/abc_writer_transform.h index 4397b220761..af50929a963 100644 --- a/source/blender/io/alembic/exporter/abc_writer_transform.h +++ b/source/blender/io/alembic/exporter/abc_writer_transform.h @@ -25,6 +25,10 @@ #include <Alembic/AbcGeom/All.h> +namespace blender { +namespace io { +namespace alembic { + class AbcTransformWriter : public AbcObjectWriter { Alembic::AbcGeom::OXform m_xform; Alembic::AbcGeom::OXformSchema m_schema; @@ -57,4 +61,8 @@ class AbcTransformWriter : public AbcObjectWriter { bool hasAnimation(Object *ob) const; }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_WRITER_TRANSFORM_H__ */ diff --git a/source/blender/io/alembic/intern/abc_axis_conversion.cc b/source/blender/io/alembic/intern/abc_axis_conversion.cc index 17db5e9c99f..a74432a3540 100644 --- a/source/blender/io/alembic/intern/abc_axis_conversion.cc +++ b/source/blender/io/alembic/intern/abc_axis_conversion.cc @@ -27,6 +27,10 @@ extern "C" { #include "BLI_math_geom.h" } +namespace blender { +namespace io { +namespace alembic { + void create_swapped_rotation_matrix(float rot_x_mat[3][3], float rot_y_mat[3][3], float rot_z_mat[3][3], @@ -72,7 +76,8 @@ void create_swapped_rotation_matrix(float rot_x_mat[3][3], rot_z_mat[1][0] = -sin(rz); rot_z_mat[0][1] = sin(rz); rot_z_mat[1][1] = cos(rz); -} +} // namespace + // alembicvoidcreate_swapped_rotation_matrix(floatrot_x_mat[3][3],floatrot_y_mat[3][3],floatrot_z_mat[3][3],constfloateuler[3],AbcAxisSwapModemode) /* Convert matrix from Z=up to Y=up or vice versa. * Use yup_mat = zup_mat for in-place conversion. */ @@ -164,3 +169,7 @@ void create_transform_matrix(Object *obj, copy_m44_axis_swap(r_yup_mat, zup_mat, ABC_YUP_FROM_ZUP); } + +} // namespace alembic +} // namespace io +} // namespace blender
\ No newline at end of file diff --git a/source/blender/io/alembic/intern/abc_axis_conversion.h b/source/blender/io/alembic/intern/abc_axis_conversion.h index 7fde0e92ea4..734c5ca01c9 100644 --- a/source/blender/io/alembic/intern/abc_axis_conversion.h +++ b/source/blender/io/alembic/intern/abc_axis_conversion.h @@ -30,6 +30,10 @@ struct Object; # define ABC_INLINE static inline #endif +namespace blender { +namespace io { +namespace alembic { + /* TODO(kevin): for now keeping these transformations hardcoded to make sure * everything works properly, and also because Alembic is almost exclusively * used in Y-up software, but eventually they'll be set by the user in the UI @@ -97,3 +101,7 @@ void create_transform_matrix(Object *obj, float r_transform_mat[4][4], AbcMatrixMode mode, Object *proxy_from); + +} // namespace alembic +} // namespace io +} // namespace blender
\ No newline at end of file diff --git a/source/blender/io/alembic/intern/abc_customdata.cc b/source/blender/io/alembic/intern/abc_customdata.cc index 62f6a52f7cf..f3e2342e844 100644 --- a/source/blender/io/alembic/intern/abc_customdata.cc +++ b/source/blender/io/alembic/intern/abc_customdata.cc @@ -50,6 +50,9 @@ using Alembic::Abc::V2fArraySample; using Alembic::AbcGeom::OC4fGeomParam; using Alembic::AbcGeom::OV2fGeomParam; +namespace blender { +namespace io { +namespace alembic { static void get_uvs(const CDStreamConfig &config, std::vector<Imath::V2f> &uvs, @@ -485,3 +488,7 @@ void read_custom_data(const std::string &iobject_full_name, } } } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/intern/abc_customdata.h b/source/blender/io/alembic/intern/abc_customdata.h index 96b57b08681..a5f480d48c3 100644 --- a/source/blender/io/alembic/intern/abc_customdata.h +++ b/source/blender/io/alembic/intern/abc_customdata.h @@ -38,6 +38,9 @@ struct Mesh; using Alembic::Abc::ICompoundProperty; using Alembic::Abc::OCompoundProperty; +namespace blender { +namespace io { +namespace alembic { struct UVSample { std::vector<Imath::V2f> uvs; @@ -112,4 +115,8 @@ void read_custom_data(const std::string &iobject_full_name, const CDStreamConfig &config, const Alembic::Abc::ISampleSelector &iss); +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_CUSTOMDATA_H__ */ diff --git a/source/blender/io/alembic/intern/abc_reader_archive.cc b/source/blender/io/alembic/intern/abc_reader_archive.cc index d55736f732a..d7f1095f0fd 100644 --- a/source/blender/io/alembic/intern/abc_reader_archive.cc +++ b/source/blender/io/alembic/intern/abc_reader_archive.cc @@ -39,6 +39,10 @@ using Alembic::Abc::Exception; using Alembic::Abc::IArchive; using Alembic::Abc::kWrapExisting; +namespace blender { +namespace io { +namespace alembic { + static IArchive open_archive(const std::string &filename, const std::vector<std::istream *> &input_streams) { @@ -103,3 +107,7 @@ Alembic::Abc::IObject ArchiveReader::getTop() { return m_archive.getTop(); } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/intern/abc_reader_archive.h b/source/blender/io/alembic/intern/abc_reader_archive.h index 304c876adce..6f3478aa14e 100644 --- a/source/blender/io/alembic/intern/abc_reader_archive.h +++ b/source/blender/io/alembic/intern/abc_reader_archive.h @@ -32,6 +32,10 @@ struct Main; struct Scene; +namespace blender { +namespace io { +namespace alembic { + /* Wrappers around input and output archives. The goal is to be able to use * streams so that unicode paths work on Windows (T49112), and to make sure that * the stream objects remain valid as long as the archives are open. @@ -50,4 +54,8 @@ class ArchiveReader { Alembic::Abc::IObject getTop(); }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_READER_ARCHIVE_H__ */ diff --git a/source/blender/io/alembic/intern/abc_reader_camera.cc b/source/blender/io/alembic/intern/abc_reader_camera.cc index 0752534f8c2..3affb35908d 100644 --- a/source/blender/io/alembic/intern/abc_reader_camera.cc +++ b/source/blender/io/alembic/intern/abc_reader_camera.cc @@ -37,6 +37,10 @@ using Alembic::AbcGeom::IFloatProperty; using Alembic::AbcGeom::ISampleSelector; using Alembic::AbcGeom::kWrapExisting; +namespace blender { +namespace io { +namespace alembic { + AbcCameraReader::AbcCameraReader(const Alembic::Abc::IObject &object, ImportSettings &settings) : AbcObjectReader(object, settings) { @@ -109,3 +113,7 @@ void AbcCameraReader::readObjectData(Main *bmain, const ISampleSelector &sample_ m_object = BKE_object_add_only_object(bmain, OB_CAMERA, m_object_name.c_str()); m_object->data = bcam; } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/intern/abc_reader_camera.h b/source/blender/io/alembic/intern/abc_reader_camera.h index 1d9763b0454..3aa905e36c4 100644 --- a/source/blender/io/alembic/intern/abc_reader_camera.h +++ b/source/blender/io/alembic/intern/abc_reader_camera.h @@ -23,6 +23,10 @@ #include "abc_reader_object.h" +namespace blender { +namespace io { +namespace alembic { + class AbcCameraReader : public AbcObjectReader { Alembic::AbcGeom::ICameraSchema m_schema; @@ -37,4 +41,8 @@ class AbcCameraReader : public AbcObjectReader { void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel); }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_READER_CAMERA_H__ */ diff --git a/source/blender/io/alembic/intern/abc_reader_curves.cc b/source/blender/io/alembic/intern/abc_reader_curves.cc index d5e0b694294..a505dfd654b 100644 --- a/source/blender/io/alembic/intern/abc_reader_curves.cc +++ b/source/blender/io/alembic/intern/abc_reader_curves.cc @@ -54,6 +54,10 @@ using Alembic::AbcGeom::IInt16Property; using Alembic::AbcGeom::ISampleSelector; using Alembic::AbcGeom::kWrapExisting; +namespace blender { +namespace io { +namespace alembic { + AbcCurveReader::AbcCurveReader(const Alembic::Abc::IObject &object, ImportSettings &settings) : AbcObjectReader(object, settings) { @@ -351,3 +355,7 @@ Mesh *AbcCurveReader::read_mesh(Mesh *existing_mesh, return BKE_mesh_new_nomain_from_curve(m_object); } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/intern/abc_reader_curves.h b/source/blender/io/alembic/intern/abc_reader_curves.h index eb0538308f8..bef5bec2e74 100644 --- a/source/blender/io/alembic/intern/abc_reader_curves.h +++ b/source/blender/io/alembic/intern/abc_reader_curves.h @@ -31,6 +31,10 @@ struct Curve; #define ABC_CURVE_RESOLUTION_U_PROPNAME "blender:resolution" +namespace blender { +namespace io { +namespace alembic { + class AbcCurveReader : public AbcObjectReader { Alembic::AbcGeom::ICurvesSchema m_curves_schema; @@ -53,4 +57,8 @@ class AbcCurveReader : public AbcObjectReader { const Alembic::Abc::ISampleSelector &sample_selector); }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_READER_CURVES_H__ */ diff --git a/source/blender/io/alembic/intern/abc_reader_mesh.cc b/source/blender/io/alembic/intern/abc_reader_mesh.cc index 8b79a3a0aa0..a37ac84bdfb 100644 --- a/source/blender/io/alembic/intern/abc_reader_mesh.cc +++ b/source/blender/io/alembic/intern/abc_reader_mesh.cc @@ -59,6 +59,10 @@ using Alembic::AbcGeom::N3fArraySamplePtr; using Alembic::AbcGeom::UInt32ArraySamplePtr; using Alembic::AbcGeom::V2fArraySamplePtr; +namespace blender { +namespace io { +namespace alembic { + /* NOTE: Alembic's polygon winding order is clockwise, to match with Renderman. */ /* Some helpers for mesh generation */ @@ -930,3 +934,7 @@ Mesh *AbcSubDReader::read_mesh(Mesh *existing_mesh, return config.mesh; } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/intern/abc_reader_mesh.h b/source/blender/io/alembic/intern/abc_reader_mesh.h index bc95c7ec134..6acfc057151 100644 --- a/source/blender/io/alembic/intern/abc_reader_mesh.h +++ b/source/blender/io/alembic/intern/abc_reader_mesh.h @@ -26,6 +26,10 @@ struct Mesh; +namespace blender { +namespace io { +namespace alembic { + class AbcMeshReader : public AbcObjectReader { Alembic::AbcGeom::IPolyMeshSchema m_schema; @@ -83,4 +87,8 @@ void read_mverts(MVert *mverts, CDStreamConfig get_config(struct Mesh *mesh); +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_READER_MESH_H__ */ diff --git a/source/blender/io/alembic/intern/abc_reader_nurbs.cc b/source/blender/io/alembic/intern/abc_reader_nurbs.cc index 5b9954b3ff6..3ca3f6229ab 100644 --- a/source/blender/io/alembic/intern/abc_reader_nurbs.cc +++ b/source/blender/io/alembic/intern/abc_reader_nurbs.cc @@ -44,6 +44,10 @@ using Alembic::AbcGeom::INuPatch; using Alembic::AbcGeom::INuPatchSchema; using Alembic::AbcGeom::IObject; +namespace blender { +namespace io { +namespace alembic { + AbcNurbsReader::AbcNurbsReader(const IObject &object, ImportSettings &settings) : AbcObjectReader(object, settings) { @@ -222,3 +226,7 @@ void AbcNurbsReader::getNurbsPatches(const IObject &obj) getNurbsPatches(child); } } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/intern/abc_reader_nurbs.h b/source/blender/io/alembic/intern/abc_reader_nurbs.h index f4284c136fb..49840e49bec 100644 --- a/source/blender/io/alembic/intern/abc_reader_nurbs.h +++ b/source/blender/io/alembic/intern/abc_reader_nurbs.h @@ -23,6 +23,10 @@ #include "abc_reader_object.h" +namespace blender { +namespace io { +namespace alembic { + class AbcNurbsReader : public AbcObjectReader { std::vector<std::pair<Alembic::AbcGeom::INuPatchSchema, Alembic::Abc::IObject>> m_schemas; @@ -37,4 +41,8 @@ class AbcNurbsReader : public AbcObjectReader { void getNurbsPatches(const Alembic::Abc::IObject &obj); }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_READER_NURBS_H__ */ diff --git a/source/blender/io/alembic/intern/abc_reader_object.cc b/source/blender/io/alembic/intern/abc_reader_object.cc index e5bd0771a42..39b9cd4c161 100644 --- a/source/blender/io/alembic/intern/abc_reader_object.cc +++ b/source/blender/io/alembic/intern/abc_reader_object.cc @@ -41,6 +41,10 @@ using Alembic::AbcGeom::IObject; using Alembic::AbcGeom::IXform; using Alembic::AbcGeom::IXformSchema; +namespace blender { +namespace io { +namespace alembic { + AbcObjectReader::AbcObjectReader(const IObject &object, ImportSettings &settings) : m_name(""), m_object_name(""), @@ -330,3 +334,7 @@ void AbcObjectReader::decref() m_refcount--; BLI_assert(m_refcount >= 0); } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/intern/abc_reader_object.h b/source/blender/io/alembic/intern/abc_reader_object.h index dcc2697e0b5..d8e0e57f2f9 100644 --- a/source/blender/io/alembic/intern/abc_reader_object.h +++ b/source/blender/io/alembic/intern/abc_reader_object.h @@ -33,6 +33,10 @@ struct Object; using Alembic::AbcCoreAbstract::chrono_t; +namespace blender { +namespace io { +namespace alembic { + struct ImportSettings { bool do_convert_mat; float conversion_mat[4][4]; @@ -166,4 +170,8 @@ class AbcObjectReader { Imath::M44d get_matrix(const Alembic::AbcGeom::IXformSchema &schema, const float time); +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_READER_OBJECT_H__ */ diff --git a/source/blender/io/alembic/intern/abc_reader_points.cc b/source/blender/io/alembic/intern/abc_reader_points.cc index c5d08693176..b805da4daa3 100644 --- a/source/blender/io/alembic/intern/abc_reader_points.cc +++ b/source/blender/io/alembic/intern/abc_reader_points.cc @@ -43,6 +43,10 @@ using Alembic::AbcGeom::IPoints; using Alembic::AbcGeom::IPointsSchema; using Alembic::AbcGeom::ISampleSelector; +namespace blender { +namespace io { +namespace alembic { + AbcPointsReader::AbcPointsReader(const Alembic::Abc::IObject &object, ImportSettings &settings) : AbcObjectReader(object, settings) { @@ -153,3 +157,7 @@ struct Mesh *AbcPointsReader::read_mesh(struct Mesh *existing_mesh, return new_mesh ? new_mesh : existing_mesh; } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/intern/abc_reader_points.h b/source/blender/io/alembic/intern/abc_reader_points.h index 99881e091f9..91ddcf31de1 100644 --- a/source/blender/io/alembic/intern/abc_reader_points.h +++ b/source/blender/io/alembic/intern/abc_reader_points.h @@ -27,6 +27,10 @@ #include "abc_customdata.h" #include "abc_reader_object.h" +namespace blender { +namespace io { +namespace alembic { + class AbcPointsReader : public AbcObjectReader { Alembic::AbcGeom::IPointsSchema m_schema; Alembic::AbcGeom::IPointsSchema::Sample m_sample; @@ -51,4 +55,8 @@ void read_points_sample(const Alembic::AbcGeom::IPointsSchema &schema, const Alembic::AbcGeom::ISampleSelector &selector, CDStreamConfig &config); +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_READER_POINTS_H__ */ diff --git a/source/blender/io/alembic/intern/abc_reader_transform.cc b/source/blender/io/alembic/intern/abc_reader_transform.cc index 3df391f8432..456d1da2c68 100644 --- a/source/blender/io/alembic/intern/abc_reader_transform.cc +++ b/source/blender/io/alembic/intern/abc_reader_transform.cc @@ -29,6 +29,10 @@ using Alembic::Abc::ISampleSelector; +namespace blender { +namespace io { +namespace alembic { + AbcEmptyReader::AbcEmptyReader(const Alembic::Abc::IObject &object, ImportSettings &settings) : AbcObjectReader(object, settings) { @@ -72,3 +76,7 @@ void AbcEmptyReader::readObjectData(Main *bmain, const ISampleSelector &UNUSED(s m_object = BKE_object_add_only_object(bmain, OB_EMPTY, m_object_name.c_str()); m_object->data = NULL; } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/intern/abc_reader_transform.h b/source/blender/io/alembic/intern/abc_reader_transform.h index 6b4d23c1884..57e1f9b2334 100644 --- a/source/blender/io/alembic/intern/abc_reader_transform.h +++ b/source/blender/io/alembic/intern/abc_reader_transform.h @@ -25,6 +25,10 @@ #include <Alembic/AbcGeom/All.h> +namespace blender { +namespace io { +namespace alembic { + class AbcEmptyReader : public AbcObjectReader { Alembic::AbcGeom::IXformSchema m_schema; @@ -39,4 +43,8 @@ class AbcEmptyReader : public AbcObjectReader { void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel); }; +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_READER_TRANSFORM_H__ */ diff --git a/source/blender/io/alembic/intern/abc_util.cc b/source/blender/io/alembic/intern/abc_util.cc index 92f4b9532a1..04febd7bfcb 100644 --- a/source/blender/io/alembic/intern/abc_util.cc +++ b/source/blender/io/alembic/intern/abc_util.cc @@ -38,6 +38,10 @@ #include "PIL_time.h" +namespace blender { +namespace io { +namespace alembic { + std::string get_id_name(const Object *const ob) { if (!ob) { @@ -256,3 +260,7 @@ std::ostream &operator<<(std::ostream &os, const SimpleLogger &logger) os << logger.str(); return os; } + +} // namespace alembic +} // namespace io +} // namespace blender diff --git a/source/blender/io/alembic/intern/abc_util.h b/source/blender/io/alembic/intern/abc_util.h index 8a5763bb38b..fbad1cce306 100644 --- a/source/blender/io/alembic/intern/abc_util.h +++ b/source/blender/io/alembic/intern/abc_util.h @@ -41,12 +41,16 @@ struct CacheReader { using Alembic::Abc::chrono_t; -class AbcObjectReader; -struct ImportSettings; - struct ID; struct Object; +namespace blender { +namespace io { +namespace alembic { + +class AbcObjectReader; +struct ImportSettings; + std::string get_id_name(const ID *const id); std::string get_id_name(const Object *const ob); std::string get_valid_abc_name(const char *name); @@ -165,4 +169,8 @@ class SimpleLogger { */ std::ostream &operator<<(std::ostream &os, const SimpleLogger &logger); +} // namespace alembic +} // namespace io +} // namespace blender + #endif /* __ABC_UTIL_H__ */ diff --git a/source/blender/io/alembic/intern/alembic_capi.cc b/source/blender/io/alembic/intern/alembic_capi.cc index e70f19fdbd8..40dd690301e 100644 --- a/source/blender/io/alembic/intern/alembic_capi.cc +++ b/source/blender/io/alembic/intern/alembic_capi.cc @@ -99,6 +99,8 @@ using Alembic::AbcGeom::XformSample; using Alembic::AbcMaterial::IMaterial; +using namespace blender::io::alembic; + struct AbcArchiveHandle { int unused; }; |