Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-07-14 15:59:08 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-07-14 15:59:08 +0400
commit475c45e4b1c3052885c222bd42afd4d78343b74a (patch)
treec848b5b644796ccbedd2e06b1b911d3bccac5719
parentd20a38c4069ff1896b20eb3cef83cfab77e862ca (diff)
bugfix [#22843] Cannot export to folder with ".blend" on the end.
-rw-r--r--io_anim_camera.py3
-rw-r--r--io_export_directx_x.py4
-rw-r--r--io_export_unreal_psk_psa.py10
-rw-r--r--io_mesh_raw/__init__.py3
-rw-r--r--io_mesh_stl/__init__.py3
5 files changed, 12 insertions, 11 deletions
diff --git a/io_anim_camera.py b/io_anim_camera.py
index d50fce1f..1f1b51ab 100644
--- a/io_anim_camera.py
+++ b/io_anim_camera.py
@@ -146,7 +146,8 @@ class CameraExporter(bpy.types.Operator):
def menu_export(self, context):
- default_path = bpy.data.filepath.replace(".blend", ".py")
+ import os
+ default_path = os.path.splitext(bpy.data.filepath)[0] + ".py"
self.layout.operator(CameraExporter.bl_idname, text="Cameras & Markers (.py)").filepath = default_path
diff --git a/io_export_directx_x.py b/io_export_directx_x.py
index 8b41f01c..40c1c931 100644
--- a/io_export_directx_x.py
+++ b/io_export_directx_x.py
@@ -1038,9 +1038,7 @@ class DirectXExporter(bpy.types.Operator):
def menu_func(self, context):
- DefaultPath = bpy.data.filepath
- if DefaultPath.endswith(".blend"):
- DefaultPath = DefaultPath[:-6] + ".x"
+ DefaultPath = os.path.splitext(bpy.data.filepath)[0] + ".x"
self.layout.operator(DirectXExporter.bl_idname, text="DirectX (.x)").filepath = DefaultPath
diff --git a/io_export_unreal_psk_psa.py b/io_export_unreal_psk_psa.py
index 81cdcf02..a49ad521 100644
--- a/io_export_unreal_psk_psa.py
+++ b/io_export_unreal_psk_psa.py
@@ -1510,7 +1510,7 @@ class ExportUDKAnimData(bpy.types.Operator):
def menu_func(self, context):
bpy.context.scene.unrealexportpsk = True
bpy.context.scene.unrealexportpsa = True
- default_path = bpy.data.filepath.replace(".blend", ".psk")
+ default_path = os.path.splitext(bpy.data.filepath)[0] + ".psk"
self.layout.operator("export.udk_anim_data", text="Skeleton Mesh / Animation Data (.psk/.psa)").filepath = default_path
@@ -1521,7 +1521,7 @@ class VIEW3D_PT_unrealtools_objectmode(bpy.types.Panel):
def poll(self, context):
return context.active_object
-
+
def draw(self, context):
layout = self.layout
#layout.label(text="Unreal Tools")
@@ -1575,8 +1575,8 @@ class OBJECT_OT_UnrealExport(bpy.types.Operator):
bpy.context.scene.unrealexportpsk = True
bpy.context.scene.unrealexportpsa = True
print("Exporting ALL...")
- default_path = bpy.data.filepath.replace(".blend", ".psk")
- print(dir(bpy.data.filepath))
+
+ default_path = os.path.splitext(bpy.data.filepath)[0] + ".psk"
fs_callback(default_path, bpy.context, False)
#self.report({'WARNING', 'INFO'}, exportmessage)
@@ -1590,7 +1590,7 @@ def register():
bpy.types.register(VIEW3D_PT_unrealtools_objectmode)
bpy.types.register(ExportUDKAnimData)
bpy.types.INFO_MT_file_export.append(menu_func)
-
+
def unregister():
global MENUPANELBOOL
if MENUPANELBOOL:
diff --git a/io_mesh_raw/__init__.py b/io_mesh_raw/__init__.py
index 8a1569bc..1af09c9f 100644
--- a/io_mesh_raw/__init__.py
+++ b/io_mesh_raw/__init__.py
@@ -40,7 +40,8 @@ def menu_import(self, context):
def menu_export(self, context):
from io_mesh_raw import export_raw
- default_path = bpy.data.filepath.replace(".blend", ".raw")
+ import os
+ default_path = os.path.splitext(bpy.data.filepath)[0] + ".raw"
self.layout.operator(export_raw.RawExporter.bl_idname, text="Raw Faces (.raw)").filepath = default_path
diff --git a/io_mesh_stl/__init__.py b/io_mesh_stl/__init__.py
index b671dd9e..1858c17b 100644
--- a/io_mesh_stl/__init__.py
+++ b/io_mesh_stl/__init__.py
@@ -128,7 +128,8 @@ def menu_import(self, context):
def menu_export(self, context):
- default_path = bpy.data.filepath.replace(".blend", ".stl")
+ import os
+ default_path = os.path.splitext(bpy.data.filepath)[0] + ".stl"
self.layout.operator(StlExporter.bl_idname,
text="Stl (.stl)").filepath = default_path