I'm working on a plugin modification which is a tool for exporting gltf. On the export windows, we have a choice to put "Copyright" & "Default Texture Location" parameters as you can see here :
I wanted to add some input into the preferences tab of the addon by adding two input :
- Default Texture Location
- Default Copyright Name
That way, we could just set this one time and no need to make some operator presets etc..

My code is for the preference part is :
## class to add the preference settings
class addSettingsPanel(bpy.types.AddonPreferences):
bl_idname = __package__
settings_default_texture_location: bpy.props.StringProperty (
name = "Default Texture Location",
description = "Default Texture Location",
default = "../texture"
)
settings_default_copyright: bpy.props.StringProperty (
name = "Default Copyright Name",
description = "Default Copyright Name",
default = ""
)
##bpy.types.Scene.toto = settings_default_copyright
bpy.types.Scene.my_sel_value = bpy.props.StringProperty(name="Sel")
## draw the panel in the addon preferences
def draw(self, context):
layout = self.layout
box = layout.box()
##row = layout.row()
col = box.column(align = True)
## texture default location
col.prop(self, 'settings_default_texture_location', expand=True)
## default copyright
col.prop(self, 'settings_default_copyright', expand=True)
The question is :
How to access to these values in the export windows, which is on another file to show it in the first image instead of the blank label "Textures" and "Copyright" ?
EDIT :
As @brockmann Suggested in the comments,
I modified the code to :
preferences = bpy.context.preferences
addon_prefs = preferences.addons[__package__].preferences
export_copyright: StringProperty(
name='Copyright',
description='Legal rights and conditions for the model',
default=addon_prefs.settings_default_texture_location
)
But I've got the error " KeyError: ... key "Blender2MSFS.exporter" not found. So I tried to manually put "Blender2MSFS" instead of package and it is not working too.
The code is here : https://github.com/btronquo/Blender2MSFS2 exporter/init.py (line 96,97 and then 129 / 151)

__init__.pyin the export folder, declare your preferences there and assign the new properties to thedefaultparm of e.g.export_copyright(line 122). – brockmann Oct 29 '21 at 08:05How i'm supposed to retrive the value and put it in the default="" place ?
export_copyright: StringProperty( name='Copyright', description='Legal rights and conditions for the model', default='' )It would be :
– Boris Oct 29 '21 at 08:22default=settings_default_copyright.defaultor something ?addon_prefs = preferences.addons[__name__].preferencesand then just assign it (default=addon_prefs.default_texture_location) as mentioned. – brockmann Oct 29 '21 at 08:27