Hey everyone, so I want to use some premade 3D models and actions in order to continue working on the programming portion of a video game and not worry about character models. Im guessing Panda3D works strictly from .egg models. The problem I am seeing is that there are a bunch of free 3D models online, but it seems like the only converter for all the model types (.3ds, .fbx etc) is using YABEE with Blender to get a .egg model. Are there any alternative routes to getting a .egg character model with textures and actions? Again, I just want something basic, but I am getting a lot of issues with the textures staying on character models when I use YABEE, so Im looking for alternatives. Thank y’all!
Panda3D supports a wide variety of model formats with varying amounts of success. For character models, I believe the best options are:
- BAM (Panda3D internal format)
- glTF (via panda3d-gltf)
- Collada (DAE)
FBX is supported, but I do not remember the status of importing characters.
If you have the model in Blender, you can give blend2bam a try.
This is slightly tangential, but to address the following:
I think that there’s a good chance that this is a result of the manner in which the textures are applied to the model: if I’m not much mistaken, YABEE expects textures to be applied in the texture-slots of materials. (It’s possible that there are other methods that will work–I don’t know whether it observes nodes, for example. However, there are some methods that I’m pretty confident don’t work–for example, a texture simply applied in Blender’s UV/image-editor isn’t observed by YABEE, I believe.)
So, Ive recently read your whole thread with Noob about his texture issues. And in all honesty, I know so little about 3D modeling and Blender’s utility that I was going to make it my last resort to try and fix the issues. I read through the posts and was really lost when reading about how it observes the nodes and its UV editor. I just wanted something basic to use as placeholders so I can continue programming haha.
Thank you! Are there any sites that you know of to download free 3D Models in those formats? I will try blend2bam and see how it works.
You’re unlikely to find many (or any) sites with BAM and EGG models on them since they are specific to Panda3D. Also, BAM is a poor distribution format since it is tied to Panda3D versions.
You may have some luck with glTF. The glTF format is growing a lot in popularity, but I do not know any sites with assets in glTF (although I am sure they exist).
Perfect thanks! I’ll look to see if I get lucky finding glTF. Also, in regard to blend2bam, could you give me some simple directions on how to properly use it? I installed it with pip but I am a bit lost. Im assuming I make certain blend2bam commands on terminal for specific directories with the model I want to convert?
Also, this might sound dumb, but shouldnt I be able to simply put the glTF model where I would normally put the EGG model and have it show up the same way without changing anything to my code, like keeping the same calling of self.character.reparentTo(render) etc? I did this and got the error “raise IOError(“Could not load Actor model %s” % (modelPath))”
That’s fair enough!
As to placeholders, I have a few egg-file models that I’ve made available for such use–you should find them here:
I believe that @wezu has some, too–although as they’re not mine, I of course stand to be corrected on their availability. It looks like they are available for this purpose, however! You should find them here:
Ah, this is wonderful! Thank you so much!
It’s my pleasure! I hope that you find the models useful.
So, it seems it may not have been my exporting that was the issue but the placement of my texture file. When I placed your model in the directory and loaded my game, the model was still untextured (all black.) Where does the tex file need to be for the .egg file to locate and apply the textures to the model?
Hmm. That’s very odd. As long as you placed both the model and the texture-file(s) in the same place relative to each other as you found them in the repository, they should just work.
Do you have any lighting set up in your scene?
Haha, thaaaat is probably it. Can some models come with lighting already set up on them? Im wondering because some models I have loaded without any modification to the code have loaded with visible textures. Im obviously new to Panda3D and video game programming in general haha
I don’t think that the “egg” format includes lights, no. However, it’s possible that different internal model-setups may interact differently with different lighting-setups–I’m not sure.
A quick test: Try using PView to open one of the models that appears to be black in your project. Is it black there?
(If you don’t know how to use PView, see this manual page.)
If the textures are visible in PView, then the problem is likely in the way that your program is handling the models or lighting, not in the model or where you’ve stored the textures.
That’s fair enough! We’re all new at some point, after all.
Since you are new, may I suggest my beginner’s tutorial? It should take you through the process of building a very simple game, from pretty much the fundamentals of Panda through to making a distributable.
You should find it here:
Ah, yep, your textures loaded just fine in PView, so it must be the code. I was trying to follow along with one pdf of a Panda3D tutorial that I found, but apparently, it has left out some crucial details to rendering character models lol. So yeah, I’ll take a swing at your tutorial for sure. Thanks again man, you’ve been a great help!
Not a problem! I’m glad if I’ve been of service.
As to the tutorial, I hope that it helps! For what it’s worth, it includes full source, so there shouldn’t be anything missing.