[Bf-blender-cvs] [d65c48e] alembic: DNA file for strands types.

Lukas Tönne noreply at git.blender.org
Wed Apr 8 19:22:19 CEST 2015


Commit: d65c48e9a866c1ba3583d2d4db7ec46a007f7ed3
Author: Lukas Tönne
Date:   Wed Apr 8 18:49:18 2015 +0200
Branches: alembic
https://developer.blender.org/rBd65c48e9a866c1ba3583d2d4db7ec46a007f7ed3

DNA file for strands types.

This is not strictly needed because the strands data is only created
at runtime at this point. However, it might be useful to later include
this in blend files.

Also the C++ RNA API has a bug that makes non-DNA collection properties
difficult (the length function is not implemented properly).

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

M	source/blender/CMakeLists.txt
M	source/blender/blenkernel/BKE_strands.h
A	source/blender/makesdna/DNA_strands_types.h
M	source/blender/makesdna/intern/makesdna.c

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

diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
index cb3063b..e2dcf0d 100644
--- a/source/blender/CMakeLists.txt
+++ b/source/blender/CMakeLists.txt
@@ -80,6 +80,7 @@ set(SRC_DNA_INC
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_sound_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_space_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_speaker_types.h
+	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_strands_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_text_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_texture_types.h
 	${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_userdef_types.h
diff --git a/source/blender/blenkernel/BKE_strands.h b/source/blender/blenkernel/BKE_strands.h
index c557aaf..3a80950 100644
--- a/source/blender/blenkernel/BKE_strands.h
+++ b/source/blender/blenkernel/BKE_strands.h
@@ -21,36 +21,7 @@
 
 #include "BLI_utildefines.h"
 
-typedef struct StrandsVertex {
-	float co[3];
-	float time;
-	float weight;
-	
-	/* utility data */
-	float nor[3]; /* normals (edge directions) */
-} StrandsVertex;
-
-typedef struct StrandsMotionState {
-	float co[3];
-	float vel[3];
-	
-	/* utility data */
-	float nor[3]; /* normals (edge directions) */
-} StrandsMotionState;
-
-typedef struct StrandsCurve {
-	int numverts;
-	float root_matrix[3][3];
-} StrandsCurve;
-
-typedef struct Strands {
-	StrandsCurve *curves;
-	StrandsVertex *verts;
-	int totcurves, totverts;
-	
-	/* optional */
-	StrandsMotionState *state;
-} Strands;
+#include "DNA_strands_types.h"
 
 struct Strands *BKE_strands_new(int strands, int verts);
 void BKE_strands_free(struct Strands *strands);
@@ -64,23 +35,6 @@ void BKE_strands_ensure_normals(struct Strands *strands);
 
 void BKE_strands_get_minmax(struct Strands *strands, float min[3], float max[3], bool use_motion_state);
 
-typedef struct StrandsChildCurve {
-	int numverts;
-} StrandsChildCurve;
-
-typedef struct StrandsChildVertex {
-	float co[3];
-	float time;
-	
-	/* utility data */
-	float nor[3]; /* normals (edge directions) */
-} StrandsChildVertex;
-
-typedef struct StrandsChildren {
-	StrandsChildCurve *curves;
-	StrandsChildVertex *verts;
-	int totcurves, totverts;
-} StrandsChildren;
 
 struct StrandsChildren *BKE_strands_children_new(int strands, int verts);
 void BKE_strands_children_free(struct StrandsChildren *strands);
@@ -94,9 +48,9 @@ void BKE_strands_children_get_minmax(struct StrandsChildren *strands, float min[
 
 typedef struct StrandIterator {
 	int index, tot;
-	StrandsCurve *curve;
-	StrandsVertex *verts;
-	StrandsMotionState *state;
+	struct StrandsCurve *curve;
+	struct StrandsVertex *verts;
+	struct StrandsMotionState *state;
 } StrandIterator;
 
 BLI_INLINE void BKE_strand_iter_init(StrandIterator *iter, Strands *strands)
diff --git a/source/blender/makesdna/DNA_strands_types.h b/source/blender/makesdna/DNA_strands_types.h
new file mode 100644
index 0000000..1b64a83
--- /dev/null
+++ b/source/blender/makesdna/DNA_strands_types.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2015, Blender Foundation.
+ *
+ * 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.
+ */
+
+/** \file DNA_strands_types.h
+ *  \ingroup DNA
+ */
+
+#ifndef __DNA_STRANDS_TYPES_H__
+#define __DNA_STRANDS_TYPES_H__
+
+#include "DNA_defs.h"
+
+typedef struct StrandsVertex {
+	float co[3];
+	float time;
+	float weight;
+	
+	/* utility data */
+	float nor[3]; /* normals (edge directions) */
+} StrandsVertex;
+
+typedef struct StrandsMotionState {
+	float co[3];
+	float vel[3];
+	
+	/* utility data */
+	float nor[3]; /* normals (edge directions) */
+} StrandsMotionState;
+
+typedef struct StrandsCurve {
+	int numverts;
+	float root_matrix[3][3];
+} StrandsCurve;
+
+typedef struct Strands {
+	StrandsCurve *curves;
+	StrandsVertex *verts;
+	int totcurves, totverts;
+	
+	/* optional */
+	StrandsMotionState *state;
+} Strands;
+
+
+typedef struct StrandsChildCurve {
+	int numverts;
+} StrandsChildCurve;
+
+typedef struct StrandsChildVertex {
+	float co[3];
+	float time;
+	
+	/* utility data */
+	float nor[3]; /* normals (edge directions) */
+} StrandsChildVertex;
+
+typedef struct StrandsChildren {
+	StrandsChildCurve *curves;
+	StrandsChildVertex *verts;
+	int totcurves, totverts;
+} StrandsChildren;
+
+#endif  /* __DNA_STRANDS_TYPES_H__ */
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 5504520..4997492 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -137,6 +137,7 @@ static const char *includefiles[] = {
 	"DNA_freestyle_types.h",
 	"DNA_linestyle_types.h",
 	"DNA_cache_library_types.h",
+	"DNA_strands_types.h",
 
 	/* empty string to indicate end of includefiles */
 	""
@@ -1289,4 +1290,5 @@ int main(int argc, char **argv)
 #include "DNA_freestyle_types.h"
 #include "DNA_linestyle_types.h"
 #include "DNA_cache_library_types.h"
+#include "DNA_strands_types.h"
 /* end of list */




More information about the Bf-blender-cvs mailing list