I have a .gltf file which I am trying to view using panda3d. I am able to load and see the mesh but not the colors associated with it. If I load it into blender, I can see both the mesh and the associated colors if I set up the color attribute and link it to base color.
this is what I have so far:
from panda3d.core import AmbientLight, DirectionalLight, Vec3, Vec4
from direct.showbase.ShowBase import ShowBase
import simplepbr
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
simplepbr.init()
self.environ = self.loader.loadModel("models/output_file.gltf")
self.environ.reparentTo(self.render)
self.environ.setPos(0, 0, 0)
# Create a new directional light and set its direction
dlight = DirectionalLight('dlight')
dlight.setColor(Vec4(1, 1, 1, 1))
dlight.setDirection(Vec3(-1, -1, -1))
# Create a NodePath for the light, attach it to the render graph,
# and call set_light to cause it to cast light on everything in the scene
dlnp = self.render.attach_new_node(dlight)
self.render.set_light(dlnp)
# Add an ambient light
alight = AmbientLight('alight')
alight.setColor(Vec4(0.2, 0.2, 0.2, 1))
alnp = self.render.attach_new_node(alight)
self.render.set_light(alnp)
app = MyApp()
app.run()
these are the files (gltf and bin) : https://drive.google.com/file/d/1037G2ytddx3a_gAuG96g0AqR57dXVRgc/view?usp=sharing https://drive.google.com/file/d/13zYEAymYSSbnPSkLQQzEm_phqHh3AAeu/view?usp=sharing
I also tried showing the model directly without simplebpr, but I get the same thing. I have also tried all sorts of different conversions (egg,obj,ply,etc...) but they all just give me the grey model.