NEW ASE Export Script (only for UDK)

Hi guys i’ve made an ase export script for udk and i want to share with you

this is it :
old version: Ase Exporter_complete.zip (2.9 KB) (not Bmesh)
version1.2 for bmesh: Ase Exporter_Bmesh.zip (3.21 KB)

version 1.2 changes:

  • New smoothing group method: this is more faster, just select a face in edit mode, and in the tool panel (T), select the shade type you want (Smooth or flat). This time what you see is what you got, if a mesh is flat shaded in Blender is also flat shaded in UDK. The option is available in the export window under the scale option.

  • bug fixes

Features

  • Autotris and autoquad(when export finish)
  • Vertex color
  • multiple uv channel
  • smoothing group
  • UCX OBject(collision)

How to USE

export the mesh like usual.
Smoothing group are faces with all edge marked sharp(CTRL+E). For have a preview of the results is my advice to use smooth shading on the mesh and then use split modifier with “sharp edge” only option selected.

collision object are detected by using the prefix “UCX_, USX_, UBX_” on mesh name. example: UCX_Cube

save the lightmap uv set as second uv(UDK standard lightmap channel)

Mesh must have one material and one UV set …will be fixed

note: scale is set to 50 as default, but you can change it on the export menu, so you can edit mesh as usually do, default grid and scale and unit, cause 1u in blender is exactly 1u in UDK and 1u in UDK is 0,02 cm, so for use the standard measure unit of blender (1m is 1m) so when export in udk 50u is equal to 1m

Hi. I tried your script with Blender 2.63 (with a cube) but got an error when importing into UDK. It said “ASE Importer Error: Did you forget to include geometry AND materials in the export?” In the ASE file, it does look like it’s missing some geometry and materials.

did you have unwrapped the mesh? UDK need a uv map in the ase file, however it import the mesh, you can try to make a uv directly in udk, for me don’t work this method, but you can try it.

Yes, I did have a UV map. I figured out the problem. I’m using the script for Blender 2.63.

When your script generated the ASE file, there are errors in the file. Specifically, under MESH_TFACELIST, some index numbers are duplicated. Here’s a copy/paste so you see what I mean. Faces 3 and 9 have duplicated indices.

*MESH_TFACELIST {
     *MESH_TFACE 0 0 1 2
     *MESH_TFACE 1 3 4 5
     *MESH_TFACE 2 6 7 8
     *MESH_TFACE 3 0 9 10 10
     *MESH_TFACE 4 5 1 11
     *MESH_TFACE 5 1 0 6
     *MESH_TFACE 6 12 0 2
     *MESH_TFACE 7 13 3 5
     *MESH_TFACE 8 11 6 8
     *MESH_TFACE 9 6 0 10 10
     *MESH_TFACE 10 13 5 11
     *MESH_TFACE 11 11 1 6
}

Once I removed those duplicates, I was able to load the file in UDK without it complaining and the mesh looked fine with the smoothing groups (no weird shadows) in the viewport.

Out of 16 file exports, the problem happened except on the 3rd, 12th, and 15th export. This pattern was repeatable for me. In some of the files, indices were repeated three times as opposed to two times. I’ve attached both my blend file and the first exported ASE file if you want to look.

Also, the exported ASE file has mismatched curly braces for MATERIAL_LIST and GEOMOBJECT. Oddly enough, UDK did not complain about that and still loaded the file.

Attachments

cubeTest.zip (76.8 KB)

Does this script support multiple meshes or does it have to be one multi-surface/multi-material mesh?

Also, how is this script compare to http://code.google.com/p/ase-export-vmc/ ? (@rebellion maybe you can make that one to work with Blender 2.63 too? :slight_smile: )

Ook, I gave it a spin. Your exporter might be messing up UV map:

Even if I triangulate the mesh manually, rotate the edges for even wire distribution and UV map it after that, I still get some issues with UV map, but on the different polygons than what you see on the image.

So either you have issues with the exporter or Blender’s BMesh has issues with UV maps.

try to resize a little the map, some engine like UDK move the vertex at the border of the uv space, for the campagnini script, i don’t know how it work… and it have problem with smoothing groups, so i made my own algorithm to find it

strange, i’ve tested the script but i’ll look at the code… however in this day i’ve tried to implement the possibility to use custom normals. but i’ve discovered that UDK DON’t read the normal from ase file it don’t read a lot of things, in fact my ase script don’t write thing like “MATERIAL_LIST and GEOMOBJECT” and other things… for the uv, you see this things because i’ve packed the uv list and removed vertices with the same coords… maybe there is an error in this part of the script.

I know you probably take pride in the script you wrote, but no matter what I do, UV’s look messed up. Wouldn’t it be easier to port working script from 2.62 to 2.63 instead of reinventing the wheel?

@ appa

i found the problem i think, i don’t really understand it, but i fix it, i hope.

this is the update: Ase Exporter_Bmesh v1,2,1.zip (3.2 KB)

however, duo to the recent discover i made on UDK ASE importer, i’ve passed on fbx exporter, it have more compatibly with engine.

this is the document where i take the info of the ase file format

http://wiki.beyondunreal.com/Legacy:ASE_File_Format

as you can see are minimal the info that UDK read from the file…

@motorsep

the problem is that the way the code of campagnini is wrote, is far from what i can do now with python, and duo to the api change some part of the code need to be rebuild.
my script is very easy and some algorithm can be done better to work faster, and probably they have bug. try to ask for someone else, for the moment i can try to fix you’r problem… but i need more info: give me the blend file you use for the image you’ve posted.

Updated: http://code.google.com/p/ase-export-vmc/