KatsBits Community
Game Editing => Scripts & Support => Topic started by: kat on July 26, 2010, 05:20:51 AM
-
ASE Import and export scripts for Blender 2.5 series (up to 2.56+/- only. NOTE: may work with other versions - test before use). Both import and export scripts should be placed in Blenders "scripts\addons" (or "scripts\io" if scripts\addons doesn't appear to be working) folder. If there are any other ASE scripts present it's best to remove or rename them as Blender 2.5 tends to like scripts following a specific naming convention.
Download
- Download ASE export for 2.56 (https://www.katsbits.com/files/ase/io_export_ase.zip)
- Download ASE export for Blender 2.54 (https://www.katsbits.com/files/ase/export-ase-254.zip) (inc, 2.55beta)
- ASE Import/Export for 2.53 here (https://www.katsbits.com/files/ase/blender2.5-imp-exp_ase.zip)
- For Blender 2.6 series see link here (https://www.katsbits.com/smforum/index.php?topic=257.0) (note this is an offsite script)
Installation for 2.56+/-
Make sure you are using an officially released version of Blender (available from Blender.org (https://blender.org/)) before using these scripts - in-development versions of Blender may break scripts so test before use.
Both scripts need to be placed in the following location;
scripts\addons\
For Windows Vista/Win7 users Blender's scripts folder is typically located in;
C:\Users\[profile]\AppData\Roaming\Blender Foundation\Blender 2.53\scripts\addons\
Windows XP users should look in;
C:\Documents and Settings\[profile]\Application Data\Blender Foundation\Blender 2.53\scripts\addons\
Linux and Mac installation will differ depending on OS version used.
Using the ASE export script
For additional and extensive ASE export details read the ASE export tutorial here (https://www.katsbits.com/tutorials/blender/export-ase-models.php).
ASE Export
As with other scripts, select the object or objects that need to be exported and click "File » Export » Ascii Scene Export (ase)". Type a name or select the file to overwrite, and then click the "Export ASE" button to export the model.
Model scale default is set to "16", this is a multiplier so it will scale your object up by sixteen (or "[n]" value input). To export objects 'as is', set the "Scale: [n]" value to "1" ("Scale: 1").
Note: remember that you can export several objects as a single mesh to get a multi sub-object mesh (has several "GEOMOBJECTS" written into the ASE) with multiple materials. Or, an object where sub-objects are joined before export producing a single model with one multi-material. Additionally, it's currently not possible to export 'blank' meshes, i.e. all meshes need a material, texture and UVW map else the process reads them as being incomplete, halting the export procedure.
(https://www.katsbits.com/images/tools_utilities/blender-2.5-ase-import-export.jpg)
ASE Import
From the "File" menu select "Import » Ascii Scene Export (ase)", then select the file to be imported into Blender. To import a model 'as is' without altering the size of the object/s, from "Import ASE" section change the "Scale: [n]" value to "1" (default currently "0.06").
(https://www.katsbits.com/images/tools_utilities/blender-2.5-ase-import-settings.jpg)
Problems and Errors
There are a couple of basic script related issues you need to be aware of when exporting or importing meshes and models;
- The script is currently written to halt on finding 'blank' meshes, i.e. a mesh object without materials, textures or UVW maps will stop the process.
- If Blender complains about 'periods', check the file names to make sure they're as follows as anything else may return a script error in the Python console.
- export_ase.py
- import_ase.py
- Similarly, if the script doesn't appear in the "File » Import/Export" menus check file name conforms to the above.
Misc & UT/UDK editing
For Unreal Development Kit and Unreal Engine usage, models are not currently exported correctly where MULTI-MATERIALS (multiple materials) are needed; although objects do contain individual elements, they are defined at the OBJECT and not the MATERIAL level. This means that models for UT/UDK can only contain ONE material and ONE texture. Other issues exist, for more details read this topic.
-
Doesn't work with 2.55.1
===================================
Traceback (most recent call last):
File "/home/motorsep/software/blender25/2.55/scripts/io/export_ase.py", line 494, in invoke
wm.add_fileselect(self)
AttributeError: 'WindowManager' object has no attribute 'add_fileselect'
location:<unknown location>:-1
location:<unknown location>:-1
===================================
-
I'm guessing that's the latest Graphicall(?) release? The scripts always break on those (unstable) in development versions of Blender, you must be using the officially released version available from Blender.org (http://www.blender.org); the ASE exporter works in that (just tested it to double check).
-
Aye. Switched to official 2.55 beta.
-
I've installed the script, but when I try to use it I get an error to say that my mesh is not UV mapped. Your instructions say the mesh must have material, texture and uv mapping. That confuses me, because I thought that uv mapping was just a way to create a texture. My lack of understanding, clearly. Could you be more specific about what my mesh needs before I can export it, please.
-
Read this section of the Learning Blender 2.5 tutorial series that deals with UVW maps specifically (http://www.katsbits.com/tutorials/blender/blender-basics-2.5-unwrapping-uvw-maps.php).
To give a quick reply here though, UVW maps are a necessary component of game models because the coordinates ("U", "V" and "W") of the 'map' itself are used by games to figure out how textures are supposed to be applied over a mesh, without them, engine tech is basically looking at a blank canvas. UVW maps don't specifically relate to textures directly in terms of how those are made (except to 'map' areas of a texture to certain corresponding areas on a model).
That error means that if you could get that model into game, it'll likely appear with some form of "shader not found" default image (or depending on the game engine being used, more commonly flat lit as either solid 'black' or 'white') because the game won't be able to map textures to the mesh (so the script is replicating that by spitting out the same message).
So make sure your mesh has at least one material (with an associated texture/image), and some form of a UVW map present before export.
-
Got it! Thanks for your help.
By the way, your tutorial on UV mapping was great. The first one I have fully understood.
-
ASE export script appears to be broken in Blender 2.56beta with the following error (similar to one mentioned above);
Traceback (most recent call last):
File "C:\Users\Ken\AppData\Roaming\Blender Foundation\Blender\2.56\scripts\io\export_ase.py", line 494, in invoke
wm.add_fileselect(self)
AttributeError: 'WindowManager' object has no attribute 'add_fileselect'
location:<unknown location>:-1
-
OK, a fix came in via NB - cheers matey.
Download the fixed ase export script (http://www.katsbits.com/tools/index.php#ase) from the downloads page. Or open the script in a text editor and find line 494 or the below text;
wm.add_fileselect(self)
Replace with;
wm.fileselect_add(self)
-
I use the official 2.56b and get the following error:
Line 474, in execute if os.path.exists(self.properties.filepath):
UnicodeDecodeError:'utf8'codec can't decode bytes in position 30-33:invalid data location<unknown location>:-1
-
Need a bit more info all systems and directory related..
- What OS/Blender/Python are you using?
- Where is Blender installed to?
- Where are the scripts located?
- Where did you try and export the file to?
-
Sorry about the lack of info.
I have Windows XP SP3/Blender2.56a(blender.org version)/bundled Python
Blender is installed to: C:\Program Files\Blender Foundation\Blender
script location: C:\Program Files\Blender Foundation\Blender\2.56\scripts\io
I tried exporting to the desktop and the documents folder.
Installing with the ApplicationData folder option did not work for me, that's why I have my user data in the same place.
The full error message:
Trackback (most recent call last):
File "C:\Progra~1\Blende~1\Blender\scripts\io\export_ase.py", line474, in execute
if os.path.exists(self.properties.filepath):
UnicodeDecodeError: 'utf8'codec can't decode bytes in position 30-33: invalid data
location:<unknown location>:-1
-
Hmm looks like you've got two problems there. For some reason it's not seeing the "2.56" segment of the path location for the scripts. I'm also guessing the presence of the (pre Win98) truncation symbols ("~") may also be causing issues (although I'm puzzled as to why because that's an established 'system' protocol). Not sure how to get around this one to be honest, but a few things you could try... you might try setting the Python System path (http://www.katsbits.com/tutorials/blender/setting-up-windows-python-path-system-variable.php) to see if that stops Blender/Python from truncating the directory names. Also try re-installing Blender/Python to folders/directory's not using any 'special' characters in them; the "." counts as one iirc, so "256" instead of "2.56".
-
How does one use the ASE exporter with the Windows 7 64 bit version of Blender 2.49b? I went to the folder suggested to place it in but it of course was not there as no self installer has been made for the 64bit version as of yet.
-
With 2.49 you should be able to load the script into the Text View (Shift+F11) and run it with "Alt+P" irrespective of which version of Windows you're on, that's what I usually do. I don't currently have access to a W7 machine so can't test/confirm this though. Post back if it works.
-
Hey kat. I went ahead and upgraded to the newest version of blender, 5.56.0 64bit and placed the file where you said to do so. However the option to export as .ase doesn't appear under file->export.
-
Not sure if this will work but try loading it into the script/text view and running it like that the old skool way (Alt+P). Otherwise you'll have to do a system search what "blender" folders you can find and play around with where you put the script. Also... long shot... I don't think the scripts need Python installed to show in the navigation menus but check that option as well.
-
Hi
I made few changes to get your ASE exporter working on 2.57 RC2. I haven't tested with older versions like 2.56a but I think it should be fine. I'm not expert with Blender exporters and these modifications are for my own purposes. So feel free to use them in future versions or not.
Here are changes I made:
# line 22
bl_info = {
"name": "ASCII Scene Exporter",
"author": "Richard Bartlett",
"version": (0, 0, 5),
"blender": (2, 5, 7),
"api": 35622,
"location": "File > Export > ASCII Scene (.ase)",
"description": "Export ASCII Scene (.ase)",
"warning": "",
"wiki_url": "",
"tracker_url": "",
"category": "Import-Export"}
#line 437 ( line 427 before additions )
#Sets origin to 3d Cursor -- Transformations need this - Not sure how this behaves
bpy.ops.object.origin_set(type='ORIGIN_CURSOR', center='MEDIAN')
#line 495 I commented this out because it was annoying to me...
# This one needed to be changed. Should put warning dialog here though
# if os.path.exists(self.properties.filepath):
# print(self.properties.filepath + ' already exists. Aborting.')
# return {'CANCELLED'}
# line 524 Same as the lambda function but maybe easier to read
# I added .ase suffix to end because inserting it manually was tedious
def menu_func(self, context):
default_path = os.path.splitext(bpy.data.filepath)[0] + ".ase"
self.layout.operator(EXPORT_OT_asel.bl_idname, text="Ascii Scene Export (.ase)").filepath = default_path
#These ones needed the additions or otherwise script wouldn't had worked.
def register():
bpy.utils.register_module(__name__)
bpy.types.INFO_MT_file_export.append(menu_func)
def unregister():
bpy.utils.unregister_module(__name__)
bpy.types.INFO_MT_file_export.remove(menu_func)
Keep up doing great work, your scripts have served well!
-
The scripts are the results of other peoples hard work and diligence, KatsBits just tests and hosts. ;D
WRT your edits, have you just knocked out that over-writing message or are there other changes? I'm not sure why rich_is_bored put that in there originally as you normally you want to do that or version save. Hopefully Blender won't change anything between now and then to break these changes.
Welcome by the way ;)
-
The scripts are the results of other peoples hard work and diligence, KatsBits just tests and hosts. ;D
Ah, yes of course. :)
WRT your edits, have you just knocked out that over-writing message or are there other changes? I'm not sure why rich_is_bored put that in there originally as you normally you want to do that or version save. Hopefully Blender won't change anything between now and then to break these changes.
Changes are cosmetic. Most of the changes were to get it working with latest version of Blender and to get it's "install Add-on" working without using command line magic/"old-school" -way for enabling it.
In 2.57 Add-on manager I couldn't see ASE exporter so I made those updates.
Other changes were putting automatic .ase postfix and getting rid of no-overwriting clause. Those changes were made with minimal effort and are mostly untested. I tried to keep my hands off from making any changes regarding the exported data itself.
Welcome by the way ;)
Thank you. :)
-
Is it working under Blender 2.57 ?
-
Still one or two features to finalise but this works for 2.57 (http://www.katsbits.com/smforum/index.php?topic=257.0) (I'll update the original post here once this script goes final).
-
Hey kat! Long time no see :)
I guess I can wait on final script. Any ETA on that?
-
MCampagnini (the author) says he's just got multiple UV export to sort out then then script should be done and dusted. No real ETA except "when it's done" ;)
-
Hi,
I'm a complete noob as far as blender's concerned and my initial requirement is just to convert various model types to .ase for use with Muvizu.
I've put various export scripts in the scripts/io folder but as for Franktrog nothing appears in the export menu.
It's not in the user prefs stuff either (not sure whether it should have been but just looking for answers ;) .
I've got the latest Blender 2.58a 64 bit for Win7 64bit.
Do I need an update of some sort?
Si
-
They've changed the location of the "script/io" again in 2.58. For Windows users is should be in the same directory Blender is installed to.. i.e. this is where mine is;
D:\Program Files\Blender Foundation\Blender 2.58a\2.58\scripts\addons
You'll notice there's no "io" folder now either, all scripts are dumped into the "addons" folder. If you can't find it, search your system for "addon" that should bring it up. Try those and see if that fixes the problem (I've not yet tested the script with 2.58 yet so don't know if it fully works so keep that in mind).
-
Yes, found my copy of that folder but still no joy.
The python parser seems quite picky when I tried the copy-into-text-window route.
I'm trying the Richard Bartlett 2.53 Beta version.
Running the script gave me a greyed out menu item called export-ase.py so it's nearly registered but probably needs some work.
I'll check back when I return from hols.
Thanks for your reply,
Si
-
Blender 2.59 is out. Has anyone tested ASE exporter with it and can confirm the script is working with 2.59 ? Thanks.
-
Not yet.
[EDIT] no it doesn't. Another internal change breaks the script from 2.56 - 2.58/59; it can be tweaked to appear in the Export list (AddOn) but it's disabled from use.
I don't currently recommend the other one because smoothing is no longer based on marking edges (it's based on angle) so we longer have full control over smooth group assignments - it's too much of a hit-n-miss process to be useful when you're trying to do things properly IMHO.
-
This script is not working with Blender 2.59
-
You can find the latest ASE exporter here_
http://campagnini.net/2011/04/16/blender-to-udk-ase-export/ (#post_) [dead link]
I couldn't install it however. Can someone give me some tips on how to set up the python path system variable, for python 3.2? I know there is a tutorial for 2.2, but I couldn't get it working so far.
Or is it possible that this is not the problem since Blender 2.60 comes with bundeled python?
-
It should be just a simple case of dropping the script into the "addons" folder (custom scripts go back into the "User" folder) or using "Install AddOn" from User Preferences. You shouldn't need to install Python or set up the system variable as Blender appears to use some pre-installed modules now (it doesn't give you the usual "looking for..." message to tell you what version it wants). Just tried the new version as per the above and it works fine in 2.60a. Is it giving you a specific error or some other issue?
-
Blender crashes when I try to install the add-on. I can't restart it either (Blender I mean) so it really must mess up something and I always have to reinstall. I still use Windows XP.
-
Hmm it shouldn't be doing that. Try removing the Python Path variable completely and see what that does. Normally Blender can find what it needs without that being in place but using XP with the latest version of the app may be causing problems.
-
It doesn't help. Thanks for the help and I hope I could help with the posted link as well. For now I will stick with fbx.
I have another question though it seams that Epic changed the fbx import in the september release by removing the explicit normals checkbox and replacing it with an import tangents option. Enabling this however doesn't stop UDK to weld the split edges back together.
I know this is a bit off topic, but have you met similar results with ase imports?
-
Yes, that seems to be a common, albeit infrequent, problem with ASE imports so the fact that it's happening to another format means that UDK is a bit too literal in its looking for MAX-centric formatted files.
If you want to start a new topic on the fbx issue specifically that would be good. Hint hint ;)
-
Hi folks, I've been wanting to do ASE import with this script, but I can't seem to get it to install in Blender 2.61. I've now tried both on my desktop and my netbook, to no avail. To add insult to injury, I do not seem to get any error messages printed and thus I have no idea on how to solve it.
I would be grateful for any help. :)
-
If you're importing you'll need to use the specific version of Blender the script is for (http://download.blender.org/release/) (2.54 if using the script in the first post); the constant changes to Blender mean that these scripts won't work for different versions other than the ones written for unfortunately.
-
Hi kat, and thanks for the quick answer. However, I don't seem to have any more luck with the 2.54beta downloaded from here: http://download.blender.org/release/Blender2.54beta/ (I could not find the stable 2.54 release on the website). I used the "Install Add-On" button, and when doing it twice I get a warning that the file is already installed. It still does not show up in the add-ons list nor in the import/export menus.
-
Hmmm... You'll need to drop back down another version to 2.53 (then download the 'archived' version of the ASE script for 2.53); I though I/O was combined in 2.54 onwards but it appears not. If you have trouble installing the AddOn find the "scripts/io" folder in your main 'User' profile (if you're on Windows that's usually "C:\User\[username]\etc..." Once you do that 'import' should be listed in "File > Import > ASE" - I've not tested it recently though so I can't remember how good it was at importing complex ASE models so you'll likely need to do a bit of experimentation.
-
Hi, I talked to a friendly guy at the Blender IRC channel, who was so kind as to port the script to work with Blender 2.61. Link to the 2.61 version: http://topherdigital.com/io_export_ase.py
However, I only see it appear in the export menu, which isn't very helpful in my case since I want to import an ASE file, not export it. Any clues? Or is this script export-only? In that case, maybe you should update the thread to reflect that.
Edit: Skip that; I did a mistake and downloaded the wrong script. Sorry for blaming you; it's totally my own fault. :)
-
No worries.. we got a 2.61 version out of it! heh ;D
Have you export tested the ported version? If it works OK I'll add that to the list of available options.
-
No I haven't. He offered to port the import script as well, so here it is: http://topherdigital.com/io_import_ase.py
About the import script he said: I don't gurantee everything works lol... but meshes import correctly, as well as vertex colors and UV maps.
So both the export script and the import script should work, but it hasn't really been tested (I can test the importer on my other computer in a while).
-
The import script didn't work, and the awesome guy doing the port fixed it and uploaded it to the same address. I can confirm it works at least for my mesh. :D
-
Hi,
I found an ase2obj python2 script [1], which seems to work fine on some examples [2].
[1] http://zeq2.com/SVN/Source/Tools/ASE2OBJ/
[2] http://opengameart.org/comment/9116#comment-9116
License: unknown. tried emailing repository admin, didn't receive reply.
Hope this helps some of you out. You have to edit the last two lines to match file names.
-
The parent website that script belongs to looks like it's been mothballed, which would explain the lack of response (it doesn't look like it's supposed to be available to the public, so you might have inadvertently gained access through directory listing - which should be turned off normally). Depending on how complete (robust) it is, it might be a better option to use the older versions of Blender to import the ASE where there are stubborn issues, at least that way you can save the file and re-open in a newer version of Blender, fixing issues in the process. Nice find though.
-
Thought this might be of interest: Mike Campagnini has updated the old ASE exporter so that it works with current builds of Blender (I had it working with 2.69). You'll need to manually install it, but, there you go.
https://code.google.com/p/ase-export-vmc/
-
Cheers for posting the info. There is a topic on this ASE exporter here (http://www.katsbits.com/smforum/index.php?topic=257.0), it's just not stickied or referenced in this one because it's an off-site script. If anyone uses it and/or has questions as a result the community is more than happy to assist where it can though, as we've been doing from the start.
-
Oh, didn't realize that, Kat. Thanks for making that clarification. I had been referencing this thread quite a bit without realizing there was another more current conversation going. Awesome! Reading up on it now! :)
-
heh absolutely no worries. The general prep process is pretty much the same although consideration needs to be given to the UDK preference of the script you linked to above (the items listed in this topic are generally geared towards the idTech approach to ASE which is a bit more basic and handles sub-materials and sub-meshes in a different way).