Page 1 of 1
Blender and exporting ASE for use in Quake 3
Posted: Thu Apr 03, 2014 10:23 pm
by Bacon
I'm having a small problem. Im trying to get an ASE model into radiant, but the textures don't show up. Now I know why they don't, the following 3 lines in the ase need to be changed:
*MATERIAL_NAME "shape.048" Needs to be changed to *MATERIAL_NAME "textures\test\4442806A_c"
*MAP_NAME "4442806A_c.bmp.009" Needs to be changed to *MAP_NAME "textures\test\4442806A_c.jpg.009"
*BITMAP "textures\test\4442806A_c.bmp" Needs to be changed to *BITMAP "textures\test\4442806A_c.jpg"
After doing this it works. BUT here's the problem. The mesh i'm exporting has over 700 materials on it. Find and replace only works until I get to changing the material name, since they are all named "shape.xxx", I can replace it with nothing, but I still have to manually enter in the right path. Obviously it will take forever to manually paste the proper names in so here's my question:
-Possible to edit the ASE exporter script and make it so material names get replaced with the texture names?
-Is it possible to do all of this with regular expression usage in find/replace?
-Is it possible to "combine" all materials into one image for the entire mesh? (1 Mesh)
-Is there any exporters that let you specify the material path names etc?
-Any other soultion
I'm frustrated and out of ideas. Any help would be appreciated.
Re: Blender and exporting ASE for use in Quake 3
Posted: Thu Apr 03, 2014 11:09 pm
by Kat
700 materials?! Unfortunately that won't work, it's one material per (geom) Object for idtech, otherwise when you load the mesh, the one material/texture that is used will be applied to everything. You could combine the images into a single texture sheet but that depends on what you're doing and how big your items are or how complex the materials & textures being used (how much space they use etc.).
Depending on the version of the script you're using the 'shader path' as used in idtech will come from either the *Material ID* or the *Texture ID*, i.e. the *name* you assign to either/or (assigned in the text box directly under the list) - you should be able to write the full shader path as well as that limitation was removed some time ago.
HTH
Re: Blender and exporting ASE for use in Quake 3
Posted: Thu Apr 03, 2014 11:46 pm
by obsidian
Oh hey look everyone, it's Kat!
What I'm wondering is what kind of model has 700 materials? I think all of Q3 doesn't even come close to that many textures. Perhaps you need to do some optimization before even considering exporting.
Re: Blender and exporting ASE for use in Quake 3
Posted: Fri Apr 04, 2014 1:30 am
by Bacon
Well there's 700 but only mabye 20 different textures. A while back I was converting levels from N64 games into quake, and the way i've been doing it is kind of slow. This would have been perfect because it would save hours and hours of re-texturing in radiant. Theres 700+ materials because every single wall is it's own material I guess when you rip the maps. That really sucks about only being able to load 1 material per object, I guess i'll just have to stick to brushwork.
Edit: I tested 2 different materials and it worked so I guess you can have more than one?
[lvlshot]http://img.bacon.ms/shot0150.jpg[/lvlshot]
Thats all one .ase model.
Re: Blender and exporting ASE for use in Quake 3
Posted: Fri Apr 04, 2014 1:47 am
by obsidian
I think what Kat means is:
A single .ase model file can have more than one mesh object inside of it. Each mesh object in Q3 can only have one material attributed to it (no submaterials). So if you want a model to use more than one material, you can, but you need to split the mesh object into different pieces based on the number of different materials.
Re: Blender and exporting ASE for use in Quake 3
Posted: Fri Apr 04, 2014 3:57 am
by dONKEY
Hey Kat!!!
Also, aside from the 700 materials issue,
the texture paths are not quite right.
I'm going to very unhelpful here, because I'm at work, and I haven't done this for ages...but some of the lines require / and some require \...and I can't remember which way around it is off the top of my head. The bitmap line (again, I think it's that one from memory) also needs to give the full texture path;it can be truncated, but again with out checking I can't remember the form used.
All the info is on Kat's site actually.
Re: Blender and exporting ASE for use in Quake 3
Posted: Fri Apr 04, 2014 5:37 am
by Theftbot
Bacon what ver of Blender.
Re: Blender and exporting ASE for use in Quake 3
Posted: Fri Apr 04, 2014 11:55 am
by Bacon
I mainly use 2.68a (r58537) and still have 2.49b somewhere.
dONKEY wrote:Hey Kat!!!
Also, aside from the 700 materials issue,
the texture paths are not quite right.
I'm going to very unhelpful here, because I'm at work, and I haven't done this for ages...but some of the lines require / and some require \...and I can't remember which way around it is off the top of my head. The bitmap line (again, I think it's that one from memory) also needs to give the full texture path;it can be truncated, but again with out checking I can't remember the form used.
All the info is on Kat's site actually.
I got the textures to show up in game.
Re: Blender and exporting ASE for use in Quake 3
Posted: Fri Apr 04, 2014 4:14 pm
by Kat
*waves at the guys*
@ Bacon: unfortunately there isn't a quick way to condense materials the way you're wanting in Blender; selection is material based because textures can be assigned to more than one material. It might be possible to edit your source file, change the material/texture assignments there using find and replace, then import that into Blender (assuming it's an OBJ file or similar). Once done you can then export multiple meshes each of which can have a separate material assignment as obsidian clarified.
Re: Blender and exporting ASE for use in Quake 3
Posted: Fri Apr 04, 2014 4:50 pm
by Theftbot
you can have seperate materials/shaders in ASE- all in same mesh.
Ill take a copy of your ASE exporter script Bacon.
Re: Blender and exporting ASE for use in Quake 3
Posted: Fri Apr 04, 2014 7:21 pm
by Bacon
Theftbot wrote:Ill take a copy of your ASE exporter script Bacon.
I'm using the script available from here:
http://code.google.com/p/ase-export-vmc/
Kat wrote:*waves at the guys*
@ Bacon: unfortunately there isn't a quick way to condense materials the way you're wanting in Blender; selection is material based because textures can be assigned to more than one material. It might be possible to edit your source file, change the material/texture assignments there using find and replace, then import that into Blender (assuming it's an OBJ file or similar). Once done you can then export multiple meshes each of which can have a separate material assignment as obsidian clarified.
That's a shame, but at least I get now why it's like that. Thanks for clarifying. I'm still learning how to use Blender.
I tried editing 2 different scripts but I can't get them to work. Is there any way to get the texture path or filename while handling materials? For example the part that writes the material name is:
file.write("%s*MATERIAL_NAME \"%s\"\n" % ((Tab*idnt), mat_name))
Is there any way to replace mat_name with the texture name?
Re: Blender and exporting ASE for use in Quake 3
Posted: Sun Apr 06, 2014 11:48 pm
by Bacon
Well, a very very very nice friend of mine fixed the script for me, so it even outputs as textures\blabla so its nice and easy to find/replace everything.
[lvlshot]http://img.bacon.ms/loooooooooool.jpg[/lvlshot]
[lvlshot]http://img.bacon.ms/shot0153.jpg[/lvlshot]
So yeah, problem solved
If anyone is interested in the script, let me know.
Edit: Wonder what the limit is for how big ASE can be, heres a chunk of road rash 64's island, one single .ASE
[lvlshot]http://bacon.ms/shot0156.jpg[/lvlshot]
[lvlshot]http://bacon.ms/shot0157.jpg[/lvlshot]
And sunshine in one single .ase
[lvlshot]http://img.bacon.ms/test45345435.jpg[/lvlshot]
the compile time is much faster than with brushwork, spawnflags 2 on the model clips it for you automatically too