[Bf-blender-cvs] [66d275f8d3d] blender2.8: RNA: update gizmo API for changes in Blender
Campbell Barton
noreply at git.blender.org
Fri Sep 7 22:41:47 CEST 2018
Commit: 66d275f8d3d4e7821e940b4d0ccbd7aa9b1f5037
Author: Campbell Barton
Date: Sat Sep 8 06:50:02 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB66d275f8d3d4e7821e940b4d0ccbd7aa9b1f5037
RNA: update gizmo API for changes in Blender
- gpu module renamed.
- make gizmo.new() take type as a required argument.
===================================================================
M release/scripts/modules/bpy_types.py
M source/blender/makesrna/intern/rna_wm_gizmo.c
===================================================================
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index 55912e28c04..52dce466800 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -638,7 +638,7 @@ class Gizmo(StructRNA):
:return: The newly created shape.
:rtype: Undefined (it may change).
"""
- from _gpu.types import (
+ from gpu.types import (
GPUBatch,
GPUVertBuf,
GPUVertFormat,
diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c
index 4834b7ae5fc..c31e5825da0 100644
--- a/source/blender/makesrna/intern/rna_wm_gizmo.c
+++ b/source/blender/makesrna/intern/rna_wm_gizmo.c
@@ -885,7 +885,8 @@ static void rna_def_gizmos(BlenderRNA *brna, PropertyRNA *cprop)
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, "", "Gizmo identifier"); /* optional */
+ parm = RNA_def_string(func, "type", "Type", 0, "", "Gizmo identifier"); /* optional */
+ RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
parm = RNA_def_pointer(func, "gizmo", "Gizmo", "", "New gizmo");
RNA_def_function_return(func, parm);
More information about the Bf-blender-cvs
mailing list