KatsBits Community

Game Editing => Scripts & Support => Topic started by: MCampagnini on April 15, 2011, 05:58:06 PM

Title: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: MCampagnini on April 15, 2011, 05:58:06 PM
Please note: the ASE export script linked to below is provided by an offsite third party. Issues with the script itself (it not running in 'x' version of Blender for example) will require contacting the author directly.



ASE Export for Blender 2.6+
MCampagnini's ASE export script - supports ASE output with single or multiple materials and objects.
http://code.google.com/p/ase-export-vmc/

Download latest version (currently 2.5) for Blender 2.63
http://code.google.com/p/ase-export-vmc/downloads/detail?name=ASE250.zip

MC
Title: Re: Blender 2.57 ASE Export WITH Multi-Material
Post by: kat on April 15, 2011, 06:55:11 PM
Yes, that's correct. The current version of the script isn't saving out a properly formatted ASE file where "Material > Sub-Material" relationships are concerned for UDK/UT; it's basically exporting everything out as a 'parent' Material regardless as to wither that's on an object with single or multiple mesh elements.

So to correct the script, the way it *used* to be done was that the material/sub-material relationship was determined by the object relationships and material assignments - for UDK/UT you'd join individual meshes together into a single unit and export that out; the material assignments applied to that then determine the sub-material relationships.

In rich_'s defense, that script was written originally for idtech and his update was similarly tasked which is why it outputs correctly for Material/Sub-Goemobjects but not the other way around. Bear in mind also that it currently doesn't save mesh-smoothing/smooth-group info (properly formatted mesh/vertex splits).

[EDIT] forgot to add, that I'll see about hosting any 'fixed' versions on KatsBits.. I've never been keen on using those 'free' (*cough*) hosting sites

Neither of these will work properly in UDK because it can't read sub-objects or independent materials, both end up with one material applied to everything.

(https://www.katsbits.com/images/misc/blender-ase-test-materials-sub-mesh.jpg) (https://www.katsbits.com/images/misc/blender-ase-test-materials-sub-mesh.jpg)

(https://www.katsbits.com/images/misc/blender-ase-test-sub-materials-mesh.jpg) (https://www.katsbits.com/images/misc/blender-ase-test-sub-materials-mesh.jpg)
Title: Re: Blender 2.57 ASE Export WITH Multi-Material
Post by: MCampagnini on April 18, 2011, 11:21:29 PM
Bumping since I edited original post and added a download link.
Title: Re: Blender 2.57 ASE Export WITH Multi-Material
Post by: kat on April 19, 2011, 12:27:37 AM
Shaping up nicely. Will test this when I get a chance.

A couple of comments. Max saves data pertaining to smooth groups at the "face" (polygon) level instead of the vertex where Blender (and other 3D apps) store it iirc. It tends to cause problems because UDK is effectively looking for Max formatting (face data) typically ignoring/merging vertex splits - it's been a real PITA over the years this one.

If you export based on what you're doing right now, 'complex' models will export every material even if they reference the same texture image (which is what you showed in the vid funny enough). Ideally you want it the other way around so you guarantee only material/texture data used gets exported. That or preface everything with "collapse and remove" unwanted and/or duplicate materials (which people will always forget to do).
Title: Re: Blender 2.57 ASE Export WITH Multi-Material
Post by: MCampagnini on April 19, 2011, 05:25:19 AM
Thanks for the comments - it was an adventure.  I updated the script with your recommendations. 

With the current version a material will not be exported if

Getting there...

MC
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: MCampagnini on April 21, 2011, 05:05:57 AM
ASE Exporter vMC 1.04
http://campagnini.net/2011/04/16/ase-export-for-blender-2-57/ (http://campagnini.net/2011/04/16/ase-export-for-blender-2-57/)


The info and video on the site will be updated tomorrow(4/21)...too late to do it now.
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: kat on April 21, 2011, 05:17:13 PM
Just testing export and then checking the ASE is a text editor so I've not yet opened either 'type' of output into the model viewer or UDK yet. So, multimaterial export seems to work properly relative to UDK type structure, there's a single mesh with single multmaterial (containing several sub-materials) as expected.

I'm finding that exporting the same model out composed of several sub-objects creates the expected separate "geom_objects" but not the associated individual material assignments; it looks like Blender is reading the first material it finds and assigning that as the primary and only material exported (a single material is being applied over everything).

For reference, this is how the ASE files are set up, as per the ASE export tutorial (http://www.katsbits.com/tutorials/blender/blender-2.5-export-ase-models_adv.php#hierarchy), the version on the left causes the above problem, the one on the right exports fine (which is what you'd do for multimaterialed objects [UDK]).

This is using the latest version you got uploaded as of me posting this.

PS. I'll update this once I've looked at the meshes in the model viewer.
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: MCampagnini on May 04, 2011, 04:20:40 PM
update -

export script handles multiple uv maps and calculates out smoothing groups based on an angle set by the user during export.  future plans will add an ability to manually set smooth groups instead of automatically generating them.  The more faces you have in your mesh, the longer it will take to calculate smoothing groups.

official forum:  http://forums.epicgames.com/showthread.php?t=776986 (http://forums.epicgames.com/showthread.php?t=776986)

download: http://campagnini.net/2011/04/16/ase-export-for-blender-2-57/ (http://campagnini.net/2011/04/16/ase-export-for-blender-2-57/)
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: kat on May 04, 2011, 07:13:46 PM
Thanks for the update, was wondering how things were progressing. Two points to consider;

1) not entirely sure why you've set the script up so it's calculating smoothing instead of just reading vertex split data in the file and 'format parsing' that (that's the only significant difference between Blender ASE and Max ASE where smoothing is concerned), much less costly and much quicker to do.

2) related to the above, I'm not sure why you've chosen to focus on angle based smoothing (to be set as default later?), it's practically useless for game content because it's arbitrary in implementation; the only reason people use it is because it's easier to do and more broadly, because they don't understand what smoothing is or how to properly set it up on a mesh. Both reasons result in incorrectly mesh smoothed models and encourage lazy/bad technique.

So, I'd suggest/recommend ditching the use of angle based smoothing and/or switching focus so it's an option rather than a default. I'd also find a way to parse scene data rather than have the script pull in a file and then do all the calculations (which it appears the script is doing right now?) - as an aside here, you may not know this but Goofos' very first ASE scripts for Blender did exactly what you're doing now with disastrous results, some files took tens of minutes, and very large files (terrains), hours, to output instead of seconds, it wasn't until he switched to simply parsing scene data that vast improvements were made. All you need to do is make sure the users applies any modifiers or force that on export.

Sometimes in trying to make thing easy one ends up making things more difficult  ;)

Other than the above, excellent work! ;D

[EDIT]I just read your smoothing tutorial and realised you're trying to replicate the limited mechanism that Max uses for it's smoothing systems, that's not going to work with Blender because there are two general problems with this approach.

1) as you noted in the tute, Max is limited to 32 groups so you have to be 'creative' with your application on more complex models (terrain again being a classic example) otherwise in trying to replicate Max output exactly, you're going to 'mush' (compress) groups together... that again means an arbitrary distribution based on what the script thinks is best, not the artist (the script doesn't know what the object is). If ASE is hard limited to using actual groups rather then just maintaining vertex splits (see below), then it's probably a better approach to output a warning to the user saying an object has more than the recommended groups and should be optimised better or some such... you've always got to keep control in the hands of the artist.

