I’m just starting with panda3d. I’ve gone through the tutorials. Now I have tried to use my own .egg file in place of the pre-packaged .egg files used in the tutorial.
All I’ve done is run blender and created an .egg with the default blender cube, with a color texture applied (tried even without texture, although I don’t know what this would do to change). I export this to .egg into the panda3d/models directory where the other (tutorial) models are located.
I replace the tutorial model name with the name of my .egg file (without the extension) and I get this error:
raise IOError(message)
OSError: Could not load model file(s)
Is there a good place here for guidance on loading your own .egg files other than the tutorial? I’ve looked at the YABEE documentation but I don’t know what I’m doing wrong. Thanks.
I am slightly mystified as to why it doesn’t work as in the original script–as noted there, the Panda-provided models seem to work from that directory–but otherwise I recommend as @serega-kkz does: if you place your models in a directory within your project’s main directory, and then use relative paths to access them, it should work.
(It can be made to work via absolute paths, or directories outside of your project directory, but that may well lead to trouble later.)
My config.prc file is properly configured with the model path. I have also used the fully qualified path to be sure and it still does not work.
I believe the error lies somewhere in the Blender conversion and is making the .egg not readable by Panda3d. Since I’m so new at panda I’m not sure how to configure a blender obj to be convertable to .egg.
Error in /c/Panda3D-1.10.0-x64/models/test.egg at line 183, column 18:
<TRef> { Tex }
^
Unknown texture Tex
:egg2pg(error): Error reading /c/Panda3D-1.10.0-x64/models/test.egg
:loader(error): Couldn't load file /c/Panda3D-1.10.0-x64/models/test.egg: invalid.
Traceback (most recent call last):
File "hellowa.py", line 60, in <module>
app = MyApp()
File "hellowa.py", line 22, in __init__
self.box = self.loader.loadModel("/c/Panda3D-1.10.0-x64/models/test.egg")
File "C:\Panda3D-1.10.0-x64\direct\showbase\Loader.py", line 248, in loadModel
raise IOError(message)
OSError: Could not load model file(s): ['/c/Panda3D-1.10.0-x64/models/test.egg']
I have tried without the .egg. I also noticed that I cannot open the .egg file directly, again making me think I’ve done something incompatible. I’ve looked through the YABEE doc and don’t know what it could be.
Is there any place other than the YABEE doc that shows proper method of converting a blender obj to a usable .egg? I tried to open the egg file directly and it will not open:
Maybe there is something really simple I’m missing. I tried also to convert some blender models I have previously made and they also will not open. I have tried blender 2.79 and 2.78 (different machines) and have the latest YABEE. Thanks again for trying to help.