Changeset View
Changeset View
Standalone View
Standalone View
source/blender/alembic/intern/abc_writer_mball.cc
| Show All 24 Lines | |||||
| #include "DNA_meta_types.h" | #include "DNA_meta_types.h" | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "BKE_displist.h" | #include "BKE_displist.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "BKE_mball.h" | #include "BKE_mball.h" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "BKE_object.h" | |||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| } | } | ||||
| AbcMBallWriter::AbcMBallWriter(Main *bmain, | AbcMBallWriter::AbcMBallWriter(Main *bmain, | ||||
| Object *ob, | Object *ob, | ||||
| AbcTransformWriter *parent, | AbcTransformWriter *parent, | ||||
| uint32_t time_sampling, | uint32_t time_sampling, | ||||
| Show All 9 Lines | |||||
| bool AbcMBallWriter::isAnimated() const | bool AbcMBallWriter::isAnimated() const | ||||
| { | { | ||||
| return true; | return true; | ||||
| } | } | ||||
| Mesh *AbcMBallWriter::getEvaluatedMesh(Scene * /*scene_eval*/, Object *ob_eval, bool &r_needsfree) | Mesh *AbcMBallWriter::getEvaluatedMesh(Scene * /*scene_eval*/, Object *ob_eval, bool &r_needsfree) | ||||
| { | { | ||||
| if (ob_eval->runtime.mesh_eval != NULL) { | Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob_eval); | ||||
| if (mesh_eval != NULL) { | |||||
| /* Mesh_eval only exists when generative modifiers are in use. */ | /* Mesh_eval only exists when generative modifiers are in use. */ | ||||
| r_needsfree = false; | r_needsfree = false; | ||||
| return ob_eval->runtime.mesh_eval; | return mesh_eval; | ||||
| } | } | ||||
| r_needsfree = true; | r_needsfree = true; | ||||
| /* The approach below is copied from BKE_mesh_new_from_object() */ | /* The approach below is copied from BKE_mesh_new_from_object() */ | ||||
| Mesh *tmpmesh = BKE_mesh_add(m_bmain, ((ID *)m_object->data)->name + 2); | Mesh *tmpmesh = BKE_mesh_add(m_bmain, ((ID *)m_object->data)->name + 2); | ||||
| BLI_assert(tmpmesh != NULL); | BLI_assert(tmpmesh != NULL); | ||||
| /* BKE_mesh_add gives us a user count we don't need */ | /* BKE_mesh_add gives us a user count we don't need */ | ||||
| Show All 26 Lines | |||||