[Bf-blender-cvs] [4e7f37c] fracture_modifier: compile fixes due to merge
Martin Felke
noreply at git.blender.org
Wed Apr 1 11:42:34 CEST 2015
Commit: 4e7f37c6e886e4ce2372a211a07868a5745d76e2
Author: Martin Felke
Date: Wed Apr 1 11:32:33 2015 +0200
Branches: fracture_modifier
https://developer.blender.org/rB4e7f37c6e886e4ce2372a211a07868a5745d76e2
compile fixes due to merge
===================================================================
M release/scripts/startup/bl_operators/presets.py
M source/blender/blenkernel/BKE_deform.h
M source/blender/blenkernel/BKE_mesh_mapping.h
M source/blender/blenkernel/CMakeLists.txt
M source/blender/blenkernel/intern/mesh_mapping.c
M source/blender/blenloader/intern/readfile.c
M source/blender/blenloader/intern/versioning_270.c
M source/blender/makesdna/DNA_modifier_types.h
M source/blender/modifiers/CMakeLists.txt
===================================================================
diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py
index 2d0650f..6606d40 100644
--- a/release/scripts/startup/bl_operators/presets.py
+++ b/release/scripts/startup/bl_operators/presets.py
@@ -647,6 +647,8 @@ class AddPresetFracture(AddPresetBase, Operator):
"fracture.grease_decimate",
"fracture.use_greasepencil_edges",
"fracture.cutter_axis",
+ "fracture.cluster_constraint_type",
+ "fracture.constraint_target",
]
preset_subdir = "fracture"
diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h
index 8510a2f..bdec1c3 100644
--- a/source/blender/blenkernel/BKE_deform.h
+++ b/source/blender/blenkernel/BKE_deform.h
@@ -87,6 +87,19 @@ void defvert_normalize_lock_map(struct MDeformVert *dvert,
const bool *vgroup_subset, const int vgroup_tot,
const bool *lock_flags, const int defbase_tot);
+/* Utilities to 'extract' a given vgroup into a simple float array, for verts, but also edges/polys/loops. */
+void BKE_defvert_extract_vgroup_to_vertweights(
+ struct MDeformVert *dvert, const int defgroup, const int num_verts, float *r_weights, const bool invert_vgroup);
+void BKE_defvert_extract_vgroup_to_edgeweights(
+ struct MDeformVert *dvert, const int defgroup, const int num_verts, struct MEdge *edges, const int num_edges,
+ float *r_weights, const bool invert_vgroup);
+void BKE_defvert_extract_vgroup_to_loopweights(
+ struct MDeformVert *dvert, const int defgroup, const int num_verts, struct MLoop *loops, const int num_loops,
+ float *r_weights, const bool invert_vgroup);
+void BKE_defvert_extract_vgroup_to_polyweights(
+ struct MDeformVert *dvert, const int defgroup, const int num_verts, struct MLoop *loops, const int num_loops,
+ struct MPoly *polys, const int num_polys, float *r_weights, const bool invert_vgroup);
+
/* utility function, note that MAX_VGROUP_NAME chars is the maximum string length since its only
* used with defgroups currently */
diff --git a/source/blender/blenkernel/BKE_mesh_mapping.h b/source/blender/blenkernel/BKE_mesh_mapping.h
index ed7e506..9d78895 100644
--- a/source/blender/blenkernel/BKE_mesh_mapping.h
+++ b/source/blender/blenkernel/BKE_mesh_mapping.h
@@ -109,6 +109,10 @@ void BKE_mesh_vert_poly_map_create(
MeshElemMap **r_map, int **r_mem,
const struct MPoly *mface, const struct MLoop *mloop,
int totvert, int totface, int totloop);
+void BKE_mesh_vert_loop_map_create(
+ MeshElemMap **r_map, int **r_mem,
+ const struct MPoly *mface, const struct MLoop *mloop,
+ int totvert, int totface, int totloop);
void BKE_mesh_vert_edge_map_create(
MeshElemMap **r_map, int **r_mem,
const struct MEdge *medge, int totvert, int totedge);
@@ -122,6 +126,60 @@ void BKE_mesh_origindex_map_create(
const int totorig,
const int *final_origindex, const int totfinal);
+/* islands */
+
+/* Loop islands data helpers. */
+enum {
+ MISLAND_TYPE_NONE = 0,
+ MISLAND_TYPE_VERT = 1,
+ MISLAND_TYPE_EDGE = 2,
+ MISLAND_TYPE_POLY = 3,
+ MISLAND_TYPE_LOOP = 4,
+};
+
+typedef struct MeshIslandStore {
+ short item_type; /* MISLAND_TYPE_... */
+ short island_type; /* MISLAND_TYPE_... */
+ short innercut_type; /* MISLAND_TYPE_... */
+
+ int items_to_islands_num;
+ int *items_to_islands; /* map the item to the island index */
+
+ int islands_num;
+ size_t islands_num_alloc;
+ struct MeshElemMap **islands; /* Array of pointers, one item per island. */
+ struct MeshElemMap **innercuts; /* Array of pointers, one item per island. */
+
+ struct MemArena *mem; /* Memory arena, internal use only. */
+} MeshIslandStore;
+
+void BKE_mesh_loop_islands_init(
+ MeshIslandStore *island_store,
+ const short item_type, const int item_num, const short island_type, const short innercut_type);
+ void BKE_mesh_loop_islands_clear(MeshIslandStore *island_store);
+ void BKE_mesh_loop_islands_free(MeshIslandStore *island_store);
+ void BKE_mesh_loop_islands_add(
+ MeshIslandStore *islands, const int item_num, int *item_indices,
+ const int num_island_items, int *island_item_indices,
+ const int num_innercut_items, int *innercut_item_indices);
+
+typedef bool (*MeshRemapIslandsCalc)(
+ struct MVert *verts, const int totvert,
+ struct MEdge *edges, const int totedge,
+ struct MPoly *polys, const int totpoly,
+ struct MLoop *loops, const int totloop,
+ struct MeshIslandStore *r_island_store);
+
+/* Above vert/UV mapping stuff does not do what we need here, but does things we do not need here.
+ * So better keep them separated for now, I think.
+ */
+bool BKE_mesh_calc_islands_loop_poly_uv(
+ struct MVert *verts, const int totvert,
+ struct MEdge *edges, const int totedge,
+ struct MPoly *polys, const int totpoly,
+ struct MLoop *loops, const int totloop,
+ MeshIslandStore *r_island_store);
+
/* smoothgroups */
int *BKE_mesh_calc_smoothgroups(
const struct MEdge *medge, const int totedge,
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 22840df..968ba5f 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -124,6 +124,7 @@ set(SRC
intern/mesh.c
intern/mesh_evaluate.c
intern/mesh_mapping.c
+ intern/mesh_remap.c
intern/mesh_validate.c
intern/modifier.c
intern/modifiers_bmesh.c
@@ -238,6 +239,7 @@ set(SRC
BKE_mball.h
BKE_mesh.h
BKE_mesh_mapping.h
+ BKE_mesh_remap.h
BKE_modifier.h
BKE_movieclip.h
BKE_multires.h
diff --git a/source/blender/blenkernel/intern/mesh_mapping.c b/source/blender/blenkernel/intern/mesh_mapping.c
index 0b76fe3..8d9fbe4 100644
--- a/source/blender/blenkernel/intern/mesh_mapping.c
+++ b/source/blender/blenkernel/intern/mesh_mapping.c
@@ -389,7 +389,6 @@ typedef bool (*MeshRemap_CheckIslandBoundary)(
const int nbr_egde_users);
static void poly_edge_loop_islands_calc(
-int *BKE_mesh_calc_smoothgroups(const MEdge *medge, const int totedge,
const MEdge *medge, const int totedge, const MPoly *mpoly, const int totpoly,
const MLoop *mloop, const int totloop, MeshElemMap *edge_poly_map,
const bool use_bitflags, MeshRemap_CheckIslandBoundary edge_boundary_check,
@@ -409,7 +408,6 @@ int *BKE_mesh_calc_smoothgroups(const MEdge *medge, const int totedge,
/* map vars */
int *edge_poly_mem = NULL;
- int *edge_poly_mem;
if (totpoly == 0) {
*r_totgroup = 0;
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 053321b..7a07f7c 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4892,6 +4892,13 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
/* if modifiers disappear, or for upward compatibility */
if (NULL == modifierType_getInfo(md->type))
md->type = eModifierType_None;
+
+ /* XXX hack, in Fracture Modifier Branch prior to 2.74 no DataTransfer Modifier
+ * existed, but after 2.74 it takes the place of Fracture Modifier in internal numbering
+ * so fix this temporarily here, BRANCH ONLY !!! */
+ if ((md->type == eModifierType_DataTransfer) && (fd->fileversion < 274)) {
+ md->type = eModifierType_Fracture;
+ }
if (md->type == eModifierType_Subsurf) {
SubsurfModifierData *smd = (SubsurfModifierData *)md;
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index cd0869f..9d3cddf 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -45,6 +45,7 @@
#include "DNA_mesh_types.h"
#include "DNA_modifier_types.h"
#include "DNA_particle_types.h"
+#include "DNA_rigidbody_types.h"
#include "DNA_linestyle_types.h"
#include "DNA_actuator_types.h"
@@ -643,6 +644,20 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
+ if (!MAIN_VERSION_ATLEAST(main, 274, 0)) {
+ Object *ob;
+ for (ob = main->object.first; ob != NULL; ob = ob->id.next) {
+ /*initialize older blends to useful values */
+ FractureModifierData *fmd = (FractureModifierData* )modifiers_findByType(ob, eModifierType_Fracture);
+ if (fmd != NULL)
+ {
+ fmd->cluster_constraint_type = RBC_TYPE_FIXED;
+ fmd->constraint_target = MOD_FRACTURE_CENTROID;
+ fmd->use_breaking = true;
+ }
+ }
+ }
+
if (!MAIN_VERSION_ATLEAST(main, 274, 3)) {
FOREACH_NODETREE(main, ntree, id)
{
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index a538030..56dcf94 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -84,7 +84,7 @@ typedef enum ModifierType {
eModifierType_Wireframe = 48,
eModifierType_DataTransfer = 49,
eModifierType_NormalEdit = 50,
- eModifierType_Fracture = (1 << 30),
+ eModifierType_Fracture = (1 << 20),
NUM_MODIFIER_TYPES
} ModifierType;
@@ -1560,39 +1560,6 @@ typedef struct FractureModifierData {
//char pad[4];
} FractureModifierData;
-/* Set Split Normals modifier */
-typedef struct NormalEditModifierData {
- ModifierData modifier;
- char defgrp_name[64]; /* MAX_VGROUP_NAME */
- struct Object *target; /* Source of normals, or center of ellipsoid. */
- short mode;
- short flag;
- short mix_mode;
- char pad[2];
- float mix_factor;
- float offset[3];
-} NormalEditModifierData;
-
-/* NormalEditModifierData.mode */
-enum {
- MOD_NORMALEDIT_MODE_RADIAL = 0,
- MOD_NORMALEDIT_MODE_DIRECTIONAL = 1,
-};
-
-/* NormalEditModifierData.flags */
-enum {
- MOD_NORMALEDIT_INVERT_VGROUP = (1 << 0),
- MOD_NORMALEDIT_USE_DIRECTION_PARALLEL = (1 << 1),
-};
-
-/* NormalEditModifierData.mix_mode */
-enum {
- MOD_NORMALEDIT_MIX_COPY = 0,
- MOD_NORMALEDIT_MIX_ADD = 1,
- MOD_NORMALEDIT_MIX_SUB = 2,
- MOD_NORMALEDIT_MIX_MUL = 3,
-};
-
typedef struct DataTransferModifierData {
ModifierData modifier;
diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeL
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list