diff options
author | Aurel Gruber <aurel.gruber@infix.ch> | 2017-01-31 15:58:43 +0300 |
---|---|---|
committer | Aurel Gruber <aurel.gruber@infix.ch> | 2017-02-27 13:24:36 +0300 |
commit | 518ab567e175032ab32c27d3287dfb62577e4f8b (patch) | |
tree | d237cdc4bd7638211a07ab058cc5bc8faa415d77 | |
parent | 185418608e8714093b032be4cb2e0521e1391df3 (diff) |
Category: UV Unwrapping SLIM Algorithm Integration
adding weightinfluence
-rw-r--r-- | source/blender/editors/uvedit/uvedit_parametrizer.c | 4 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_parametrizer.h | 1 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_unwrap_ops.c | 7 |
3 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index ea8bf4df4af..1459f9d45ca 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -252,6 +252,7 @@ typedef struct PHandle { bool with_weighted_parameterization; MDeformVert *weightMapData; int weightMapIndex; + double weightInfluence; BMesh *bm; } PHandle; @@ -4370,6 +4371,7 @@ void param_slim_enrich_handle(Object *obedit, matrix_transfer *mt, MDeformVert *dvert, int weightMapIndex, + double weightInfluence, int n_iterations, bool skip_initialization, bool pack_islands, @@ -4384,6 +4386,7 @@ void param_slim_enrich_handle(Object *obedit, phandle->with_weighted_parameterization = with_weighted_parameterization; phandle->weightMapData = dvert; phandle->weightMapIndex = weightMapIndex; + phandle->weightInfluence = weightInfluence; phandle->bm = em->bm; } @@ -4830,6 +4833,7 @@ void transfer_data_to_slim(ParamHandle *handle){ mt->pinned_vertices = false; mt->transform_islands = true; mt->with_weighted_parameterization = phandle->with_weighted_parameterization; + mt->weight_influence = phandle->weightInfluence; convert_blender_slim(handle, false, phandle->weightMapIndex); } diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.h b/source/blender/editors/uvedit/uvedit_parametrizer.h index bb5b9e16f4c..ed5b10a5946 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.h +++ b/source/blender/editors/uvedit/uvedit_parametrizer.h @@ -97,6 +97,7 @@ void param_slim_enrich_handle(Object *obedit, matrix_transfer *mt, MDeformVert *dvert, int weightMapIndex, + double weightInfluence, int n_iterations, bool skip_initialization, bool pack_islands, diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index a19336643e6..247c43c4c5a 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -530,6 +530,7 @@ void enrich_handle_slim(Scene *scene, Object *obedit, BMEditMesh *em, ParamHandl int n_iterations = scene->toolsettings->slim_n_iterations; bool skip_initialization = scene->toolsettings->slim_skip_initialization; bool pack_islands = scene->toolsettings->slim_pack_islands; + double weight_influence = scene->toolsettings->slim_weight_influence; MDeformVert *weightMapData = NULL; @@ -545,6 +546,7 @@ void enrich_handle_slim(Scene *scene, Object *obedit, BMEditMesh *em, ParamHandl mt, weightMapData, weightMapIndex, + weight_influence, n_iterations, skip_initialization, pack_islands, @@ -813,7 +815,7 @@ static bool minimize_stretch_SLIM_init(bContext *C, wmOperator *op) scene->toolsettings->slim_skip_initialization = true; scene->toolsettings->slim_pack_islands = false; scene->toolsettings->slim_fixed_boundary = true; - + scene->toolsettings->slim_weight_influence = RNA_float_get(op->ptr, "slim_weight_influence"); enrich_handle_slim(scene, obedit, em, handle, mss->mt); param_slim_begin(handle); @@ -1024,7 +1026,8 @@ void UV_OT_minimize_stretch_slim(wmOperatorType *ot) RNA_def_boolean(ot->srna, "fill_holes_slim", 1, "Fill Holes", "Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry"); RNA_def_float_factor(ot->srna, "blend_slim", 0.0f, 0.0f, 1.0f, "Blend", "Blend factor between stretch minimized and original", 0.0f, 1.0f); RNA_def_int(ot->srna, "iterations_slim", 0, 0, INT_MAX, "Iterations", "Number of iterations to run, 0 is unlimited when run interactively", 0, 100); -} + RNA_def_float(ot->srna, "slim_weight_influence", 1.0, -10000.0, 10000.0, "SLIM Weight Map Influence", + "How much influence the weightmap has for weighted parameterization, 0 being no influence.", 0.0, 10.0);} /* ******************** Pack Islands operator **************** */ |