Chicken, an Egg exporter for Blender 2.49 and lower

For some strange reason the Chicken 1.0c exporter doesn’t export the animation I created. I think I made the animation correctly, not parenting the mesh to the armature. In Blender the animation plays as it should. When I hit A to select all objects in the scene and select the Chicken exporter, the exporter detects the animation and shows the controls for it. When I press export, the exporter says the model was exported successfully. However, no animation file seems to be created when I look in the directory. Chicken should export the animation to a separate file, right? Also, when I check the pview button, pview opens and displays the model but the text reads “No animation”. I’m on Windows XP, with Blender 2.42a.

Wow, that is really strange, and if the fault is in Chicken I’d very much like to fix it. Would you mind sending me your .blend file? Any .blend file you can make that produces the bug will do. My e-mail is included with the exporter.

in case anyone tried to export models which where lit with blender’s radiosity tools and he got a almost transparent model in panda he can change line 842
from
col = [col.r, col.g, col.b, col.a]
to
col = [col.r, col.g, col.b, 255]

this will export ALL vertex-colors as fully non-transparent. =)

Just bumping so people know I updated the first post with info on a new release

shame on you psiberpunk.
cant you tell me earlyer??
yesturday i took the 1.0c and modified it working on it more than 16 hours to let it export huge (static) mmorpg worlds into sets of well sized , easy to stream egg’s… and nowl… not even 24 hours later you release a new version …
for everyone intrested:

THE FILE BELOW IS NOT THE OFFICIAL CHICKEN!!! (see the first post if you’r looking for it)
IT’S NOT TESTED ON WINDOWS!!
BAM EXPORT,PVIEW-PREVIEW AND CHARACTRES WONT WORK WITH THIS!!
http://home.arcor.de/positiveelectron/files/project-files/chicken_export1.0c-mmorpg.py

this version takes divides the whole world into virtual blocks with the size 16x16x16blenderunits (size can be changed in the script).
it works an all static geometry (i dont know what happenes if you have modelsl with an armature in it, might result in a non-static .egg file)
if you export a blenderobject it will automatically export all other objects which are in the same worldblock. the exporter will create a new egg file for each block and name them with their position like
x_y_z.egg if the values are negative you will have a name like -12_4_-5.egg
those files are suppoesd to be loaded into panda and than !flattened! see the .flattenStrong() on this. afterwards they can be saved again to hdd as a bam file for speed optimisatoin.

now why should one do this?.. simply because it’s a pain to model and export huge mmorpg worlds manually =) and since the resulting egg files can be loaded and unloaded quite easy at runtime it allows you to page your world, allowing huge,panda optimized worlds without popping (if you load them outside the vewing range) or loading screens.

psiberpunk: perhaps you can add this somehow. since i’m not fammiliar with the OO-concept of languages i more or less forced my code in there. so adding a extra button and a small input field for would be quite nice. perhaps force your geometry check to static mode if enabled =)

Well, the idea of the 1.0 release is to have feature freeze and just fix any remaining bugs (I’m pretty sure there are none left, but I still prefer to leave the possibility open). So I don’t think I’ll put this in there.
However, you can easily merge the 1.0 changes into your own version (I can help you out with this if you like). But, more importantly, reading your code just gave me a great idea for a feature I can include in the next version: that is to improve the Background export mode so it can also be called by other scripts inside Blender. This would allow your code to be split up as a separate script that calls up Chicken for every chunk it wants to export. This would give you the freedom to do whatever you want to the geometry before export without having to hack your code into Chicken’s inner workings.

If you’re interested in that approach I’ll give the highest priority to that feature as I haven’t had any other feature requests; it shouldn’t take me long.

EDIT:
Good news for you, if you check out the SVN trunk there’s already a module in there that allows you to invoke Chicken from any Blender script.
To install it you need to place chicken_interface.py in your scripts/bpymodules directory, and also modify the EXPORTER_NAME variable to the name of the chicken version you want to invoke.

To use it all you need is code like the following:

from chicken_interface import Invoke

Invoke('/home/user/eggfiles/file.egg', [['anim1', 30, 1, 60], ['anim2', 20, 60, 90]])

Filename and animation list are both optional. It will export all selected objects. You’ll probably only need to use the filename argument for what you’re doing, and since I’ll probably change the Background mode implementation, the arguments to this function might change, but I’ll leave the filename as the first so you don’t have to change any code you might write that uses this.

well i would need to force it to static mode only and i need to set vertex-colors (the alpha value to 255). so i need to change the exporter anyway. since it’s only a custom solution for my project i dont need more than a working code (and so i’ll stick with the modified 1.0c)
but thanks for the offer :slight_smile:

Well, as I said in my edit this is already implemented in the SVN trunk, and I insist that it will be much cleaner this way. If all you need is the vertex color alpha capped at 255 changing a line on that is not going to set you back much. And I don’t see why you need to force static mode when that is determined by whether or not your selection has armature modifiers.

