Hi. A while ago I made an addon which does some exporting, and that part of it works fine. The File > Export > [addon] window has some properties (strings, bools, enums). Their default values are set from a config file, but I’d prefer all values to be set on the objects themselves (i.e per file) so they can be set and saved.
Presets are okay but they still need to be chosen each time (or each session).
I’ve already set up a custom panel with a string property whose value gets passed directly to the export script, so if necessary I can just move all of the properties in the Export panel to my custom panel, but does anyone know if these properties can be sent to the export window instead? The idea is to give the user a chance to review the settings.
The gist of my code is as follows. It might be easier to use the comments to understand what I’m asking, or to see if different arrangement is required to make it possible:
init.py: (forum has converted double _s in filename into italics)
class ExportPanel(bpy.types.Operator):
prop_example: StringProperty(name='thing', default=tryconfig(...), description='thingy') #would be ideal to read this from a scene prop but currently it's just in the export panel/preset
...etc
def execute(self, context):
...
keywords['extra_prop'] = context.scene.customPropName #this is how I'm currently sending a custom scene property directly to the export script, but it would be nice if, instead, it could show up in the Export window.
further down the file…
class CustomPanelExample(bpy.types.Panel):
...
bl_context='object'
...
def_draw(self, context):
layout.row().prop(context.scene, 'extra_prop') #this is the value which directly sets a param/keyword in the export script. Can it be sent to the Export window instead?
...
further down again…
def_register():
...
bpy.types.Scene.extra_prop = StringProperty(name='', description='something') #registers the custom panel property
Thanks for any advice that is offered!
Update: I decided to just move some of the properties from the Export window to the Object data panel. These are things that could change per object/file. The Export window now just has the properties that are likely to be set just once (after the addon is installed).