Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-12-04 02:15:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-12-04 02:17:42 +0300
commitc631782542f49ae2ce9ff45ae2cdb5f61af80e68 (patch)
treef9041add81085b2bb3434e6ed50f20837fda5a3f
parent2c19c9b2f646e2b28e3ad399380fe27971fe23d8 (diff)
Fix T58474: Gizmo Operator template fails on rerun
-rw-r--r--release/scripts/templates_py/gizmo_operator.py4
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c16
2 files changed, 10 insertions, 10 deletions
diff --git a/release/scripts/templates_py/gizmo_operator.py b/release/scripts/templates_py/gizmo_operator.py
index 524dd1dd20e..96f4f4de940 100644
--- a/release/scripts/templates_py/gizmo_operator.py
+++ b/release/scripts/templates_py/gizmo_operator.py
@@ -68,7 +68,7 @@ class SelectSideOfPlane(Operator):
if context.space_data.type == 'VIEW_3D':
wm = context.window_manager
- wm.gizmo_group_type_add(SelectSideOfPlaneGizmoGroup.bl_idname)
+ wm.gizmo_group_type_ensure(SelectSideOfPlaneGizmoGroup.bl_idname)
return {'FINISHED'}
@@ -106,7 +106,7 @@ class SelectSideOfPlaneGizmoGroup(GizmoGroup):
op = cls.my_target_operator(context)
if op is None:
wm = context.window_manager
- wm.gizmo_group_type_remove(SelectSideOfPlaneGizmoGroup.bl_idname)
+ wm.gizmo_group_type_unlink_delayed(SelectSideOfPlaneGizmoGroup.bl_idname)
return False
return True
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 874fdb62029..92a396c22b9 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -138,19 +138,19 @@ static wmGizmoGroupType *wm_gizmogrouptype_find_for_add_remove(ReportList *repor
return gzgt;
}
-static void rna_gizmo_group_type_add(ReportList *reports, const char *idname)
+static void rna_gizmo_group_type_ensure(ReportList *reports, const char *idname)
{
wmGizmoGroupType *gzgt = wm_gizmogrouptype_find_for_add_remove(reports, idname);
if (gzgt != NULL) {
- WM_gizmo_group_type_add_ptr(gzgt);
+ WM_gizmo_group_type_ensure_ptr(gzgt);
}
}
-static void rna_gizmo_group_type_remove(Main *bmain, ReportList *reports, const char *idname)
+static void rna_gizmo_group_type_unlink_delayed(ReportList *reports, const char *idname)
{
wmGizmoGroupType *gzgt = wm_gizmogrouptype_find_for_add_remove(reports, idname);
if (gzgt != NULL) {
- WM_gizmo_group_type_remove_ptr(bmain, gzgt);
+ WM_gizmo_group_type_unlink_delayed_ptr(gzgt);
}
}
@@ -549,15 +549,15 @@ 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, "gizmo_group_type_add", "rna_gizmo_group_type_add");
+ func = RNA_def_function(srna, "gizmo_group_type_ensure", "rna_gizmo_group_type_ensure");
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, "", "Gizmo group type name");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
- 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);
+ func = RNA_def_function(srna, "gizmo_group_type_unlink_delayed", "rna_gizmo_group_type_unlink_delayed");
+ RNA_def_function_ui_description(func, "Unlink a widget group (when the persistent option is set)");
+ RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_REPORTS);
parm = RNA_def_string(func, "identifier", NULL, 0, "", "Gizmo group type name");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);