Skip to content

Commit

Permalink
Show Blenders python script code for export options
Browse files Browse the repository at this point in the history
  • Loading branch information
sercero committed Feb 8, 2024
1 parent 7dcb527 commit 4b0249a
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions io_ogre/ui/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,26 @@ def execute(self, context):
# Load addonPreference in CONFIG
config.update_from_addon_preference(context)

# Update saved defaults to new settings and also print export code
kw = {}
conf_name = ""

print ("_" * 80,"\n")

print("# Blender Script:")
print("import bpy")
print("bpy.ops.ogre.export(")
print(" filepath=\"%s\", " % os.path.abspath(self.filepath))
for name in dir(_OgreCommonExport_):
if name.startswith('EX_V1_'):
kw[ name[6:] ] = getattr(self,name)
elif name.startswith('EX_V2_'):
kw[ name[6:] ] = getattr(self,name)
elif name.startswith('EX_Vx_'):
kw[ name[6:] ] = getattr(self,name)
if name.startswith('EX_V1_') or name.startswith('EX_V2_') or name.startswith('EX_Vx_'):
conf_name = name[6:]
elif name.startswith('EX_'):
kw[ name[3:] ] = getattr(self,name)
conf_name = name[3:]
kw[ conf_name ] = getattr(self, name)
if name.startswith('EX_') and config._CONFIG_DEFAULTS_ALL[ conf_name ] != getattr(self, name):
print(" %s=%s, " % (name, getattr(self, name)))
config.update(**kw)
print(")")

print ("_" * 80,"\n")

Expand Down

0 comments on commit 4b0249a

Please sign in to comment.