RNA: update gizmo API for changes in Blender

- gpu module renamed.
- make gizmo.new() take type as a required argument.
This commit is contained in:
Campbell Barton 2018-09-08 06:50:02 +10:00
parent f23319d095
commit 66d275f8d3
2 changed files with 3 additions and 2 deletions

View File

@ -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,

View File

@ -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);