I also simplified the installation procedure a whole lot. I made a script called build-release, that makes a .zip file out of an SVN checkout. You just call ‘python build-release.py [version]’ and it’ll make a chicken_export[version].zip for you (e.g. version = SVN ==> chicken_exportSVN.zip), then you just unzip this in your scripts directory like you would any other Chicken release and it doesn’t disturb other versions you have (except maybe the PandaPath in Windows).

If you don’t want to use it, no problem. But I’m pretty sure it would be really simple to make your code work correctly with it. And you’ll gain the benefit of abstraction and easy integration with future Chicken versions.

abstraction … easy integration… … well if i could programm a little bit better… than maybe^^ and since it already works correctly =) no way to make it working easyer :stuck_out_tongue:. well if others wanna use it i might switch over to the newer version but for now it’s ok =)

well well another nice thing is coming our way :slight_smile:
blender.org/cms/Multiple_UV_ … 837.0.html
multiple uv-set’s per material in the upcoming blender version.
since egg&panda supports them to it would be quite nice to make them export-able,too.
aside from smaller things this would allow nice,lightmapped levels when used with blenders new render to texture function :slight_smile:
would be a big step towards high-quality grafics.
so psiberpunk, please have a look at it =)
note:python api should be up-to-date already.

Thanks for the heads-up, I’ll definitely look into that.

Also I’ll take this opportunity to mention the new features that are already in SVN.
-Added support for saving and loading export settings inside a .blend file.
-Modified Background export mode accordingly, so now it’s simpler to use.
-Updated chicken_interface module so it completely supports the new implementation.
Note: all these features require the pprint Python module which is not included in the bundled Python in Windows, but you can use them if you have a separate Python 2.4 install (no such problems in Linux). If you don’t have the module installed you won’t see a save button in the GUI and importing the chicken_interface module will raise an ImportError and print a message.

Also I’m currently working on:
-Adding support for exporting Shape Keys (a.k.a. Morph Targets) and animations that use them.
-Improving scene analysis and reporting of possible issues before export so users won’t have to refer to the manual to figure out what went wrong with their model.

I added support for multiple UV channels in the latest SVN revision. It’s disabled by default because the latest Blender release candidates wrongly report their version as 242 so I can’t discriminate automatically. To enable it, edit the script so it sets the MULTI_UV_SUPPORT variable to True instead of False (line 67).
Also there are some slight details: The Python API doesn’t have access to the field that indicates which UV channel a texture is mapped to, so Chicken exports all textures as using the default UV channel. Chicken considers the default to be the one named ‘UVTex’ (because that’s the Blender default). This channel gets exported without a name, because that’s the default for egg files.
If you want a texture to use a specific uv set, you’ll have to add this to the definition by hand:

<Scalar> uv-name { <my-uv-name> }

without the angle brackets around the name obviously

I’ve put this version as a packaged zip file in the sourceforge download section if you wish to try it out [link].

Greetings all!

I’ve started using Chicken for all my blender export needs. It’s very cool!

I’ve run into one difficulty with it, as far as I can tell. I’m running blender on Mac OSX, and I don’t see how to export textures on my model. My Chicken interface doesn’t look like the one shown in the help file:

Does anyone have any insight as to what might be wrong?

-Mark

As far as I know Chicken supports UV textures.
Just apply UV textures to it and export. The textures are automatically included.

Ah, I see it now. Thank you!

I had been using image textures via the “Links and Materials” system, not the UV textures. A quick modification solved that problem.

I am still confused, however, as to why my interface doesn’t look like the one in the documentation. Any ideas?

-Mark

the interface it ok. it automatically adapts to what you want to export. seems like you exported a static models. if you export one with armature and animations the interface will automatically change and provide fields for animation-specific exporting.

A couple of questions about the chicken exporter.

#1 Does it support contraints on the armatures it exports with the mesh from blender.

#2 What exactly is an ObjectType? I read the part about how to export ObjectType in the chicken manual using the properties box in the real time engine screen in blender. ObjectTypes are mentioned in the panda manual but the manual never actually says what they are.

#1 Yes it does, but obviously the constraints only work if the constraint target is a bone in the armature. If the target is an external object, the effect is not exported even if the object is also selected for export.

#2 An ObjectType is a shortcut or alias for an arbitrary block of .egg syntax. These aliases are defined in your Confauto.prc and Config.prc files. For example, one of the aliases is “sphere” which takes the geometry and replaces it with a collision volume defined by its bounding sphere. You can also define your own aliases and use them with Chicken.

Great program!
But uehrm… would it be hard to create a function to export modifiers?
I have a wave modifier, and i want to export it, and pview says i don’t have an animation.

wave modifiers modifies the verticex position. so you would have to use pandas morph animations things. i dont think the current chicken version supports this animation already.
… i think… if you know what to do… it’s not that hard :stuck_out_tongue:
it is possible, that’s for sure=)