Skip to content
Snippets Groups Projects
Commit c7425abe authored by Campbell Barton's avatar Campbell Barton
Browse files

fix for md3 menu

parent 2405c3c5
Branches
Tags
No related merge requests found
...@@ -684,7 +684,7 @@ class ExportMD3(bpy.types.Operator): ...@@ -684,7 +684,7 @@ class ExportMD3(bpy.types.Operator):
return context.active_object is not None return context.active_object is not None
def menu_func(self, context): def menu_func(self, context):
newpath = os.path.splitext(bpy.context.main.filepath)[0] + ".md3" newpath = os.path.splitext(bpy.context.blend_data.filepath)[0] + ".md3"
self.layout.operator(ExportMD3.bl_idname, text="Quake Model 3 (.md3)").filepath = newpath self.layout.operator(ExportMD3.bl_idname, text="Quake Model 3 (.md3)").filepath = newpath
def register(): def register():
...@@ -694,4 +694,4 @@ def unregister(): ...@@ -694,4 +694,4 @@ def unregister():
bpy.types.INFO_MT_file_export.remove(menu_func) bpy.types.INFO_MT_file_export.remove(menu_func)
if __name__ == "__main__": if __name__ == "__main__":
register() register()
\ No newline at end of file
...@@ -82,7 +82,7 @@ class PasteAllOperator(bpy.types.Operator): ...@@ -82,7 +82,7 @@ class PasteAllOperator(bpy.types.Operator):
# get the selected text # get the selected text
text = self.get_selected_text(st.text) text = self.get_selected_text(st.text)
# if no text is selected send the whole file # if no text is selected send the whole file
if text == None: text = st.text.as_string() if text is None: text = st.text.as_string()
# get the file type based on the extension # get the file type based on the extension
format = self.get_file_format(st.text) format = self.get_file_format(st.text)
...@@ -90,14 +90,14 @@ class PasteAllOperator(bpy.types.Operator): ...@@ -90,14 +90,14 @@ class PasteAllOperator(bpy.types.Operator):
# send the text and receive the returned page # send the text and receive the returned page
html = self.send_text(text, format) html = self.send_text(text, format)
if html == None: if html is None:
self.report('ERROR', "Error in sending the text to the server.") self.report('ERROR', "Error in sending the text to the server.")
return {'CANCELLED'} return {'CANCELLED'}
# get the link of the posted page # get the link of the posted page
page = self.get_page(str(html)) page = self.get_page(str(html))
if page == None or page == "": if page is None or page == "":
self.report('ERROR', "Error in retrieving the page.") self.report('ERROR', "Error in retrieving the page.")
return {'CANCELLED'} return {'CANCELLED'}
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment