Setting textures on Box.egg

I’m new to panda3d. I’m trying to add different textures to each side of a box which I have loaded from the built in box.egg, but I can’t find the documentation on how the textures work for it. I want to give each side of the box a different texture, but setTexture sets every side of the box to the same texture.

Here’s how I am doing it:

You can also use different texture stages as an alternative way of doing this.

I’m getting an error

      <MRef> { Material }
                      ^
Unknown material Material

When I try to load the egg file you linked

I haven’t linked an egg file, just the changes I made. If you have Blender3D and you follow the instructions you should get a similar outcome. But if you are not very familiar with 3D modelling software and UV maps, and want to use the default box.egg without affecting its file contents, I would advise looking into texture-stages. If you wish every face to have a separate texture you may have to create 6 different texture stages, one for each side, and then assign them the textures you want.
You may find this link useful:
http://www.panda3d.org/manual/?title=Multitexture_Introduction

I’ve made an egg file using blender3d, but the textures aren’t loading properly. On the sides I don’t set a texture, the cube is white as expected, but the side a set a texture to just become a solid block of color, instead of the texture I set. It looks like that solid color is the average of every colour in the image I’m trying to set.

When using texture stages on the default box.egg, how would I tell the texture stage to only display the image on one side, currently any texture I set get put on every side, even if I use a texture stage

I haven’t really done the texture stage method, but I would imagine you need to rescale and rotate your texture stage to get the desired effect.

As for blender3D, using the default cube, make a UV map where every face of the cube takes up the entire size of the map. Also make sure that your UV map has a size that is a power of 2. Then export the egg file, and open it using a text editor of your choice. Right at the end off the egg file you will find this:

<Polygon> {
  <MRef> { Material }
  <Normal> {0.000000 0.000000 -1.000000}
  <VertexRef> { 0 1 2 3 <Ref> { Cube }} 
}
<Polygon> {
  <MRef> { Material }
  <Normal> {0.000000 0.000000 1.000000}
  <VertexRef> { 4 5 6 7 <Ref> { Cube }} 
}
<Polygon> {
  <MRef> { Material }
  <Normal> {1.000000 -0.000000 0.000000}
  <VertexRef> { 8 9 10 11 <Ref> { Cube }} 
}
<Polygon> {
  <MRef> { Material }
  <Normal> {-0.000000 -1.000000 -0.000000}
  <VertexRef> { 12 13 14 15 <Ref> { Cube }} 
}
<Polygon> {
  <MRef> { Material }
  <Normal> {-1.000000 0.000000 -0.000000}
  <VertexRef> { 16 17 18 19 <Ref> { Cube }} 
}
<Polygon> {
  <MRef> { Material }
  <Normal> {0.000000 1.000000 0.000000}
  <VertexRef> { 20 21 22 23 <Ref> { Cube }} 
}

What this represents is the six faces of the cube. And since you want to add a texture to each one of these faces, you will need a way to access them. I decided to do this by assigning them in groups which you can find in that first link I sent you earlier. From there it is pretty simple, and I have even written a small working sample which should get you what you’re looking for.

Thank you.
I used the box.egg that comes with panda3d, and I made a copy of it and added the groups at the end like you said. It is all working fine now.