So I just switched from unity to panda3d and am porting my game.
YABEE is definitely the best blender exporter I’ve seen for a graphics engine (dat HowTo pdf!)
But I have a problem that I had to hack my way through.
Problem:
Actor objects will throw out all meshes except one when loading an Egg file with multiple skeletons (I believe this is what is happening) let me illustrate.
Here is my happy (but poorly drawn) wizard in blender:
This shows how his skeleton is split:
Here’s how he looks in pview when I export him (the animation is working too, couldn’t show that):
But here’s how he looks in game when I use the actor class:
model = loader.loadModel("fullWizTest")
self.pandaActor = Actor(model,{"walk": "fullWizTest-walk.egg"})
or
self.pandaActor = Actor("fullWizTest",{"walk": "fullWizTest-walk.egg"})
The animation for the feet still works, but obviously his upper torso is missing, presenting a problem.
Hacky Solution:
Export the chest by itself:
Then load the chest by itself as well as the other model:
model = loader.loadModel("fullWizTest")
chest = loader.loadModel("fullWizChest")
self.pandaActor = Actor(model,{"walk": "fullWizTest-walk.egg"})
self.pandaActor2 = Actor(chest,{"walk": "fullWizChest-walk.egg", "cast": "fullWizChest-cast.egg"})
I also had to find the hat and head (they were separated also) apparently the exist in the original files still, they just aren’t showing up on screen.
head = model.findAllMatches("*").getPath(0).findAllMatches("*head*").getPath(0)
hat = model.findAllMatches("*").getPath(0).findAllMatches("*hat*").getPath(0)
I added all these objects to the same node and then to the world. The torso came out right on top of the legs with no adjusting, the hat and head took some adjusting with setPos()
Now all the character’s parts are in the game:
I’m not sure why this is happening, and I read a few places that you’re supposed to be able to export like this (multiple skeletons/meshes) as long as it’s one skeleton to one mesh. Also in the exporter GUI there’s a checkbox to “Merge Actor” which gave me the idea to merge the skeletons (the tooltip suggests this will work) so
I joined the two skeletons (keeping the meshes separate), redid the weights and animations for the torso, but when I tried to export this I got an error:
Sorry that this isn’t more descriptive. It’s 5am and I just wanted to get some info down before I pass out. I’m going to update this tomorrow or the next day with more information. Hopefully I can figure this out and I won’t have to use this hacky method, or maybe I can make the hacky method less hacky.
Oh yeah, the reason I have separate meshes is so that the material shows up correctly. I’m a bad 3d artist, so I had to make the textures in pieces having multiple textures. If I join all the meshes, the exporter jarbles all the materials together giving a really weird look (only tested in pview) I tried using the “bake” option, but it looks weird too (scaling off) maybe I could play around with that more.