diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-15 00:49:00 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-15 00:49:00 +0300 |
commit | 5ebebcfbfff4c218ab4101ee7f6a66617ee9b01f (patch) | |
tree | 86f319a9291847c2608bfd0b89bae3d504e378cf /source/blender/makesrna | |
parent | cd1600413246a62156441f6e7910489b19ae5a28 (diff) |
WM: rename manipulator to gizmo internally
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_context.c | 10 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_internal.h | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 16 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 22 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 36 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm_api.c | 30 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm_gizmo.c | 684 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm_gizmo_api.c | 94 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_workspace_api.c | 6 |
11 files changed, 455 insertions, 455 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index fe8868235c4..f66c80beeab 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -374,8 +374,8 @@ extern StructRNA RNA_LineStyleThicknessModifier_Tangent; extern StructRNA RNA_LockedTrackConstraint; extern StructRNA RNA_Macro; extern StructRNA RNA_MagicTexture; -extern StructRNA RNA_Manipulator; -extern StructRNA RNA_ManipulatorProperties; +extern StructRNA RNA_Gizmo; +extern StructRNA RNA_GizmoProperties; extern StructRNA RNA_MarbleTexture; extern StructRNA RNA_MaskModifier; extern StructRNA RNA_MaskSequence; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index bb24452d67a..393ebc15d3e 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -3443,7 +3443,7 @@ static RNAProcessItem PROCESS_ITEMS[] = { {"rna_userdef.c", NULL, RNA_def_userdef}, {"rna_vfont.c", "rna_vfont_api.c", RNA_def_vfont}, {"rna_wm.c", "rna_wm_api.c", RNA_def_wm}, - {"rna_wm_gizmo.c", "rna_wm_gizmo_api.c", RNA_def_wm_manipulator}, + {"rna_wm_gizmo.c", "rna_wm_gizmo_api.c", RNA_def_wm_gizmo}, {"rna_workspace.c", "rna_workspace_api.c", RNA_def_workspace}, {"rna_world.c", NULL, RNA_def_world}, {"rna_movieclip.c", NULL, RNA_def_movieclip}, diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index 6e07976a3c6..7b07faf8ee7 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -121,11 +121,11 @@ static PointerRNA rna_Context_region_data_get(PointerRNA *ptr) return PointerRNA_NULL; } -static PointerRNA rna_Context_manipulator_group_get(PointerRNA *ptr) +static PointerRNA rna_Context_gizmo_group_get(PointerRNA *ptr) { bContext *C = (bContext *)ptr->data; PointerRNA newptr; - RNA_pointer_create(NULL, &RNA_ManipulatorGroup, CTX_wm_manipulator_group(C), &newptr); + RNA_pointer_create(NULL, &RNA_GizmoGroup, CTX_wm_gizmo_group(C), &newptr); return newptr; } @@ -256,10 +256,10 @@ void RNA_def_context(BlenderRNA *brna) RNA_def_property_struct_type(prop, "RegionView3D"); RNA_def_property_pointer_funcs(prop, "rna_Context_region_data_get", NULL, NULL, NULL); - prop = RNA_def_property(srna, "manipulator_group", PROP_POINTER, PROP_NONE); + prop = RNA_def_property(srna, "gizmo_group", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_struct_type(prop, "ManipulatorGroup"); - RNA_def_property_pointer_funcs(prop, "rna_Context_manipulator_group_get", NULL, NULL, NULL); + RNA_def_property_struct_type(prop, "GizmoGroup"); + RNA_def_property_pointer_funcs(prop, "rna_Context_gizmo_group_get", NULL, NULL, NULL); /* Data */ prop = RNA_def_property(srna, "blend_data", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index a57777f0630..83d173de6c8 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -193,7 +193,7 @@ void RNA_def_ui(struct BlenderRNA *brna); void RNA_def_userdef(struct BlenderRNA *brna); void RNA_def_vfont(struct BlenderRNA *brna); void RNA_def_wm(struct BlenderRNA *brna); -void RNA_def_wm_manipulator(struct BlenderRNA *brna); +void RNA_def_wm_gizmo(struct BlenderRNA *brna); void RNA_def_workspace(struct BlenderRNA *brna); void RNA_def_world(struct BlenderRNA *brna); void RNA_def_movieclip(struct BlenderRNA *brna); @@ -308,8 +308,8 @@ void RNA_api_image(struct StructRNA *srna); void RNA_api_lattice(struct StructRNA *srna); void RNA_api_operator(struct StructRNA *srna); void RNA_api_macro(struct StructRNA *srna); -void RNA_api_manipulator(struct StructRNA *srna); -void RNA_api_manipulatorgroup(struct StructRNA *srna); +void RNA_api_gizmo(struct StructRNA *srna); +void RNA_api_gizmogroup(struct StructRNA *srna); void RNA_api_keyconfig(struct StructRNA *srna); void RNA_api_keyconfigs(struct StructRNA *srna); void RNA_api_keyingset(struct StructRNA *srna); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 690c6d8e4c1..54b553e94ae 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -413,7 +413,7 @@ const EnumPropertyItem rna_enum_bake_pass_filter_type_items[] = { {0, NULL, 0, NULL, NULL} }; -static const EnumPropertyItem rna_enum_manipulator_items[] = { +static const EnumPropertyItem rna_enum_gizmo_items[] = { {SCE_MANIP_TRANSLATE, "TRANSLATE", 0, "Translate", ""}, {SCE_MANIP_ROTATE, "ROTATE", 0, "Rotate", ""}, {SCE_MANIP_SCALE, "SCALE", 0, "Scale", ""}, @@ -647,11 +647,11 @@ static void rna_GPencilBrush_name_set(PointerRNA *ptr, const char *value) /* ----------------- end of Grease pencil drawing brushes ------------*/ -static void rna_ToolSettings_manipulator_flag_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) +static void rna_ToolSettings_gizmo_flag_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) { ToolSettings *ts = scene->toolsettings; - if ((ts->manipulator_flag & (SCE_MANIP_TRANSLATE | SCE_MANIP_ROTATE | SCE_MANIP_SCALE)) == 0) { - ts->manipulator_flag |= SCE_MANIP_TRANSLATE; + if ((ts->gizmo_flag & (SCE_MANIP_TRANSLATE | SCE_MANIP_ROTATE | SCE_MANIP_SCALE)) == 0) { + ts->gizmo_flag |= SCE_MANIP_TRANSLATE; } } @@ -2690,12 +2690,12 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_ui_icon(prop, ICON_ORTHO, 0); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ - prop = RNA_def_property(srna, "use_manipulator_mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "manipulator_flag"); - RNA_def_property_enum_items(prop, rna_enum_manipulator_items); + prop = RNA_def_property(srna, "use_gizmo_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "gizmo_flag"); + RNA_def_property_enum_items(prop, rna_enum_gizmo_items); RNA_def_property_flag(prop, PROP_ENUM_FLAG); RNA_def_property_ui_text(prop, "Gizmo Mode", ""); - RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ToolSettings_manipulator_flag_update"); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ToolSettings_gizmo_flag_update"); /* Grease Pencil */ prop = RNA_def_property(srna, "use_gpencil_continuous_drawing", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 4bdf7a09585..5c30cdb2b07 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2562,7 +2562,7 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna) prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag2", V3D_RENDER_OVERRIDE); - RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like manipulators and outlines"); + RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like gizmos and outlines"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE); @@ -2939,24 +2939,24 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_ui_icon(prop, ICON_ORTHO, 0); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_MANIPULATOR_HIDE); + prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_GIZMO_HIDE); RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "show_manipulator_navigate", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_MANIPULATOR_HIDE_NAVIGATE); + prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_GIZMO_HIDE_NAVIGATE); RNA_def_property_ui_text(prop, "Navigate Gizmo", ""); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "show_manipulator_context", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_MANIPULATOR_HIDE_CONTEXT); - RNA_def_property_ui_text(prop, "Context Gizmo", "Context sensitive manipulators for the active item"); + prop = RNA_def_property(srna, "show_gizmo_context", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_GIZMO_HIDE_CONTEXT); + RNA_def_property_ui_text(prop, "Context Gizmo", "Context sensitive gizmos for the active item"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "show_manipulator_tool", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_MANIPULATOR_HIDE_TOOL); - RNA_def_property_ui_text(prop, "Tool Gizmo", "Active tool manipulator"); + prop = RNA_def_property(srna, "show_gizmo_tool", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_GIZMO_HIDE_TOOL); + RNA_def_property_ui_text(prop, "Tool Gizmo", "Active tool gizmo"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index d8941e303d9..5557afdb33f 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -1201,33 +1201,33 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Z Axis", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - /* Generic manipulator colors. */ - prop = RNA_def_property(srna, "manipulator_hi", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_float_sdna(prop, NULL, "manipulator_hi"); + /* Generic gizmo colors. */ + prop = RNA_def_property(srna, "gizmo_hi", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "gizmo_hi"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Gizmo Highlight", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "manipulator_primary", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_float_sdna(prop, NULL, "manipulator_primary"); + prop = RNA_def_property(srna, "gizmo_primary", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "gizmo_primary"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Gizmo Primary", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "manipulator_secondary", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_float_sdna(prop, NULL, "manipulator_secondary"); + prop = RNA_def_property(srna, "gizmo_secondary", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "gizmo_secondary"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Gizmo Secondary", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "manipulator_a", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_float_sdna(prop, NULL, "manipulator_a"); + prop = RNA_def_property(srna, "gizmo_a", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "gizmo_a"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Gizmo A", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "manipulator_b", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_float_sdna(prop, NULL, "manipulator_b"); + prop = RNA_def_property(srna, "gizmo_b", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "gizmo_b"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Gizmo B", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); @@ -3705,7 +3705,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) /* mini axis */ static const EnumPropertyItem mini_axis_type_items[] = { {0, "MINIMAL", 0, "Simple Axis", ""}, - {USER_SHOW_MANIPULATOR_AXIS, "MANIPULATOR", 0, "Interactive Navigation", ""}, + {USER_SHOW_GIZMO_AXIS, "GIZMO", 0, "Interactive Navigation", ""}, {0, NULL, 0, NULL, NULL} }; @@ -3739,16 +3739,16 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Rotation Angle", "Rotation step for numerical pad keys (2 4 6 8)"); /* 3D transform widget */ - prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "manipulator_flag", USER_MANIPULATOR_DRAW); - RNA_def_property_ui_text(prop, "Manipulators", "Use transform manipulators by default"); + prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "gizmo_flag", USER_GIZMO_DRAW); + RNA_def_property_ui_text(prop, "Gizmos", "Use transform gizmos by default"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_PIXEL); - RNA_def_property_int_sdna(prop, NULL, "manipulator_size"); + prop = RNA_def_property(srna, "gizmo_size", PROP_INT, PROP_PIXEL); + RNA_def_property_int_sdna(prop, NULL, "gizmo_size"); RNA_def_property_range(prop, 10, 200); RNA_def_property_int_default(prop, 75); - RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of the manipulator"); + RNA_def_property_ui_text(prop, "Gizmo Size", "Diameter of the gizmo"); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop = RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_PIXEL); diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index f398c4143ae..7abcf0f0667 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -118,33 +118,33 @@ static void rna_event_timer_remove(struct wmWindowManager *wm, wmTimer *timer) } -static wmManipulatorGroupType *wm_manipulatorgrouptype_find_for_add_remove(ReportList *reports, const char *idname) +static wmGizmoGroupType *wm_gizmogrouptype_find_for_add_remove(ReportList *reports, const char *idname) { - wmManipulatorGroupType *wgt = WM_manipulatorgrouptype_find(idname, true); + wmGizmoGroupType *wgt = WM_gizmogrouptype_find(idname, true); if (wgt == NULL) { - BKE_reportf(reports, RPT_ERROR, "Manipulator group type '%s' not found!", idname); + BKE_reportf(reports, RPT_ERROR, "Gizmo group type '%s' not found!", idname); return NULL; } - if (wgt->flag & WM_MANIPULATORGROUPTYPE_PERSISTENT) { - BKE_reportf(reports, RPT_ERROR, "Manipulator group '%s' has 'PERSISTENT' option set!", idname); + if (wgt->flag & WM_GIZMOGROUPTYPE_PERSISTENT) { + BKE_reportf(reports, RPT_ERROR, "Gizmo group '%s' has 'PERSISTENT' option set!", idname); return NULL; } return wgt; } -static void rna_manipulator_group_type_add(ReportList *reports, const char *idname) +static void rna_gizmo_group_type_add(ReportList *reports, const char *idname) { - wmManipulatorGroupType *wgt = wm_manipulatorgrouptype_find_for_add_remove(reports, idname); + wmGizmoGroupType *wgt = wm_gizmogrouptype_find_for_add_remove(reports, idname); if (wgt != NULL) { - WM_manipulator_group_type_add_ptr(wgt); + WM_gizmo_group_type_add_ptr(wgt); } } -static void rna_manipulator_group_type_remove(Main *bmain, ReportList *reports, const char *idname) +static void rna_gizmo_group_type_remove(Main *bmain, ReportList *reports, const char *idname) { - wmManipulatorGroupType *wgt = wm_manipulatorgrouptype_find_for_add_remove(reports, idname); + wmGizmoGroupType *wgt = wm_gizmogrouptype_find_for_add_remove(reports, idname); if (wgt != NULL) { - WM_manipulator_group_type_remove_ptr(bmain, wgt); + WM_gizmo_group_type_remove_ptr(bmain, wgt); } } @@ -516,16 +516,16 @@ void RNA_api_wm(StructRNA *srna) parm = RNA_def_pointer(func, "timer", "Timer", "", ""); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); - func = RNA_def_function(srna, "manipulator_group_type_add", "rna_manipulator_group_type_add"); + func = RNA_def_function(srna, "gizmo_group_type_add", "rna_gizmo_group_type_add"); RNA_def_function_ui_description(func, "Activate an existing widget group (when the persistent option isn't set)"); RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_REPORTS); - parm = RNA_def_string(func, "identifier", NULL, 0, "", "Manipulator group type name"); + parm = RNA_def_string(func, "identifier", NULL, 0, "", "Gizmo group type name"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - func = RNA_def_function(srna, "manipulator_group_type_remove", "rna_manipulator_group_type_remove"); + func = RNA_def_function(srna, "gizmo_group_type_remove", "rna_gizmo_group_type_remove"); RNA_def_function_ui_description(func, "De-activate a widget group (when the persistent option isn't set)"); RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_MAIN | FUNC_USE_REPORTS); - parm = RNA_def_string(func, "identifier", NULL, 0, "", "Manipulator group type name"); + parm = RNA_def_string(func, "identifier", NULL, 0, "", "Gizmo group type name"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); /* Progress bar interface */ diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c index c2c4c95b83f..754ef4575a4 100644 --- a/source/blender/makesrna/intern/rna_wm_gizmo.c +++ b/source/blender/makesrna/intern/rna_wm_gizmo.c @@ -71,38 +71,38 @@ /* -------------------------------------------------------------------- */ -/** \name Manipulator API +/** \name Gizmo API * \{ */ #ifdef WITH_PYTHON -static void rna_manipulator_draw_cb( - const struct bContext *C, struct wmManipulator *mpr) +static void rna_gizmo_draw_cb( + const struct bContext *C, struct wmGizmo *mpr) { - extern FunctionRNA rna_Manipulator_draw_func; - wmManipulatorGroup *mgroup = mpr->parent_mgroup; + extern FunctionRNA rna_Gizmo_draw_func; + wmGizmoGroup *mgroup = mpr->parent_mgroup; PointerRNA mpr_ptr; ParameterList list; FunctionRNA *func; RNA_pointer_create(NULL, mpr->type->ext.srna, mpr, &mpr_ptr); /* RNA_struct_find_function(&mpr_ptr, "draw"); */ - func = &rna_Manipulator_draw_func; + func = &rna_Gizmo_draw_func; RNA_parameter_list_create(&list, &mpr_ptr, func); RNA_parameter_set_lookup(&list, "context", &C); mgroup->type->ext.call((bContext *)C, &mpr_ptr, func, &list); RNA_parameter_list_free(&list); } -static void rna_manipulator_draw_select_cb( - const struct bContext *C, struct wmManipulator *mpr, int select_id) +static void rna_gizmo_draw_select_cb( + const struct bContext *C, struct wmGizmo *mpr, int select_id) { - extern FunctionRNA rna_Manipulator_draw_select_func; - wmManipulatorGroup *mgroup = mpr->parent_mgroup; + extern FunctionRNA rna_Gizmo_draw_select_func; + wmGizmoGroup *mgroup = mpr->parent_mgroup; PointerRNA mpr_ptr; ParameterList list; FunctionRNA *func; RNA_pointer_create(NULL, mpr->type->ext.srna, mpr, &mpr_ptr); /* RNA_struct_find_function(&mpr_ptr, "draw_select"); */ - func = &rna_Manipulator_draw_select_func; + func = &rna_Gizmo_draw_select_func; RNA_parameter_list_create(&list, &mpr_ptr, func); RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "select_id", &select_id); @@ -110,17 +110,17 @@ static void rna_manipulator_draw_select_cb( RNA_parameter_list_free(&list); } -static int rna_manipulator_test_select_cb( - struct bContext *C, struct wmManipulator *mpr, const struct wmEvent *event) +static int rna_gizmo_test_select_cb( + struct bContext *C, struct wmGizmo *mpr, const struct wmEvent *event) { - extern FunctionRNA rna_Manipulator_test_select_func; - wmManipulatorGroup *mgroup = mpr->parent_mgroup; + extern FunctionRNA rna_Gizmo_test_select_func; + wmGizmoGroup *mgroup = mpr->parent_mgroup; PointerRNA mpr_ptr; ParameterList list; FunctionRNA *func; RNA_pointer_create(NULL, mpr->type->ext.srna, mpr, &mpr_ptr); /* RNA_struct_find_function(&mpr_ptr, "test_select"); */ - func = &rna_Manipulator_test_select_func; + func = &rna_Gizmo_test_select_func; RNA_parameter_list_create(&list, &mpr_ptr, func); RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "event", &event); @@ -134,19 +134,19 @@ static int rna_manipulator_test_select_cb( return intersect_id; } -static int rna_manipulator_modal_cb( - struct bContext *C, struct wmManipulator *mpr, const struct wmEvent *event, - eWM_ManipulatorTweak tweak_flag) +static int rna_gizmo_modal_cb( + struct bContext *C, struct wmGizmo *mpr, const struct wmEvent *event, + eWM_GizmoFlagTweak tweak_flag) { - extern FunctionRNA rna_Manipulator_modal_func; - wmManipulatorGroup *mgroup = mpr->parent_mgroup; + extern FunctionRNA rna_Gizmo_modal_func; + wmGizmoGroup *mgroup = mpr->parent_mgroup; PointerRNA mpr_ptr; ParameterList list; FunctionRNA *func; const int tweak_flag_int = tweak_flag; RNA_pointer_create(NULL, mpr->type->ext.srna, mpr, &mpr_ptr); /* RNA_struct_find_function(&mpr_ptr, "modal"); */ - func = &rna_Manipulator_modal_func; + func = &rna_Gizmo_modal_func; RNA_parameter_list_create(&list, &mpr_ptr, func); RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "event", &event); @@ -161,34 +161,34 @@ static int rna_manipulator_modal_cb( return ret_enum; } -static void rna_manipulator_setup_cb( - struct wmManipulator *mpr) +static void rna_gizmo_setup_cb( + struct wmGizmo *mpr) { - extern FunctionRNA rna_Manipulator_setup_func; - wmManipulatorGroup *mgroup = mpr->parent_mgroup; + extern FunctionRNA rna_Gizmo_setup_func; + wmGizmoGroup *mgroup = mpr->parent_mgroup; PointerRNA mpr_ptr; ParameterList list; FunctionRNA *func; RNA_pointer_create(NULL, mpr->type->ext.srna, mpr, &mpr_ptr); /* RNA_struct_find_function(&mpr_ptr, "setup"); */ - func = &rna_Manipulator_setup_func; + func = &rna_Gizmo_setup_func; RNA_parameter_list_create(&list, &mpr_ptr, func); mgroup->type->ext.call((bContext *)NULL, &mpr_ptr, func, &list); RNA_parameter_list_free(&list); } -static int rna_manipulator_invoke_cb( - struct bContext *C, struct wmManipulator *mpr, const struct wmEvent *event) +static int rna_gizmo_invoke_cb( + struct bContext *C, struct wmGizmo *mpr, const struct wmEvent *event) { - extern FunctionRNA rna_Manipulator_invoke_func; - wmManipulatorGroup *mgroup = mpr->parent_mgroup; + extern FunctionRNA rna_Gizmo_invoke_func; + wmGizmoGroup *mgroup = mpr->parent_mgroup; PointerRNA mpr_ptr; ParameterList list; FunctionRNA *func; RNA_pointer_create(NULL, mpr->type->ext.srna, mpr, &mpr_ptr); /* RNA_struct_find_function(&mpr_ptr, "invoke"); */ - func = &rna_Manipulator_invoke_func; + func = &rna_Gizmo_invoke_func; RNA_parameter_list_create(&list, &mpr_ptr, func); RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "event", &event); @@ -202,17 +202,17 @@ static int rna_manipulator_invoke_cb( return ret_enum; } -static void rna_manipulator_exit_cb( - struct bContext *C, struct wmManipulator *mpr, bool cancel) +static void rna_gizmo_exit_cb( + struct bContext *C, struct wmGizmo *mpr, bool cancel) { - extern FunctionRNA rna_Manipulator_exit_func; - wmManipulatorGroup *mgroup = mpr->parent_mgroup; + extern FunctionRNA rna_Gizmo_exit_func; + wmGizmoGroup *mgroup = mpr->parent_mgroup; PointerRNA mpr_ptr; ParameterList list; FunctionRNA *func; RNA_pointer_create(NULL, mpr->type->ext.srna, mpr, &mpr_ptr); /* RNA_struct_find_function(&mpr_ptr, "exit"); */ - func = &rna_Manipulator_exit_func; + func = &rna_Gizmo_exit_func; RNA_parameter_list_create(&list, &mpr_ptr, func); RNA_parameter_set_lookup(&list, "context", &C); { @@ -223,17 +223,17 @@ static void rna_manipulator_exit_cb( RNA_parameter_list_free(&list); } -static void rna_manipulator_select_refresh_cb( - struct wmManipulator *mpr) +static void rna_gizmo_select_refresh_cb( + struct wmGizmo *mpr) { - extern FunctionRNA rna_Manipulator_select_refresh_func; - wmManipulatorGroup *mgroup = mpr->parent_mgroup; + extern FunctionRNA rna_Gizmo_select_refresh_func; + wmGizmoGroup *mgroup = mpr->parent_mgroup; PointerRNA mpr_ptr; ParameterList list; FunctionRNA *func; RNA_pointer_create(NULL, mpr->type->ext.srna, mpr, &mpr_ptr); /* RNA_struct_find_function(&mpr_ptr, "select_refresh"); */ - func = &rna_Manipulator_select_refresh_func; + func = &rna_Gizmo_select_refresh_func; RNA_parameter_list_create(&list, &mpr_ptr, func); mgroup->type->ext.call((bContext *)NULL, &mpr_ptr, func, &list); RNA_parameter_list_free(&list); @@ -242,9 +242,9 @@ static void rna_manipulator_select_refresh_cb( #endif /* WITH_PYTHON */ /* just to work around 'const char *' warning and to ensure this is a python op */ -static void rna_Manipulator_bl_idname_set(PointerRNA *ptr, const char *value) +static void rna_Gizmo_bl_idname_set(PointerRNA *ptr, const char *value) { - wmManipulator *data = ptr->data; + wmGizmo *data = ptr->data; char *str = (char *)data->type->idname; if (!str[0]) { BLI_strncpy(str, value, MAX_NAME); /* utf8 already ensured */ @@ -254,7 +254,7 @@ static void rna_Manipulator_bl_idname_set(PointerRNA *ptr, const char *value) } } -static wmManipulator *rna_ManipulatorProperties_find_operator(PointerRNA *ptr) +static wmGizmo *rna_GizmoProperties_find_operator(PointerRNA *ptr) { #if 0 wmWindowManager *wm = ptr->id.data; @@ -265,13 +265,13 @@ static wmManipulator *rna_ManipulatorProperties_find_operator(PointerRNA *ptr) IDProperty *properties = ptr->data; for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) { - if (ar->manipulator_map) { - wmManipulatorMap *mmap = ar->manipulator_map; - for (wmManipulatorGroup *mgroup = WM_manipulatormap_group_list(mmap)->first; + if (ar->gizmo_map) { + wmGizmoMap *mmap = ar->gizmo_map; + for (wmGizmoGroup *mgroup = WM_gizmomap_group_list(mmap)->first; mgroup; mgroup = mgroup->next) { - for (wmManipulator *mpr = mgroup->manipulators.first; mpr; mpr = mpr->next) { + for (wmGizmo *mpr = mgroup->gizmos.first; mpr; mpr = mpr->next) { if (mpr->properties == properties) { return mpr; } @@ -284,9 +284,9 @@ static wmManipulator *rna_ManipulatorProperties_find_operator(PointerRNA *ptr) return NULL; } -static StructRNA *rna_ManipulatorProperties_refine(PointerRNA *ptr) +static StructRNA *rna_GizmoProperties_refine(PointerRNA *ptr) { - wmManipulator *mpr = rna_ManipulatorProperties_find_operator(ptr); + wmGizmo *mpr = rna_GizmoProperties_find_operator(ptr); if (mpr) return mpr->type->srna; @@ -294,143 +294,143 @@ static StructRNA *rna_ManipulatorProperties_refine(PointerRNA *ptr) return ptr->type; } -static IDProperty *rna_ManipulatorProperties_idprops(PointerRNA *ptr, bool create) +static IDProperty *rna_GizmoProperties_idprops(PointerRNA *ptr, bool create) { if (create && !ptr->data) { IDPropertyTemplate val = {0}; - ptr->data = IDP_New(IDP_GROUP, &val, "RNA_ManipulatorProperties group"); + ptr->data = IDP_New(IDP_GROUP, &val, "RNA_GizmoProperties group"); } return ptr->data; } -static PointerRNA rna_Manipulator_properties_get(PointerRNA *ptr) +static PointerRNA rna_Gizmo_properties_get(PointerRNA *ptr) { - wmManipulator *mpr = ptr->data; + wmGizmo *mpr = ptr->data; return rna_pointer_inherit_refine(ptr, mpr->type->srna, mpr->properties); } -/* wmManipulator.float */ -#define RNA_MANIPULATOR_GENERIC_FLOAT_RW_DEF(func_id, member_id) \ -static float rna_Manipulator_##func_id##_get(PointerRNA *ptr) \ +/* wmGizmo.float */ +#define RNA_GIZMO_GENERIC_FLOAT_RW_DEF(func_id, member_id) \ +static float rna_Gizmo_##func_id##_get(PointerRNA *ptr) \ { \ - wmManipulator *mpr = ptr->data; \ + wmGizmo *mpr = ptr->data; \ return mpr->member_id; \ } \ -static void rna_Manipulator_##func_id##_set(PointerRNA *ptr, float value) \ +static void rna_Gizmo_##func_id##_set(PointerRNA *ptr, float value) \ { \ - wmManipulator *mpr = ptr->data; \ + wmGizmo *mpr = ptr->data; \ mpr->member_id = value; \ } -#define RNA_MANIPULATOR_GENERIC_FLOAT_ARRAY_INDEX_RW_DEF(func_id, member_id, index) \ -static float rna_Manipulator_##func_id##_get(PointerRNA *ptr) \ +#define RNA_GIZMO_GENERIC_FLOAT_ARRAY_INDEX_RW_DEF(func_id, member_id, index) \ +static float rna_Gizmo_##func_id##_get(PointerRNA *ptr) \ { \ - wmManipulator *mpr = ptr->data; \ + wmGizmo *mpr = ptr->data; \ return mpr->member_id[index]; \ } \ -static void rna_Manipulator_##func_id##_set(PointerRNA *ptr, float value) \ +static void rna_Gizmo_##func_id##_set(PointerRNA *ptr, float value) \ { \ - wmManipulator *mpr = ptr->data; \ + wmGizmo *mpr = ptr->data; \ mpr->member_id[index] = value; \ } -/* wmManipulator.float[len] */ -#define RNA_MANIPULATOR_GENERIC_FLOAT_ARRAY_RW_DEF(func_id, member_id, len) \ -static void rna_Manipulator_##func_id##_get(PointerRNA *ptr, float value[len]) \ +/* wmGizmo.float[len] */ +#define RNA_GIZMO_GENERIC_FLOAT_ARRAY_RW_DEF(func_id, member_id, len) \ +static void rna_Gizmo_##func_id##_get(PointerRNA *ptr, float value[len]) \ { \ - wmManipulator *mpr = ptr->data; \ + wmGizmo *mpr = ptr->data; \ memcpy(value, mpr->member_id, sizeof(float[len])); \ } \ -static void rna_Manipulator_##func_id##_set(PointerRNA *ptr, const float value[len]) \ +static void rna_Gizmo_##func_id##_set(PointerRNA *ptr, const float value[len]) \ { \ - wmManipulator *mpr = ptr->data; \ + wmGizmo *mpr = ptr->data; \ memcpy(mpr->member_id, value, sizeof(float[len])); \ } -/* wmManipulator.flag */ -#define RNA_MANIPULATOR_GENERIC_FLAG_RW_DEF(func_id, member_id, flag_value) \ -static bool rna_Manipulator_##func_id##_get(PointerRNA *ptr) \ +/* wmGizmo.flag */ +#define RNA_GIZMO_GENERIC_FLAG_RW_DEF(func_id, member_id, flag_value) \ +static bool rna_Gizmo_##func_id##_get(PointerRNA *ptr) \ { \ - wmManipulator *mpr = ptr->data; \ + wmGizmo *mpr = ptr->data; \ return (mpr->member_id & flag_value) != 0; \ } \ -static void rna_Manipulator_##func_id##_set(PointerRNA *ptr, bool value) \ +static void rna_Gizmo_##func_id##_set(PointerRNA *ptr, bool value) \ { \ - wmManipulator *mpr = ptr->data; \ + wmGizmo *mpr = ptr->data; \ SET_FLAG_FROM_TEST(mpr->member_id, value, flag_value); \ } -/* wmManipulator.flag (negative) */ -#define RNA_MANIPULATOR_GENERIC_FLAG_NEG_RW_DEF(func_id, member_id, flag_value) \ -static bool rna_Manipulator_##func_id##_get(PointerRNA *ptr) \ +/* wmGizmo.flag (negative) */ +#define RNA_GIZMO_GENERIC_FLAG_NEG_RW_DEF(func_id, member_id, flag_value) \ +static bool rna_Gizmo_##func_id##_get(PointerRNA *ptr) \ { \ - wmManipulator *mpr = ptr->data; \ + wmGizmo *mpr = ptr->data; \ return (mpr->member_id & flag_value) == 0; \ } \ -static void rna_Manipulator_##func_id##_set(PointerRNA *ptr, bool value) \ +static void rna_Gizmo_##func_id##_set(PointerRNA *ptr, bool value) \ { \ - wmManipulator *mpr = ptr->data; \ + wmGizmo *mpr = ptr->data; \ SET_FLAG_FROM_TEST(mpr->member_id, !value, flag_value); \ } -#define RNA_MANIPULATOR_FLAG_RO_DEF(func_id, member_id, flag_value) \ -static int rna_Manipulator_##func_id##_get(PointerRNA *ptr) \ +#define RNA_GIZMO_FLAG_RO_DEF(func_id, member_id, flag_value) \ +static int rna_Gizmo_##func_id##_get(PointerRNA *ptr) \ { \ - wmManipulator *mpr = ptr->data; \ + wmGizmo *mpr = ptr->data; \ return (mpr->member_id & flag_value) != 0; \ } -RNA_MANIPULATOR_GENERIC_FLOAT_ARRAY_RW_DEF(color, color, 3); -RNA_MANIPULATOR_GENERIC_FLOAT_ARRAY_RW_DEF(color_hi, color_hi, 3); +RNA_GIZMO_GENERIC_FLOAT_ARRAY_RW_DEF(color, color, 3); +RNA_GIZMO_GENERIC_FLOAT_ARRAY_RW_DEF(color_hi, color_hi, 3); -RNA_MANIPULATOR_GENERIC_FLOAT_ARRAY_INDEX_RW_DEF(alpha, color, 3); -RNA_MANIPULATOR_GENERIC_FLOAT_ARRAY_INDEX_RW_DEF(alpha_hi, color_hi, 3); +RNA_GIZMO_GENERIC_FLOAT_ARRAY_INDEX_RW_DEF(alpha, color, 3); +RNA_GIZMO_GENERIC_FLOAT_ARRAY_INDEX_RW_DEF(alpha_hi, color_hi, 3); -RNA_MANIPULATOR_GENERIC_FLOAT_ARRAY_RW_DEF(matrix_space, matrix_space, 16); -RNA_MANIPULATOR_GENERIC_FLOAT_ARRAY_RW_DEF(matrix_basis, matrix_basis, 16); -RNA_MANIPULATOR_GENERIC_FLOAT_ARRAY_RW_DEF(matrix_offset, matrix_offset, 16); +RNA_GIZMO_GENERIC_FLOAT_ARRAY_RW_DEF(matrix_space, matrix_space, 16); +RNA_GIZMO_GENERIC_FLOAT_ARRAY_RW_DEF(matrix_basis, matrix_basis, 16); +RNA_GIZMO_GENERIC_FLOAT_ARRAY_RW_DEF(matrix_offset, matrix_offset, 16); -static void rna_Manipulator_matrix_world_get(PointerRNA *ptr, float value[16]) +static void rna_Gizmo_matrix_world_get(PointerRNA *ptr, float value[16]) { - wmManipulator *mpr = ptr->data; - WM_manipulator_calc_matrix_final(mpr, (float (*)[4])value); + wmGizmo *mpr = ptr->data; + WM_gizmo_calc_matrix_final(mpr, (float (*)[4])value); } -RNA_MANIPULATOR_GENERIC_FLOAT_RW_DEF(scale_basis, scale_basis); -RNA_MANIPULATOR_GENERIC_FLOAT_RW_DEF(line_width, line_width); +RNA_GIZMO_GENERIC_FLOAT_RW_DEF(scale_basis, scale_basis); +RNA_GIZMO_GENERIC_FLOAT_RW_DEF(line_width, line_width); -RNA_MANIPULATOR_GENERIC_FLAG_RW_DEF(flag_use_draw_hover, flag, WM_MANIPULATOR_DRAW_HOVER); -RNA_MANIPULATOR_GENERIC_FLAG_RW_DEF(flag_use_draw_modal, flag, WM_MANIPULATOR_DRAW_MODAL); -RNA_MANIPULATOR_GENERIC_FLAG_RW_DEF(flag_use_draw_value, flag, WM_MANIPULATOR_DRAW_VALUE); -RNA_MANIPULATOR_GENERIC_FLAG_RW_DEF(flag_use_draw_offset_scale, flag, WM_MANIPULATOR_DRAW_OFFSET_SCALE); -RNA_MANIPULATOR_GENERIC_FLAG_NEG_RW_DEF(flag_use_draw_scale, flag, WM_MANIPULATOR_DRAW_OFFSET_SCALE); -RNA_MANIPULATOR_GENERIC_FLAG_RW_DEF(flag_hide, flag, WM_MANIPULATOR_HIDDEN); -RNA_MANIPULATOR_GENERIC_FLAG_RW_DEF(flag_use_grab_cursor, flag, WM_MANIPULATOR_GRAB_CURSOR); -RNA_MANIPULATOR_GENERIC_FLAG_RW_DEF(flag_use_select_background, flag, WM_MANIPULATOR_SELECT_BACKGROUND); +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); +RNA_GIZMO_GENERIC_FLAG_RW_DEF(flag_use_draw_value, flag, WM_GIZMO_DRAW_VALUE); +RNA_GIZMO_GENERIC_FLAG_RW_DEF(flag_use_draw_offset_scale, flag, WM_GIZMO_DRAW_OFFSET_SCALE); +RNA_GIZMO_GENERIC_FLAG_NEG_RW_DEF(flag_use_draw_scale, flag, WM_GIZMO_DRAW_OFFSET_SCALE); +RNA_GIZMO_GENERIC_FLAG_RW_DEF(flag_hide, flag, WM_GIZMO_HIDDEN); +RNA_GIZMO_GENERIC_FLAG_RW_DEF(flag_use_grab_cursor, flag, WM_GIZMO_GRAB_CURSOR); +RNA_GIZMO_GENERIC_FLAG_RW_DEF(flag_use_select_background, flag, WM_GIZMO_SELECT_BACKGROUND); -/* wmManipulator.state */ -RNA_MANIPULATOR_FLAG_RO_DEF(state_is_highlight, state, WM_MANIPULATOR_STATE_HIGHLIGHT); -RNA_MANIPULATOR_FLAG_RO_DEF(state_is_modal, state, WM_MANIPULATOR_STATE_MODAL); -RNA_MANIPULATOR_FLAG_RO_DEF(state_select, state, WM_MANIPULATOR_STATE_SELECT); +/* wmGizmo.state */ +RNA_GIZMO_FLAG_RO_DEF(state_is_highlight, state, WM_GIZMO_STATE_HIGHLIGHT); +RNA_GIZMO_FLAG_RO_DEF(state_is_modal, state, WM_GIZMO_STATE_MODAL); +RNA_GIZMO_FLAG_RO_DEF(state_select, state, WM_GIZMO_STATE_SELECT); -static void rna_Manipulator_state_select_set(struct PointerRNA *ptr, bool value) +static void rna_Gizmo_state_select_set(struct PointerRNA *ptr, bool value) { - wmManipulator *mpr = ptr->data; - wmManipulatorGroup *mgroup = mpr->parent_mgroup; - WM_manipulator_select_set(mgroup->parent_mmap, mpr, value); + wmGizmo *mpr = ptr->data; + wmGizmoGroup *mgroup = mpr->parent_mgroup; + WM_gizmo_select_set(mgroup->parent_mmap, mpr, value); } -static PointerRNA rna_Manipulator_group_get(PointerRNA *ptr) +static PointerRNA rna_Gizmo_group_get(PointerRNA *ptr) { - wmManipulator *mpr = ptr->data; - return rna_pointer_inherit_refine(ptr, &RNA_ManipulatorGroup, mpr->parent_mgroup); + wmGizmo *mpr = ptr->data; + return rna_pointer_inherit_refine(ptr, &RNA_GizmoGroup, mpr->parent_mgroup); } #ifdef WITH_PYTHON -static void rna_Manipulator_unregister(struct Main *bmain, StructRNA *type); -void BPY_RNA_manipulator_wrapper(wmManipulatorType *wgt, void *userdata); +static void rna_Gizmo_unregister(struct Main *bmain, StructRNA *type); +void BPY_RNA_gizmo_wrapper(wmGizmoType *wgt, void *userdata); -static StructRNA *rna_Manipulator_register( +static StructRNA *rna_Gizmo_register( Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { @@ -438,17 +438,17 @@ static StructRNA *rna_Manipulator_register( char idname[MAX_NAME]; } temp_buffers; - wmManipulatorType dummywt = {NULL}; - wmManipulator dummymnp = {NULL}; + wmGizmoType dummywt = {NULL}; + wmGizmo dummymnp = {NULL}; PointerRNA mnp_ptr; /* Two sets of functions. */ int have_function[8]; - /* setup dummy manipulator & manipulator type to store static properties in */ + /* setup dummy gizmo & gizmo type to store static properties in */ dummymnp.type = &dummywt; dummywt.idname = temp_buffers.idname; - RNA_pointer_create(NULL, &RNA_Manipulator, &dummymnp, &mnp_ptr); + RNA_pointer_create(NULL, &RNA_Gizmo, &dummymnp, &mnp_ptr); /* Clear so we can detect if it's left unset. */ temp_buffers.idname[0] = '\0'; @@ -458,16 +458,16 @@ static StructRNA *rna_Manipulator_register( return NULL; if (strlen(identifier) >= sizeof(temp_buffers.idname)) { - BKE_reportf(reports, RPT_ERROR, "Registering manipulator class: '%s' is too long, maximum length is %d", + BKE_reportf(reports, RPT_ERROR, "Registering gizmo class: '%s' is too long, maximum length is %d", identifier, (int)sizeof(temp_buffers.idname)); return NULL; } - /* check if we have registered this manipulator type before, and remove it */ + /* check if we have registered this gizmo type before, and remove it */ { - const wmManipulatorType *wt = WM_manipulatortype_find(dummywt.idname, true); + const wmGizmoType *wt = WM_gizmotype_find(dummywt.idname, true); if (wt && wt->ext.srna) { - rna_Manipulator_unregister(bmain, wt->ext.srna); + rna_Gizmo_unregister(bmain, wt->ext.srna); } } if (!RNA_struct_available_or_report(reports, dummywt.idname)) { @@ -475,13 +475,13 @@ static StructRNA *rna_Manipulator_register( } { /* allocate the idname */ - /* For multiple strings see ManipulatorGroup. */ + /* For multiple strings see GizmoGroup. */ dummywt.idname = BLI_strdup(temp_buffers.idname); } - /* create a new manipulator type */ - dummywt.ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummywt.idname, &RNA_Manipulator); - /* manipulator properties are registered separately */ + /* create a new gizmo type */ + dummywt.ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummywt.idname, &RNA_Gizmo); + /* gizmo properties are registered separately */ RNA_def_struct_flag(dummywt.ext.srna, STRUCT_NO_IDPROPERTIES); dummywt.ext.data = data; dummywt.ext.call = call; @@ -489,21 +489,21 @@ static StructRNA *rna_Manipulator_register( { int i = 0; - dummywt.draw = (have_function[i++]) ? rna_manipulator_draw_cb : NULL; - dummywt.draw_select = (have_function[i++]) ? rna_manipulator_draw_select_cb : NULL; - dummywt.test_select = (have_function[i++]) ? rna_manipulator_test_select_cb : NULL; - dummywt.modal = (have_function[i++]) ? rna_manipulator_modal_cb : NULL; -// dummywt.property_update = (have_function[i++]) ? rna_manipulator_property_update : NULL; -// dummywt.position_get = (have_function[i++]) ? rna_manipulator_position_get : NULL; - dummywt.setup = (have_function[i++]) ? rna_manipulator_setup_cb : NULL; - dummywt.invoke = (have_function[i++]) ? rna_manipulator_invoke_cb : NULL; - dummywt.exit = (have_function[i++]) ? rna_manipulator_exit_cb : NULL; - dummywt.select_refresh = (have_function[i++]) ? rna_manipulator_select_refresh_cb : NULL; + dummywt.draw = (have_function[i++]) ? rna_gizmo_draw_cb : NULL; + dummywt.draw_select = (have_function[i++]) ? rna_gizmo_draw_select_cb : NULL; + dummywt.test_select = (have_function[i++]) ? rna_gizmo_test_select_cb : NULL; + dummywt.modal = (have_function[i++]) ? rna_gizmo_modal_cb : NULL; +// dummywt.property_update = (have_function[i++]) ? rna_gizmo_property_update : NULL; +// dummywt.position_get = (have_function[i++]) ? rna_gizmo_position_get : NULL; + dummywt.setup = (have_function[i++]) ? rna_gizmo_setup_cb : NULL; + dummywt.invoke = (have_function[i++]) ? rna_gizmo_invoke_cb : NULL; + dummywt.exit = (have_function[i++]) ? rna_gizmo_exit_cb : NULL; + dummywt.select_refresh = (have_function[i++]) ? rna_gizmo_select_refresh_cb : NULL; BLI_assert(i == ARRAY_SIZE(have_function)); } - WM_manipulatortype_append_ptr(BPY_RNA_manipulator_wrapper, (void *)&dummywt); + WM_gizmotype_append_ptr(BPY_RNA_gizmo_wrapper, (void *)&dummywt); /* update while blender is running */ WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); @@ -511,9 +511,9 @@ static StructRNA *rna_Manipulator_register( return dummywt.ext.srna; } -static void rna_Manipulator_unregister(struct Main *bmain, StructRNA *type) +static void rna_Gizmo_unregister(struct Main *bmain, StructRNA *type) { - wmManipulatorType *wt = RNA_struct_blender_type_get(type); + wmGizmoType *wt = RNA_struct_blender_type_get(type); if (!wt) return; @@ -523,71 +523,71 @@ static void rna_Manipulator_unregister(struct Main *bmain, StructRNA *type) WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); - WM_manipulatortype_remove_ptr(NULL, bmain, wt); + WM_gizmotype_remove_ptr(NULL, bmain, wt); } -static void **rna_Manipulator_instance(PointerRNA *ptr) +static void **rna_Gizmo_instance(PointerRNA *ptr) { - wmManipulator *mpr = ptr->data; + wmGizmo *mpr = ptr->data; return &mpr->py_instance; } #endif /* WITH_PYTHON */ -static StructRNA *rna_Manipulator_refine(PointerRNA *mnp_ptr) +static StructRNA *rna_Gizmo_refine(PointerRNA *mnp_ptr) { - wmManipulator *mpr = mnp_ptr->data; - return (mpr->type && mpr->type->ext.srna) ? mpr->type->ext.srna : &RNA_Manipulator; + wmGizmo *mpr = mnp_ptr->data; + return (mpr->type && mpr->type->ext.srna) ? mpr->type->ext.srna : &RNA_Gizmo; } /** \} */ -/** \name Manipulator Group API +/** \name Gizmo Group API * \{ */ -static wmManipulator *rna_ManipulatorGroup_manipulator_new( - wmManipulatorGroup *mgroup, ReportList *reports, const char *idname) +static wmGizmo *rna_GizmoGroup_gizmo_new( + wmGizmoGroup *mgroup, ReportList *reports, const char *idname) { - const wmManipulatorType *wt = WM_manipulatortype_find(idname, true); + const wmGizmoType *wt = WM_gizmotype_find(idname, true); if (wt == NULL) { - BKE_reportf(reports, RPT_ERROR, "ManipulatorType '%s' not known", idname); + BKE_reportf(reports, RPT_ERROR, "GizmoType '%s' not known", idname); return NULL; } - wmManipulator *mpr = WM_manipulator_new_ptr(wt, mgroup, NULL); + wmGizmo *mpr = WM_gizmo_new_ptr(wt, mgroup, NULL); return mpr; } -static void rna_ManipulatorGroup_manipulator_remove( - wmManipulatorGroup *mgroup, bContext *C, wmManipulator *mpr) +static void rna_GizmoGroup_gizmo_remove( + wmGizmoGroup *mgroup, bContext *C, wmGizmo *mpr) { - WM_manipulator_unlink(&mgroup->manipulators, mgroup->parent_mmap, mpr, C); + WM_gizmo_unlink(&mgroup->gizmos, mgroup->parent_mmap, mpr, C); } -static void rna_ManipulatorGroup_manipulator_clear( - wmManipulatorGroup *mgroup, bContext *C) +static void rna_GizmoGroup_gizmo_clear( + wmGizmoGroup *mgroup, bContext *C) { - while (mgroup->manipulators.first) { - WM_manipulator_unlink(&mgroup->manipulators, mgroup->parent_mmap, mgroup->manipulators.first, C); + while (mgroup->gizmos.first) { + WM_gizmo_unlink(&mgroup->gizmos, mgroup->parent_mmap, mgroup->gizmos.first, C); } } -static void rna_ManipulatorGroup_name_get(PointerRNA *ptr, char *value) +static void rna_GizmoGroup_name_get(PointerRNA *ptr, char *value) { - wmManipulatorGroup *mgroup = ptr->data; + wmGizmoGroup *mgroup = ptr->data; strcpy(value, mgroup->type->name); } -static int rna_ManipulatorGroup_name_length(PointerRNA *ptr) +static int rna_GizmoGroup_name_length(PointerRNA *ptr) { - wmManipulatorGroup *mgroup = ptr->data; + wmGizmoGroup *mgroup = ptr->data; return strlen(mgroup->type->name); } /* just to work around 'const char *' warning and to ensure this is a python op */ -static void rna_ManipulatorGroup_bl_idname_set(PointerRNA *ptr, const char *value) +static void rna_GizmoGroup_bl_idname_set(PointerRNA *ptr, const char *value) { - wmManipulatorGroup *data = ptr->data; + wmGizmoGroup *data = ptr->data; char *str = (char *)data->type->idname; if (!str[0]) BLI_strncpy(str, value, MAX_NAME); /* utf8 already ensured */ @@ -595,9 +595,9 @@ static void rna_ManipulatorGroup_bl_idname_set(PointerRNA *ptr, const char *valu assert(!"setting the bl_idname on a non-builtin operator"); } -static void rna_ManipulatorGroup_bl_label_set(PointerRNA *ptr, const char *value) +static void rna_GizmoGroup_bl_label_set(PointerRNA *ptr, const char *value) { - wmManipulatorGroup *data = ptr->data; + wmGizmoGroup *data = ptr->data; char *str = (char *)data->type->name; if (!str[0]) BLI_strncpy(str, value, MAX_NAME); /* utf8 already ensured */ @@ -605,18 +605,18 @@ static void rna_ManipulatorGroup_bl_label_set(PointerRNA *ptr, const char *value assert(!"setting the bl_label on a non-builtin operator"); } -static bool rna_ManipulatorGroup_has_reports_get(PointerRNA *ptr) +static bool rna_GizmoGroup_has_reports_get(PointerRNA *ptr) { - wmManipulatorGroup *mgroup = ptr->data; + wmGizmoGroup *mgroup = ptr->data; return (mgroup->reports && mgroup->reports->list.first); } #ifdef WITH_PYTHON -static bool rna_manipulatorgroup_poll_cb(const bContext *C, wmManipulatorGroupType *wgt) +static bool rna_gizmogroup_poll_cb(const bContext *C, wmGizmoGroupType *wgt) { - extern FunctionRNA rna_ManipulatorGroup_poll_func; + extern FunctionRNA rna_GizmoGroup_poll_func; PointerRNA ptr; ParameterList list; @@ -625,7 +625,7 @@ static bool rna_manipulatorgroup_poll_cb(const bContext *C, wmManipulatorGroupTy int visible; RNA_pointer_create(NULL, wgt->ext.srna, NULL, &ptr); /* dummy */ - func = &rna_ManipulatorGroup_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */ + func = &rna_GizmoGroup_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */ RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_set_lookup(&list, "context", &C); @@ -639,16 +639,16 @@ static bool rna_manipulatorgroup_poll_cb(const bContext *C, wmManipulatorGroupTy return visible; } -static void rna_manipulatorgroup_setup_cb(const bContext *C, wmManipulatorGroup *mgroup) +static void rna_gizmogroup_setup_cb(const bContext *C, wmGizmoGroup *mgroup) { - extern FunctionRNA rna_ManipulatorGroup_setup_func; + extern FunctionRNA rna_GizmoGroup_setup_func; PointerRNA mgroup_ptr; ParameterList list; FunctionRNA *func; RNA_pointer_create(NULL, mgroup->type->ext.srna, mgroup, &mgroup_ptr); - func = &rna_ManipulatorGroup_setup_func; /* RNA_struct_find_function(&wgroupr, "setup"); */ + func = &rna_GizmoGroup_setup_func; /* RNA_struct_find_function(&wgroupr, "setup"); */ RNA_parameter_list_create(&list, &mgroup_ptr, func); RNA_parameter_set_lookup(&list, "context", &C); @@ -657,9 +657,9 @@ static void rna_manipulatorgroup_setup_cb(const bContext *C, wmManipulatorGroup RNA_parameter_list_free(&list); } -static wmKeyMap *rna_manipulatorgroup_setup_keymap_cb(const wmManipulatorGroupType *wgt, wmKeyConfig *config) +static wmKeyMap *rna_gizmogroup_setup_keymap_cb(const wmGizmoGroupType *wgt, wmKeyConfig *config) { - extern FunctionRNA rna_ManipulatorGroup_setup_keymap_func; + extern FunctionRNA rna_GizmoGroup_setup_keymap_func; void *ret; PointerRNA ptr; @@ -667,7 +667,7 @@ static wmKeyMap *rna_manipulatorgroup_setup_keymap_cb(const wmManipulatorGroupTy FunctionRNA *func; RNA_pointer_create(NULL, wgt->ext.srna, NULL, &ptr); /* dummy */ - func = &rna_ManipulatorGroup_setup_keymap_func; /* RNA_struct_find_function(&wgroupr, "setup_keymap"); */ + func = &rna_GizmoGroup_setup_keymap_func; /* RNA_struct_find_function(&wgroupr, "setup_keymap"); */ RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_set_lookup(&list, "keyconfig", &config); @@ -681,16 +681,16 @@ static wmKeyMap *rna_manipulatorgroup_setup_keymap_cb(const wmManipulatorGroupTy return keymap; } -static void rna_manipulatorgroup_refresh_cb(const bContext *C, wmManipulatorGroup *mgroup) +static void rna_gizmogroup_refresh_cb(const bContext *C, wmGizmoGroup *mgroup) { - extern FunctionRNA rna_ManipulatorGroup_refresh_func; + extern FunctionRNA rna_GizmoGroup_refresh_func; PointerRNA mgroup_ptr; ParameterList list; FunctionRNA *func; RNA_pointer_create(NULL, mgroup->type->ext.srna, mgroup, &mgroup_ptr); - func = &rna_ManipulatorGroup_refresh_func; /* RNA_struct_find_function(&wgroupr, "refresh"); */ + func = &rna_GizmoGroup_refresh_func; /* RNA_struct_find_function(&wgroupr, "refresh"); */ RNA_parameter_list_create(&list, &mgroup_ptr, func); RNA_parameter_set_lookup(&list, "context", &C); @@ -699,16 +699,16 @@ static void rna_manipulatorgroup_refresh_cb(const bContext *C, wmManipulatorGrou RNA_parameter_list_free(&list); } -static void rna_manipulatorgroup_draw_prepare_cb(const bContext *C, wmManipulatorGroup *mgroup) +static void rna_gizmogroup_draw_prepare_cb(const bContext *C, wmGizmoGroup *mgroup) { - extern FunctionRNA rna_ManipulatorGroup_draw_prepare_func; + extern FunctionRNA rna_GizmoGroup_draw_prepare_func; PointerRNA mgroup_ptr; ParameterList list; FunctionRNA *func; RNA_pointer_create(NULL, mgroup->type->ext.srna, mgroup, &mgroup_ptr); - func = &rna_ManipulatorGroup_draw_prepare_func; /* RNA_struct_find_function(&wgroupr, "draw_prepare"); */ + func = &rna_GizmoGroup_draw_prepare_func; /* RNA_struct_find_function(&wgroupr, "draw_prepare"); */ RNA_parameter_list_create(&list, &mgroup_ptr, func); RNA_parameter_set_lookup(&list, "context", &C); @@ -717,10 +717,10 @@ static void rna_manipulatorgroup_draw_prepare_cb(const bContext *C, wmManipulato RNA_parameter_list_free(&list); } -void BPY_RNA_manipulatorgroup_wrapper(wmManipulatorGroupType *wgt, void *userdata); -static void rna_ManipulatorGroup_unregister(struct Main *bmain, StructRNA *type); +void BPY_RNA_gizmogroup_wrapper(wmGizmoGroupType *wgt, void *userdata); +static void rna_GizmoGroup_unregister(struct Main *bmain, StructRNA *type); -static StructRNA *rna_ManipulatorGroup_register( +static StructRNA *rna_GizmoGroup_register( Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { @@ -729,19 +729,19 @@ static StructRNA *rna_ManipulatorGroup_register( char idname[MAX_NAME]; } temp_buffers; - wmManipulatorGroupType dummywgt = {NULL}; - wmManipulatorGroup dummywg = {NULL}; + wmGizmoGroupType dummywgt = {NULL}; + wmGizmoGroup dummywg = {NULL}; PointerRNA wgptr; /* Two sets of functions. */ int have_function[5]; - /* setup dummy manipulatorgroup & manipulatorgroup type to store static properties in */ + /* setup dummy gizmogroup & gizmogroup type to store static properties in */ dummywg.type = &dummywgt; dummywgt.name = temp_buffers.name; dummywgt.idname = temp_buffers.idname; - RNA_pointer_create(NULL, &RNA_ManipulatorGroup, &dummywg, &wgptr); + RNA_pointer_create(NULL, &RNA_GizmoGroup, &dummywg, &wgptr); /* Clear so we can detect if it's left unset. */ temp_buffers.idname[0] = temp_buffers.name[0] = '\0'; @@ -751,28 +751,28 @@ static StructRNA *rna_ManipulatorGroup_register( return NULL; if (strlen(identifier) >= sizeof(temp_buffers.idname)) { - BKE_reportf(reports, RPT_ERROR, "Registering manipulatorgroup class: '%s' is too long, maximum length is %d", + BKE_reportf(reports, RPT_ERROR, "Registering gizmogroup class: '%s' is too long, maximum length is %d", identifier, (int)sizeof(temp_buffers.idname)); return NULL; } /* check if the area supports widgets */ - const struct wmManipulatorMapType_Params wmap_params = { + const struct wmGizmoMapType_Params wmap_params = { .spaceid = dummywgt.mmap_params.spaceid, .regionid = dummywgt.mmap_params.regionid, }; - wmManipulatorMapType *mmap_type = WM_manipulatormaptype_ensure(&wmap_params); + wmGizmoMapType *mmap_type = WM_gizmomaptype_ensure(&wmap_params); if (mmap_type == NULL) { - BKE_reportf(reports, RPT_ERROR, "Area type does not support manipulators"); + BKE_reportf(reports, RPT_ERROR, "Area type does not support gizmos"); return NULL; } - /* check if we have registered this manipulatorgroup type before, and remove it */ + /* check if we have registered this gizmogroup type before, and remove it */ { - wmManipulatorGroupType *wgt = WM_manipulatorgrouptype_find(dummywgt.idname, true); + wmGizmoGroupType *wgt = WM_gizmogrouptype_find(dummywgt.idname, true); if (wgt && wgt->ext.srna) { - rna_ManipulatorGroup_unregister(bmain, wgt->ext.srna); + rna_GizmoGroup_unregister(bmain, wgt->ext.srna); } } if (!RNA_struct_available_or_report(reports, dummywgt.idname)) { @@ -792,23 +792,23 @@ static StructRNA *rna_ManipulatorGroup_register( BLI_assert(ARRAY_SIZE(strings) == 2); } - /* create a new manipulatorgroup type */ - dummywgt.ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummywgt.idname, &RNA_ManipulatorGroup); - RNA_def_struct_flag(dummywgt.ext.srna, STRUCT_NO_IDPROPERTIES); /* manipulatorgroup properties are registered separately */ + /* create a new gizmogroup type */ + dummywgt.ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummywgt.idname, &RNA_GizmoGroup); + RNA_def_struct_flag(dummywgt.ext.srna, STRUCT_NO_IDPROPERTIES); /* gizmogroup properties are registered separately */ dummywgt.ext.data = data; dummywgt.ext.call = call; dummywgt.ext.free = free; /* We used to register widget group types like this, now we do it similar to * operator types. Thus we should be able to do the same as operator types now. */ - dummywgt.poll = (have_function[0]) ? rna_manipulatorgroup_poll_cb : NULL; - dummywgt.setup_keymap = (have_function[1]) ? rna_manipulatorgroup_setup_keymap_cb : NULL; - dummywgt.setup = (have_function[2]) ? rna_manipulatorgroup_setup_cb : NULL; - dummywgt.refresh = (have_function[3]) ? rna_manipulatorgroup_refresh_cb : NULL; - dummywgt.draw_prepare = (have_function[4]) ? rna_manipulatorgroup_draw_prepare_cb : NULL; + dummywgt.poll = (have_function[0]) ? rna_gizmogroup_poll_cb : NULL; + dummywgt.setup_keymap = (have_function[1]) ? rna_gizmogroup_setup_keymap_cb : NULL; + dummywgt.setup = (have_function[2]) ? rna_gizmogroup_setup_cb : NULL; + dummywgt.refresh = (have_function[3]) ? rna_gizmogroup_refresh_cb : NULL; + dummywgt.draw_prepare = (have_function[4]) ? rna_gizmogroup_draw_prepare_cb : NULL; - wmManipulatorGroupType *wgt = WM_manipulatorgrouptype_append_ptr( - BPY_RNA_manipulatorgroup_wrapper, (void *)&dummywgt); + wmGizmoGroupType *wgt = WM_gizmogrouptype_append_ptr( + BPY_RNA_gizmogroup_wrapper, (void *)&dummywgt); { const char *owner_id = RNA_struct_state_owner_get(); @@ -817,8 +817,8 @@ static StructRNA *rna_ManipulatorGroup_register( } } - if (wgt->flag & WM_MANIPULATORGROUPTYPE_PERSISTENT) { - WM_manipulator_group_type_add_ptr_ex(wgt, mmap_type); + if (wgt->flag & WM_GIZMOGROUPTYPE_PERSISTENT) { + WM_gizmo_group_type_add_ptr_ex(wgt, mmap_type); /* update while blender is running */ WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); @@ -827,9 +827,9 @@ static StructRNA *rna_ManipulatorGroup_register( return dummywgt.ext.srna; } -static void rna_ManipulatorGroup_unregister(struct Main *bmain, StructRNA *type) +static void rna_GizmoGroup_unregister(struct Main *bmain, StructRNA *type) { - wmManipulatorGroupType *wgt = RNA_struct_blender_type_get(type); + wmGizmoGroupType *wgt = RNA_struct_blender_type_get(type); if (!wgt) return; @@ -839,27 +839,27 @@ static void rna_ManipulatorGroup_unregister(struct Main *bmain, StructRNA *type) WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); - WM_manipulator_group_type_remove_ptr(bmain, wgt); + WM_gizmo_group_type_remove_ptr(bmain, wgt); } -static void **rna_ManipulatorGroup_instance(PointerRNA *ptr) +static void **rna_GizmoGroup_instance(PointerRNA *ptr) { - wmManipulatorGroup *mgroup = ptr->data; + wmGizmoGroup *mgroup = ptr->data; return &mgroup->py_instance; } #endif /* WITH_PYTHON */ -static StructRNA *rna_ManipulatorGroup_refine(PointerRNA *mgroup_ptr) +static StructRNA *rna_GizmoGroup_refine(PointerRNA *mgroup_ptr) { - wmManipulatorGroup *mgroup = mgroup_ptr->data; - return (mgroup->type && mgroup->type->ext.srna) ? mgroup->type->ext.srna : &RNA_ManipulatorGroup; + wmGizmoGroup *mgroup = mgroup_ptr->data; + return (mgroup->type && mgroup->type->ext.srna) ? mgroup->type->ext.srna : &RNA_GizmoGroup; } -static void rna_ManipulatorGroup_manipulators_begin(CollectionPropertyIterator *iter, PointerRNA *mgroup_ptr) +static void rna_GizmoGroup_gizmos_begin(CollectionPropertyIterator *iter, PointerRNA *mgroup_ptr) { - wmManipulatorGroup *mgroup = mgroup_ptr->data; - rna_iterator_listbase_begin(iter, &mgroup->manipulators, NULL); + wmGizmoGroup *mgroup = mgroup_ptr->data; + rna_iterator_listbase_begin(iter, &mgroup->gizmos, NULL); } /** \} */ @@ -868,40 +868,40 @@ static void rna_ManipulatorGroup_manipulators_begin(CollectionPropertyIterator * #else /* RNA_RUNTIME */ -/* ManipulatorGroup.manipulators */ -static void rna_def_manipulators(BlenderRNA *brna, PropertyRNA *cprop) +/* GizmoGroup.gizmos */ +static void rna_def_gizmos(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; FunctionRNA *func; PropertyRNA *parm; - RNA_def_property_srna(cprop, "Manipulators"); - srna = RNA_def_struct(brna, "Manipulators", NULL); - RNA_def_struct_sdna(srna, "wmManipulatorGroup"); - RNA_def_struct_ui_text(srna, "Manipulators", "Collection of manipulators"); + RNA_def_property_srna(cprop, "Gizmos"); + srna = RNA_def_struct(brna, "Gizmos", NULL); + RNA_def_struct_sdna(srna, "wmGizmoGroup"); + RNA_def_struct_ui_text(srna, "Gizmos", "Collection of gizmos"); - func = RNA_def_function(srna, "new", "rna_ManipulatorGroup_manipulator_new"); - RNA_def_function_ui_description(func, "Add manipulator"); + func = RNA_def_function(srna, "new", "rna_GizmoGroup_gizmo_new"); + RNA_def_function_ui_description(func, "Add gizmo"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_string(func, "type", "Type", 0, "", "Manipulator identifier"); /* optional */ - parm = RNA_def_pointer(func, "manipulator", "Manipulator", "", "New manipulator"); + RNA_def_string(func, "type", "Type", 0, "", "Gizmo identifier"); /* optional */ + parm = RNA_def_pointer(func, "gizmo", "Gizmo", "", "New gizmo"); RNA_def_function_return(func, parm); - func = RNA_def_function(srna, "remove", "rna_ManipulatorGroup_manipulator_remove"); + func = RNA_def_function(srna, "remove", "rna_GizmoGroup_gizmo_remove"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - RNA_def_function_ui_description(func, "Delete manipulator"); - parm = RNA_def_pointer(func, "manipulator", "Manipulator", "", "New manipulator"); + RNA_def_function_ui_description(func, "Delete gizmo"); + parm = RNA_def_pointer(func, "gizmo", "Gizmo", "", "New gizmo"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); - func = RNA_def_function(srna, "clear", "rna_ManipulatorGroup_manipulator_clear"); + func = RNA_def_function(srna, "clear", "rna_GizmoGroup_gizmo_clear"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - RNA_def_function_ui_description(func, "Delete all manipulators"); + RNA_def_function_ui_description(func, "Delete all gizmos"); } -static void rna_def_manipulator(BlenderRNA *brna, PropertyRNA *cprop) +static void rna_def_gizmo(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; PropertyRNA *prop; @@ -909,26 +909,26 @@ static void rna_def_manipulator(BlenderRNA *brna, PropertyRNA *cprop) FunctionRNA *func; PropertyRNA *parm; - RNA_def_property_srna(cprop, "Manipulator"); - srna = RNA_def_struct(brna, "Manipulator", NULL); - RNA_def_struct_sdna(srna, "wmManipulator"); - RNA_def_struct_ui_text(srna, "Manipulator", "Collection of manipulators"); - RNA_def_struct_refine_func(srna, "rna_Manipulator_refine"); + RNA_def_property_srna(cprop, "Gizmo"); + srna = RNA_def_struct(brna, "Gizmo", NULL); + RNA_def_struct_sdna(srna, "wmGizmo"); + RNA_def_struct_ui_text(srna, "Gizmo", "Collection of gizmos"); + RNA_def_struct_refine_func(srna, "rna_Gizmo_refine"); #ifdef WITH_PYTHON RNA_def_struct_register_funcs( srna, - "rna_Manipulator_register", - "rna_Manipulator_unregister", - "rna_Manipulator_instance"); + "rna_Gizmo_register", + "rna_Gizmo_unregister", + "rna_Gizmo_instance"); #endif RNA_def_struct_translation_context(srna, BLT_I18NCONTEXT_OPERATOR_DEFAULT); prop = RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_struct_type(prop, "ManipulatorProperties"); + RNA_def_property_struct_type(prop, "GizmoProperties"); RNA_def_property_ui_text(prop, "Properties", ""); - RNA_def_property_pointer_funcs(prop, "rna_Manipulator_properties_get", NULL, NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Gizmo_properties_get", NULL, NULL, NULL); /* -------------------------------------------------------------------- */ /* Registerable Variables */ @@ -938,20 +938,20 @@ static void rna_def_manipulator(BlenderRNA *brna, PropertyRNA *cprop) prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->idname"); RNA_def_property_string_maxlength(prop, MAX_NAME); - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Manipulator_bl_idname_set"); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Gizmo_bl_idname_set"); /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */ RNA_def_property_flag(prop, PROP_REGISTER); RNA_define_verify_sdna(1); /* not in sdna */ - /* wmManipulator.draw */ + /* wmGizmo.draw */ func = RNA_def_function(srna, "draw", NULL); RNA_def_function_ui_description(func, ""); RNA_def_function_flag(func, FUNC_REGISTER); parm = RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); - /* wmManipulator.draw_select */ + /* wmGizmo.draw_select */ func = RNA_def_function(srna, "draw_select", NULL); RNA_def_function_ui_description(func, ""); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); @@ -959,7 +959,7 @@ static void rna_def_manipulator(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); parm = RNA_def_int(func, "select_id", 0, 0, INT_MAX, "", "", 0, INT_MAX); - /* wmManipulator.test_select */ + /* wmGizmo.test_select */ func = RNA_def_function(srna, "test_select", NULL); RNA_def_function_ui_description(func, ""); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); @@ -970,10 +970,10 @@ static void rna_def_manipulator(BlenderRNA *brna, PropertyRNA *cprop) parm = RNA_def_int(func, "intersect_id", 0, 0, INT_MAX, "", "", 0, INT_MAX); RNA_def_function_return(func, parm); - /* wmManipulator.handler */ + /* wmGizmo.handler */ static EnumPropertyItem tweak_actions[] = { - {WM_MANIPULATOR_TWEAK_PRECISE, "PRECISE", 0, "Precise", ""}, - {WM_MANIPULATOR_TWEAK_SNAP, "SNAP", 0, "Snap", ""}, + {WM_GIZMO_TWEAK_PRECISE, "PRECISE", 0, "Precise", ""}, + {WM_GIZMO_TWEAK_SNAP, "SNAP", 0, "Snap", ""}, {0, NULL, 0, NULL, NULL} }; func = RNA_def_function(srna, "modal", NULL); @@ -988,15 +988,15 @@ static void rna_def_manipulator(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); parm = RNA_def_enum_flag(func, "result", rna_enum_operator_return_items, OPERATOR_CANCELLED, "result", ""); RNA_def_function_return(func, parm); - /* wmManipulator.property_update */ + /* wmGizmo.property_update */ /* TODO */ - /* wmManipulator.setup */ + /* wmGizmo.setup */ func = RNA_def_function(srna, "setup", NULL); RNA_def_function_ui_description(func, ""); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); - /* wmManipulator.invoke */ + /* wmGizmo.invoke */ func = RNA_def_function(srna, "invoke", NULL); RNA_def_function_ui_description(func, ""); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); @@ -1007,7 +1007,7 @@ static void rna_def_manipulator(BlenderRNA *brna, PropertyRNA *cprop) parm = RNA_def_enum_flag(func, "result", rna_enum_operator_return_items, OPERATOR_CANCELLED, "result", ""); RNA_def_function_return(func, parm); - /* wmManipulator.exit */ + /* wmGizmo.exit */ func = RNA_def_function(srna, "exit", NULL); RNA_def_function_ui_description(func, ""); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); @@ -1016,10 +1016,10 @@ static void rna_def_manipulator(BlenderRNA *brna, PropertyRNA *cprop) parm = RNA_def_boolean(func, "cancel", 0, "Cancel, otherwise confirm", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - /* wmManipulator.cursor_get */ + /* wmGizmo.cursor_get */ /* TODO */ - /* wmManipulator.select_refresh */ + /* wmGizmo.select_refresh */ func = RNA_def_function(srna, "select_refresh", NULL); RNA_def_function_ui_description(func, ""); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); @@ -1030,146 +1030,146 @@ static void rna_def_manipulator(BlenderRNA *brna, PropertyRNA *cprop) prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_struct_type(prop, "ManipulatorGroup"); - RNA_def_property_pointer_funcs(prop, "rna_Manipulator_group_get", NULL, NULL, NULL); - RNA_def_property_ui_text(prop, "", "Manipulator group this manipulator is a member of"); + RNA_def_property_struct_type(prop, "GizmoGroup"); + RNA_def_property_pointer_funcs(prop, "rna_Gizmo_group_get", NULL, NULL, NULL); + RNA_def_property_ui_text(prop, "", "Gizmo group this gizmo is a member of"); /* Color & Alpha */ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); - RNA_def_property_float_funcs(prop, "rna_Manipulator_color_get", "rna_Manipulator_color_set", NULL); + RNA_def_property_float_funcs(prop, "rna_Gizmo_color_get", "rna_Gizmo_color_set", NULL); prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Alpha", ""); - RNA_def_property_float_funcs(prop, "rna_Manipulator_alpha_get", "rna_Manipulator_alpha_set", NULL); + RNA_def_property_float_funcs(prop, "rna_Gizmo_alpha_get", "rna_Gizmo_alpha_set", NULL); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); /* Color & Alpha (highlight) */ prop = RNA_def_property(srna, "color_highlight", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); - RNA_def_property_float_funcs(prop, "rna_Manipulator_color_hi_get", "rna_Manipulator_color_hi_set", NULL); + RNA_def_property_float_funcs(prop, "rna_Gizmo_color_hi_get", "rna_Gizmo_color_hi_set", NULL); prop = RNA_def_property(srna, "alpha_highlight", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Alpha", ""); - RNA_def_property_float_funcs(prop, "rna_Manipulator_alpha_hi_get", "rna_Manipulator_alpha_hi_set", NULL); + RNA_def_property_float_funcs(prop, "rna_Gizmo_alpha_hi_get", "rna_Gizmo_alpha_hi_set", NULL); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); prop = RNA_def_property(srna, "matrix_space", PROP_FLOAT, PROP_MATRIX); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_ui_text(prop, "Space Matrix", ""); - RNA_def_property_float_funcs(prop, "rna_Manipulator_matrix_space_get", "rna_Manipulator_matrix_space_set", NULL); + RNA_def_property_float_funcs(prop, "rna_Gizmo_matrix_space_get", "rna_Gizmo_matrix_space_set", NULL); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); prop = RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_ui_text(prop, "Basis Matrix", ""); - RNA_def_property_float_funcs(prop, "rna_Manipulator_matrix_basis_get", "rna_Manipulator_matrix_basis_set", NULL); + RNA_def_property_float_funcs(prop, "rna_Gizmo_matrix_basis_get", "rna_Gizmo_matrix_basis_set", NULL); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); prop = RNA_def_property(srna, "matrix_offset", PROP_FLOAT, PROP_MATRIX); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_ui_text(prop, "Offset Matrix", ""); - RNA_def_property_float_funcs(prop, "rna_Manipulator_matrix_offset_get", "rna_Manipulator_matrix_offset_set", NULL); + RNA_def_property_float_funcs(prop, "rna_Gizmo_matrix_offset_get", "rna_Gizmo_matrix_offset_set", NULL); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); prop = RNA_def_property(srna, "matrix_world", PROP_FLOAT, PROP_MATRIX); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_ui_text(prop, "Final World Matrix", ""); - RNA_def_property_float_funcs(prop, "rna_Manipulator_matrix_world_get", NULL, NULL); + RNA_def_property_float_funcs(prop, "rna_Gizmo_matrix_world_get", NULL, NULL); prop = RNA_def_property(srna, "scale_basis", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Scale Basis", ""); - RNA_def_property_float_funcs(prop, "rna_Manipulator_scale_basis_get", "rna_Manipulator_scale_basis_set", NULL); + RNA_def_property_float_funcs(prop, "rna_Gizmo_scale_basis_get", "rna_Gizmo_scale_basis_set", NULL); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); prop = RNA_def_property(srna, "line_width", PROP_FLOAT, PROP_PIXEL); RNA_def_property_ui_text(prop, "Line Width", ""); - RNA_def_property_float_funcs(prop, "rna_Manipulator_line_width_get", "rna_Manipulator_line_width_set", NULL); + RNA_def_property_float_funcs(prop, "rna_Gizmo_line_width_get", "rna_Gizmo_line_width_set", NULL); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); - /* wmManipulator.flag */ - /* WM_MANIPULATOR_HIDDEN */ + /* wmGizmo.flag */ + /* WM_GIZMO_HIDDEN */ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs( - prop, "rna_Manipulator_flag_hide_get", "rna_Manipulator_flag_hide_set"); + prop, "rna_Gizmo_flag_hide_get", "rna_Gizmo_flag_hide_set"); RNA_def_property_ui_text(prop, "Hide", ""); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); - /* WM_MANIPULATOR_GRAB_CURSOR */ + /* WM_GIZMO_GRAB_CURSOR */ prop = RNA_def_property(srna, "use_grab_cursor", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs( - prop, "rna_Manipulator_flag_use_grab_cursor_get", "rna_Manipulator_flag_use_grab_cursor_set"); + prop, "rna_Gizmo_flag_use_grab_cursor_get", "rna_Gizmo_flag_use_grab_cursor_set"); RNA_def_property_ui_text(prop, "Grab Cursor", ""); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); - /* WM_MANIPULATOR_DRAW_HOVER */ + /* WM_GIZMO_DRAW_HOVER */ prop = RNA_def_property(srna, "use_draw_hover", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs( - prop, "rna_Manipulator_flag_use_draw_hover_get", "rna_Manipulator_flag_use_draw_hover_set"); + prop, "rna_Gizmo_flag_use_draw_hover_get", "rna_Gizmo_flag_use_draw_hover_set"); RNA_def_property_ui_text(prop, "Draw Hover", ""); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); - /* WM_MANIPULATOR_DRAW_MODAL */ + /* WM_GIZMO_DRAW_MODAL */ prop = RNA_def_property(srna, "use_draw_modal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs( - prop, "rna_Manipulator_flag_use_draw_modal_get", "rna_Manipulator_flag_use_draw_modal_set"); + prop, "rna_Gizmo_flag_use_draw_modal_get", "rna_Gizmo_flag_use_draw_modal_set"); RNA_def_property_ui_text(prop, "Draw Active", "Draw while dragging"); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); - /* WM_MANIPULATOR_DRAW_VALUE */ + /* WM_GIZMO_DRAW_VALUE */ prop = RNA_def_property(srna, "use_draw_value", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs( - prop, "rna_Manipulator_flag_use_draw_value_get", "rna_Manipulator_flag_use_draw_value_set"); + prop, "rna_Gizmo_flag_use_draw_value_get", "rna_Gizmo_flag_use_draw_value_set"); RNA_def_property_ui_text(prop, "Draw Value", "Show an indicator for the current value while dragging"); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); - /* WM_MANIPULATOR_DRAW_OFFSET_SCALE */ + /* WM_GIZMO_DRAW_OFFSET_SCALE */ prop = RNA_def_property(srna, "use_draw_offset_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs( - prop, "rna_Manipulator_flag_use_draw_offset_scale_get", "rna_Manipulator_flag_use_draw_offset_scale_set"); + prop, "rna_Gizmo_flag_use_draw_offset_scale_get", "rna_Gizmo_flag_use_draw_offset_scale_set"); RNA_def_property_ui_text(prop, "Scale Offset", "Scale the offset matrix (use to apply screen-space offset)"); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); - /* WM_MANIPULATOR_DRAW_NO_SCALE (negated) */ + /* WM_GIZMO_DRAW_NO_SCALE (negated) */ prop = RNA_def_property(srna, "use_draw_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs( - prop, "rna_Manipulator_flag_use_draw_scale_get", "rna_Manipulator_flag_use_draw_scale_set"); + prop, "rna_Gizmo_flag_use_draw_scale_get", "rna_Gizmo_flag_use_draw_scale_set"); RNA_def_property_ui_text(prop, "Scale", "Use scale when calculating the matrix"); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); - /* WM_MANIPULATOR_SELECT_BACKGROUND */ + /* WM_GIZMO_SELECT_BACKGROUND */ prop = RNA_def_property(srna, "use_select_background", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs( - prop, "rna_Manipulator_flag_use_select_background_get", "rna_Manipulator_flag_use_select_background_set"); + prop, "rna_Gizmo_flag_use_select_background_get", "rna_Gizmo_flag_use_select_background_set"); RNA_def_property_ui_text(prop, "Select Background", "Don't write into the depth buffer"); RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL); - /* wmManipulator.state (readonly) */ - /* WM_MANIPULATOR_STATE_HIGHLIGHT */ + /* wmGizmo.state (readonly) */ + /* WM_GIZMO_STATE_HIGHLIGHT */ prop = RNA_def_property(srna, "is_highlight", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_funcs(prop, "rna_Manipulator_state_is_highlight_get", NULL); + RNA_def_property_boolean_funcs(prop, "rna_Gizmo_state_is_highlight_get", NULL); RNA_def_property_ui_text(prop, "Highlight", ""); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - /* WM_MANIPULATOR_STATE_MODAL */ + /* WM_GIZMO_STATE_MODAL */ prop = RNA_def_property(srna, "is_modal", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_funcs(prop, "rna_Manipulator_state_is_modal_get", NULL); + RNA_def_property_boolean_funcs(prop, "rna_Gizmo_state_is_modal_get", NULL); RNA_def_property_ui_text(prop, "Highlight", ""); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - /* WM_MANIPULATOR_STATE_SELECT */ + /* WM_GIZMO_STATE_SELECT */ /* (note that setting is involved, needs to handle array) */ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_funcs(prop, "rna_Manipulator_state_select_get", "rna_Manipulator_state_select_set"); + RNA_def_property_boolean_funcs(prop, "rna_Gizmo_state_select_get", "rna_Gizmo_state_select_set"); RNA_def_property_ui_text(prop, "Select", ""); - RNA_api_manipulator(srna); + RNA_api_gizmo(srna); - srna = RNA_def_struct(brna, "ManipulatorProperties", NULL); - RNA_def_struct_ui_text(srna, "Manipulator Properties", "Input properties of an Manipulator"); - RNA_def_struct_refine_func(srna, "rna_ManipulatorProperties_refine"); - RNA_def_struct_idprops_func(srna, "rna_ManipulatorProperties_idprops"); + srna = RNA_def_struct(brna, "GizmoProperties", NULL); + RNA_def_struct_ui_text(srna, "Gizmo Properties", "Input properties of an Gizmo"); + RNA_def_struct_refine_func(srna, "rna_GizmoProperties_refine"); + RNA_def_struct_idprops_func(srna, "rna_GizmoProperties_idprops"); RNA_def_struct_flag(srna, STRUCT_NO_DATABLOCK_IDPROPERTIES); } -static void rna_def_manipulatorgroup(BlenderRNA *brna) +static void rna_def_gizmogroup(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -1177,16 +1177,16 @@ static void rna_def_manipulatorgroup(BlenderRNA *brna) FunctionRNA *func; PropertyRNA *parm; - srna = RNA_def_struct(brna, "ManipulatorGroup", NULL); - RNA_def_struct_ui_text(srna, "ManipulatorGroup", "Storage of an operator being executed, or registered after execution"); - RNA_def_struct_sdna(srna, "wmManipulatorGroup"); - RNA_def_struct_refine_func(srna, "rna_ManipulatorGroup_refine"); + srna = RNA_def_struct(brna, "GizmoGroup", NULL); + RNA_def_struct_ui_text(srna, "GizmoGroup", "Storage of an operator being executed, or registered after execution"); + RNA_def_struct_sdna(srna, "wmGizmoGroup"); + RNA_def_struct_refine_func(srna, "rna_GizmoGroup_refine"); #ifdef WITH_PYTHON RNA_def_struct_register_funcs( srna, - "rna_ManipulatorGroup_register", - "rna_ManipulatorGroup_unregister", - "rna_ManipulatorGroup_instance"); + "rna_GizmoGroup_register", + "rna_GizmoGroup_unregister", + "rna_GizmoGroup_instance"); #endif RNA_def_struct_translation_context(srna, BLT_I18NCONTEXT_OPERATOR_DEFAULT); @@ -1198,14 +1198,14 @@ static void rna_def_manipulatorgroup(BlenderRNA *brna) prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->idname"); RNA_def_property_string_maxlength(prop, MAX_NAME); - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ManipulatorGroup_bl_idname_set"); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GizmoGroup_bl_idname_set"); RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_struct_name_property(srna, prop); prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->name"); RNA_def_property_string_maxlength(prop, MAX_NAME); /* else it uses the pointer size! */ - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ManipulatorGroup_bl_label_set"); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GizmoGroup_bl_label_set"); /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */ RNA_def_property_flag(prop, PROP_REGISTER); @@ -1226,24 +1226,24 @@ static void rna_def_manipulatorgroup(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); /* bl_options */ - static EnumPropertyItem manipulatorgroup_flag_items[] = { - {WM_MANIPULATORGROUPTYPE_3D, "3D", 0, "3D", + static EnumPropertyItem gizmogroup_flag_items[] = { + {WM_GIZMOGROUPTYPE_3D, "3D", 0, "3D", "Use in 3D viewport"}, - {WM_MANIPULATORGROUPTYPE_SCALE, "SCALE", 0, "Scale", + {WM_GIZMOGROUPTYPE_SCALE, "SCALE", 0, "Scale", "Scale to respect zoom (otherwise zoom independent draw size)"}, - {WM_MANIPULATORGROUPTYPE_DEPTH_3D, "DEPTH_3D", 0, "Depth 3D", + {WM_GIZMOGROUPTYPE_DEPTH_3D, "DEPTH_3D", 0, "Depth 3D", "Supports culled depth by other objects in the view"}, - {WM_MANIPULATORGROUPTYPE_SELECT, "SELECT", 0, "Select", + {WM_GIZMOGROUPTYPE_SELECT, "SELECT", 0, "Select", "Supports selection"}, - {WM_MANIPULATORGROUPTYPE_PERSISTENT, "PERSISTENT", 0, "Persistent", + {WM_GIZMOGROUPTYPE_PERSISTENT, "PERSISTENT", 0, "Persistent", ""}, - {WM_MANIPULATORGROUPTYPE_DRAW_MODAL_ALL, "SHOW_MODAL_ALL", 0, "Show Modal All", + {WM_GIZMOGROUPTYPE_DRAW_MODAL_ALL, "SHOW_MODAL_ALL", 0, "Show Modal All", "Show all while interacting"}, {0, NULL, 0, NULL, NULL} }; prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->flag"); - RNA_def_property_enum_items(prop, manipulatorgroup_flag_items); + RNA_def_property_enum_items(prop, gizmogroup_flag_items); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL | PROP_ENUM_FLAG); RNA_def_property_ui_text(prop, "Options", "Options for this operator type"); @@ -1254,7 +1254,7 @@ static void rna_def_manipulatorgroup(BlenderRNA *brna) /* poll */ func = RNA_def_function(srna, "poll", NULL); - RNA_def_function_ui_description(func, "Test if the manipulator group can be called or not"); + RNA_def_function_ui_description(func, "Test if the gizmo group can be called or not"); RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_REGISTER_OPTIONAL); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); parm = RNA_def_pointer(func, "context", "Context", "", ""); @@ -1264,7 +1264,7 @@ static void rna_def_manipulatorgroup(BlenderRNA *brna) func = RNA_def_function(srna, "setup_keymap", NULL); RNA_def_function_ui_description( func, - "Initialize keymaps for this manipulator group, use fallback keymap when not present"); + "Initialize keymaps for this gizmo group, use fallback keymap when not present"); RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_REGISTER_OPTIONAL); parm = RNA_def_pointer(func, "keyconfig", "KeyConfig", "", ""); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); @@ -1275,7 +1275,7 @@ static void rna_def_manipulatorgroup(BlenderRNA *brna) /* setup */ func = RNA_def_function(srna, "setup", NULL); - RNA_def_function_ui_description(func, "Create manipulators function for the manipulator group"); + RNA_def_function_ui_description(func, "Create gizmos function for the gizmo group"); RNA_def_function_flag(func, FUNC_REGISTER); parm = RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); @@ -1298,38 +1298,38 @@ static void rna_def_manipulatorgroup(BlenderRNA *brna) prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_string_funcs(prop, "rna_ManipulatorGroup_name_get", "rna_ManipulatorGroup_name_length", NULL); + RNA_def_property_string_funcs(prop, "rna_GizmoGroup_name_get", "rna_GizmoGroup_name_length", NULL); RNA_def_property_ui_text(prop, "Name", ""); prop = RNA_def_property(srna, "has_reports", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* this is 'virtual' property */ - RNA_def_property_boolean_funcs(prop, "rna_ManipulatorGroup_has_reports_get", NULL); + RNA_def_property_boolean_funcs(prop, "rna_GizmoGroup_has_reports_get", NULL); RNA_def_property_ui_text(prop, "Has Reports", - "ManipulatorGroup has a set of reports (warnings and errors) from last execution"); + "GizmoGroup has a set of reports (warnings and errors) from last execution"); RNA_define_verify_sdna(0); /* not in sdna */ - prop = RNA_def_property(srna, "manipulators", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_sdna(prop, NULL, "manipulators", NULL); - RNA_def_property_struct_type(prop, "Manipulator"); + prop = RNA_def_property(srna, "gizmos", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "gizmos", NULL); + RNA_def_property_struct_type(prop, "Gizmo"); RNA_def_property_collection_funcs( - prop, "rna_ManipulatorGroup_manipulators_begin", "rna_iterator_listbase_next", + prop, "rna_GizmoGroup_gizmos_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); - RNA_def_property_ui_text(prop, "Manipulators", "List of manipulators in the Manipulator Map"); - rna_def_manipulator(brna, prop); - rna_def_manipulators(brna, prop); + RNA_def_property_ui_text(prop, "Gizmos", "List of gizmos in the Gizmo Map"); + rna_def_gizmo(brna, prop); + rna_def_gizmos(brna, prop); RNA_define_verify_sdna(1); /* not in sdna */ - RNA_api_manipulatorgroup(srna); + RNA_api_gizmogroup(srna); } -void RNA_def_wm_manipulator(BlenderRNA *brna) +void RNA_def_wm_gizmo(BlenderRNA *brna) { - rna_def_manipulatorgroup(brna); + rna_def_gizmogroup(brna); } #endif /* RNA_RUNTIME */ diff --git a/source/blender/makesrna/intern/rna_wm_gizmo_api.c b/source/blender/makesrna/intern/rna_wm_gizmo_api.c index b06ba4d3dac..04c02889fa3 100644 --- a/source/blender/makesrna/intern/rna_wm_gizmo_api.c +++ b/source/blender/makesrna/intern/rna_wm_gizmo_api.c @@ -46,43 +46,43 @@ #include "ED_gizmo_library.h" -static void rna_manipulator_draw_preset_box( - wmManipulator *mpr, float matrix[16], int select_id) +static void rna_gizmo_draw_preset_box( + wmGizmo *mpr, float matrix[16], int select_id) { - ED_manipulator_draw_preset_box(mpr, (float (*)[4])matrix, select_id); + ED_gizmo_draw_preset_box(mpr, (float (*)[4])matrix, select_id); } -static void rna_manipulator_draw_preset_arrow( - wmManipulator *mpr, float matrix[16], int axis, int select_id) +static void rna_gizmo_draw_preset_arrow( + wmGizmo *mpr, float matrix[16], int axis, int select_id) { - ED_manipulator_draw_preset_arrow(mpr, (float (*)[4])matrix, axis, select_id); + ED_gizmo_draw_preset_arrow(mpr, (float (*)[4])matrix, axis, select_id); } -static void rna_manipulator_draw_preset_circle( - wmManipulator *mpr, float matrix[16], int axis, int select_id) +static void rna_gizmo_draw_preset_circle( + wmGizmo *mpr, float matrix[16], int axis, int select_id) { - ED_manipulator_draw_preset_circle(mpr, (float (*)[4])matrix, axis, select_id); + ED_gizmo_draw_preset_circle(mpr, (float (*)[4])matrix, axis, select_id); } -static void rna_manipulator_draw_preset_facemap( - wmManipulator *mpr, struct bContext *C, struct Object *ob, int facemap, int select_id) +static void rna_gizmo_draw_preset_facemap( + wmGizmo *mpr, struct bContext *C, struct Object *ob, int facemap, int select_id) { struct Scene *scene = CTX_data_scene(C); - ED_manipulator_draw_preset_facemap(C, mpr, scene, ob, facemap, select_id); + ED_gizmo_draw_preset_facemap(C, mpr, scene, ob, facemap, select_id); } /* -------------------------------------------------------------------- */ -/** \name Manipulator Property Define +/** \name Gizmo Property Define * \{ */ -static void rna_manipulator_target_set_prop( - wmManipulator *mpr, ReportList *reports, const char *target_propname, +static void rna_gizmo_target_set_prop( + wmGizmo *mpr, ReportList *reports, const char *target_propname, PointerRNA *ptr, const char *propname, int index) { - const wmManipulatorPropertyType *mpr_prop_type = - WM_manipulatortype_target_property_find(mpr->type, target_propname); + const wmGizmoPropertyType *mpr_prop_type = + WM_gizmotype_target_property_find(mpr->type, target_propname); if (mpr_prop_type == NULL) { - BKE_reportf(reports, RPT_ERROR, "Manipulator target property '%s.%s' not found", + BKE_reportf(reports, RPT_ERROR, "Gizmo target property '%s.%s' not found", mpr->type->idname, target_propname); return; } @@ -95,13 +95,13 @@ static void rna_manipulator_target_set_prop( } if (mpr_prop_type->data_type != RNA_property_type(prop)) { - const int manipulator_type_index = RNA_enum_from_value(rna_enum_property_type_items, mpr_prop_type->data_type); + const int gizmo_type_index = RNA_enum_from_value(rna_enum_property_type_items, mpr_prop_type->data_type); const int prop_type_index = RNA_enum_from_value(rna_enum_property_type_items, RNA_property_type(prop)); - BLI_assert((manipulator_type_index != -1) && (prop_type_index == -1)); + BLI_assert((gizmo_type_index != -1) && (prop_type_index == -1)); - BKE_reportf(reports, RPT_ERROR, "Manipulator target '%s.%s' expects '%s', '%s.%s' is '%s'", + BKE_reportf(reports, RPT_ERROR, "Gizmo target '%s.%s' expects '%s', '%s.%s' is '%s'", mpr->type->idname, target_propname, - rna_enum_property_type_items[manipulator_type_index].identifier, + rna_enum_property_type_items[gizmo_type_index].identifier, RNA_struct_identifier(ptr->type), propname, rna_enum_property_type_items[prop_type_index].identifier); return; @@ -112,7 +112,7 @@ static void rna_manipulator_target_set_prop( const int prop_array_length = RNA_property_array_length(ptr, prop); if (mpr_prop_type->array_length != prop_array_length) { BKE_reportf(reports, RPT_ERROR, - "Manipulator target property '%s.%s' expects an array of length %d, found %d", + "Gizmo target property '%s.%s' expects an array of length %d, found %d", mpr->type->idname, target_propname, mpr_prop_type->array_length, prop_array_length); @@ -123,7 +123,7 @@ static void rna_manipulator_target_set_prop( else { if (mpr_prop_type->array_length != 1) { BKE_reportf(reports, RPT_ERROR, - "Manipulator target property '%s.%s' expects an array of length %d", + "Gizmo target property '%s.%s' expects an array of length %d", mpr->type->idname, target_propname, mpr_prop_type->array_length); return; @@ -131,16 +131,16 @@ static void rna_manipulator_target_set_prop( } if (index >= mpr_prop_type->array_length) { - BKE_reportf(reports, RPT_ERROR, "Manipulator target property '%s.%s', index %d must be below %d", + BKE_reportf(reports, RPT_ERROR, "Gizmo target property '%s.%s', index %d must be below %d", mpr->type->idname, target_propname, index, mpr_prop_type->array_length); return; } - WM_manipulator_target_property_def_rna_ptr(mpr, mpr_prop_type, ptr, prop, index); + WM_gizmo_target_property_def_rna_ptr(mpr, mpr_prop_type, ptr, prop, index); } -static PointerRNA rna_manipulator_target_set_operator( - wmManipulator *mpr, ReportList *reports, const char *opname, int part_index) +static PointerRNA rna_gizmo_target_set_operator( + wmGizmo *mpr, ReportList *reports, const char *opname, int part_index) { wmOperatorType *ot; @@ -154,36 +154,36 @@ static PointerRNA rna_manipulator_target_set_operator( IDProperty *properties; { IDPropertyTemplate val = {0}; - properties = IDP_New(IDP_GROUP, &val, "wmManipulatorProperties"); + properties = IDP_New(IDP_GROUP, &val, "wmGizmoProperties"); } - return *WM_manipulator_operator_set(mpr, part_index, ot, properties); + return *WM_gizmo_operator_set(mpr, part_index, ot, properties); } /** \} */ /* -------------------------------------------------------------------- */ -/** \name Manipulator Property Access +/** \name Gizmo Property Access * \{ */ -static bool rna_manipulator_target_is_valid( - wmManipulator *mpr, ReportList *reports, const char *target_propname) +static bool rna_gizmo_target_is_valid( + wmGizmo *mpr, ReportList *reports, const char *target_propname) { - wmManipulatorProperty *mpr_prop = - WM_manipulator_target_property_find(mpr, target_propname); + wmGizmoProperty *mpr_prop = + WM_gizmo_target_property_find(mpr, target_propname); if (mpr_prop == NULL) { - BKE_reportf(reports, RPT_ERROR, "Manipulator target property '%s.%s' not found", + BKE_reportf(reports, RPT_ERROR, "Gizmo target property '%s.%s' not found", mpr->type->idname, target_propname); return false; } - return WM_manipulator_target_property_is_valid(mpr_prop); + return WM_gizmo_target_property_is_valid(mpr_prop); } /** \} */ #else -void RNA_api_manipulator(StructRNA *srna) +void RNA_api_gizmo(StructRNA *srna) { /* Utility draw functions, since we don't expose new OpenGL drawing wrappers via Python yet. * exactly how these should be exposed isn't totally clear. @@ -198,7 +198,7 @@ void RNA_api_manipulator(StructRNA *srna) /* Primitive Shapes */ /* draw_preset_box */ - func = RNA_def_function(srna, "draw_preset_box", "rna_manipulator_draw_preset_box"); + func = RNA_def_function(srna, "draw_preset_box", "rna_gizmo_draw_preset_box"); RNA_def_function_ui_description(func, "Draw a box"); parm = RNA_def_property(func, "matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); @@ -207,7 +207,7 @@ void RNA_api_manipulator(StructRNA *srna) RNA_def_int(func, "select_id", -1, -1, INT_MAX, "Zero when not selecting", "", -1, INT_MAX); /* draw_preset_box */ - func = RNA_def_function(srna, "draw_preset_arrow", "rna_manipulator_draw_preset_arrow"); + func = RNA_def_function(srna, "draw_preset_arrow", "rna_gizmo_draw_preset_arrow"); RNA_def_function_ui_description(func, "Draw a box"); parm = RNA_def_property(func, "matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); @@ -216,7 +216,7 @@ void RNA_api_manipulator(StructRNA *srna) 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); - func = RNA_def_function(srna, "draw_preset_circle", "rna_manipulator_draw_preset_circle"); + func = RNA_def_function(srna, "draw_preset_circle", "rna_gizmo_draw_preset_circle"); RNA_def_function_ui_description(func, "Draw a box"); parm = RNA_def_property(func, "matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); @@ -229,7 +229,7 @@ void RNA_api_manipulator(StructRNA *srna) /* Other Shapes */ /* draw_preset_facemap */ - func = RNA_def_function(srna, "draw_preset_facemap", "rna_manipulator_draw_preset_facemap"); + func = RNA_def_function(srna, "draw_preset_facemap", "rna_gizmo_draw_preset_facemap"); RNA_def_function_ui_description(func, "Draw the face-map of a mesh object"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); parm = RNA_def_pointer(func, "object", "Object", "", "Object"); @@ -243,7 +243,7 @@ void RNA_api_manipulator(StructRNA *srna) /* Define Properties */ /* note, 'target_set_handler' is defined in 'bpy_rna_gizmo.c' */ - func = RNA_def_function(srna, "target_set_prop", "rna_manipulator_target_set_prop"); + func = RNA_def_function(srna, "target_set_prop", "rna_gizmo_target_set_prop"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, ""); parm = RNA_def_string(func, "target", NULL, 0, "", "Target property"); @@ -255,10 +255,10 @@ void RNA_api_manipulator(StructRNA *srna) RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); RNA_def_int(func, "index", -1, -1, INT_MAX, "", "", -1, INT_MAX); /* RNA_NO_INDEX == -1 */ - func = RNA_def_function(srna, "target_set_operator", "rna_manipulator_target_set_operator"); + func = RNA_def_function(srna, "target_set_operator", "rna_gizmo_target_set_operator"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description( - func, "Operator to run when activating the manipulator " + func, "Operator to run when activating the gizmo " "(overrides property targets)"); parm = RNA_def_string(func, "operator", NULL, 0, "", "Target operator"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); @@ -271,7 +271,7 @@ void RNA_api_manipulator(StructRNA *srna) /* Access Properties */ /* note, 'target_get', 'target_set' is defined in 'bpy_rna_gizmo.c' */ - func = RNA_def_function(srna, "target_is_valid", "rna_manipulator_target_is_valid"); + func = RNA_def_function(srna, "target_is_valid", "rna_gizmo_target_is_valid"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_string(func, "property", NULL, 0, "", "Property identifier"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); @@ -282,7 +282,7 @@ void RNA_api_manipulator(StructRNA *srna) } -void RNA_api_manipulatorgroup(StructRNA *UNUSED(srna)) +void RNA_api_gizmogroup(StructRNA *UNUSED(srna)) { /* nothing yet */ } diff --git a/source/blender/makesrna/intern/rna_workspace_api.c b/source/blender/makesrna/intern/rna_workspace_api.c index eceaaeec3a4..98e84f60b33 100644 --- a/source/blender/makesrna/intern/rna_workspace_api.c +++ b/source/blender/makesrna/intern/rna_workspace_api.c @@ -51,7 +51,7 @@ static void rna_WorkspaceTool_setup( /* Args for: 'bToolRef_Runtime'. */ int cursor, const char *keymap, - const char *manipulator_group, + const char *gizmo_group, const char *data_block, const char *operator, int index) @@ -60,7 +60,7 @@ static void rna_WorkspaceTool_setup( tref_rt.cursor = cursor; STRNCPY(tref_rt.keymap, keymap); - STRNCPY(tref_rt.manipulator_group, manipulator_group); + STRNCPY(tref_rt.gizmo_group, gizmo_group); STRNCPY(tref_rt.data_block, data_block); STRNCPY(tref_rt.operator, operator); tref_rt.index = index; @@ -110,7 +110,7 @@ void RNA_api_workspace_tool(StructRNA *srna) parm = RNA_def_property(func, "cursor", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(parm, rna_enum_window_cursor_items); RNA_def_string(func, "keymap", NULL, KMAP_MAX_NAME, "Key Map", ""); - RNA_def_string(func, "manipulator_group", NULL, MAX_NAME, "Manipulator Group", ""); + RNA_def_string(func, "gizmo_group", NULL, MAX_NAME, "Gizmo Group", ""); RNA_def_string(func, "data_block", NULL, MAX_NAME, "Data Block", ""); RNA_def_string(func, "operator", NULL, MAX_NAME, "Operator", ""); RNA_def_int(func, "index", 0, INT_MIN, INT_MAX, "Index", "", INT_MIN, INT_MAX); |