Chicken, an Egg exporter for Blender 2.49 and lower

Hmm, the behavior of a NURBS curve near its endpoints is determined by its knot vector. Are you sure the knot vector is getting exported properly from Blender, and getting read properly by whatever Python code is applying the motion?

David

Well, its a long time since I did anything with NURBS, though there was a time many years ago when I understood them. But chicken writes out the order, knots and control vertices of the curve into the egg file - it gets these values from Blender and its then up to Panda what happens with them next. It really doesn’t look like a process where there can be any errors - its just basic data manipulation. The only abnormality I note is that vertices can have weights as well, but I see no indication of that in Chicken. Saying that Anons sample has all the weights set to 1, so I can’t see that mattering in this case.

Looking at the knot vector output for the specific example its just 0 to 7 in sequence. Now, if I remember correctly, for the nurbs curve to do what Panda is doing, and have the nurbs curve begin and end at the control vertices, you have to repeat values at the start and end of the knot vector - given that the knot vector in the file lacks repetition but the behaviour of Panda is consistent with repetition my general suspicion is Panda is doing something strange. (It is just a suspicion though - I really don’t have the time to remind myself exactly how nurbs work again!)

Ah, indeed you are correct:

>>> m = loader.loadModel('/home/drose/monkey/curve2/curve.egg')
>>> m.ls()
ModelRoot curve.egg
  NurbsCurve, order 4, 4 CV's.  t ranges from 0 to 4.
  CV's:
  0) -0.236423 1.72055 -2.99437, weight 1
  1) -1 1.72055 2.51831, weight 1
  2) 1 1.72055 2.51831, weight 1
  3) 0.236423 1.72055 -2.99437, weight 1
  Knots:  0 0 0 0 4 4 4 4

The Panda loader has indeed corrupted the knot vector. Looking deeper, I see this is a fundamental limitation of the old-style NurbsCurve loader, which is required by the Mopath implementation: it cannot support knot vectors that don’t begin and end in repetition.

This flaw is corrected in the new-style NurbsCurveEvaluator loader, which is used by RopeNode; but Mopath has not yet been updated to use this new mechanism.

So, for now, you have to limit yourself to NURBS curves that start and stop at their endpoints.

David

I just installed Panda 1.7 on my Mac machine and my chicken exporter is not working anymore:

dyld: Library not loaded: libp3dtoolconfig.1.7.0.dylib
  Referenced from: /Developer/Tools/Panda3D/egg2bam
  Reason: image not found
Configuring chicken, script is /Applications/blender-2.49a-OSX-10.5-py2.5-intel/blender.app/Contents/MacOS/.blender/scripts/bpydata/chicken/chicken_config.py
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Blender/Scripts/chicken_exportR81.py", line 2006, in <module>
    Blender.Run(scr)
AttributeError: no such file or Blender text

As you can see, I was using R81.
So, I downloaded R85 and :

dyld: Library not loaded: libp3dtoolconfig.1.7.0.dylib
  Referenced from: /Developer/Tools/Panda3D/egg2bam
  Reason: image not found
Configuring chicken, script is /Applications/blender-2.49a-OSX-10.5-py2.5-intel/blender.app/Contents/MacOS/.blender/scripts/bpydata/chicken/chicken_config.py
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Blender/Scripts/bpymodules/chicken_exportR85.py", line 2221, in <module>
    Blender.Run(scr)
AttributeError: no such file or Blender text

Even if it doesn’t seem to be a path error, I had many tries changing it and placing chicken_exportR81.py in other folders but no succes until here.
I’ll try tomorrow with a windows version and maybe revert to 1.6.2 to see if the problem is coming from there!

FOLLOW-UP :
I rolled back to Panda1.6.2 and the chicken exporter worked as before.
The error was claiming that the file libp3dtoolconfig.1.7.0.dylib located in “/Developer/Tools/Panda3d” was missing while a print sys.path showed that all paths were present.

The problem isn’t the location of the chicken_exportR81.py file - its the location of the chicken_config.py file. Something is wrong with the paths (Which is strange on a mac - its typically only Windows where that matters.), and its trying to open the configuration interface to ask you to locate Panda, which it can’t find. Check that you have put chicken_config.py in the right place - that error message prints out where it should be!

Chicken R91 is now on sourceforge - its just a bunch of bug fixes, though some are quite critical, especially with regards to shape keys and stencil textures (Both should now work). Enjoy!

I am having problems with chicken r81 and 91.

When I try to use R91 an error appears but it goes off screen so i cannot read it at all, Sorry this isnt much help i dont understand why its happening this way

os Win7 64bit
core i7 860
blender 2.49b

When i try to use r81 its gets an error that states
“chicken_interface” could not be imported Chicken will not operate without this module. But i looked and the interface is right where it should be in the folder under “bpymodules”.

So what could be happening to cause this?

Have you read the installation guide? What looks like the right directory is not necessarily the right directory! If you could run Blender on the command line (run cmd using the search in the start menu, type blender and hit enter.) and tell me the output that would be useful - hard for me to know otherwise. (This is assuming that installation guide doesn’t point you in the right direction.)

Ok so there was an issue apparently it was not copying right in my system. So the file ended up in the right directory but it was blank and some of the files didnt even copy (Although they said they did)… That dosnt work for what we need so i tried again as admin and this time it worked right apparently unless I specify copy as admin it didnt work right. Well it is fixed now and Seems to be working quite well!

Thanks for your “help” and “understanding”.

