Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bmesh_strands_conv.h « intern « bmesh « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: aa18b779b176933f8a1f8499629fd0c4c4c007e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * ***** BEGIN GPL LICENSE BLOCK *****
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * The Original Code is Copyright (C) 2014 Blender Foundation.
 * All rights reserved.
 *
 * The Original Code is: all of this file.
 *
 * Contributor(s): Lukas Toenne.
 *
 * ***** END GPL LICENSE BLOCK *****
 */

#ifndef __BMESH_STRANDS_CONV_H__
#define __BMESH_STRANDS_CONV_H__

/** \file blender/bmesh/intern/bmesh_strands_conv.h
 *  \ingroup bmesh
 */

struct BMesh;
struct Mesh;
struct Object;
struct ParticleSystem;
struct DerivedMesh;
struct BVHTreeFromMesh;
struct Strands;
struct Key;

extern const char *CD_HAIR_SEGMENT_LENGTH;
extern const char *CD_HAIR_MASS;
extern const char *CD_HAIR_WEIGHT;
extern const char *CD_HAIR_ROOT_LOCATION;

void BM_strands_cd_validate(struct BMesh *bm);
void BM_strands_cd_flag_ensure(struct BMesh *bm, const char cd_flag);
void BM_strands_cd_flag_apply(struct BMesh *bm, const char cd_flag);
char BM_strands_cd_flag_from_bmesh(struct BMesh *bm);

void BM_strands_bm_from_strands(struct BMesh *bm, struct Strands *strands, float mat[4][4], struct Key *key, struct DerivedMesh *emitter_dm, const bool set_key, int act_key_nr);
struct Strands *BM_strands_bm_to_strands(struct BMesh *bm, struct Strands *strands, float mat[4][4], struct Key *key, struct DerivedMesh *emitter_dm, struct BVHTreeFromMesh *emitter_bvhtree);

int BM_strands_count_psys_keys(struct ParticleSystem *psys);
void BM_strands_bm_from_psys(struct BMesh *bm, struct Object *ob, struct ParticleSystem *psys, struct DerivedMesh *emitter_dm,
                             const bool set_key, int act_key_nr);
void BM_strands_bm_to_psys(struct BMesh *bm, struct Object *ob, struct ParticleSystem *psys, struct DerivedMesh *emitter_dm, struct BVHTreeFromMesh *emitter_bvhtree);

#define BMALLOC_TEMPLATE_FROM_STRANDS(strands) { (CHECK_TYPE_INLINE(strands, Strands *), \
	strands->totverts), (strands->totverts - strands->totcurves), 0, 0 }
#define BMALLOC_TEMPLATE_FROM_PSYS(psys) { (CHECK_TYPE_INLINE(psys, ParticleSystem *), \
	BM_strands_count_psys_keys(psys)), (BM_strands_count_psys_keys(psys) - (psys)->totpart), 0, 0 }

#endif /* __BMESH_STRANDS_CONV_H__ */