Chicken, an Egg exporter for Blender 2.49 and lower

Sorry I might not be able to send you the .blend and .egg files for a while since my internets going crazy. I’ll try downloading the script again since I might have the wrong version again. Sorry for causing you so much trouble. :stuck_out_tongue:

Just posting to say I posted version 1.0c. Check out the first post and the homepage for more details.

Also, I’d like to know whether your problem persisted BoZ. Please PM me or post here.

I downloaded the latest version and its working fine now. I’d say it was the vertex groups that have spaces in their names like you said before. I’ve got all my models and animations working so thanks a bunch for making this great exporter.

I’m glad your problem was solved and that you’ve found my exporter useful. If you have any other problem, or some feature you’d like, do post it here or send me a message.

I use blender all time. In fact I found out about panda3d while browsing the old www.elysiun.org forums.

I am reading thru the documentation for this export script and have some real question. I will post them all when I get them all together in one post. For now its just nice to see someone that is working in both blender and panda3d

Is having the pview button depressed when you export supposed to start pview with the model that you export? I so it does not work for me. Maybe the problem is that I am exporting the egg file to another directory other then /model. After copying the exported .egg file to the /model directory under the panda3d-1.3.1 directory and running C:/Panda3d-1.3.1>pview test.egg pview worked.

Also should my ppython path be C:\Panda3d-1.3.1\bin or C:\Panda3d-1.3.1\python

Sorry for the delay. Okay, to answer your question: Yes, if you have the pview button depressed it is supposed to invoke pview regardless of the directory you’re exporting your model to.

Considering your final question I’m guessing this might be an incompatibility with the 1.3.x releases. Ppython.exe used to be in the \bin subdirectory together with the other executables and therefore the bin directory was what was set in the PATH environment variable. If the 1.3.x releases are also adding this \python subdirectory that might have broken the logic I used to make the initial guess for the right directory to use.

So in conclusion, you should tell Chicken the location of your \bin subdirectory, not the \python subdirectory.

EDIT: It’s confirmed, on a fresh install of Panda 1.3.2 and deleting Chicken’s configuration file, it detected the \python subdirectory instead of the \bin. This’ll be fixed in the next release, which will be out some time this month.

running it on my linux box (fedora 5) gives me a error.
console output:

Compiled with Python version 2.4.
Checking for installed Python... got it!
Traceback (most recent call last):
  File "/HD2/Modellstuff/blender-2.42a-linux-glibc232-py24-i386/./.blender/scripts/chicken_export1.0c.py", line 978, in ?
    exporter = Gui()
  File "/HD2/Modellstuff/blender-2.42a-linux-glibc232-py24-i386/./.blender/scripts/chicken_export1.0c.py", line 292, in __init__
    self.init()
  File "/HD2/Modellstuff/blender-2.42a-linux-glibc232-py24-i386/./.blender/scripts/chicken_export1.0c.py", line 70, in init
    pathdirs = path.split(os.pathsep)

blender stops running the script at the line with pathdirs = path.split(os.pathsep)

Yes, that bug has also been reported and I’ll also address it in the next release. For now you can go ahead and comment that part out because under Linux you don’t need to set the path to the panda binaries.

okido =) thx for telling.
btw… grats on your exporter… it’s on a good way to become the best egg exporter available for panda3d (not only amongst blender exporters)

Thanks for the compliments on the exporter. I really appreciate it :smiley:

I also take this opportunity to mention that I’m currently moving the exporter’s site to SourceForge. Here’s the link: http://chicken-export.sf.net/. Currently only version 1.0c has been uploaded.

Really enjoying the chicken exporter!

I’m having one problem right this second, which actually may be more of a blender issue than a chicken issue. I have a non-animated (not an actor) model shaped roughly like a human body, with arms and legs.

The trouble I’m having is that I’m explicitly trying to rotate the shoulder joint by modifying the hpr. However, it appears that the default model has already rotated the shoulder; loading the model and checking the values, I see the hpr is (-90,0,90).

Is there any way to bake the rotations on the should joint into the geometry itself so that the hpr defaults to (0,0,0)?

Thanks,
Mark

Well, this is more of a Blender question actually, but here’s the answer. The easiest way I know of doing what you want is looking at the exact rotation the object has (you can do this with the n key) and jotting it down somewhere, then resetting the object rotation with Alt-R, and finally going into edit mode (Tab), selecting all vertices (A) and then rotating them just like the object was rotated.

Writing a Python script to do this would be trivial, so there must be one that does this floating around somewhere.

and if you dont want to re-move (not remove) the vertices you can simply select the 2 objects in blender, join them together, select the shoulder in editmode and press P to seperate them again. afterwards the 2 origins and rotations matches perfectly

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.