[Bf-blender-cvs] [16b07fb08d8] fracture_modifier: allow grid spacing > 1
Martin Felke
noreply at git.blender.org
Fri Aug 3 11:22:35 CEST 2018
Commit: 16b07fb08d888177d88a7b81de55947bf4a3d1cd
Author: Martin Felke
Date: Fri Aug 3 11:22:08 2018 +0200
Branches: fracture_modifier
https://developer.blender.org/rB16b07fb08d888177d88a7b81de55947bf4a3d1cd
allow grid spacing > 1
===================================================================
M source/blender/blenkernel/intern/fracture.c
M source/blender/makesrna/intern/rna_fracture.c
===================================================================
diff --git a/source/blender/blenkernel/intern/fracture.c b/source/blender/blenkernel/intern/fracture.c
index c37e04e576f..1602afa4370 100644
--- a/source/blender/blenkernel/intern/fracture.c
+++ b/source/blender/blenkernel/intern/fracture.c
@@ -2043,7 +2043,7 @@ void BKE_fracture_shard_by_points(FracMesh *fmesh, ShardID id, FracPointCloud *p
if (point_source & MOD_FRACTURE_GRID)
{
int v = 0;
- float fact[3] = {1 - spacing[0], 1 - spacing[1], 1 - spacing[2]};
+ float fact[3] = {1 + spacing[0], 1 + spacing[1], 1 + spacing[2]};
for (p = 0; p < pointcloud->totpoints; p++)
{
//adjust centroid and...
@@ -2060,8 +2060,8 @@ void BKE_fracture_shard_by_points(FracMesh *fmesh, ShardID id, FracPointCloud *p
add_v3_v3(voro_cells[p].verts[v], off);
//print_v3("Vert", voro_cells[p].verts[v]);
- sub_v3_v3(voro_cells[p].verts[v], cent);
- add_v3_v3(voro_cells[p].verts[v], voro_cells[p].centroid);
+ add_v3_v3(voro_cells[p].verts[v], cent);
+ sub_v3_v3(voro_cells[p].verts[v], voro_cells[p].centroid);
}
}
}
diff --git a/source/blender/makesrna/intern/rna_fracture.c b/source/blender/makesrna/intern/rna_fracture.c
index 03757247663..9a16ecd7755 100644
--- a/source/blender/makesrna/intern/rna_fracture.c
+++ b/source/blender/makesrna/intern/rna_fracture.c
@@ -1564,7 +1564,7 @@ void RNA_def_fracture(BlenderRNA *brna)
prop = RNA_def_property(srna, "grid_spacing", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "grid_spacing");
- RNA_def_property_range(prop, 0.0f, 0.99f);
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_array(prop, 3);
RNA_def_property_float_default(prop, 0.0f);
RNA_def_property_ui_text(prop, "Grid Spacing", "How much space inbetween the bricks, in each direction");
More information about the Bf-blender-cvs
mailing list