[Bf-blender-cvs] [9c55a8374e] uv_unwrapping_slim_algorithm: Category: UV Unwrapping SLIM Algorithm Integration

Aurel Gruber noreply at git.blender.org
Thu Feb 23 16:53:30 CET 2017


Commit: 9c55a8374ef257c610027750ee6d3c1cf95cd360
Author: Aurel Gruber
Date:   Tue Jan 31 13:58:43 2017 +0100
Branches: uv_unwrapping_slim_algorithm
https://developer.blender.org/rB9c55a8374ef257c610027750ee6d3c1cf95cd360

Category: UV Unwrapping SLIM Algorithm Integration

adding weightinfluence

===================================================================

M	source/blender/editors/uvedit/uvedit_parametrizer.c
M	source/blender/editors/uvedit/uvedit_parametrizer.h
M	source/blender/editors/uvedit/uvedit_unwrap_ops.c

===================================================================

diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index ea8bf4df4a..1459f9d45c 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 bb5b9e16f4..ed5b10a594 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 a19336643e..247c43c4c5 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 **************** */




More information about the Bf-blender-cvs mailing list