Merge branch 'master' into blender2.8
[blender.git] / source / blender / alembic / intern / abc_hair.h
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
23 #ifndef __ABC_HAIR_H__
24 #define __ABC_HAIR_H__
25
26 #include "abc_object.h"
27
28 struct DerivedMesh;
29 struct ParticleSettings;
30 struct ParticleSystem;
31
32 /* ************************************************************************** */
33
34 class AbcHairWriter : public AbcObjectWriter {
35         ParticleSystem *m_psys;
36
37         Alembic::AbcGeom::OCurvesSchema m_schema;
38         Alembic::AbcGeom::OCurvesSchema::Sample m_sample;
39
40         bool m_uv_warning_shown;
41
42 public:
43         AbcHairWriter(Scene *scene,
44                       Object *ob,
45                       AbcTransformWriter *parent,
46                       uint32_t time_sampling,
47                       ExportSettings &settings,
48                       ParticleSystem *psys);
49
50 private:
51         virtual void do_write();
52
53         void write_hair_sample(DerivedMesh *dm,
54                                ParticleSettings *part,
55                                std::vector<Imath::V3f> &verts,
56                                std::vector<Imath::V3f> &norm_values,
57                                std::vector<Imath::V2f> &uv_values,
58                                std::vector<int32_t> &hvertices);
59
60         void write_hair_child_sample(DerivedMesh *dm,
61                                      ParticleSettings *part,
62                                      std::vector<Imath::V3f> &verts,
63                                      std::vector<Imath::V3f> &norm_values,
64                                      std::vector<Imath::V2f> &uv_values,
65                                      std::vector<int32_t> &hvertices);
66 };
67
68 #endif  /* __ABC_HAIR_H__ */