Skip to content

Commit

Permalink
Fix script when attribute is string
Browse files Browse the repository at this point in the history
  • Loading branch information
sercero committed Apr 1, 2024
1 parent 494cb23 commit 25a8789
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions io_ogre/ui/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ def execute(self, context):
script_text += "import bpy\n"
script_text += "bpy.ops.ogre.export(\n"
script_text += " filepath='%s', \n" % os.path.abspath(self.filepath).replace('\\', '\\\\')
#print(dir(_OgreCommonExport_))
for name in dir(_OgreCommonExport_):
conf_name = ""
if name.startswith('EX_V1_') or \
Expand All @@ -157,7 +156,10 @@ def execute(self, context):
attribute = getattr(self, name)
kw[ conf_name ] = attribute
if config._CONFIG_DEFAULTS_ALL[ conf_name ] != attribute:
script_text += " %s=%s, \n" % (name, attribute)
if type(attribute) == str:
script_text += " %s='%s', \n" % (name, attribute)
else:
script_text += " %s=%s, \n" % (name, attribute)
script_text += ")\n"

print(script_text)
Expand Down
5 changes: 4 additions & 1 deletion io_ogre/ui/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ def execute(self, context):
attribute = getattr(self, name)
kw[ conf_name ] = attribute
if config._CONFIG_DEFAULTS_ALL[ conf_name ] != attribute:
script_text += " %s=%s, \n" % (name, attribute)
if type(attribute) == str:
script_text += " %s='%s', \n" % (name, attribute)
else:
script_text += " %s=%s, \n" % (name, attribute)
script_text += ")\n"

print(script_text)
Expand Down

0 comments on commit 25a8789

Please sign in to comment.