How to get textures within an egg file to show up


#1

I used an egg file (marioKart) that contains textures:

<CoordinateSystem> { Z-up } 
<Material> mt_mario {
  <Scalar> diffr { 0.640000 }
  <Scalar> diffg { 0.640000 }
  <Scalar> diffb { 0.640000 }
  <Scalar> specr { 0.500000 }
  <Scalar> specg { 0.500000 }
  <Scalar> specb { 0.500000 }
  <Scalar> shininess { 12.5 }
  <Scalar> ambr { 1.000000 }
  <Scalar> ambg { 1.000000 }
  <Scalar> ambb { 1.000000 }
  <Scalar> emitr { 0.000000 }
  <Scalar> emitg { 0.000000 }
  <Scalar> emitb { 0.000000 }
}

<Material> mt_Kart_Mario_Tire_S {
  <Scalar> diffr { 0.640000 }
  <Scalar> diffg { 0.640000 }
  <Scalar> diffb { 0.640000 }
  <Scalar> specr { 0.500000 }
  <Scalar> specg { 0.500000 }
  <Scalar> specb { 0.500000 }
  <Scalar> shininess { 12.5 }
  <Scalar> ambr { 1.000000 }
  <Scalar> ambg { 1.000000 }
  <Scalar> ambb { 1.000000 }
  <Scalar> emitr { 0.000000 }
  <Scalar> emitg { 0.000000 }
  <Scalar> emitb { 0.000000 }
}

<Material> mt_kart_Mario_S {
  <Scalar> diffr { 0.640000 }
  <Scalar> diffg { 0.640000 }
  <Scalar> diffb { 0.640000 }
  <Scalar> specr { 0.500000 }
  <Scalar> specg { 0.500000 }
  <Scalar> specb { 0.500000 }
  <Scalar> shininess { 12.5 }
  <Scalar> ambr { 1.000000 }
  <Scalar> ambg { 1.000000 }
  <Scalar> ambb { 1.000000 }
  <Scalar> emitr { 0.000000 }
  <Scalar> emitg { 0.000000 }
  <Scalar> emitb { 0.000000 }
}

<Texture> Texture.001 {
  "./tex/F2_Item_Kart_Mario_Kart_S.png"
  <Scalar> envtype { MODULATE }
  <Scalar> minfilter { LINEAR_MIPMAP_LINEAR }
  <Scalar> magfilter { LINEAR_MIPMAP_LINEAR }
  <Scalar> wrap { REPEAT }
}

<Texture> Texture.002 {
  "./tex/F2_Item_Kart_Mario_Body_S.png"
  <Scalar> envtype { MODULATE }
  <Scalar> minfilter { LINEAR_MIPMAP_LINEAR }
  <Scalar> magfilter { LINEAR_MIPMAP_LINEAR }
  <Scalar> wrap { REPEAT }
}

<Texture> Texture {
  "./tex/F2_Item_Kart_Mario_Tire_S.png"
  <Scalar> envtype { MODULATE }
  <Scalar> minfilter { LINEAR_MIPMAP_LINEAR }
  <Scalar> magfilter { LINEAR_MIPMAP_LINEAR }
  <Scalar> wrap { REPEAT }
}

but when I use the file in my code, the textures don’t show up on the model (it appears as a plain white model)

self.marioActor = Actor("images/MarioKart")

i have the textures in a folder that is in the same folder as the egg file. this worked for another project i saw, with these exact files. i tried for a while to manually put the textures on the model but i saw the other project didn’t do any of that, so is it supposed to show up on its own? also i keep getting an error saying that images/MarioKart is not an actor.


#2

The eggfile says they are in a subfolder called tex…


#3

Yeah, I realized that after a little while. Now it works but only on my old laptop. On my current laptop (they have access to the same files through iCloud), it doesn’t work. They’re both on the same version of python and panda3d, so I don’t know why.


#4

Are they in the same relative location on the current laptop? That is, I gather that on your old laptop, you now have the models in some folder, and the textures in a sub-folder of that folder–is the same true on your current laptop?

If so, are you running the same code–there isn’t perhaps some change that you’ve made to your project’s code as you have it on your old laptop that you haven’t yet made on to the version that you have on your current laptop?