Hi All,
I have troubles with replacing of a texture on particular model which already have many TextureStages composed in a specific way. Instead of adding of such a complex model I decide to do simple model that represents in a best way my trobles with a complex one. The code that I use to change it is next:
import direct.directbase.DirectStart
from pandac.PandaModules import *
model = loader.loadModel("untitled.egg")
model.reparentTo(render)
print model.findAllTextureStages()
texStageBox = model.findTextureStage('boxMat_00_diffuse')
texStageSphere = model.findTextureStage('sphereMat_00_diffuse')
texPool = model.findAllTextures(texStageBox)
texPool2 = model.findAllTextures(texStageSphere)
newTex = loader.loadTexture('./red.png')
model.clearTexture(texStageBox)
model.setTexture(texStageBox, newTex, 1)
texStageBox = model.findTextureStage('boxMat_00_diffuse')
texStageSphere = model.findTextureStage('sphereMat_00_diffuse')
texPool = model.findAllTextures(texStageBox)
texPool2 = model.findAllTextures(texStageSphere)
print texPool
print texPool2
run()
The problem is that changing of a texture on specific stage changes textures on others.
Any suggestions are welcome …
Models and Textures: ge.tt/9tjslTK/v/0
Please note that model have 6 TextureStages and two different Materials. All poligons are textured only by 3 of them (1 diffuse, 1 gloss and 1 normal) and by 1 of materials.
I`m using Panda3d-1.8.0
Thanks