As soon as chicken_config.py is not under dir ‘bpydata/chicken’, the script ‘Chicken_R91’ doens’t appear in blender (Script / export)…
I think I tried to relocate both chicken_exportR81.py and chicken_config.py in ever it was possible to relocate them and unfortunatly I’m still getting that error!

You suggested me to relocate ‘chicken_config.py’ where the error message tell me to put it which is
/Applications/blender-2.49a-OSX-10.5-py2.5-intel/blender.app/Contents/MacOS/.blender/scripts/bpydata/chicken/chicken_config.py
Well, I don’t know where the .blender is and cant’ go further.
I can only guess that it’s somekinda pointer that aim to the path I need to deffine under Blender in ‘script’ folder. Iif this assemption is correct, ‘chicken_config.py’ has always been under the right folder then!

May I remind that on OSX, Panda 1.7 is not stored at the same location as 1.6.2 was.
Indeed, Panda 1.6.2 was under /Application and now Panda1.7 is dislocated in several different directories of /Developer.
For exemple: ‘egg2bam’ is under /Developer/tools/Panda3d and ‘config.prc’ is under /Developer/Panda3d/lib

Well, I don’t know what else can I try!!!
Hoping that you’ll be able to help me, I’m going to reinstall Panda1.6.2 just for using chicken :slight_smile:

Just for the record, it’s /Developer/Tools/Panda3D, not /develop/tools/Panda3d/.

I have a french OS and in french 'developper" is a verb wth meaning ‘to develop’ while here it must be an english word for the name of person who develop --> the developer. I just translated it where there was no reason to do it!
Post corrected!

I’ll have a look at this sometime this weekend - right now I’m in crunch mode for a deadline in 6 and a half hours, having now been awake for 28 hours, so brain isn’t really working. What I will say is I don’t have access to a mac, so some guessing and experimentation is probably going to be required.

Ok, this is going to be tricky - I don’t have access to a mac for testing, so I’m afraid I’m going to have to make a bunch of educated guesses.

Looking again at the error I’m thinking that its an unhandled exception and that its loading the chicken_config.py file, but then throwing an error so that the import code thinks its failed. Likely that error is with running egg2bam - could you confim or not if that works on the command line for you? If not then that is the problem, if it does work there would presumably be some difference between Blenders environment and the standard command line environment that breaks things.

(For future reference - the .blender directory is hidden, the convention on unix style systems (Such as macs.) is for all files/directories starting with a dot to be hidden - to browse to that directory you probably need to unhide hidden stuff - there is usually an option somewhere.)

Indeed, running egg2bam command show this:

egg2bam
dyld: Library not loaded: libp3dtoolconfig.1.7.0.dylib
  Referenced from: /Developer/Tools/Panda3D/egg2bam
  Reason: image not found
Trace/BPT trap

rdb, is it possible for you to test this on a mac ?
According to lethe, I’m not the only mac user facing this problem.

I get the following error when I run Chicken R91 using Blender 2.49b under OS X 10.6.2:

guessing './blender' == '/Applications/blender-2.49b-OSX-10.5-py2.5-intel/blender.app/Contents/MacOS/./blender'
Compiled with Python version 2.5.4.
Checking for installed Python... got it!
Settings for export not found. Using defaults.
Traceback (most recent call last):
  File "/Applications/blender-2.49b-OSX-10.5-py2.5-intel/blender.app/Contents/MacOS/./.blender/scripts/bpydata/chicken/eggoctree.py", line 31, in <module>
    from pandac.PandaModules import *
ImportError: No module named pandac.PandaModules

Thanks,
Daniel.

That error basically means you don’t have Panda installed for the Mac OS install of python - install it!

Are there any plans to update Chicken to work with the Blender 2.5 series? I understand that would require updating Chicken to work with Python 3, which probably would be best implemented as a new branch. (keep the old Python 2.x branch around for bugfixes, but have a Python 3 branch for newer versions of Blender)

My team and I would be willing to help with development and testing, if you’d like.

Well, the plan certainly exists, and I have spent time looking into it. Its not a simple job though - its basically a complete rewrite, with extensive reference to the original. Its possibly a bit early to do this though - the Blender 2.5 api is not 100% locked down, though its close enough that any changes shouldn’t be too bad.

However, I haven’t committed fully to doing this - the reason is that the plan for Panda is to depreciate egg files for Collada files, and I am not sure I want to put in the effort of the port for a file format that will be going dodo at some point in the future.

I have no knowledge of the time scale of this plan, so don’t know what kind of ‘gap’ in service this would cause, but there is already dae2egg, so the collada pipeline already works, albeit with a conversion step. (Blender 2.5 already comes with a Collada exporter.) It might make more sense to work on that pipeline than create a new temporary one - my list of things to do includes sitting down and having a play, to see what the limits of the collada route are, as I don’t know how well it works right now. There is a strong likelihood that certain Chicken features will not be supported via this route - would need to see what they are and if they can be fixed.

The egg format supports texture stenciling, nurbs curves export, instancing, LOD levels, empties, collision geometry export. Does the current implementation of panda’s collada support this? Does dae2egg support this? What about bam files? Backward campatability? I don’t know why but I don’t like this idea.

@lethe: Are you planning to make any new versions of chicken for Blender 2.4x? Blender 2.5 is still alpha and I’m not going to immediatelly switch to it anyway (pretty used to the old UI and hotkeys, using bunch of python 2.x scripts, etc.)