Permalink
Browse files

add logging & fix path

  • Loading branch information...
Benoit Juin
Benoit Juin committed Jun 8, 2017
1 parent 3f20a67 commit 1bf2f30840f72072b605b548ce9048ae7ac55e98
Showing with 42 additions and 2 deletions.
  1. +26 −0 .gitignore
  2. +1 −1 io_ogre/ogre/scene.py
  3. +15 −1 io_ogre/ui/export.py
View
@@ -0,0 +1,26 @@
syntax: glob
# This line is a comment, and will be skipped.
# Empty lines are skipped too.
# Backup/Lock files left behind by the Emacs editor.
*~
\#*.*\#
# Lock files used by the Emacs editor.
# Notice that the "#" character is quoted with a backslash.
# This prevents it from being interpreted as starting a comment.
.\#*
# Temporary files used by the vim editor.
.*.swp
# A hidden file created by the Mac OS X Finder.
.DS_Store
# python bytecode
*.pyc
__pycache__
_ogre_debug.txt
test/blender/
View
@@ -26,7 +26,7 @@ def dot_scene(path, scene_name=None):
print("Creating Directory -", path)
os.mkdir(path)
print("Processing Scene -", scene_name)
print("Processing Scene: name:%s, path: %s"%(scene_name, path))
prefix = scene_name
# Nodes (objects) - gather because macros will change selection state
View
@@ -4,6 +4,8 @@
import getpass
import math
import mathutils
import logging
from bpy.props import EnumProperty, BoolProperty, FloatProperty, StringProperty, IntProperty
from .. import config
from ..report import Report
@@ -14,6 +16,7 @@
from ..ogre import scene
from ..ogre import material
logger = logging.getLogger('root')
def auto_register(register):
yield OP_ogre_export
@@ -49,6 +52,10 @@ def invoke(self, context, event):
return {'RUNNING_MODAL'}
def execute(self, context):
logger.info("context.blend_data %s"%context.blend_data.filepath)
logger.info("context.scene.name %s"%context.scene.name)
logger.info("self.filepath %s"%self.filepath)
logger.info("self.last_export_path %s"%self.last_export_path)
# Resolve path from opened .blend if available. It's not if
# blender normally was opened with "last open scene".
# After export is done once, remember that path when re-exporting.
@@ -64,16 +71,23 @@ def execute(self, context):
if self.filepath == "" or not self.filepath:
self.filepath = "blender2ogre"
logger.info("self.filepath %s"%self.filepath)
kw = {}
for name in dir(self):
if name.startswith('EX_'):
kw[ name[3:] ] = getattr(self,name)
config.update(**kw)
print ("_"*80)
target_path = self.last_export_path
target_path = os.path.dirname(os.path.abspath(self.filepath))
target_file_name = self.filepath
target_file_name_no_ext = os.path.splitext(target_file_name)[0]
logger.info("target_path %s"%target_path)
logger.info("target_file_name %s"%target_file_name)
logger.info("target_file_name_no_ext %s"%target_file_name_no_ext)
Report.reset()
scene.dot_scene(target_path, target_file_name_no_ext)
Report.show()

0 comments on commit 1bf2f30

Please sign in to comment.