Chicken, an Egg exporter for Blender 2.49 and lower

You’re welcome :slight_smile:

Would it be possible for you to try this same blend file on Windows to see if the problem is platform specific? If you can’t I wouldn’t mind trying it out (you can send it to my e-mail, it’s on the exporter’s page).

nah… i dont think its a platformspecific problem (i cant test it on windows since i dont have a win install nearby)… i think i messed something up. since it works with the rest.(and i tried a lot of stuff with this one so dont worry) it’s just a wrong texture-name after all.

Okay, that’s good to hear then. How about the export to BAM options, and pview launching? Is that working well on Linux as well? That’s probably the most platform-specific part.

havent tested them so fat… i’ll have a look at it tomorrow or so. stay tuned =)
i’ll edit this post and submit the results

ups^^ i mistook your exporter with the one from chris holland.
exporting a simple textured box worked fine. my models however did not. the console output:

Got export name of /HD2/Modellstuff/Modells/char-001-05.egg
Traceback (most recent call last):
  File "<string>", line 338, in gui
  File "<string>", line 302, in buildExportables
  File "<string>", line 1173, in doExport
  File "<string>", line 575, in ExportMesh
  File "<string>", line 600, in AddTex
AttributeError: 'NoneType' object has no attribute 'name'

exporting to bam file didnt work either. opening in pview option worked and pview opend but the model wasnt loaded

:egg(error): Unable to open “/HD2/Modellstuff/Modells/box.egg”

well the name and path above is ok. might be something else.
well animation dosent seem to work. when parenting a armature to a mesh it’s seems to be no longer exportable(also isnt shown in the exporter overview anymore).
to execute tha egg2bam converter under linux you can use
os.system("egg2bam “+inputfile+” "+outputfile)
same with pview
os.system("pview "+filename)

well unanimated and textured models usualy are exported fine to egg.
basicaly works =)

Hmm, the fact that it crashed on line 600 suggests that your object has material indices with no materials assigned to them, is that correct?

Also thanks for the input on the export to BAM and pview options, I think it might be the quotes on the paths of the parameters. I know about the os.system way of doing it, but that doesn’t allow me to check for the return code. That would mean you’d have to check the console yourself to see if it executed correctly or not.

As for the animation, I know it doesn’t export when you parent to armature. I did that on purpose because that is an obsolete way to animate things. If you don’t parent the object to the armature, and use the armature modifier instead it should work with no problems.

if thats whats happening when you assign a material and delete it again… then it is possible :smiley:

bdw. are animations supposed to be exported?

Yes, that’s exactly what happens :slight_smile: I forgot to consider that case. I’ll fix that up.
About the animations, I already answered that in my previous post. You must use the armature modifier, not parenting to armature. Supporting both ways would’ve been a mess so I decided to only use the current official way which is the modifier.

oh …thx for telling me twice :slight_smile: armature modifier worked… but it seems the rotation of the bones is a little bit wrong. instead of bending my object its twisting it :unamused: looks somewhat strange.

Check that object-level transforms are cleared on both the object and the armature (Alt-G, Alt-R, Alt-S to clear translation, rotation and scaling respectively). Sometimes they can be weird like that. As far as I’ve tested, eggX has the same problem, and it’s sometimes much worse.

oh… ok… the standart cube in blender is rotated by 90° … everything clear =) thx again

No problem, but please check out the script’s help as well, since it addresses most of these questions.

I’ll upload a fix for the material issue you found earlier as soon as my host lets me upload files again (they’re having some ftp problems it seems).

EDIT: Okay, I uploaded an updated version which fixes the material indices without materials issues, and hopefully fixes egg2bam and pview invocation under Linux. I couldn’t try it in Linux cause I only have a live CD and no space to install it, but I did try Python’s invocation functions and their quirks so it should work.

hm… well i just tried the new version…
material is still strange. it still seems to use the texture name of the deleted material’s texture instead the one from the UV-editor.
bam export doesnt work (still same error)
pview opens but still no model loaded. (the “egg unable to open…” error disappeared :unamused:)
no real changes… well…at least you got one errormessage less :slight_smile:
i guess bam and pview aren’t so important. but it would be nice if the material stuff can be fixed since blender is using the uv-editor’s image as preview. atm it’s like… assign a texture and you’r doomed :wink:. you dont need to hurry because of me. use the nights to get sleep, dont fall for the bits, they b(i/y)te :open_mouth:

Could you send me a blend file that produces the error? Perhaps I misunderstood the problem. I fixed something, but perhaps it wasn’t what you wanted.
I guess I’ll have to wait until I have a working Linux install to really fix the egg2bam/pview issue, but this other one doesn’t seem to have anything to do with Linux.

shure, thats the file in question.
http://home.arcor.de/positiveelectron/files/char-001-06.blend.zip

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 { 
  char-001-02hairMesh.004.png 
  <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 http://www.alienhelpdesk.com/index.php?id=22. 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.