Merge branch 'master' into blender2.8
authorSybren A. Stüvel <sybren@stuvel.eu>
Wed, 19 Apr 2017 13:07:54 +0000 (15:07 +0200)
committerSybren A. Stüvel <sybren@stuvel.eu>
Wed, 19 Apr 2017 13:07:54 +0000 (15:07 +0200)
# Conflicts:
# source/blender/alembic/intern/abc_exporter.cc
# source/blender/alembic/intern/abc_exporter.h

1  2 
source/blender/alembic/intern/abc_exporter.cc
source/blender/alembic/intern/abc_exporter.h
source/blender/alembic/intern/alembic_capi.cc
source/blender/makesrna/intern/rna_scene_api.c

index 391f3fe79af7f997c21283b6da67da46d12332bb,d70b9625f1d12084e85335093201e65727e89fe8..dd65613e2232ff985f0aac07c96c3935d70a1a73
@@@ -528,10 -527,31 +530,33 @@@ void AbcExporter::exploreObject(Evaluat
        free_object_duplilist(lb);
  }
  
 -void AbcExporter::createShapeWriter(Object *ob, Object *dupliObParent)
+ 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(Base *ob_base, Object *dupliObParent)
  {
 +      Object *ob = ob_base->object;
 +
        if (!object_is_shape(ob)) {
                return;
        }
index 75a2e0074f10fd8613fcf09982331a424e8e834e,797a2560d65de861f6ee209eb9caf6aa936252c5..3831acaafaba5c8809b04bbba72ee6391a8a61fe
@@@ -113,10 -112,11 +115,11 @@@ private
  
        void createTransformWritersHierarchy(EvaluationContext *eval_ctx);
        AbcTransformWriter * createTransformWriter(Object *ob,  Object *parent, Object *dupliObParent);
 -      void exploreTransform(EvaluationContext *eval_ctx, Object *ob, Object *parent, Object *dupliObParent = NULL);
 -      void exploreObject(EvaluationContext *eval_ctx, Object *ob, Object *dupliObParent);
 +      void exploreTransform(EvaluationContext *eval_ctx, Base *ob_base, Object *parent, Object *dupliObParent);
 +      void exploreObject(EvaluationContext *eval_ctx, Base *ob_base, Object *dupliObParent);
        void createShapeWriters(EvaluationContext *eval_ctx);
 -      void createShapeWriter(Object *ob, Object *dupliObParent);
 +      void createShapeWriter(Base *ob_base, Object *dupliObParent);
+       void createParticleSystemsWriters(Object *ob, AbcTransformWriter *xform);
  
        AbcTransformWriter *getXForm(const std::string &name);
  
index cee571b9e412fe264392b1b74ef9be10d94046d5,104b19beaf08fe8b50482fe85b571dadb1051eec..7d0ceb7668ac06abf08a025ddd5fa3e4998caa53
@@@ -270,8 -269,11 +271,10 @@@ static void export_startjob(void *custo
                if (CFRA != orig_frame) {
                        CFRA = orig_frame;
  
 -                      BKE_scene_update_for_newframe(data->bmain->eval_ctx, data->bmain,
 -                                                    scene, scene->lay);
 +                      BKE_scene_update_for_newframe(data->bmain->eval_ctx, data->bmain, scene);
                }
+               data->export_ok = !data->was_canceled;
        }
        catch (const std::exception &e) {
                ABC_LOG(data->settings.logger) << "Abc Export error: " << e.what() << '\n';
@@@ -348,15 -341,12 +353,17 @@@ bool ABC_export
        job->settings.export_normals = params->normals;
        job->settings.export_uvs = params->uvs;
        job->settings.export_vcols = params->vcolors;
+       job->settings.export_hair = params->export_hair;
+       job->settings.export_particles = params->export_particles;
        job->settings.apply_subdiv = params->apply_subdiv;
        job->settings.flatten_hierarchy = params->flatten_hierarchy;
 +
 +      /* Sybren: visible_layer & renderable only is ignored for now,
 +       * to be replaced with collections later in the 2.8 dev process
 +       * (also see note above). */
        job->settings.visible_layers_only = params->visible_layers_only;
        job->settings.renderable_only = params->renderable_only;
 +
        job->settings.use_subdiv_schema = params->use_subdiv_schema;
        job->settings.export_ogawa = (params->compression_type == ABC_ARCHIVE_OGAWA);
        job->settings.pack_uv = params->packuv;