Merge branch 'blender2.7'
[blender.git] / source / blender / alembic / intern / abc_hair.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16
17 /** \file
18  * \ingroup balembic
19  */
20
21 #ifndef __ABC_HAIR_H__
22 #define __ABC_HAIR_H__
23
24 #include "abc_object.h"
25
26 struct ParticleSettings;
27 struct ParticleSystem;
28
29 /* ************************************************************************** */
30
31 class AbcHairWriter : public AbcObjectWriter {
32         ParticleSystem *m_psys;
33
34         Alembic::AbcGeom::OCurvesSchema m_schema;
35         Alembic::AbcGeom::OCurvesSchema::Sample m_sample;
36
37         bool m_uv_warning_shown;
38
39 public:
40         AbcHairWriter(Object *ob,
41                       AbcTransformWriter *parent,
42                       uint32_t time_sampling,
43                       ExportSettings &settings,
44                       ParticleSystem *psys);
45
46 private:
47         virtual void do_write();
48
49         void write_hair_sample(struct Mesh *mesh,
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         void write_hair_child_sample(struct Mesh *mesh,
57                                      ParticleSettings *part,
58                                      std::vector<Imath::V3f> &verts,
59                                      std::vector<Imath::V3f> &norm_values,
60                                      std::vector<Imath::V2f> &uv_values,
61                                      std::vector<int32_t> &hvertices);
62 };
63
64 #endif  /* __ABC_HAIR_H__ */