Hi there, i am learning panda3D doing examples and small scenes. I wanted to place a model of an archer’s target, which has a flag on top of it, and i want it to wave, like there was some wind… so i started blender, modeled the target, and flag. Made the flag a “softbody” added some wind and baked the animation. But when i tried to export it using chicken exporter, it exported the flag in its fixed initial position…
i was searching on how to do this, but i have no luck… can you give me some clues on what to search for? and also, can you give me some advice on how to do this ?
thanks a lot,
I think Panda3D does not have support for softbodies yet.
I am currently working on a Panda3D integration for AGEIA PhysX, which will offer softbodies. Cloth and fluids already work pretty well. But it will be some month before this work becomes stable and usable.
@ennox… well panda doesnt but blender does. so he baked the flag into an animation and tried to export it.
so far this is no trouble, since panda has support for morph targets, also known as vertex-based animations its theoretically possible to do this.
the reason why it does not work is : the chicken exporter doesnt support those moprh targets yet. i think there arlready where a few requests to add it. i think once more i have to refer you to psiberpunk who wrote chicken. if i remember correctly it was in discussion to be added if someone could provide samples.
as conclusion …as long as the blender api gives access to the vertexdata. it’s technically possible.
Yes, as ThomasEgi said, someone from this forum had requested the morph target feature, and offered to provide a sample file I could use as a test for the feature. Let’s just say they didn’t keep their end of the bargain so I haven’t really looked into it. If you want you can provide me with this .blend file you’ve made that you’d like to export so I can use it as a reference.
It is perfectly feasible, but it seemed like a lot of trouble at the time and there didn’t seem to be much interest for it around the time I released version 1.0
well, at first let me apologize for not answering, i have my account with “Always notify me of replies:” set on yes but for some reason i didn’t get the mails, so i thought no one had answered…
and yes, Thomas, that’s exactly what i wanted to do, thanks for explaining it
psiberpunk, i would love to send all blend files you need, but i don’t know how. would you like to give me your email and i send it there?
mine is my nick at gmail
well… hope this gets implemented soon
Oops, morph targets eluded my attention so far, but I am eager to fill this knowledge gap. So, for my own education:
If a soft body is baked into an animation in blender, and then exported to Panda3D as morph target: Is it only this particular sequence that is available in Panda3D (for example a poorly inflated soccer ball hitting the ground)? Or will the animations be computed in real-time, for example the deformation of the ball if a soccer player hits it at a random point with his foot?
I’m asking because in this case morph targets would be a better alternative for NxPanda cloth, fluid and soft body actors (better than re-writing the vertex positions each frame).
as i see it (and PLEEEASEEE correct me if i’m wrong) exporting a softbody from blender is like exporting a character animation using bones… but, without the bones
what i’m trying to do is to have a waving flag… so i don’t need to spend lot of CPU to have a wind and a flag moving in real time, so i do an animation of the flag and play it in a loop. it’s really hard to have the first and last frame in the same position so when you see the loop you don’t notice this… i’m trying to figure out how to do it. But i think is worth it… in cases like this.
I don’t think this is a good approach if you’re trying to make cloth
Was this ever followed up? Because I’m trying to do something similar with say a t-shirt or a cape. Whatever happened? Was the code ever supported?
I’m afraid this won’t work, and is unlikely to work any time soon, if ever. Chicken doesn’t currently have shape key support in the main branch, and it is not going to be added particularly soon as the next thing happening to Chicken is a rewrite for blender 2.50. Now, clcheung has added shape key support to an older version of Chicken, but its capability is limited - you can find more info here: https://discourse.panda3d.org/viewtopic.php?t=6389; even using that however won’t solve the softbody scenario unless you can convert the softbody into a shape key, which I don’t think you can do.
Now, if i wanted to do this I would do two things:
Add softbody support to Panda. Not as hard as it sounds, but you obviously need to know quite a bit about how Panda works and C++; implementing softbodies is actually very easy, at least for a basic implementation.
make the flag as a mesh, drive it by bones and then either:
a) animate the bones to make it look like its waving - simple but involves a lot of work.
b) Much more fun: create a soft body flag as well, use vertex parents to have empties follow the vertices, and use constraints to have the armatures follow the empties. The end result is the softbody flag should transfer over to the armature flag, which will export through Chicken. (I haven’t tried this - its just one of those perverse ideas that pops into your head when thinking about how to solve a specific problem!)
Yes, I’ve considered option b). For a flag it works well, for a t-shirt… probably not. Its probably also possible(just as costly to have Chicken write it as one file) to export the mesh frame by frame, load it into a cashe, and then just swap the frames out at game speed.