Why exported .egg files from Blender aren't loading up?

Hi community,
I’m just getting my head around how exporting .egg files and loading them into P3D works.
Problem I’m facing is that .egg file is exported presumably successfully since I’m
getting no errors but loading the file isn’t working:

my file is in models/BASEmodel.egg and my game.py file looks like the following:

from panda3d.core import loadPrcFile
loadPrcFile('config/conf.prc')
from direct.showbase.ShowBase import ShowBase
from direct.actor.Actor import Actor


class Game(ShowBase):

    def __init__(self):
        super().__init__()
        girl = self.loader.loadModel('models/BASEmodel')
        girl.setPos(0, 20, 0)
        girl.reparentTo(self.render)


game = Game()
game.run()

Blender v2.83
since there are more forks of YABEE I’ve tried the one located here GitHub - kergalym/PRPEE: Egg Exporter for Blender 2.8 and Panda3D with RenderPipeline which supposedly is meant for Blender v2.8

then I also tried older version:
Blender 2.7.9
YABEE from GitHub - 09th/YABEE: Export models from the Blender to Panda3D game engine

Both of the above exported .egg file but I was unable to load it up. Getting just a blank screen and I believe I’ve set position of the model correctly.

the egg file can be downloaded here https://www.dropbox.com/s/ij70zlahzbmewmz/BASEmodel.egg?dl=1

Any suggestions ?

And do not think that you did the right thing, try to move the mouse.
Or still install it correctly.

girl.setPos(0, -20, 0)

I’ve moved the mouse around in all axis with and without changing the setPos() attribute
and I’m still getting just a blank screen.

Then provide a test model for the forum.

Sure. I’ve added a download link to my post.

You just have armature bones, no geometry.

I know nothing about 3D modeling to be honest, but I gathered that it means P3D can’t load it for this reason.

Rather, it looks like the model hasn’t been exported properly: looking within your egg-file, I see an armature, but no actual model.

At a guess, did you perhaps have only the armature selected when exporting?

If so, note that when exporting via YABEE one has to select in Blender anything that one wants to have exported; anything not selected is not exported.

That said, for versions of Blender from 2.8 up, I believe that it’s recommended that one use an approach other than YABEE for exporting, such as blend2bam or exporting as gltf.

In particular, I believe that it’s strongly recommended that one not use PRPEE: that exporter is intended for one specific user-project, and has some known issues that may affect general exportation, I believe.

(I’ve seen a number of people trip up over PRPEE now; I wonder whether we shouldn’t have some notice about it somewhere…)

I’ve found model that claims to be “game-ready”. So I exported it and the engine still
won’t load it. https://www.dropbox.com/s/5zggz30jaoq72z2/Dragon.egg?dl=1

Noted. Thank you. Can you recommend proven-by-community exporter ? I’m familiar with blend2bam but I don’t know how to load it so I can play with it in Panda. I can’t just call loader on it like with .eggs, can I ?

I believe that I’ve seen blend2bam recommended a number of times.

In short, it exports to the “bam” format, which is one that generally ends up being used anyway: when producing a distributable, the build-tool generally converts egg-files into bam-files.

And indeed, as native Panda-files, you should be able to load bam-files via “loader”! You may have either to add the “.bam” extension to the file-name when loading, or to set a config-variable to make bam-files the default, but it should work just as well as loading egg-files.

That is, given a model-file named “mew.bam”, you can do either the following:

In your .prc-file:

default-model-extension .bam

In your program:

self.myModel = loader.loadModel("mew")

Or the following:

In your program, with no changes to your .prc-file:

self.myModel = loader.loadModel("mew.bam")

(Or you can load the prc-setting in code, but that’s close enough to the above that I won’t show it here.)

Thanks a bunch for all the info. I’ve got it all set up.

running blend2bam [src] [dst] is giving me errors though.

...
...
08:10:01 | INFO: Extracting primitive: Cube.007
08:10:01 | INFO: Primitives created: 1
08:10:01 | INFO: Extracting primitive: Cube.008
08:10:01 | INFO: Primitives created: 1
08:10:01 | INFO: Extracting primitive: Cube.009
08:10:01 | INFO: Primitives created: 1
08:10:01 | INFO: Extracting primitive: Cube.002
08:10:01 | INFO: Primitives created: 1
08:10:01 | WARNING: Animation target pose.bones["Bone.001"] not found
08:10:01 | WARNING: Animation target pose.bones["Bone.001"] not found
08:10:01 | WARNING: Animation target pose.bones["Bone.001"] not found
08:10:01 | WARNING: Animation target pose.bones["Bone.001"] not found
08:10:01 | WARNING: Animation target pose.bones["Bone.001"] not found
08:10:01 | WARNING: Animation target pose.bones["Bone.001"] not found
Error: Could not set action 'CDA:MatIpo.002' onto ID 'OBa', as it does not have suitably rooted paths for this purpose

https://www.dropbox.com/sh/zxx314yq2mfcuz3/AAA2Z1mRxsjYFJHU98Op3Ap9a?dl=1 this is the “game-ready” model I’m trying to convert into bam.

Could you test if the conversion works on your machine ?

I’m afraid that I don’t have blend2bam loaded on my end–and in any case, I don’t use it myself, and so am not familiar with it. (I’m still using the older pipeline of Blender 2.7 + YABEE, as switching now would mean significant changes to the process used by my main project.) As a result, I’ll leave it for another to test, I think.

That said, perhaps the model was made in some older version of Blender than blend2bam expects, resulting in errors? What happens if you try to export something simple from a current version of Blender? For example, what happens if you open Blender 2.8, make a box, save the file, and then export that with blend2bam?

I can confirm that the default box gets exported just fine and loaded too. But the test model won’t even load into some versions of Blender. Looks like I’m gonna have a lot of fun just to get format conversion working. I’ve seen in discussions that some got it working with Blender v2.7, v2.7.8c, some with v2.7.9, some with v2.8, etc …

I’ve seen a YouTuber who made it work nicely with v2.7.9 under Windows. I’m on Ubuntu but that shouldn’t matter.

Indeed, it seems like the problem might be related to the version of Blender in which that specific model was created.

And indeed, note that earlier versions of Blender will–in my admittedly limited experience–not reliably load models created in later versions. But that’s perhaps somewhat to be expected: they were made in versions of Blender that may have had features or changes not present in the earlier versions.

So, can you find out what version of Blender was used to create the model? If so, then you can perhaps look into a good exporter for that version, and use it to export just this one model.

(That might be more reliable than attempting to convert the model to load in another version of Blender, I suspect.)

I’ve found a combo that works for me by far the best. Blender v.2.8.0 and PERPEE. Exporting to .egg works and the model loads too (most of the time).

Okay, fair enough–just bear in mind that PRPEE is not recommended for general use, and that you may bump into problems at a later stage.

Still, if it does work for your purposes, then well and good! :slight_smile:

Noted. There’s a good chance that I will find more reliable way of converting formats in the future.
Thank you for chiming in !

1 Like

I think you should know that there is geometry and animation. What you think of as models are actually animations.

In order to export the animation, you need to select the bones, and in order to export the geometry(mesh), you need to select the polygons.

I think I’ll be using blend2bam whenever possible as it appears to be more reliable than PRPEE. Though I’m still trying to figure out how do I trigger animation if I get only 1 blend file.