Chicken, an Egg exporter for Blender [V1.0 (final) out!]

Panda3D Forum Index -> Pipeline Post new topic   Reply to topic
Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 16, 17, 18  Next View previous topic :: View next topic  
Author Message
Eric48k


Posts: 90
Location: Spain

PostPosted: Fri Apr 11, 2008 8:01 am    Post subject: Reply with quote
dreamsavior wrote:
I made a model of a worm (actually just a line of spheres meant to look a little like a worm... maybe that's why the chicken won't eat it?) with an animation that makes it wiggle. Chicken will export the model, but it won't export the wiggle animation. My Chicken is version R42 and I do have Python fully installed, so I must have made a mistake when animating the model.

First of all, when I was making the animation, the tutorial I was following told me to parent the model to the armature. Yes, I found out later that Chicken doesn't accept that. So I unparented the model. But Chicken still won't lay the animation. So my question is... is there any way to save my animation? If I have to start over, can someone link me a good tutorial for making armature animations the Chicken-kosher way? Thanks in advance.


I'm stuck right now with the same problem, I exported an animated model I made from scratch with no problem, but another one that had mesh-armature parenthood didn't work, so I cleared parent of both and added armature-modifier to the mesh, chicken doesn't recognize the animation and exports as static scene.

I'm trying to find a way to make it work, but any help about this would be great

Edit: I've found that a subsurf modifier was somehow messing with the exporting of the animation. I guess I will apply the subsurf before I export, but being just a humble beginner, I don't know if it's logical or expected to behave like that
lethe


Posts: 466
Location: London, England

PostPosted: Fri Apr 11, 2008 11:45 am    Post subject: Reply with quote
Just an observation/feature request:

The chicken exporter is using egg-trans to generate the relevant tangent and bi-normal info, when the method blender uses to calculate that is different. At least, for faces adjacent to seams the normals are wrong when rendered in panda, and don't match up at all over the seam. (Obviously seems are never perfect and are best hidden, but this is a case where it could be better.) I presume a difference between blenders and pandas methods of calculating the tangents and bi-normals is responsible.

I suspect this can be fixed, or at least improved, if you can query blender to get the tangent and bi-normal information its calculated from it direct and use that instead. Of course, that is dependent on Blender exposing that capability to your script, about which I have no idea, but if possible this would certainly be the preferred method.

Thanks for chicken btw, it works brilliantly, and these new features are going to save me some time:-)
psiberpunk


Posts: 134
Location: Santiago, Chile

PostPosted: Fri Apr 11, 2008 10:21 pm    Post subject: Reply with quote
Well, it didn't actually cross my mind to look into Blender's own tangent and binormal calculation methods but now that I have, prompted by your post, it appears that its results are not accessible from Python scripts. I guess the egg-trans method will have to do for now.
I will keep this in mind, and look out for it in future Blender releases. Maybe it even warrants taking the time to make a patch of my own and submit it.

