diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-10-29 17:27:44 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-10-29 17:38:55 +0300 |
commit | 405980b1facff4a76e3661a412eab1d072d0236f (patch) | |
tree | 5ae5b79ac5bb91c2dc8d732531e7db4e67abee45 /source/blender/alembic/intern/abc_exporter.cc | |
parent | 7530c54c3cf38016d9038e6879c8ee2b1bd14c9e (diff) | |
parent | 89eb05a8908130f8668e4c677d63f3d2b89e68bb (diff) |
Merge branch 'master' into blender2.8
# Conflicts:
# source/blender/alembic/intern/abc_exporter.cc
# source/blender/alembic/intern/abc_exporter.h
# source/blender/alembic/intern/alembic_capi.cc
# tests/gtests/alembic/abc_export_test.cc
Diffstat (limited to 'source/blender/alembic/intern/abc_exporter.cc')
-rw-r--r-- | source/blender/alembic/intern/abc_exporter.cc | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc index df2bc52aa2c..5635e3a9420 100644 --- a/source/blender/alembic/intern/abc_exporter.cc +++ b/source/blender/alembic/intern/abc_exporter.cc @@ -28,6 +28,7 @@ #include "abc_camera.h" #include "abc_curves.h" #include "abc_hair.h" +#include "abc_mball.h" #include "abc_mesh.h" #include "abc_nurbs.h" #include "abc_points.h" @@ -37,6 +38,7 @@ extern "C" { #include "DNA_camera_types.h" #include "DNA_curve_types.h" +#include "DNA_meta_types.h" #include "DNA_mesh_types.h" #include "DNA_modifier_types.h" #include "DNA_object_types.h" @@ -54,6 +56,7 @@ extern "C" { #include "BKE_global.h" #include "BKE_idprop.h" #include "BKE_main.h" +#include "BKE_mball.h" #include "BKE_modifier.h" #include "BKE_particle.h" #include "BKE_scene.h" @@ -108,7 +111,7 @@ static bool object_is_smoke_sim(Object *ob) return false; } -static bool object_type_is_exportable(Object *ob) +static bool object_type_is_exportable(Scene *scene, Object *ob) { switch (ob->type) { case OB_MESH: @@ -122,6 +125,8 @@ static bool object_type_is_exportable(Object *ob) case OB_SURF: case OB_CAMERA: return true; + case OB_MBALL: + return AbcMBallWriter::isBasisBall(scene, ob); default: return false; } @@ -163,8 +168,9 @@ static bool export_object(const ExportSettings * const settings, const Base * co /* ************************************************************************** */ -AbcExporter::AbcExporter(EvaluationContext *eval_ctx, Scene *scene, const char *filename, ExportSettings &settings) - : m_settings(settings) +AbcExporter::AbcExporter(Main *bmain, EvaluationContext *eval_ctx, Scene *scene, const char *filename, ExportSettings &settings) + : m_bmain(bmain) + , m_settings(settings) , m_filename(filename) , m_trans_sampling_index(0) , m_shape_sampling_index(0) @@ -361,11 +367,9 @@ void AbcExporter::createTransformWritersHierarchy(EvaluationContext *eval_ctx) switch (ob->type) { case OB_LAMP: case OB_LATTICE: - case OB_MBALL: case OB_SPEAKER: /* We do not export transforms for objects of these classes. */ break; - default: exploreTransform(eval_ctx, base, ob->parent, NULL); } @@ -383,7 +387,7 @@ void AbcExporter::exploreTransform(EvaluationContext *eval_ctx, Base *ob_base, O return; } - if (object_type_is_exportable(ob)) { + if (object_type_is_exportable(m_scene, ob)) { createTransformWriter(eval_ctx, ob, parent, dupliObParent); } @@ -553,7 +557,7 @@ void AbcExporter::createShapeWriter(Base *ob_base, Object *dupliObParent) { Object *ob = ob_base->object; - if (!object_type_is_exportable(ob)) { + if (!object_type_is_exportable(m_scene, ob)) { return; } @@ -619,6 +623,18 @@ void AbcExporter::createShapeWriter(Base *ob_base, Object *dupliObParent) break; } + case OB_MBALL: + { + MetaBall *mball = static_cast<MetaBall *>(ob->data); + if (!mball) { + return; + } + + m_shapes.push_back(new AbcMBallWriter( + m_bmain, m_eval_ctx, m_scene, ob, xform, + m_shape_sampling_index, m_settings)); + break; + } } } |