[Bf-blender-cvs] [f23319d0958] blender2.8: RNA: Area.header_text_set text is now required

Campbell Barton noreply at git.blender.org
Fri Sep 7 22:15:35 CEST 2018


Commit: f23319d0958bdfc860f884dd261c652b158d587f
Author: Campbell Barton
Date:   Sat Sep 8 06:23:25 2018 +1000
Branches: blender2.8
https://developer.blender.org/rBf23319d0958bdfc860f884dd261c652b158d587f

RNA: Area.header_text_set text is now required

===================================================================

M	release/scripts/startup/bl_operators/wm.py
M	release/scripts/templates_py/gizmo_custom_geometry.py
M	release/scripts/templates_py/operator_modal_view3d.py
M	source/blender/makesrna/intern/rna_screen.c

===================================================================

diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index b84710a0de0..168873ce565 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -831,17 +831,17 @@ class WM_OT_context_modal_mouse(Operator):
                     header_text = header_text % eval("item.%s" % self.data_path_item)
                 else:
                     header_text = (self.header_text % delta) + " (delta)"
-                context.area.header_text_set(text=header_text)
+                context.area.header_text_set(header_text)
 
         elif 'LEFTMOUSE' == event_type:
             item = next(iter(self._values.keys()))
             self._values_clear()
-            context.area.header_text_set()
+            context.area.header_text_set("")
             return operator_value_undo_return(item)
 
         elif event_type in {'RIGHTMOUSE', 'ESC'}:
             self._values_restore()
-            context.area.header_text_set()
+            context.area.header_text_set("")
             return {'CANCELLED'}
 
         return {'RUNNING_MODAL'}
diff --git a/release/scripts/templates_py/gizmo_custom_geometry.py b/release/scripts/templates_py/gizmo_custom_geometry.py
index 8125498fa85..071af9a660d 100644
--- a/release/scripts/templates_py/gizmo_custom_geometry.py
+++ b/release/scripts/templates_py/gizmo_custom_geometry.py
@@ -96,7 +96,7 @@ class MyCustomShapeWidget(Gizmo):
         return {'RUNNING_MODAL'}
 
     def exit(self, context, cancel):
-        context.area.header_text_set()
+        context.area.header_text_set("")
         if cancel:
             self.target_set_value("offset", self.init_value)
 
diff --git a/release/scripts/templates_py/operator_modal_view3d.py b/release/scripts/templates_py/operator_modal_view3d.py
index 9d371446829..1b94a5fd308 100644
--- a/release/scripts/templates_py/operator_modal_view3d.py
+++ b/release/scripts/templates_py/operator_modal_view3d.py
@@ -29,12 +29,12 @@ class ViewOperator(bpy.types.Operator):
             context.area.header_text_set("Offset %.4f %.4f %.4f" % tuple(self.offset))
 
         elif event.type == 'LEFTMOUSE':
-            context.area.header_text_set()
+            context.area.header_text_set("")
             return {'FINISHED'}
 
         elif event.type in {'RIGHTMOUSE', 'ESC'}:
             rv3d.view_location = self._initial_location
-            context.area.header_text_set()
+            context.area.header_text_set("")
             return {'CANCELLED'}
 
         return {'RUNNING_MODAL'}
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index 72514984188..f9dedc73280 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -325,12 +325,14 @@ static void rna_def_area_spaces(BlenderRNA *brna, PropertyRNA *cprop)
 static void rna_def_area_api(StructRNA *srna)
 {
 	FunctionRNA *func;
+	PropertyRNA *parm;
 
 	RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw");
 
 	func = RNA_def_function(srna, "header_text_set", "ED_area_status_text");
 	RNA_def_function_ui_description(func, "Set the header status text");
-	RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text");
+	parm = RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text");
+	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
 }
 
 static void rna_def_area(BlenderRNA *brna)



More information about the Bf-blender-cvs mailing list