@eric48k
If you have an Armature modifier on a mesh, the effects of any other modifiers cannot be exported. This is a Blender limitation more than it is Chicken's (since R44 static models support any modifier) because I can't get the weights of vertices other than those from the cage (unmodified) mesh.
However, this should not interfere with exporting an animated mesh. It will just show up as a warning in the report page.
If you continue to have this problem I extend to you the same offer I make to everyone else with this sort of issue: you can send me your .blend file via e-mail (its included with the script and I'd rather not reproduce it here for fear of spam) and I'll tell you what is wrong (be that your mistake or a bug in Chicken, like in dreamsavior's case). Perhaps even if you've solved your problem it would be useful to other Chicken users that you send me a file that can reproduce the original problem so I can see what went wrong and how I can make that situation a little less confusing for others.
Douglas


Posts: 78

PostPosted: Thu Apr 17, 2008 4:28 am    Post subject: Help with install Reply with quote
It would be wonderful to have install instructions in the chicken DOC.HTML
I had a very hard time getting it to work in Kubuntu. It works now though but the first try it took out all my other exporters!!! I had to guess where everything went and now it works but for only one user. It would be nice to have it also work for others on my system but I have no idea how to do that.
Thanks, Great tool!!
Douglas
psiberpunk


Posts: 134
Location: Santiago, Chile

PostPosted: Thu Apr 17, 2008 10:35 pm    Post subject: Reply with quote
It really didn't occur to me that people would have trouble installing Chicken considering it's basically the same as installing any other Blender script, though instead of just moving it to your scripts directory, you unzip it because it's more than one file.
Douglas


Posts: 78

PostPosted: Fri Apr 18, 2008 1:23 am    Post subject: install Reply with quote
First, I would say that I have it installed and working but it was not so easy for me. First off I did not know where the directory was that it needed to be unzipped into. On my Kubuntu there are a lot of places it could go but 2 main ones. First it could go in the Sudo area of the system (user/lib/blender/scripts) so that all my users could use it, second it could go in any of the HIDDEN files at /home/user/.blender/scripts

The next problem is that just unzipping it in scripts does not work. I needed to pull out the bpdata and the other folder bpmoduls (which are links in the users scripts director!) and the program and put them into 3 places. I am still not sure it is totally right because there are on nice looking graphics like in your example pictures but it does make eggs so that is good.

Also it took me a bit to see that you had an HTML file stuffed in there in one of the directories. It should be on the top level or in a directory called docs or README or something. One other thing I would say is that I had to get some little bit of help because I had never used Pview and it comes up with all white models until you press the L key. At first I thought that your program was at fault for this model with no color. Might be nice to have a warning and a link to the docs on the panda3d site.

Thanks,

Douglas
Shaba1


Posts: 171

PostPosted: Fri Apr 18, 2008 1:07 pm    Post subject: Reply with quote
psiberpunk wrote:
It really didn't occur to me that people would have trouble installing Chicken considering it's basically the same as installing any other Blender script, though instead of just moving it to your scripts directory, you unzip it because it's more than one file.


psiberpunk. Welcome to the World of IT/Computer Programming/Being the knowledgeable computer guy Smile Trust me from 32 years of working with computers from the time I was 16, NEVER ASSUME that any person will know what you are talking about. Especially when you are communicating with written words,describing a basically visual object as you are here with panda.

Good luck.
araneldon


Posts: 4
Location: Finland

PostPosted: Fri Apr 18, 2008 7:27 pm    Post subject: Reply with quote
Chicken isn't working here. First I tried with my own model and animation, but only the model got exported. Then as a sanity check I also tried the test scene with the same result.

Blender 2.45
Chicken R44

- open fleur.blend
- model object is selected
- export
- no warnings, no complaints in console window
- accept default export options (one animation on the list)
- after export only fleur.bam and fleur.egg have been created
- /me stumped

I really wanted to play with this stuff :/
araneldon


Posts: 4
Location: Finland

PostPosted: Fri Apr 18, 2008 8:04 pm    Post subject: Reply with quote
Apparently there's something screwy about the file naming.

This is what the script proposes as the target filename when exporting
from F:\Blender-2.45\.blender\test-modelR42\fleur.blend:

F:\Blender-2.45\.blender\test-modelR42\fleur.egg

If I accept that, here's the result:
F:\Blender-2.45\.blender\test-modelR42\fleur.egg
F:\Blender-2.45\.blender\test-modelR42\fleur.bam
F:\Blender-2.45\.egg

If I change the target filename to F:\fleur.egg, then everything
works correctly.
psiberpunk


Posts: 134
Location: Santiago, Chile

PostPosted: Fri Apr 18, 2008 10:32 pm    Post subject: Reply with quote
Yeah, that's a bug in a Blender utility function for making filenames with different extensions. I've found a way to bypass it and it'll be fixed in my next release.

@Douglas: Frankly I'd rather the spend the little spare time I have working on Chicken itself rather than writing readme files, especially for such obscure setups. You're welcome to contribute your own documentation however, and I'll credit you for it if you do.
Douglas


Posts: 78

PostPosted: Sat Apr 19, 2008 12:44 am    Post subject: Reply with quote
Why do you find Ubuntu obscure?
Douglas
psiberpunk


Posts: 134
Location: Santiago, Chile

PostPosted: Sat Apr 19, 2008 1:36 am    Post subject: Reply with quote
I don't find Ubuntu obscure... in fact, as I've mentioned several times in this thread, I develop Chicken on both Ubuntu and Windows XP. What I find obscure is the weirdness you described with soft links in your Blender scripts directory. If you had a normal Blender scripts directory with no soft links you would've had no problems installing Chicken on Ubuntu.
zingbat


Posts: 174

PostPosted: Sun Apr 27, 2008 5:44 pm    Post subject: Reply with quote
@psiberpunk
Are you thinking of adding support for other texture modes in the future? The new shader generation supports, normal, gloss and glow and possibly ambient. I imagine that in Blender this would be associated like this:

Nor - normal map
Spec - gloss map
Emit - glow map
Amb - ambient light
psiberpunk


Posts: 134
Location: Santiago, Chile

PostPosted: Mon Apr 28, 2008 8:47 pm    Post subject: Reply with quote
I was thinking of doing that, yes. Revision 44 already has support for Normal maps, and I plan to add the others you suggested in addition to Height textures, which I imagine would also use Norm textures, but ones that are not flagged as normal maps (i.e. they are bump maps).
Shaba1


Posts: 171

PostPosted: Sun May 04, 2008 8:13 pm    Post subject: Reply with quote
psiberpunk. I know that I have asked you this before. But here I go again. I have read the docs for chicken at least 90 times. I understand 99% of it but its just his one part of the explantion of the sytheticRoot bone that confuses me and I have read it over and over and over again

Quote:
If your animation is meant to be a loop keep in mind one thing: The movement delta for the first exported frame will be calculated relative to the origin so make sure to do one of the following:
Make the first exported frame be displaced relative to the origin as much as if the last frame in your animation were placed at the origin.
Export a reference animation that contains only the frame previous to your animation's starting frame in addition to your animation. If you do this you need the last frame's pose copied in the appropriate place to the frame just previous to your start frame.


Movement delta? First frame displace relative to the origin a if the last frame was placed at the origin? Only frame previous to the start frame? This really does not make sense to me. Could you please explain in simpler terms. Pictures would help a lot.
birukoff


Posts: 424
Location: Russia, Moscow

PostPosted: Tue May 13, 2008 11:50 am    Post subject: Reply with quote
It seems that Chicken creates additional vertices (in fact, duplicates existing ones).
For example, if I have a cube that consists of 8 vertices in eight angles and 6 square polygons. The chicken creates additional vertices so that they are not shared between polygons. So, after exporting I find 24 vertices in the egg, with 4 for each of the square polygons. Is it normal?
At the same time after I examined the Ralph model, I see that vertices may be shared between polygons.
Maybe, problems with normal maps on UV seems originate from this behavior of the exporter?
lethe


Posts: 466
Location: London, England

PostPosted: Tue May 13, 2008 12:52 pm    Post subject: Reply with quote
birukoff: That behaviour is due to the fact that Blender stores uv coordinates more efficiently than panda i.e. it can store a different uv for each face at any given vertex, so it can handle seems. Panda however only has one uv per vertex, so for it to replicate Blenders behaviour it has to duplicate vertices with different uvs. This may seem strange but it makes perfect sense - Panda is all about rendering stuff quickly and hence a simpler data structure is beneficial, whilst blender is all about editing, and so has to do it the complicated way.

In regards to your cube the default uv coordinates are such that all faces share the entire image, hence every vertex needs to be duplicated for all 3 faces that use it, making 24 vertices in total. If you take the cube and subdivide each face you will find that the vertices in the centre of the faces will now be shared between faces as they have the same uv values for multiple using faces.

The uv seam normal map issue is a separate issue unfortunately.
drwr


Posts: 8005
Location: Glendale, CA

PostPosted: Tue May 13, 2008 1:38 pm    Post subject: Reply with quote
Also, note that duplicate vertices in the egg file are automatically collapsed together, when possible, when the egg file is loaded. The number of vertices in the egg file really has very little to do with the number of vertices in the Geom that is created from it.

David
Shaba1


Posts: 171

PostPosted: Tue May 13, 2008 4:51 pm    Post subject: Reply with quote
drwr since psipherpunk never answer me maybe you could take a stab at answering the question I ask four post up from this one.
drwr


Posts: 8005
Location: Glendale, CA

PostPosted: Tue May 13, 2008 6:02 pm    Post subject: Reply with quote
Sorry, I don't know beans about Blender.

David
psiberpunk


Posts: 134
Location: Santiago, Chile

PostPosted: Wed May 14, 2008 12:16 am    Post subject: Reply with quote
Sorry, I've been really busy lately so I never got around to answering your question, Shaba1. Here goes:

A movement delta is how much the object moved in one frame. Since we're talking about motion extraction this means how much the synthetic root bone moved in one frame. So, what I mean is that the first frame you export in your animation should have the synthetic root bone displaced the same amount relative to the origin as if the pose of the last frame were copied and moved so the synthetic root bone lined up exactly with the origin. All this is only necessary if you want your animation to loop and not have a noticeable pop in the motion of your character when a loop is completed.
I don't know if that's any clearer, but I've got something better than pictures in this case. Just look at how the test model that's on the site is animated and configured for export.

I'll try to clear this up tomorrow, but right now I have to go to sleep.
birukoff


Posts: 424
Location: Russia, Moscow

PostPosted: Mon May 19, 2008 11:40 am    Post subject: Reply with quote
Blender 2.46 is out now ( http://www.blender.org/download/get-blender/ ). It is said in the release notes that it has an "improved Python API". Maybe, Chicken can be improved further to obtain features that were not possible before? To solve known issues?
neighborlee


Posts: 147
Location: Seattle, Washington

PostPosted: Fri Jun 20, 2008 12:39 pm    Post subject: parse error on export Reply with quote
Hi there all,

EDIT EDIT EDIT : ok I fixed with select >inverse , x :delete..go figura..got help from my friend surphaze so thx to him Smile

pview well no matter, but after fixing it, running pview still showed nothing..however its not a small file at 42MB so who knows there as well ..

thx
lee
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::

I have a weird parsing error in bam2egg :

C:\Programs\Programming\Panda3D-1.5.3\bin>egg2bam C:\Programs\Programming\Heartseed\eggs\heartseed.egg

Error in /c/Programs/Programming/Heartseed/eggs/heartseed.egg at line
741681, column 13:
-1.#IND -1.#IND -1.#IND

^
parse error
THEN in console I see this:

Unable to load /c/Programs/Programming/Heartseed/eggs/heartseed.egg
:framework(warning): Empty bounding volume for models
:framework(warning): Empty bounding volume for models

Any idea whats causing this ? Smile

This is in windows xp home, with Blender 2.46 and chicken R44.

While I am posting, I also get no pview ( no error though) images showing in pview window, even after pressing C, then W.

Thx anyone Smile

nl
_________________
One Game at a time-
http://heartseed.sf.net
[ We are currently looking for help ]
Email us or goto: irc.freenode.net
to channel #heartseed {You can also find us in #neighbors & #panda3d }
Thank You.
Edwood Grant


Posts: 19
Location: Bogota, Colombia

PostPosted: Tue Jul 08, 2008 11:56 am    Post subject: Reply with quote
EDIT: Ok I've looked on the script and found out that curves are actually implemented, just set the CURVE_SUPPORT variable to true and done... ill check if it work nicely with some tests...

Hello,

The exporter looks great... and I'd like to add a feature request.

The ability to export motion paths, basically to implement the <NurbsCurve> tag, it would make it a more complete exporter. And also it will give the ability to use motion paths from blender. You could use a blender NURBS object to do that... not sure if that would be too difficult to implement.

I know it not the most important feature, but it would be nice to have it.

Thanks

Italo F. Capasso B.
AKA "Edwood Grant"
_________________
"Oh, im just too good for my own bad self"
Shwang Shwing

"Vengeance is cold and sweet... just like an ice cream!"
Thaumaturge


Posts: 291
Location: Cape Town, South Africa

PostPosted: Sun Jul 13, 2008 5:29 pm    Post subject: Reply with quote
First of all, this looks like a good tool (although admittedly I'm only just starting to use it) - thank you for it! ^_^

However, I just wanted to report an error that I encountered, and the fix that I came up with. (This may have come up before, but if so, I haven't noticed anything to that effect.)

For reference, I'm using Blender 2.46.

Having placed Chicken in my Blender script directory, I attempted to invoke it, only for the script to fail with a TypeError, and with the indication that the culprit lay in line 311.

This line is protected by a try block, but, in the version that I downloaded, at least, it only catches IOErrors. The fix, of course, is simple:

Code:
line 312:          except (IOError, TypeError):


This seems to be effective. ^_^
_________________
MWAHAHAHAHA!!!

*ahem*

Sorry.
mweb


Posts: 3

PostPosted: Sun Aug 31, 2008 12:31 pm    Post subject: Reply with quote
First thanks for your exporter.
I made a small change to your exporter (Version R44). With my change it will export the animation into the same file as model it self. The advantage is that you only need to load one file and not for each animation one. It will behave like to old one if the animation only button is selected.
Here is a diff file of change: http://user.enterpriselab.ch/~zdweber/chicken_changesR44.diff

Maybe you have a reason for exporting into several files but it would be nice if this could be an option.

An other request I have is that I would like to be able to export a model that has several animations but each separated as an action. Currently I have to switch between each animation by selecting the action for the armature before each export, since I'm only able to select the frame range of an animation and not the action.
Shaba1


Posts: 171

PostPosted: Wed Sep 24, 2008 5:41 pm    Post subject: Reply with quote
mweb just how is one supposed to use this "diff" file. Do we copy and past it into the original chicken.py file. If so where. Some instructions would be helpful.
rdb
pro-rsoft

Posts: 5836
Location: Netherlands

PostPosted: Thu Sep 25, 2008 8:21 am    Post subject: Reply with quote
A diff file is a file containing just the changes to the original file.
On linux, you can just use "patch" on the command line, on windows you can probably use any text editor, or this:
http://gnuwin32.sourceforge.net/packages/patch.htm
Shaba1


Posts: 171

PostPosted: Thu Sep 25, 2008 11:38 am    Post subject: Reply with quote
Thanks pro-soft. I think I will stay with R44 although I still do not understand what psiberpunk said about looping an animation.
lethe


Posts: 466
Location: London, England

PostPosted: Sat Oct 04, 2008 10:03 am    Post subject: Reply with quote
Psiberpunk,

Going back to the whole thing of using Blenders tangents and bi-normals I had a look through the python reference the other day and found the getTangents() method - see http://www.blender.org/documentation/246PythonDoc/Mesh.Mesh-class.html#getTangents

Its quite a fiddly interface given by example only, and inconvenient compared to getting normals, but it doesn't take much to work out what is going on. My interpretation is that you call the method and, for the active uv layer, get a list with an entry for each face. Each entry is then a list of tangent normals mapping to the vertices of the face. You presumably cross-product with the normal to get the binormal.

I had a look through the chicken code and think I could implement it, but really don't have the time right now (Have a thesis to write, so unlikely to find time before Christmas.), plus I'm not sure what the current version is (to edit), looking at the changes/patches suggested above in this thread.

So I'm posting this in-case you or someone else can find the time, but if not I'll do it when I have the time... but that is not going to be any time soon.
Display posts from previous:   
Post new topic   Reply to topic    Panda3D Forum Index -> Pipeline All times are GMT - 5 Hours
Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 16, 17, 18  Next
Page 6 of 18

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group