Chicken, an Egg exporter for Blender 2.49 and lower

shure, thats the file in question.

newly created models seems to work fine, even if i assign and delete materials. after deleting it’ll take the one from the UV-editor like he’s supposed to.

i tried clear the parent/child stuff between armature and body and add an armature modifier instead. havent tried if it worked or not, yet…
well with this model i’ll always end up with the wrong texture name exported for the blue hairs. the rest of the model is fine except the armature i fixed and didnt try so far. you should see it as soon as you open it. i tried to pack the textures into blend file (using the pack button in the uv editor) so you should be able to unpack them and save them somewhere.
the blue hairs are supposed to have a texture named “char-001-02hairMesh.004.png”
i end up with
“char-001-02-textureCircle.tga” which is actually the one from the body (except the older tga, the final version uses a png image,too)

well perhaps i just messed up blender a littlebit too much =)

bdw. pview/bam doesnt really matter since egg2bam and pview can be called manually. thought they are handy extras =)

Well, it is sort of a bug you’ve found. The thing is that since the object has a material that has a diffuse texture, it’s overriding the face image even though none of the faces are using that material. I’ll get on it as soon as I can.

It’s only really an issue if you want to mix faces that have materials with textures and faces without material but with a texture set via the UV Face editor. For now the workaround is to only use materials with textures if all faces will use a material.

well thats quite strange^^ because i actually deleted the material from the object so that the UV-image is the only image left…but blender seem to keep more information about the materials…

hm… ok i just found the fix. select the model. press F9 do get to the edit buttons and delete all materials under “link and materials”.
there where a lots of meterials listed for the hair-object…well after i deleted them the export worked fine with correct textures.
if you’r looking for more features you could add then i’d suggest a button to controll the transparency type for each object. since the standart transparency often has issues with sorting and borders you can greatly prevent this with the DUAL transparency. there is just one line added in the texture part in the egg file

<Texture> Material.003_Tex_0 { 
  <Scalar> alpha { dual }

just the scalar alpha dual stuff…
if you have a to-do list or something you might want to add it =). great option if you have to export trees,hairs,bushes etc. spares the manual edit of the egg files.

well big thanks for all your support. looks like i got the important stuff working now =)… it’s just so damn cool to have such a good blenderexporter. only thing left is mutlitexturing for stuff like lightmaps and support for material nodes.i guess there would be some max users cursing their exporters after adding such stuff to the blender export :smiley:
whohoo. just great no more X files, never.
big thx again!

best greetings
thomas e

Well, I’ve already got some support for alpha tested surfaces but it only works with materials that have a texture specified for use as diffuse and alpha or separate textures for diffuse and alpha. So I guess it’s also limited support for multitexturing.
You can check out the test model on my page for a good example of the results. I tested a lot and found that actually the blend_no_occlude alpha mode with a higher than 0 draw order worked well and was more general than dual (dual only looks nice for “cutouts”; semi-transparent surfaces disappear) I also considered placing an option on the exporter to change that setting but decided it’s more trouble than it’s worth because it only means changing a line or two in the .egg file for the user.

I might add more general multitexturing support in the future, but I can’t really fathom how one would export the results of the material nodes system. I think it’s way too general and most of those effects can’t be reproduced without shaders, but if you have any suggestions on a limited subset of its use I’d be happy to hear them.

Regarding the bug you found earlier the fix was simple, and already up on the page. There is one side-effect though, and that is that some textures that aren’t used get exported anyway. I guess it’s not that big a deal, and easily avoidable if it’s not what you want.

hm… if i’d knew how io could bake lightmaps into textures (and not into vertices)… guess someone has to write a yafray->lightmap tool first.
well after that you would have to somehow add the lightmap to the mesh (not the problem) but usualy you have a lots of different meshes (each with one texture).
i guess you need 2 uv-maps per vertex to share the same lightmap between several objects. i dont know if blender supports this at all.
lightmaps seems to be quite some work… multitexturing itself seems to be a piece of cake compared to creating and capturing lightmaps.

You could check this script out I haven’t tested it yet but it claims to be able to bake anything the renderer produces into textures.

As for UVs Blender only supports one set per object. One workaround I could think of is using a naming convention to determine objects that are identical except they have different UVs. That way the exporter could consider the geometry only once but export more than one set of UVs.
For instance when the exporter finds an object named something like [name].uv1, it looks for objects named [name].uv2 and so on, and exports vertices and polys only for the first one but using UVs extracted from all.

Keep in mind though, that you might not need multiple UV sets for lightmapping. At least I’m pretty sure for lightmaps as seen in Quake an similar games you can use the same UVs for the diffuse and lightmap textures.

