diff --git a/io_scene_x3d/__init__.py b/io_scene_x3d/__init__.py index a98cb17117f76786ba4906a08414253e07e77e79..79f077e62d11f3d5f65b39b84f00f41d7b548701 100644 --- a/io_scene_x3d/__init__.py +++ b/io_scene_x3d/__init__.py @@ -145,44 +145,20 @@ class ExportX3D(bpy.types.Operator, ExportHelper): default=False, ) - blender_axis_forward = EnumProperty( - name="Blender Forward", + axis_forward = EnumProperty( + name="Forward", items=(('X', "X Forward", ""), ('Y', "Y Forward", ""), ('Z', "Z Forward", ""), ('-X', "-X Forward", ""), ('-Y', "-Y Forward", ""), ('-Z', "-Z Forward", ""), - ), - default='-Y', - ) - - blender_axis_up = EnumProperty( - name="Blender Up", - items=(('X', "X Up", ""), - ('Y', "Y Up", ""), - ('Z', "Z Up", ""), - ('-X', "-X Up", ""), - ('-Y', "-Y Up", ""), - ('-Z', "-Z Up", ""), ), default='Z', ) - x3d_axis_forward = EnumProperty( - name="X3D Forward", - items=(('X', "X Forward", ""), - ('Y', "Y Forward", ""), - ('Z', "Z Forward", ""), - ('-X', "-X Forward", ""), - ('-Y', "-Y Forward", ""), - ('-Z', "-Z Forward", ""), - ), - default='Z', - ) - - x3d_axis_up = EnumProperty( - name="X3D Up", + axis_up = EnumProperty( + name="Up", items=(('X', "X Up", ""), ('Y', "Y Up", ""), ('Z', "Z Up", ""), @@ -198,17 +174,13 @@ class ExportX3D(bpy.types.Operator, ExportHelper): def execute(self, context): from . import export_x3d - keywords = self.as_keywords(ignore=("blender_axis_forward", - "blender_axis_up", - "x3d_axis_forward", - "x3d_axis_up", + keywords = self.as_keywords(ignore=("axis_forward", + "axis_up", "check_existing", "filter_glob", )) - global_matrix = axis_conversion(from_forward=self.blender_axis_forward, - from_up=self.blender_axis_up, - to_forward=self.x3d_axis_forward, - to_up=self.x3d_axis_up, + global_matrix = axis_conversion(to_forward=self.axis_forward, + to_up=self.axis_up, ).to_4x4() keywords["global_matrix"] = global_matrix diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py index 55b7a52d27a0fa9b4fa5ad8f186b3b0c6cb6884d..aafe300bd28eaceb5be6f00cd8b8b9c15abcaab4 100644 --- a/io_scene_x3d/export_x3d.py +++ b/io_scene_x3d/export_x3d.py @@ -187,7 +187,7 @@ def h3d_shader_glsl_frag_patch(filepath, scene, global_vars, frag_uniform_var_ma lines.append("\n") elif l.lstrip().startswith("lamp_visibility_other("): w = l.split(', ') - last_transform = w[1] + _TRANSFORM # XXX - HACK!!! + last_transform = w[1] + "_transform" # XXX - HACK!!! w[1] = '(view_matrix * %s_transform * vec4(%s.x, %s.y, %s.z, 1.0)).xyz' % (w[1], w[1], w[1], w[1]) l = ", ".join(w) elif l.lstrip().startswith("lamp_visibility_sun_hemi("): @@ -282,13 +282,15 @@ def export(file, # If names are not decorated, it may be possible for two objects to # have the same name, so there has to be a unified dictionary to # prevent uuid collisions. - uuid_cache_object = {} # object - uuid_cache_lamp = uuid_cache_object # 'LA_' + object.name - uuid_cache_view = uuid_cache_object # object, different namespace - uuid_cache_mesh = uuid_cache_object # mesh - uuid_cache_material = uuid_cache_object # material - uuid_cache_image = uuid_cache_object # image - uuid_cache_world = uuid_cache_object # world + uuid_cache = {} + uuid_cache_object = uuid_cache # object + uuid_cache_lamp = uuid_cache # 'LA_' + object.name + uuid_cache_view = uuid_cache # object, different namespace + uuid_cache_mesh = uuid_cache # mesh + uuid_cache_material = uuid_cache # material + uuid_cache_image = uuid_cache # image + uuid_cache_world = uuid_cache # world + del uuid_cache CA_ = '' OB_ = '' ME_ = ''