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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-04-15 14:06:36 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-04-15 14:06:36 +0400
commit46146ecd08d0d85831b4a9a487e79310570c0c63 (patch)
tree2b78fb3e0cd89ea3b99f1e616e308f112168ad2e /source/blender/editors/uvedit
parente533fe72a3be089f7b3409f9178c83e3f37044d0 (diff)
Tweak knife/unwrap tesselation code a bit, it uses a random offset, now also
seed the random number generator to at least make these operator repeatable. I don't know why it is using random numbers at all, we should really not be doing this in my opinion, but I don't understand why it's being done so won't remove it.
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 136134a95b0..f7e1ee221c0 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -211,6 +211,8 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
/* we need the vert indices */
BM_mesh_elem_index_ensure(em->bm, BM_VERT);
+
+ BLI_srand(0);
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
ScanFillVert *v, *lastv, *firstv;
@@ -226,7 +228,6 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
if ((BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) || (sel && BM_elem_flag_test(efa, BM_ELEM_SELECT) == 0))
continue;
- /* tf= (MTexPoly *)CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */
lsel = 0;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -241,7 +242,7 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
key = (ParamKey)efa;
- /*scanfill time!*/
+ /* scanfill time! */
BLI_begin_edgefill();
firstv = lastv = NULL;
@@ -250,9 +251,9 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
v = BLI_addfillvert(l->v->co);
- /*add small random offset*/
+ /* add small random offset */
for (i = 0; i < 3; i++) {
- v->co[i] += (BLI_drand() - 0.5f) * FLT_EPSILON * 50;
+ v->co[i] += (BLI_frand() - 0.5f) * FLT_EPSILON * 50;
}
v->tmp.p = l;