Page MenuHome

Redrawing dialogs
Closed, ResolvedPublic

Description

System Information
Kubuntu 15.10
Nvidia GeForce 9600 GT (driver: 340.96)

Blender Version
Broken: (2.77rc1)
Worked: (2.76b)

Short description of error
Redrawing dialogs doesn't work in blender 2.77rc1:

import bpy

class WM_OT_my_props_dialog(bpy.types.Operator):
    bl_idname = "wm.my_props_dialog"
    bl_label = "Props Dialog"

    bool_prop = bpy.props.BoolProperty()
    str_prop = bpy.props.StringProperty()

    def check(self, context):
        return True

    def draw(self, context):
        layout = self.layout

        layout.prop(self, "bool_prop", toggle=True)
        if self.bool_prop:
            layout.prop(self, "str_prop")

    def execute(self, context):
        return {'FINISHED'}

    def invoke(self, context, event):
        return context.window_manager.invoke_props_dialog(self)


if not hasattr(bpy.types, "WM_OT_my_props_dialog"):
    bpy.utils.register_class(WM_OT_my_props_dialog)

bpy.ops.wm.my_props_dialog('INVOKE_DEFAULT')

Exact steps for others to reproduce the error
Run the script in blender's text editor.

Event Timeline

Aleksandr Zinovev (raa) raised the priority of this task from to 90.
Aleksandr Zinovev (raa) updated the task description. (Show Details)
Aleksandr Zinovev (raa) edited a custom field.

Yep… knew that change could not 'just work'™… stupid UI code :(

Will revert and apply your patch @Campbell Barton (campbellbarton), actually was my first fix, but I found it too much 'hackish' (since this case could happen in other places too, though quite unlikely).