diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2004-06-10 07:27:46 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2004-06-10 07:27:46 +0400 |
commit | a6d077bae243eef5f8826b2c7b27bd297428d7d4 (patch) | |
tree | e170a7cc6c848969d5316c5abb3f68fa89de5d9d /release/scripts/wings_export.py | |
parent | 7ff5c16a025adc56651b293ca993da82a2432a75 (diff) |
Scripts:
- tiny updates for better behavior, unix line endings, cvs Id tags;
- Updated DX7 exporter (thanks to author Ben Omari who's also working on a DX8 one);
- added sysinfo script;
Interface (scripts):
- changed behavior for which win is chosen for script guis:
Now there's a smarter order, guis will use either:
- Scripts win
- Buttons win (if not a script from groups Wizards or Utils)
- Text win
- Closest bigger area
- Added a button to the scripts header so that it's faster to return to the buttons win (this can be made general), if that was the previous win used.
Diffstat (limited to 'release/scripts/wings_export.py')
-rw-r--r-- | release/scripts/wings_export.py | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/release/scripts/wings_export.py b/release/scripts/wings_export.py index 46112ac83fd..df36aec4c9f 100644 --- a/release/scripts/wings_export.py +++ b/release/scripts/wings_export.py @@ -7,6 +7,8 @@ Group: 'Export' Tooltip: 'Export selected mesh to Wings3D File Format (*.wings)' """ +# $Id$ +# # +---------------------------------------------------------+ # | Copyright (c) 2002 Anthony D'Agostino | # | http://www.redrival.com/scorpius | @@ -268,6 +270,7 @@ def write(filename): start = time.clock() objects = Blender.Object.GetSelected() + objname = objects[0].name meshname = objects[0].data.name mesh = Blender.NMesh.GetRaw(meshname) @@ -280,28 +283,30 @@ def write(filename): message = "Unable to generate\nEdge Table for mesh.\n" message += "Object name is: " + meshname mod_meshtools.print_boxed(message) - #return - - if 0: - import Tkinter, tkMessageBox - sys.argv=['wings.pyo','wings.pyc'] # ? - - #Tkinter.NoDefaultRoot() - win1 = Tkinter.Tk() - ans = tkMessageBox.showerror("Error", message) - win1.pack() - print ans - if ans: - win1.quit() - win1.mainloop() - - else: - from Tkinter import Label - sys.argv = 'wings.py' - widget = Label(None, text=message) - #widget.title("Error") - widget.pack() - widget.mainloop() + Blender.Draw.PupMenu("Wings Export error|Unable to generate Edge Table for mesh") + return + + +# if 0: +# import Tkinter, tkMessageBox +# sys.argv=['wings.pyo','wings.pyc'] # ? +# +# #Tkinter.NoDefaultRoot() +# win1 = Tkinter.Tk() +# ans = tkMessageBox.showerror("Error", message) +# win1.pack() +# print ans +# if ans: +# win1.quit() +# win1.mainloop() +# +# else: +# from Tkinter import Label +# sys.argv = 'wings.py' +# widget = Label(None, text=message) +# #widget.title("Error") +# widget.pack() +# widget.mainloop() data = generate_data(objname, edge_table, mesh) dsize = len(data) @@ -334,4 +339,8 @@ def fs_callback(filename): if filename.find('.wings', -6) <= 0: filename += '.wings' write(filename) -Blender.Window.FileSelector(fs_callback, "Wings3D Export") + +if Blender.Object.GetSelected()[0].getType() != "Mesh": + Blender.Draw.PupMenu("Wings Export error|Selected object is not a mesh!") +else: + Blender.Window.FileSelector(fs_callback, "Wings3D Export") |