Errors inside an property update method aren't reported to the UI, only to terminal #39406

Closed
opened 2014-03-25 07:14:42 +01:00 by Garrett · 4 comments

System Information
OS: Ubuntu 13.10
Linux kernel: 3.11.0-18-generic

Blender Version
Broken: blender-2.70-b66a954-linux-glibc211-x86_64

Short description of error

If an addon has an error that occurs at runtime, there is an error message in the user interface (pop-up box and report in the Info window header). However, if the error occurs inside an "property update method", the user is not notified.

Exact steps for others to reproduce the error

  1. Open Blender and paste the following code into the Text Editor:
  import bpy
  
  class RenderPanel(bpy.types.Panel):
      bl_label="Hello!"
      bl_space_type="PROPERTIES"
      bl_region_type="WINDOW"
      bl_context = "render"
      
      def draw(self, context):
          layout = self.layout        
          layout.operator("hello.hello", text="CLICK ME!")  
          layout.prop(context.scene, 'myVar')
      
  class OBJECT_OT_HelloButton(bpy.types.Operator):
      bl_idname = "hello.hello"
      bl_label = "Say Hello"
      
      def execute(self, context):
          context.user_will_be_notified_of_this_error
          return {'FINISHED'}
   
  def updateInt(self, context):
      context.user_will_NOT_be_notified_of_this_error
          
          
  def register():
      bpy.utils.register_module(__name__)
      bpy.types.Scene.myVar = bpy.props.IntProperty(update=updateInt)
      
  def unregister():
      del bpy.types.Scene.myVar
      bpy.utils.unregister_module(__name__)
      
  if __name__=='__main__':
      register()
  1. Run Script
  2. Locate the addon in the render context of Properties window, and change the value of myVar. Note the lack of error message.

Example file: update_bug.blend

**System Information** OS: Ubuntu 13.10 Linux kernel: 3.11.0-18-generic **Blender Version** Broken: blender-2.70-b66a954-linux-glibc211-x86_64 **Short description of error** If an addon has an error that occurs at runtime, there is an error message in the user interface (pop-up box and report in the Info window header). However, if the error occurs inside an "property update method", the user is not notified. **Exact steps for others to reproduce the error** 1) Open Blender and paste the following code into the Text Editor: ``` import bpy class RenderPanel(bpy.types.Panel): bl_label="Hello!" bl_space_type="PROPERTIES" bl_region_type="WINDOW" bl_context = "render" def draw(self, context): layout = self.layout layout.operator("hello.hello", text="CLICK ME!") layout.prop(context.scene, 'myVar') class OBJECT_OT_HelloButton(bpy.types.Operator): bl_idname = "hello.hello" bl_label = "Say Hello" def execute(self, context): context.user_will_be_notified_of_this_error return {'FINISHED'} def updateInt(self, context): context.user_will_NOT_be_notified_of_this_error def register(): bpy.utils.register_module(__name__) bpy.types.Scene.myVar = bpy.props.IntProperty(update=updateInt) def unregister(): del bpy.types.Scene.myVar bpy.utils.unregister_module(__name__) if __name__=='__main__': register() ``` 2) Run Script 3) Locate the addon in the render context of Properties window, and change the value of myVar. Note the lack of error message. Example file: [update_bug.blend](https://archive.blender.org/developer/F82474/update_bug.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @Garrett-8

Added subscriber: @Garrett-8

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Campbell Barton self-assigned this 2014-03-25 07:17:55 +01:00

This is a limitation with our RNA data API. if an FCurve changes a value, or a button... and a python error occurs, there is simply no report list passed.

When you write update callbacks you are interfacing blender at quite a low level, same goes for python drivers.

closing.
since this isnt an error in blender and we're not likely to support this.

if you're developing with python you need to run blender from a terminal.

This is a limitation with our RNA data API. if an FCurve changes a value, or a button... and a python error occurs, there is simply no report list passed. When you write update callbacks you are interfacing blender at quite a low level, same goes for python drivers. closing. since this isnt an error in blender and we're not likely to support this. if you're developing with python you need to run blender from a terminal.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#39406
No description provided.