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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-08-12 17:41:59 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-08-12 17:41:59 +0400
commit1a875f915dc3b2c9ccd766f6dadc80e9fb1f6683 (patch)
tree979d052f02518405e6e1894443491deae3e95416 /source/blender/blenkernel
parentf510faed6cb982bc98d3049a78e1ab27ddd9cc16 (diff)
parent702ce76cd28392745132feb2dfb6592d220cb8ec (diff)
Merged changes in the trunk up to revision 31284.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_cloth.h54
-rw-r--r--source/blender/blenkernel/BKE_collision.h18
-rw-r--r--source/blender/blenkernel/BKE_effect.h1
-rw-r--r--source/blender/blenkernel/BKE_idcode.h75
-rw-r--r--source/blender/blenkernel/BKE_sca.h6
-rw-r--r--source/blender/blenkernel/Makefile2
-rw-r--r--source/blender/blenkernel/intern/Makefile2
-rw-r--r--source/blender/blenkernel/intern/cloth.c8
-rw-r--r--source/blender/blenkernel/intern/collision.c5
-rw-r--r--source/blender/blenkernel/intern/curve.c4
-rw-r--r--source/blender/blenkernel/intern/idcode.c129
-rw-r--r--source/blender/blenkernel/intern/implicit.c13
-rw-r--r--source/blender/blenkernel/intern/key.c7
-rw-r--r--source/blender/blenkernel/intern/lattice.c18
-rw-r--r--source/blender/blenkernel/intern/modifier.c12
-rw-r--r--source/blender/blenkernel/intern/nla.c4
-rw-r--r--source/blender/blenkernel/intern/object.c4
-rw-r--r--source/blender/blenkernel/intern/particle.c4
-rw-r--r--source/blender/blenkernel/intern/pointcache.c1
-rw-r--r--source/blender/blenkernel/intern/softbody.c5
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c4
21 files changed, 297 insertions, 79 deletions
diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h
index d8b3fcfd0bb..034bedbb07d 100644
--- a/source/blender/blenkernel/BKE_cloth.h
+++ b/source/blender/blenkernel/BKE_cloth.h
@@ -33,24 +33,8 @@
#include <float.h>
-#include "BLI_linklist.h"
-#include "BKE_customdata.h"
-#include "BKE_DerivedMesh.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_math.h"
-#include "BLI_edgehash.h"
-
-#include "DNA_cloth_types.h"
-#include "DNA_customdata_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-
-#include "BKE_collision.h"
-
struct Object;
+struct ListBase;
struct Scene;
struct MFace;
struct DerivedMesh;
@@ -210,7 +194,7 @@ typedef enum
////////////////////////////////////////////////
// needed for implicit.c
-int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, float dt );
+int cloth_bvh_objcollision (struct Object *ob, struct ClothModifierData * clmd, float step, float dt );
////////////////////////////////////////////////
@@ -220,10 +204,10 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
////////////////////////////////////////////////
// needed for cloth.c
-int implicit_init ( Object *ob, ClothModifierData *clmd );
-int implicit_free ( ClothModifierData *clmd );
-int implicit_solver ( Object *ob, float frame, ClothModifierData *clmd, ListBase *effectors );
-void implicit_set_positions ( ClothModifierData *clmd );
+int implicit_init ( struct Object *ob, struct ClothModifierData *clmd );
+int implicit_free ( struct ClothModifierData *clmd );
+int implicit_solver ( struct Object *ob, float frame, struct ClothModifierData *clmd, struct ListBase *effectors );
+void implicit_set_positions ( struct ClothModifierData *clmd );
// globally needed
void clmdSetInterruptCallBack ( int ( *f ) ( void ) );
@@ -235,23 +219,23 @@ void clmdSetInterruptCallBack ( int ( *f ) ( void ) );
////////////////////////////////////////////////
// needed for modifier.c
-void cloth_free_modifier_extern ( ClothModifierData *clmd );
-void cloth_free_modifier ( Object *ob, ClothModifierData *clmd );
-void cloth_init ( ClothModifierData *clmd );
-DerivedMesh *clothModifier_do ( ClothModifierData *clmd, struct Scene *scene, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc );
+void cloth_free_modifier_extern ( struct ClothModifierData *clmd );
+void cloth_free_modifier ( struct Object *ob, struct ClothModifierData *clmd );
+void cloth_init ( struct ClothModifierData *clmd );
+struct DerivedMesh *clothModifier_do ( struct ClothModifierData *clmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc );
-void cloth_update_normals ( ClothVertex *verts, int nVerts, MFace *face, int totface );
-int cloth_uses_vgroup(ClothModifierData *clmd);
+void cloth_update_normals ( ClothVertex *verts, int nVerts, struct MFace *face, int totface );
+int cloth_uses_vgroup(struct ClothModifierData *clmd);
// needed for collision.c
-void bvhtree_update_from_cloth ( ClothModifierData *clmd, int moving );
-void bvhselftree_update_from_cloth ( ClothModifierData *clmd, int moving );
+void bvhtree_update_from_cloth ( struct ClothModifierData *clmd, int moving );
+void bvhselftree_update_from_cloth ( struct ClothModifierData *clmd, int moving );
// needed for button_object.c
-void cloth_clear_cache ( Object *ob, ClothModifierData *clmd, float framenr );
+void cloth_clear_cache ( struct Object *ob, struct ClothModifierData *clmd, float framenr );
// needed for cloth.c
-int cloth_add_spring ( ClothModifierData *clmd, unsigned int indexA, unsigned int indexB, float restlength, int spring_type);
+int cloth_add_spring ( struct ClothModifierData *clmd, unsigned int indexA, unsigned int indexB, float restlength, int spring_type);
////////////////////////////////////////////////
@@ -270,9 +254,9 @@ typedef struct
{
char *name;
CM_SOLVER_ID id;
- int ( *init ) ( Object *ob, ClothModifierData *clmd );
- int ( *solver ) ( Object *ob, float framenr, ClothModifierData *clmd, ListBase *effectors );
- int ( *free ) ( ClothModifierData *clmd );
+ int ( *init ) ( struct Object *ob, struct ClothModifierData *clmd );
+ int ( *solver ) ( struct Object *ob, float framenr, struct ClothModifierData *clmd, struct ListBase *effectors );
+ int ( *free ) ( struct ClothModifierData *clmd );
}
CM_SOLVER_DEF;
diff --git a/source/blender/blenkernel/BKE_collision.h b/source/blender/blenkernel/BKE_collision.h
index 91c5eb4afee..d7ae7df9342 100644
--- a/source/blender/blenkernel/BKE_collision.h
+++ b/source/blender/blenkernel/BKE_collision.h
@@ -37,25 +37,21 @@
#include <string.h>
/* types */
-#include "BLI_linklist.h"
#include "BKE_collision.h"
-#include "BKE_customdata.h"
-#include "BKE_DerivedMesh.h"
#include "DNA_cloth_types.h"
-#include "DNA_customdata_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
#include "BLI_kdopbvh.h"
struct Cloth;
struct ClothModifierData;
+struct CollisionModifierData;
struct DerivedMesh;
struct Group;
struct MFace;
+struct MVert;
struct Object;
struct Scene;
+struct LinkNode;
////////////////////////////////////////
// used for collisions in collision.c
@@ -122,16 +118,16 @@ FaceCollPair;
// used in modifier.c from collision.c
/////////////////////////////////////////////////
-BVHTree *bvhtree_build_from_mvert ( MFace *mfaces, unsigned int numfaces, MVert *x, unsigned int numverts, float epsilon );
-void bvhtree_update_from_mvert ( BVHTree * bvhtree, MFace *faces, int numfaces, MVert *x, MVert *xnew, int numverts, int moving );
+BVHTree *bvhtree_build_from_mvert ( struct MFace *mfaces, unsigned int numfaces, struct MVert *x, unsigned int numverts, float epsilon );
+void bvhtree_update_from_mvert ( BVHTree * bvhtree, struct MFace *faces, int numfaces, struct MVert *x, struct MVert *xnew, int numverts, int moving );
/////////////////////////////////////////////////
-LinkNode *BLI_linklist_append_fast ( LinkNode **listp, void *ptr );
+struct LinkNode *BLI_linklist_append_fast ( struct LinkNode **listp, void *ptr );
// move Collision modifier object inter-frame with step = [0,1]
// defined in collisions.c
-void collision_move_object ( CollisionModifierData *collmd, float step, float prevstep );
+void collision_move_object ( struct CollisionModifierData *collmd, float step, float prevstep );
// interface for collision functions
void collisions_compute_barycentric ( float pv[3], float p1[3], float p2[3], float p3[3], float *w1, float *w2, float *w3 );
diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h
index 837fede3c8a..99f55200eac 100644
--- a/source/blender/blenkernel/BKE_effect.h
+++ b/source/blender/blenkernel/BKE_effect.h
@@ -31,7 +31,6 @@
#ifndef BKE_EFFECT_H
#define BKE_EFFECT_H
-#include "DNA_object_types.h"
#include "DNA_modifier_types.h"
struct Object;
diff --git a/source/blender/blenkernel/BKE_idcode.h b/source/blender/blenkernel/BKE_idcode.h
new file mode 100644
index 00000000000..b624e34e1cb
--- /dev/null
+++ b/source/blender/blenkernel/BKE_idcode.h
@@ -0,0 +1,75 @@
+/**
+ * $Id$
+ *
+ * ***** 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) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef BKE_ID_INFO_H
+#define BKE_ID_INFO_H
+
+/**
+ * Convert an idcode into a name.
+ *
+ * @param code The code to convert.
+ * @return A static string representing the name of
+ * the code.
+ */
+const char *BKE_idcode_to_name(int code);
+
+/**
+ * Convert an idcode into a name (plural).
+ *
+ * @param code The code to convert.
+ * @return A static string representing the name of
+ * the code.
+ */
+const char *BKE_idcode_to_name_plural(int code);
+
+/**
+ * Convert a name into an idcode (ie. ID_SCE)
+ *
+ * @param name The name to convert.
+ * @return The code for the name, or 0 if invalid.
+ */
+int BKE_idcode_from_name(const char *name);
+
+/**
+ * Return non-zero when an ID type is linkable.
+ *
+ * @param code The code to check.
+ * @return Boolean, 0 when non linkable.
+ */
+int BKE_idcode_is_linkable(int code);
+
+/**
+ * Return if the ID code is a valid ID code.
+ *
+ * @param code The code to check.
+ * @return Boolean, 0 when invalid.
+ */
+int BKE_idcode_is_valid(int code);
+
+#endif
diff --git a/source/blender/blenkernel/BKE_sca.h b/source/blender/blenkernel/BKE_sca.h
index 7adbfd9b48d..6cafb7ef104 100644
--- a/source/blender/blenkernel/BKE_sca.h
+++ b/source/blender/blenkernel/BKE_sca.h
@@ -70,9 +70,9 @@ void set_sca_new_poins_ob(struct Object *ob);
void set_sca_new_poins(void);
void sca_remove_ob_poin(struct Object *obt, struct Object *ob);
-void sca_move_sensor(struct bSensor *sens_to_move, Object *ob, int move_up);
-void sca_move_controller(struct bController *cont_to_move, Object *ob, int move_up);
-void sca_move_actuator(struct bActuator *act_to_move, Object *ob, int move_up);
+void sca_move_sensor(struct bSensor *sens_to_move, struct Object *ob, int move_up);
+void sca_move_controller(struct bController *cont_to_move, struct Object *ob, int move_up);
+void sca_move_actuator(struct bActuator *act_to_move, struct Object *ob, int move_up);
#endif
diff --git a/source/blender/blenkernel/Makefile b/source/blender/blenkernel/Makefile
index f0476bbf026..dc5f0a91da6 100644
--- a/source/blender/blenkernel/Makefile
+++ b/source/blender/blenkernel/Makefile
@@ -15,7 +15,7 @@
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/blender/blenkernel/intern/Makefile b/source/blender/blenkernel/intern/Makefile
index eb14914c7ba..53a9999758c 100644
--- a/source/blender/blenkernel/intern/Makefile
+++ b/source/blender/blenkernel/intern/Makefile
@@ -15,7 +15,7 @@
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index b9b1c16c0c4..bebfa4af88e 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -27,6 +27,14 @@
#include "MEM_guardedalloc.h"
+#include "DNA_cloth_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
+#include "DNA_meshdata_types.h"
+
+#include "BLI_math.h"
+#include "BLI_edgehash.h"
+
#include "BKE_cdderivedmesh.h"
#include "BKE_cloth.h"
#include "BKE_effect.h"
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index 54adc648539..3a9c15f654c 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -37,6 +37,11 @@
#include "DNA_object_types.h"
#include "DNA_object_force.h"
#include "DNA_scene_types.h"
+#include "DNA_meshdata_types.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_math.h"
+#include "BLI_edgehash.h"
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 841bd635acf..358dd1914e7 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -1573,7 +1573,7 @@ static void alfa_bezpart(BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float *
for(a=0; a<resolu; a++, fac+= dfac) {
if (tilt_array) {
- if (nu->tilt_interp==3) { /* May as well support for tilt also 2.47 ease interp */
+ if (nu->tilt_interp==KEY_CU_EASE) { /* May as well support for tilt also 2.47 ease interp */
*tilt_array = prevbezt->alfa + (bezt->alfa - prevbezt->alfa)*(3.0f*fac*fac - 2.0f*fac*fac*fac);
} else {
key_curve_position_weights(fac, t, nu->tilt_interp);
@@ -1584,7 +1584,7 @@ static void alfa_bezpart(BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float *
}
if (radius_array) {
- if (nu->radius_interp==3) {
+ if (nu->radius_interp==KEY_CU_EASE) {
/* Support 2.47 ease interp
* Note! - this only takes the 2 points into account,
* giving much more localized results to changes in radius, sometimes you want that */
diff --git a/source/blender/blenkernel/intern/idcode.c b/source/blender/blenkernel/intern/idcode.c
new file mode 100644
index 00000000000..bc5740b1638
--- /dev/null
+++ b/source/blender/blenkernel/intern/idcode.c
@@ -0,0 +1,129 @@
+/**
+ * $Id$
+ *
+ * ***** 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) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ * return info about ID types
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "DNA_ID.h"
+
+typedef struct {
+ unsigned short code;
+ char *name, *plural;
+
+ int flags;
+#define IDTYPE_FLAGS_ISLINKABLE (1<<0)
+} IDType;
+
+/* plural need to match rna_main.c's MainCollectionDef */
+static IDType idtypes[]= {
+ { ID_AC, "Action", "actions", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_AR, "Armature", "armatures", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_BR, "Brush", "brushes", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_CA, "Camera", "cameras", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_CU, "Curve", "curves", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_GD, "GPencil", "gpencil", IDTYPE_FLAGS_ISLINKABLE}, /* rename gpencil */
+ { ID_GR, "Group", "groups", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_ID, "ID", "ids", 0}, /* plural is fake */
+ { ID_IM, "Image", "images", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_IP, "Ipo", "ipos", IDTYPE_FLAGS_ISLINKABLE}, /* deprecated */
+ { ID_KE, "Key", "keys", 0},
+ { ID_LA, "Lamp", "lamps", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_LI, "Library", "libraries", 0},
+ { ID_LS, "FreestyleLineStyle", "linestyles", 0},
+ { ID_LT, "Lattice", "lattices", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_MA, "Material", "materials", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_MB, "Metaball", "metaballs", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_ME, "Mesh", "meshes", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_NT, "NodeTree", "node_groups", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_OB, "Object", "objects", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_PA, "ParticleSettings", "particles", 0},
+ { ID_SCE, "Scene", "scenes", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_SCR, "Screen", "screens", 0},
+ { ID_SEQ, "Sequence", "sequences", 0}, /* not actually ID data */
+ { ID_SO, "Sound", "sounds", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_TE, "Texture", "textures", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_TXT, "Text", "texts", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_VF, "VFont", "fonts", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_WO, "World", "worlds", IDTYPE_FLAGS_ISLINKABLE},
+ { ID_WM, "WindowManager", "window_managers", 0},
+};
+static int nidtypes= sizeof(idtypes)/sizeof(idtypes[0]);
+
+static IDType *idtype_from_name(const char *str)
+{
+ int i= nidtypes;
+
+ while (i--)
+ if (strcmp(str, idtypes[i].name)==0)
+ return &idtypes[i];
+
+ return NULL;
+}
+static IDType *idtype_from_code(int code)
+{
+ int i= nidtypes;
+
+ while (i--)
+ if (code==idtypes[i].code)
+ return &idtypes[i];
+
+ return NULL;
+}
+
+int BKE_idcode_is_valid(int code)
+{
+ return idtype_from_code(code)?1:0;
+}
+
+int BKE_idcode_is_linkable(int code) {
+ IDType *idt= idtype_from_code(code);
+ return idt?(idt->flags&IDTYPE_FLAGS_ISLINKABLE):0;
+}
+
+const char *BKE_idcode_to_name(int code)
+{
+ IDType *idt= idtype_from_code(code);
+
+ return idt?idt->name:NULL;
+}
+
+int BKE_idcode_from_name(const char *name)
+{
+ IDType *idt= idtype_from_name(name);
+
+ return idt?idt->code:0;
+}
+
+const char *BKE_idcode_to_name_plural(int code)
+{
+ IDType *idt= idtype_from_code(code);
+
+ return idt?idt->plural:NULL;
+}
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c
index 902965bd2f6..d544174b0d4 100644
--- a/source/blender/blenkernel/intern/implicit.c
+++ b/source/blender/blenkernel/intern/implicit.c
@@ -29,16 +29,21 @@
#include "MEM_guardedalloc.h"
-#include "BKE_cloth.h"
-
+#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
#include "DNA_object_force.h"
+#include "DNA_meshdata_types.h"
+
+#include "BLI_threads.h"
+#include "BLI_math.h"
+#include "BLI_linklist.h"
+#include "BKE_cloth.h"
+#include "BKE_collision.h"
#include "BKE_effect.h"
#include "BKE_global.h"
#include "BKE_utildefines.h"
-#include "BLI_threads.h"
-
#define CLOTH_OPENMP_LIMIT 25
#ifdef _WIN32
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 354b3b0e7d8..f4b931ec52b 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -1850,9 +1850,12 @@ void vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3])
tot= count_curveverts(&cu->nurb);
}
- fp= kb->data= MEM_callocN(tot*elemsize, "key_to_vertcos vertCos");
+ if (tot == 0) {
+ kb->data= NULL;
+ return;
+ }
- if (tot == 0) return;
+ fp= kb->data= MEM_callocN(tot*elemsize, "key_to_vertcos vertCos");
/* Copy coords to keyblock */
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 1eb7b5d2021..1390f0dbd56 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -225,8 +225,12 @@ void free_lattice(Lattice *lt)
if(lt->def) MEM_freeN(lt->def);
if(lt->dvert) free_dverts(lt->dvert, lt->pntsu*lt->pntsv*lt->pntsw);
if(lt->editlatt) {
- if(lt->editlatt->def) MEM_freeN(lt->editlatt->def);
- if(lt->editlatt->dvert) free_dverts(lt->editlatt->dvert, lt->pntsu*lt->pntsv*lt->pntsw);
+ Lattice *editlt= lt->editlatt->latt;
+
+ if(editlt->def) MEM_freeN(editlt->def);
+ if(editlt->dvert) free_dverts(editlt->dvert, lt->pntsu*lt->pntsv*lt->pntsw);
+
+ MEM_freeN(editlt);
MEM_freeN(lt->editlatt);
}
}
@@ -295,7 +299,7 @@ void init_latt_deform(Object *oblatt, Object *ob)
float fu, fv, fw;
int u, v, w;
- if(lt->editlatt) lt= lt->editlatt;
+ if(lt->editlatt) lt= lt->editlatt->latt;
bp = lt->def;
fp= lt->latticedata= MEM_mallocN(sizeof(float)*3*lt->pntsu*lt->pntsv*lt->pntsw, "latticedata");
@@ -350,7 +354,7 @@ void calc_latt_deform(Object *ob, float *co, float weight)
MDeformVert *dvert= lattice_get_deform_verts(ob);
- if(lt->editlatt) lt= lt->editlatt;
+ if(lt->editlatt) lt= lt->editlatt->latt;
if(lt->latticedata==NULL) return;
if(lt->vgroup[0] && dvert) {
@@ -446,7 +450,7 @@ void end_latt_deform(Object *ob)
{
Lattice *lt= ob->data;
- if(lt->editlatt) lt= lt->editlatt;
+ if(lt->editlatt) lt= lt->editlatt->latt;
if(lt->latticedata)
MEM_freeN(lt->latticedata);
@@ -1002,7 +1006,7 @@ float (*lattice_getVertexCos(struct Object *ob, int *numVerts_r))[3]
int i, numVerts;
float (*vertexCos)[3];
- if(lt->editlatt) lt= lt->editlatt;
+ if(lt->editlatt) lt= lt->editlatt->latt;
numVerts = *numVerts_r = lt->pntsu*lt->pntsv*lt->pntsw;
vertexCos = MEM_mallocN(sizeof(*vertexCos)*numVerts,"lt_vcos");
@@ -1066,7 +1070,7 @@ struct MDeformVert* lattice_get_deform_verts(struct Object *oblatt)
if(oblatt->type == OB_LATTICE)
{
Lattice *lt = (Lattice*)oblatt->data;
- if(lt->editlatt) lt= lt->editlatt;
+ if(lt->editlatt) lt= lt->editlatt->latt;
return lt->dvert;
}
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 858e9d6c6d9..ea118e4a53c 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -41,6 +41,8 @@
#include "float.h"
#include "DNA_armature_types.h"
+#include "DNA_object_types.h"
+#include "DNA_meshdata_types.h"
#include "BKE_bmesh.h"
#include "BKE_cloth.h"
@@ -193,7 +195,7 @@ void modifier_copyData(ModifierData *md, ModifierData *target)
mti->copyData(md, target);
}
-int modifier_couldBeCage(Scene *scene, ModifierData *md)
+int modifier_couldBeCage(struct Scene *scene, ModifierData *md)
{
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
@@ -233,7 +235,7 @@ void modifier_setError(ModifierData *md, char *format, ...)
* also used in transform_conversion.c, to detect CrazySpace [tm] (2nd arg
* then is NULL)
*/
-int modifiers_getCageIndex(Scene *scene, Object *ob, int *lastPossibleCageIndex_r, int virtual_)
+int modifiers_getCageIndex(struct Scene *scene, Object *ob, int *lastPossibleCageIndex_r, int virtual_)
{
ModifierData *md = (virtual_)? modifiers_getVirtualModifierList(ob): ob->modifiers.first;
int i, cageIndex = -1;
@@ -283,7 +285,7 @@ int modifiers_isParticleEnabled(Object *ob)
return (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render));
}
-int modifier_isEnabled(Scene *scene, ModifierData *md, int required_mode)
+int modifier_isEnabled(struct Scene *scene, ModifierData *md, int required_mode)
{
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
@@ -298,7 +300,7 @@ int modifier_isEnabled(Scene *scene, ModifierData *md, int required_mode)
return 1;
}
-LinkNode *modifiers_calcDataMasks(Scene *scene, Object *ob, ModifierData *md, CustomDataMask dataMask, int required_mode)
+LinkNode *modifiers_calcDataMasks(struct Scene *scene, Object *ob, ModifierData *md, CustomDataMask dataMask, int required_mode)
{
LinkNode *dataMasks = NULL;
LinkNode *curr, *prev;
@@ -487,7 +489,7 @@ int modifier_isCorrectableDeformed(ModifierData *md)
return 0;
}
-int modifiers_isCorrectableDeformed(Scene *scene, Object *ob)
+int modifiers_isCorrectableDeformed(struct Scene *scene, Object *ob)
{
ModifierData *md = modifiers_getVirtualModifierList(ob);
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 8d2ad49e7bf..b053d615756 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -1265,13 +1265,13 @@ void BKE_nlastrip_validate_name (AnimData *adt, NlaStrip *strip)
char *dot;
/* Strip off the suffix */
- dot = strchr(strip->name, '.');
+ dot = strrchr(strip->name, '.');
if (dot) *dot=0;
/* Try different possibilities */
for (number = 1; number <= 999; number++) {
/* assemble alternative name */
- BLI_snprintf(tempname, 128, "%s%c%03d", strip->name, ".", number);
+ BLI_snprintf(tempname, 128, "%s.%03d", strip->name, number);
/* if hash doesn't have this, set it */
if (BLI_ghash_haskey(gh, tempname) == 0) {
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index c08a3408505..115cfac7627 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1917,7 +1917,7 @@ static void give_parvert(Object *par, int nr, float *vec)
DispList *dl = find_displist(&par->disp, DL_VERTS);
float *co = dl?dl->verts:NULL;
- if(latt->editlatt) latt= latt->editlatt;
+ if(latt->editlatt) latt= latt->editlatt->latt;
a= latt->pntsu*latt->pntsv*latt->pntsw;
count= 0;
@@ -2501,7 +2501,7 @@ void object_handle_update(Scene *scene, Object *ob)
/* includes all keys and modifiers */
if(ob->type==OB_MESH) {
- EditMesh *em = BKE_mesh_get_editmesh(ob->data);
+ EditMesh *em = (ob == scene->obedit)? BKE_mesh_get_editmesh(ob->data): NULL;
/* evaluate drivers */
// XXX: should we push this to derivedmesh instead?
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 52ee0180f43..7b3638f0e33 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -40,12 +40,16 @@
#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
#include "DNA_particle_types.h"
#include "DNA_smoke_types.h"
+#include "DNA_scene_types.h"
+#include "BLI_blenlib.h"
#include "BLI_kdtree.h"
#include "BLI_rand.h"
#include "BLI_threads.h"
+#include "BLI_math.h"
#include "BKE_anim.h"
#include "BKE_animsys.h"
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index d44221d2cd3..6cf49808ec7 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -43,6 +43,7 @@
#include "BLI_blenlib.h"
#include "BLI_threads.h"
+#include "BLI_math.h"
#include "PIL_time.h"
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 4d1994e760b..b8e824ce3d5 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -55,11 +55,12 @@ variables on the UI for now
#include "MEM_guardedalloc.h"
/* types */
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_lattice_types.h"
#include "DNA_curve_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_scene_types.h"
#include "BLI_math.h"
#include "BLI_ghash.h"
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 0d7738353df..4c85656dd91 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -69,6 +69,8 @@ static int ccgDM_getVertMapIndex(CCGSubSurf *ss, CCGVert *v);
static int ccgDM_getEdgeMapIndex(CCGSubSurf *ss, CCGEdge *e);
static int ccgDM_getFaceMapIndex(CCGSubSurf *ss, CCGFace *f);
+static int ccgDM_use_grid_pbvh(CCGDerivedMesh *ccgdm);
+
///
static void *arena_alloc(CCGAllocatorHDL a, int numBytes) {
@@ -1249,7 +1251,7 @@ static void ccgDM_glNormalFast(float *a, float *b, float *c, float *d)
static void ccgdm_pbvh_update(CCGDerivedMesh *ccgdm)
{
- if(ccgdm->pbvh && ccgdm->multires.mmd) {
+ if(ccgdm->pbvh && ccgDM_use_grid_pbvh(ccgdm)) {
CCGFace **faces;
int totface;