I need a button to open a dialog so the user can select a folder, and the button returns the path.
I know I can use
but I don't want an edit text box, but just the button. A normal button.
I can add a button with this
self.AddButton(1000, c4d.BFH_SCALEFIT, initw=200, inith=20, name='Select Folder')
but I don't know how to select a directory on click.
According to the documentation, I can use the pluginid CUSTOMGUI_BUTTON
And that is what I was trying, but it doesn't work:
bc = c4d.BaseContainer() bc[c4d.FILENAME_DIRECTORY] = True self.AddCustomGui(1000, c4d.CUSTOMGUI_BUTTON, name="Select Folder", flags=c4d.BFH_SCALEFIT, minw=200, minh=200, customdata=bc)
Is it possible to add a normal button on a gui dialog so that I can pick a folder from there?