diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-04-07 12:54:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-04-07 12:54:43 +0400 |
commit | 3e5e49d9025985e182f75f1c245cc508ee927976 (patch) | |
tree | 34d94acfd4cd705846f343d3d635c89f37230900 /source | |
parent | 24d6192f53b0bdc289dd4f24c0d6b5c3ea5e26af (diff) |
add margin access [#26806] Missing pack margin for pack islands in UV editor
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_unwrap_ops.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 416c65c6297..cc5efd9a6ca 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -431,13 +431,20 @@ void UV_OT_minimize_stretch(wmOperatorType *ot) /* ******************** Pack Islands operator **************** */ -static int pack_islands_exec(bContext *C, wmOperator *UNUSED(op)) +static int pack_islands_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data); ParamHandle *handle; + if(RNA_property_is_set(op->ptr, "margin")) { + scene->toolsettings->uvcalc_margin= RNA_float_get(op->ptr, "margin"); + } + else { + RNA_float_set(op->ptr, "margin", scene->toolsettings->uvcalc_margin); + } + handle = construct_param_handle(scene, em, 1, 0, 1, 1); param_pack(handle, scene->toolsettings->uvcalc_margin); param_flush(handle); @@ -460,6 +467,9 @@ void UV_OT_pack_islands(wmOperatorType *ot) /* api callbacks */ ot->exec= pack_islands_exec; ot->poll= ED_operator_uvedit; + + /* properties */ + RNA_def_float_factor(ot->srna, "margin", 0.0f, 0.0f, 1.0f, "Margin", "Space between islands", 0.0f, 1.0f); } /* ******************** Average Islands Scale operator **************** */ |