Ursina Entity Default Cube blend2bam not rendering

360 Views Asked by At

I opened blender took the default cube. Saved it in the directory as cube1.blend. Used the CLI tool blend2bam and made it into cube1.bam in the same directory. Ursina Entity seems to recognize it but won't render or at least I can't find it and is not in the same spot as if I just render the packaged model cube.

 from ursina import *

 app = Ursina()

 entity = Entity(model='cube1')
 # So I can look for cube
 EditorCamera()

 app.run()

*Note default models or entity models packaged with ursina or panda3d work as expected

 from direct.showbase.ShowBase import ShowBase


 class MyApp(ShowBase):

     def __init__(self):
         ShowBase.__init__(self)

         self.camera.setPos(-9.112, -211.077, 46.951)
         self.camera.setHpr(0, -7.5, 2.4)
         # Load the environment model.
    
         self.scene = self.loader.loadModel("cube1.bam")
   
         # Reparent the model to render.
         self.scene.reparentTo(self.render)


 app = MyApp()
 app.run()

Works as expected and loads and renders my custom cube1.
Ursina Python console spits out it's loading bam and no errors....

render mode: default
no settings.py file
loading bam
no settings.py file
development mode: True
application successfully started

I am trying to get Ursina to work however so although panda3d is being more cooperative I'm assuming it's something to do with Ursina's Entity. Thank you ahead of time for any suggestions or help.

2

There are 2 best solutions below

0
On

The Ursina engine takes in a .blend or .psd file and turns it into a .obj file which it renders, it can also render .obj files directly. I dont believe Ursina has the capability of render .bam files and it was to my kowledge that Panda3D could only render the .egg file type. I had no idea Panda 3D could use .bam files. So I guess stick to using the .blend file for Ursina? That's what I've always used in that engine and I haven't had problems.

1
On

Note that ursina work's well with OBJ files. If you can convert it to OBJ. Also you need to add a lot of argument's that your missing. Here's an example:

ground = Entity(model='plane', texture = 'your_texture_name', collider = 'mesh', position = (0, 0, 0), scale = (100, 1, 100))