EDIT: Just wanted to add something. I’ve been investigating a bit and the Blender Python API doesn’t seem to yet give access to the material nodes system, so if you want any support for that it’ll have to wait until it does.

hm.well this baker script is somewhat working, even with yafray. so far my results weren’t too usable and it was damn slow^^… guess i’ll have to read through the documentation befor i continue experimenting with it.
looks like the baker thing is bakes everything(including assigned textures). so you can either hard-texture your whole levels (quite memory intensive) or use a white material on all objects to create a light-map.
with your idea of a workaround it should be possible to create and export lightmaps. (looks like the baker script creates his own uv-set and material)
even if the workflow is a little bit jerky… it would be a great succsess to have lightmap support.

more custom multitexturing like used in terrains usualy shouldn’t have problems like texturebakeing and mutliple uv-sets… so i think lightmap-only support would be sufficent for now (until someone needs it).

i agree with the nodes … they are ways to complicated and if used at all it would be a node->cg-shader exporter. nothing you would use all the time. wheras lightmaps really would be used more often. at least thats my guess.
well school starts tomorrow again but i’ll have a closer look at this baker script as soon as possible and nail down a lightmap workflow and maybe a blend file for you so you if you like to try your idea.

I got the same error as ThomasEgi, despite downloading the newest version of your funktastic script.

Got export name of C:\Program Files\Blender Foundation\plainshound.egg
Traceback (most recent call last):
File “”, line 338, in gui
File “”, line 302, in buildExportables
File “”, line 1173, in doExport
File “”, line 575, in ExportMesh
File “”, line 600, in AddTex
AttributeError: ‘NoneType’ object has no attribute ‘name’

Hmm, sorry but that seems to be your mistake. In the latest version on the site (0.5.2) line 600 is the continue statement that tells it to skip a material if it is None or it’s already been processed. Therefore you must not be running that version because there’s no reference to in line 600.

EDIT:I forgot to mention, sometimes if you’ve visited my site before, an update won’t show until you force it with Ctrl+F5 (in Firefox, I’m not sure of the shortcut in IE)

Anyway, I’ll take this opportunity to mention that I’ll soon be making an alpha release of Chicken 1.0, which is a complete redesign and rewrite. It’s about half the size, runs about twice as fast and is just all-around better.

Sorry I didn’t read console error properly, I got a SIMILAR error to ThomasEgi

Got export name of C:\Program Files\Blender Foundation\plainshound.egg
Traceback (most recent call last):
File “”, line 339, in gui
File “”, line 303, in buildExportables
File “”, line 1176, in doExport
File “”, line 576, in ExportMesh
File “”, line 613, in AddTex
AttributeError: ‘NoneType’ object has no attribute ‘getfilename’

Okay, that does seem like a bug, although a very obscure one. What it means is that you have a material that has a Texture of type image assigned to color but it doesn’t actually have an image associated with it.
I’ll fix it, but for now you can just remove unused textures from your materials.

Thanks that worked! I now have models woo! You are a champ. :slight_smile:

The models export fine but when I try to load them into Panda it gives me an error when loading them.

“StandardError: Could not load Actor model plainshound”

I’ve tried putting the model in the Panda\Models directory, in the same directory as the script i’m running and also tried writing the exact location of the model (C:\blah blah blah\plainshound.egg) and nothing seems to work.

Which version of Chicken is this? Also, would you mind sending me the .egg file and perhaps the .blend file? Any file that shows the problem would be fine.

120% soundes awsome!
i’ll give it a try as soon as i need to export something again.
good wrok improving performance. exporting landsacpes took ages whith the old versoin.
big thx again=)

I just posted a new version 1.0b that fixes most of the bugs I found and adds a couple of features.
I hope to get some more feedback on this one, because for all the views this thread has got I’m amazed that no one complained about any bugs.

psiberpunk i’m using the latest version of Chicken. How should I send you the .egg and .blend files?

You can send the files to my e-mail. It’s daniel-amthauer$gmail-com (replace the hyphens with periods and the dollar sign with @… sorry can’t be too careful with all the spam on this board.)

When you say “they export correctly”, what do you mean exactly? Can you see the model and animation in pview correctly?

Nope I just tried and it said the model was invalid. When I say it exported fine I mean’t I didn’t get any errors while exporting. :stuck_out_tongue:

Okay, then it sounds like a problem that must be solved. I see you haven’t sent me the files yet. Could you please do that? There’s not much I can do about the problem if I have no idea what’s causing it.

I would’ve thought the cause could’ve been erroneous vertex colors or names with spaces, which were both issues in v1.0a that as far as I tested were solved on v1.0b. But if you say you tested it with the latest version I guess that can’t be it.