[Bf-blender-cvs] [b5702d9bc02] master: Fix T55403: Alembic: export of animated child hairs

Sybren A. Stüvel noreply at git.blender.org
Thu Sep 19 16:59:39 CEST 2019


Commit: b5702d9bc028d4b53a9d85f5f9fb60feacbd3a00
Author: Sybren A. Stüvel
Date:   Thu Sep 19 16:53:53 2019 +0200
Branches: master
https://developer.blender.org/rBb5702d9bc028d4b53a9d85f5f9fb60feacbd3a00

Fix T55403: Alembic: export of animated child hairs

The parent hairs were written to Alembic even when the 'Parent Particles'
checkbox (`use_parent_particles`) was disabled. In this case the parent
hairs were not correct in Blender's memory, and thus also not correct in
the exported Alembic file. The Alembic exporter now respects this setting
and doesn't write the parent hairs when 'Parent Particles' is off.

===================================================================

M	source/blender/alembic/intern/abc_hair.cc

===================================================================

diff --git a/source/blender/alembic/intern/abc_hair.cc b/source/blender/alembic/intern/abc_hair.cc
index 38042bc7286..98387be2e61 100644
--- a/source/blender/alembic/intern/abc_hair.cc
+++ b/source/blender/alembic/intern/abc_hair.cc
@@ -79,10 +79,14 @@ void AbcHairWriter::do_write()
 
   if (m_psys->pathcache) {
     ParticleSettings *part = m_psys->part;
+    bool export_children = m_settings.export_child_hairs && m_psys->childcache &&
+                           part->childtype != 0;
 
-    write_hair_sample(mesh, part, verts, norm_values, uv_values, hvertices);
+    if (!export_children || part->draw & PART_DRAW_PARENT) {
+      write_hair_sample(mesh, part, verts, norm_values, uv_values, hvertices);
+    }
 
-    if (m_settings.export_child_hairs && m_psys->childcache) {
+    if (export_children) {
       write_hair_child_sample(mesh, part, verts, norm_values, uv_values, hvertices);
     }
   }



More information about the Bf-blender-cvs mailing list