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:
authorCampbell Barton <ideasman42@gmail.com>2019-05-15 09:29:16 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-15 09:29:16 +0300
commita9d8474fda7f9cc9db52b505cae854db9870d1ce (patch)
tree9cf59068648de153044755417acc2f1a42b6c30e /source/blender/makesrna/intern/rna_wm_gizmo.c
parent5005210f407b8f3426c0137a70443b2e53a02be1 (diff)
Gizmo: add depth bias for 3D selection
This allows some gizmos priority over others even when they're behind.
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm_gizmo.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm_gizmo.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c
index a473f97d554..22162aa017b 100644
--- a/source/blender/makesrna/intern/rna_wm_gizmo.c
+++ b/source/blender/makesrna/intern/rna_wm_gizmo.c
@@ -384,6 +384,7 @@ static void rna_Gizmo_matrix_world_get(PointerRNA *ptr, float value[16])
RNA_GIZMO_GENERIC_FLOAT_RW_DEF(scale_basis, scale_basis);
RNA_GIZMO_GENERIC_FLOAT_RW_DEF(line_width, line_width);
+RNA_GIZMO_GENERIC_FLOAT_RW_DEF(select_bias, select_bias);
RNA_GIZMO_GENERIC_FLAG_RW_DEF(flag_use_draw_hover, flag, WM_GIZMO_DRAW_HOVER);
RNA_GIZMO_GENERIC_FLAG_RW_DEF(flag_use_draw_modal, flag, WM_GIZMO_DRAW_MODAL);
@@ -1159,6 +1160,12 @@ static void rna_def_gizmo(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL);
+ prop = RNA_def_property(srna, "select_bias", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Select Bias", "Depth bias used for selection");
+ RNA_def_property_float_funcs(
+ prop, "rna_Gizmo_select_bias_get", "rna_Gizmo_select_bias_set", NULL);
+ RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
+
/* wmGizmo.flag */
/* WM_GIZMO_HIDDEN */
prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);