File/Path Browse with an Addon, folder button doesn't open file browser

Hey, I have some code that’s not working. Visually it looks fine but when clicking the file button blender doesn’t open the file browser view.

In my class constructor I have a StringProperty with subtype FILE_PATH.



file_path = StringProperty(
            name = "File path",
            default = "",
            description = "",
            subtype = 'FILE_PATH'
            )


and the draw function looks like this.

rowsub = col.row(align=True)
        rowsub.prop(self, "file_path")

Two questions

a) what object type is the file path assigned too eg


bpy.types.Scene.file_path = StringProperty(...)

b)

in a draw method self is assigned to the layout, and using example above, scene has the file_path prop.

eg


def draw(self, context):
    scene = context.scene
    row = self.layout.row()
    row.prop(scene, "file_path")

Thanks for the quick answer, and …

a) to nothing, just as I typed.
b) ok

I tried didn’t work, I mean. still get a string input, and the file browser icon. but the file browser icon doesn’t work.

worth to mention I am doing this in a context.window_manager.invoke_props_dialog

Ok, I see what you are trying.

IIRC you can’t do that, that is invoke a filebrowser from a any popup, or from a filebrowser (you get an info message for this one)

You can however, invoke a props dialog from an operator button in the filebrowser space, which may be a workaround.

Ah, another question.

I have an EnumProperty, which I have a function hooked up to update=onupdate
which I want to redraw the dialog window. the idea is if user selects another Enum, I want to update some options in the addon. is that possible?

have been trying to call the draw function again in so many different ways.

I just saw we’re doing addons in the same corner :stuck_out_tongue: I am trying to make a simple, select audio file. it bakes and generates a couple of empties for visuals and to attach drivers to.