abc_hair.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * ***** BEGIN GPL LICENSE BLOCK *****
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software Foundation,
  16. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. *
  18. * Contributor(s): Esteban Tovagliari, Cedric Paille, Kevin Dietrich
  19. *
  20. * ***** END GPL LICENSE BLOCK *****
  21. */
  22. #ifndef __ABC_HAIR_H__
  23. #define __ABC_HAIR_H__
  24. #include "abc_object.h"
  25. struct DerivedMesh;
  26. struct ParticleSettings;
  27. struct ParticleSystem;
  28. /* ************************************************************************** */
  29. class AbcHairWriter : public AbcObjectWriter {
  30. ParticleSystem *m_psys;
  31. Alembic::AbcGeom::OCurvesSchema m_schema;
  32. Alembic::AbcGeom::OCurvesSchema::Sample m_sample;
  33. bool m_uv_warning_shown;
  34. public:
  35. AbcHairWriter(Scene *scene,
  36. Object *ob,
  37. AbcTransformWriter *parent,
  38. uint32_t time_sampling,
  39. ExportSettings &settings,
  40. ParticleSystem *psys);
  41. private:
  42. virtual void do_write();
  43. void write_hair_sample(DerivedMesh *dm,
  44. ParticleSettings *part,
  45. std::vector<Imath::V3f> &verts,
  46. std::vector<Imath::V3f> &norm_values,
  47. std::vector<Imath::V2f> &uv_values,
  48. std::vector<int32_t> &hvertices);
  49. void write_hair_child_sample(DerivedMesh *dm,
  50. ParticleSettings *part,
  51. std::vector<Imath::V3f> &verts,
  52. std::vector<Imath::V3f> &norm_values,
  53. std::vector<Imath::V2f> &uv_values,
  54. std::vector<int32_t> &hvertices);
  55. };
  56. #endif /* __ABC_HAIR_H__ */