Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2017-04-19 14:03:52 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2017-04-19 14:03:52 +0300
commitb148ac5cf77a869bcca5b51716141400bb90a70d (patch)
tree0ef0cd74c6feae9ccf1af54bd056abd1bf539574 /source/blender/alembic/intern/abc_exporter.cc
parent0fd53c87ded952049a09e45174b7e372e126ed54 (diff)
Alembic export: made hair/particle export optional.
The export is still slower than needed, as the particle systems themselves aren't disabled during the export. It's only the writing to the Alembic file that's skipped.
Diffstat (limited to 'source/blender/alembic/intern/abc_exporter.cc')
-rw-r--r--source/blender/alembic/intern/abc_exporter.cc41
1 files changed, 26 insertions, 15 deletions
diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc
index ef3196cb15d..d70b9625f1d 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -83,6 +83,8 @@ ExportSettings::ExportSettings()
, export_vcols(false)
, export_face_sets(false)
, export_vweigths(false)
+ , export_hair(true)
+ , export_particles(true)
, apply_subdiv(false)
, use_subdiv_schema(false)
, export_child_hairs(true)
@@ -525,6 +527,29 @@ void AbcExporter::exploreObject(EvaluationContext *eval_ctx, Object *ob, Object
free_object_duplilist(lb);
}
+void AbcExporter::createParticleSystemsWriters(Object *ob, AbcTransformWriter *xform)
+{
+ if (!m_settings.export_hair && !m_settings.export_particles) {
+ return;
+ }
+
+ ParticleSystem *psys = static_cast<ParticleSystem *>(ob->particlesystem.first);
+
+ for (; psys; psys = psys->next) {
+ if (!psys_check_enabled(ob, psys, G.is_rendering) || !psys->part) {
+ continue;
+ }
+
+ if (m_settings.export_hair && psys->part->type == PART_HAIR) {
+ m_settings.export_child_hairs = true;
+ m_shapes.push_back(new AbcHairWriter(m_scene, ob, xform, m_shape_sampling_index, m_settings, psys));
+ }
+ else if (m_settings.export_particles && psys->part->type == PART_EMITTER) {
+ m_shapes.push_back(new AbcPointsWriter(m_scene, ob, xform, m_shape_sampling_index, m_settings, psys));
+ }
+ }
+}
+
void AbcExporter::createShapeWriter(Object *ob, Object *dupliObParent)
{
if (!object_is_shape(ob)) {
@@ -547,21 +572,7 @@ void AbcExporter::createShapeWriter(Object *ob, Object *dupliObParent)
return;
}
- ParticleSystem *psys = static_cast<ParticleSystem *>(ob->particlesystem.first);
-
- for (; psys; psys = psys->next) {
- if (!psys_check_enabled(ob, psys, G.is_rendering) || !psys->part) {
- continue;
- }
-
- if (psys->part->type == PART_HAIR) {
- m_settings.export_child_hairs = true;
- m_shapes.push_back(new AbcHairWriter(m_scene, ob, xform, m_shape_sampling_index, m_settings, psys));
- }
- else if (psys->part->type == PART_EMITTER) {
- m_shapes.push_back(new AbcPointsWriter(m_scene, ob, xform, m_shape_sampling_index, m_settings, psys));
- }
- }
+ createParticleSystemsWriters(ob, xform);
switch (ob->type) {
case OB_MESH: