Multitexture on a gltf model

Hi all. I’ve been trying to make a simple cube show two layers of textures by following the Panda3D manual.

I used the smiley.egg.pz model that ships with Panda3D and this graph, Uther , and it works well.

The code I use is:

from direct.showbase.ShowBase import ShowBase
from panda3d.core import *

base = ShowBase()
model = base.loader.loadModel("smiley")
ts = TextureStage("2nd")
model.setTexture(ts, base.loader.loadTexture("Uther.png"))

But when I build my own model using blender 2.83 LTS, and then export to gltf and egg files, the same code doesn’t work as expected.
To export egg format, I use the PEREE, which is for Blender 2.8.
The blender model looks like this, which should be very simple UV mapping (the graph has transparent background).

The exported gltf(left) and egg(right) models look like this:

I guess the transparent background of the smiley face graph makes the egg model transparent, too.

When I change model loaded in the above code, I get quite different results:
For the gltf model, the result doesn’t show the 2nd graph I want.

For the egg model, there simply isn’t anything shown in the window, no matter how I zoom in or out.

Is there something special about the egg format that allows more feature than the gltf models? And I’m not sure what I’m missing when exporting the egg file from Blender.
Here are the files I use here, if someone is able to get the correct result, please let me know what I’m doing wrong. Many thanks. (279.0 KB)

The problem comes from using PEREE. This is not an exporter for the standard panda render.

Since YABEE doesn’t work with blender 2.8, and I was told that PEREE is for Blender 2.8, I tried it.
If PEREE isn’t the right choice, is there one that works?
Or do you know how to get the .gltf format to work?

1 Like

I have found a solution to multitexture on the gltf models I created.
Before setTexture using the created TextureStage, set its coordinate set to a specific uv set(‘0’ by default). I guess previously the 2nd texture stage was added but simply wasn’t showing.

The following code works:

model = base.loader.loadModel("Cube.glb")
ts = TextureStage('2nd')
ts.setTexcoordName("0") #This is the key
model.setTexture(ts, base.loader.loadTexture("Anduin.png"))