2) a smooth group in a game engine is ultimately nothing more than an area defined by a vertex split, so all you need to do is find a way to maintain that at output (easier sad than done I know); using Max as a reference is going to be problematic because it formats the same vertex split data as (face) 'groups', if those don't exist UDK et-al merges the very same vert splits that would otherwise be 'valid' groups were it not for their (incorrect) formatting.
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: MCampagnini on May 06, 2011, 09:56:58 AM
Great info, thanks for the feedback.  I have been working on a second way to define smooth groups, it is just not implemented live yet.  I am aware of performance issues when dealing with complex meshes, an 11k model took about 3 minutes to push out with angle based sg's. 

I'm working on a toolbar panel inside of blender to allow you to create user defined smoothing groups a little cleaner than going through your mesh and applying the sharp seams.  For simple meshes, it is still faster to let the script calculate out the smoothing groups automatically (assuming, as you have stated, there is not a section that breaks the angle limit and requires an "artist controlled" smoothing group).

I'll go through your list when im back home in the us. I believe having a panel to control how the export will function will provide a solution to most of the current limitations you have mentioned.  Thanks again,

MC
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: motorsep on October 14, 2011, 08:45:16 PM
The exporter is almost awesome. The reason for "almost" is that it doesn't export vertex color, which is needed for terrain textures blending in iD Tech 4+.
Is there any way that feature could be added in the next build?
Thank you.
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: motorsep on October 22, 2011, 04:39:58 AM
Hmm.. I though it's been actively developed :/
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: kat on October 22, 2011, 04:50:29 AM
It is, just not here. There's a greater call for ASE over on the UT/UDK forums (see the link a bit further up the page), I don't know if the author drops by here any more as the folks over there keep him pretty busy with requests and trouble-shooting.
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: MCampagnini on December 15, 2011, 01:20:21 PM
Kat is correct. I try to drop by here every now and then, but it has been a while since my last visit.  I have already talked to motorsep on the UDK forums, but for for those viewing this post, the script has been updated since its' original release with the following features:
If anyone needs to get in touch with me for support, contact me through my site (www.campagnini.net (https://www.katsbits.com/smforum/index.php?topic=257.msg2010#msg2010) [dead link]) or the udk ase export thread - http://forums.epicgames.com/threads/776986-Blender-2.57-ASE-export (http://forums.epicgames.com/threads/776986-Blender-2.57-ASE-export).  Thanks!
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: salamanderrake on May 21, 2012, 07:39:39 PM
MCampagnini's new location for his ase exporter:
    http://code.google.com/p/ase-export-vmc/

Link to the  download for the updated version ( currently 2.0 ) that works with blender 2.63:
      http://code.google.com/p/ase-export-vmc/downloads/detail?name=ASE_Export_v2.zip
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: motorsep on May 21, 2012, 08:12:01 PM
Yay! Thanks a bunch, MCampagnini and salamanderrake !
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: salamanderrake on May 21, 2012, 08:32:57 PM
Yay me? You know I had nothing to do with the script, I just posted when he got it fixed for blender 2.63.
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: motorsep on May 21, 2012, 08:43:41 PM
I know you have nothing to do with the script, but you posted update here and I got a notification :)

I was waiting for this update since 2.63 was released.
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: kat on May 21, 2012, 08:49:12 PM
Ah.. with his site suspended this means that older versions are no longer available for anyone using those right? I'll update the first post appropriately.
Title: Re: [ASE] Blender 2.57 ASE Export WITH Multi-Material
Post by: salamanderrake on May 21, 2012, 09:07:20 PM
He mentions a little of why he moved it to a code repository, which makes more sense, in this epicgames forum post:
http://forums.epicgames.com/threads/776986-Blender-2-57-ASE-export?p=30291842&viewfull=1#post30291842

As far as the older versions they are also hosted on his code repository for those who want to stick with an older version of blender.