prop_directory : bpy.props.StringProperty(
name = “output_path”,
description=“Choose a directory:”,
default=“”,
maxlen=1024,
subtype=‘DIR_PATH’)
it seems to work on popovers but the icon does nothing on floating panels, any idea?
Thank you in advance
1 Like
Btw here is the full example
import bpy
bl_info = {
"name" : "Test",
"version": (0, 0, 1),
"description" : "",
"blender" : (2, 80, 0),
"location" : "",
"warning" : "",
"category" : "Scene"
}
class ThisThingOperator(bpy.types.Operator):
bl_idname = "scene.tester" # Unique identifier for buttons and menu items to reference.
bl_label = "Export tester project" # Display name in the interface.
prop_directory : bpy.props.StringProperty(
name="Root Folder",
description="TesterButton.",
subtype="DIR_PATH"
)
@classmethod
def poll(cls, context):
return (context.mode == 'OBJECT')
def execute(self, context):
return {'FINISHED'}
def invoke(self, context, event): # Used for user interaction
wm = context.window_manager
return wm.invoke_props_dialog(self)
def draw(self, context): # Draw options
row = self.layout
row.prop(self, "prop_directory", text="Bla")
def menu_func(self, context):
self.layout.operator(ThisThingOperator.bl_idname)
def register():
bpy.utils.register_class(ThisThingOperator)
bpy.types.TOPBAR_MT_render.append(menu_func)
bpy.types.Scene.directory = bpy.props.StringProperty(subtype='DIR_PATH')
def unregister():
bpy.utils.unregister_class(ThisThingOperator)
bpy.types.TOPBAR_MT_render.remove(menu_func)
if __name__ == "__main__":
register()
I haven’t got time to play with it, but the last line in all my work is this:
if __name__ == "__main__":
register()
Note the underscores…
It seems to be related to the formating the actual code is https://pastebin.com/hvC9bDjS
tonton
December 26, 2019, 12:14pm
5
Hey guys, no luck with this issue ?
I seems to have the same problem on a popup with a string property with a TEXTEDIT_UPDATE options.
Won’t update automatically, behaves like regular string property
I use the same kind of floating panel as you.