Documentation: Update Docs for Gizmo

This patch updates the documentation for arguments regarding the `Gizmo`
type.

- Corrected `select_id` doc for draw_preset_ functions. `-1` indicates
  that no selection ID is to be written, but previous docs incorrectly
  specified `0` instead.
- Added missing doc for `target` argument for `target_set_handler`
  function.

Reviewed by: Aaron Carlisle (Blendify)

Differential Revision: https://developer.blender.org/D14834
This commit is contained in:
2022-07-13 08:43:57 -04:00
parent 441dd08dba
commit ccdf189d3c
2 changed files with 38 additions and 4 deletions

View File

@@ -211,7 +211,15 @@ void RNA_api_gizmo(StructRNA *srna)
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4);
RNA_def_property_ui_text(parm, "", "The matrix to transform");
RNA_def_int(func, "select_id", -1, -1, INT_MAX, "Zero when not selecting", "", -1, INT_MAX);
RNA_def_int(func,
"select_id",
-1,
-1,
INT_MAX,
"ID to use when gizmo is selectable. Use -1 when not selecting",
"",
-1,
INT_MAX);
/* draw_preset_box */
func = RNA_def_function(srna, "draw_preset_arrow", "rna_gizmo_draw_preset_arrow");
@@ -221,7 +229,15 @@ void RNA_api_gizmo(StructRNA *srna)
RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4);
RNA_def_property_ui_text(parm, "", "The matrix to transform");
RNA_def_enum(func, "axis", rna_enum_object_axis_items, 2, "", "Arrow Orientation");
RNA_def_int(func, "select_id", -1, -1, INT_MAX, "Zero when not selecting", "", -1, INT_MAX);
RNA_def_int(func,
"select_id",
-1,
-1,
INT_MAX,
"ID to use when gizmo is selectable. Use -1 when not selecting",
"",
-1,
INT_MAX);
func = RNA_def_function(srna, "draw_preset_circle", "rna_gizmo_draw_preset_circle");
RNA_def_function_ui_description(func, "Draw a box");
@@ -230,7 +246,15 @@ void RNA_api_gizmo(StructRNA *srna)
RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4);
RNA_def_property_ui_text(parm, "", "The matrix to transform");
RNA_def_enum(func, "axis", rna_enum_object_axis_items, 2, "", "Arrow Orientation");
RNA_def_int(func, "select_id", -1, -1, INT_MAX, "Zero when not selecting", "", -1, INT_MAX);
RNA_def_int(func,
"select_id",
-1,
-1,
INT_MAX,
"ID to use when gizmo is selectable. Use -1 when not selecting",
"",
-1,
INT_MAX);
/* -------------------------------------------------------------------- */
/* Other Shapes */
@@ -243,7 +267,15 @@ void RNA_api_gizmo(StructRNA *srna)
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
parm = RNA_def_int(func, "face_map", 0, 0, INT_MAX, "Face map index", "", 0, INT_MAX);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
RNA_def_int(func, "select_id", -1, -1, INT_MAX, "Zero when not selecting", "", -1, INT_MAX);
RNA_def_int(func,
"select_id",
-1,
-1,
INT_MAX,
"ID to use when gizmo is selectable. Use -1 when not selecting",
"",
-1,
INT_MAX);
/* -------------------------------------------------------------------- */
/* Property API */

View File

@@ -314,6 +314,8 @@ PyDoc_STRVAR(
"\n"
" Assigns callbacks to a gizmos property.\n"
"\n"
" :arg target: Target property name.\n"
" :type target: string\n"
" :arg get: Function that returns the value for this property (single value or sequence).\n"
" :type get: callable\n"
" :arg set: Function that takes a single value argument and applies it.\n"