Regarding panda's pview.exe

Sorry about this, I understand that its most likely a simple question, but…

Is it possible to preview textures on a .egg file using pview.exe?

Like, for example, I have a separate texture box.bmp, and a egg file box.egg.

Is it possible to see box.bmp on box.egg?

Because we’re planning to use this to preview a level with the textures on, and we’re using Maya to model the level.

Thanks once again!

if your egg-file contains the correct path to the texture, and uv-coordinates. it will load the texture automatically.

pview cant modify models, so you cant set or replace a texture in it. what you can do is modify the egg-file in a text editor and replace the texture in the material definition.

but pview isnt that complicated i’d say, implementing a small viewer that can do what you need should be easy.

It’s especially easy to implement this kind of substitution viewer in Python. You could write a seven-line Python program that does it:

import sys
from direct.directbase.DirectStart import *
model = loader.loadModel(sys.argv[1])
tex = loader.loadModel(sys.argv[2])
model.setTexture(tex, 1)
model.reparentTo(render)
run()

David

Ah…

So to run it, i just run:

viewerName modelName textureName

like

viewer box.egg pie.jpg ?

Is that how the system argument thing works?

Not the way I’ve written it above. If you want to write a program that works like that, it’ll be a bit longer than 7 lines (but only a bit longer). You can get the command-line parameters from sys.argv, and figure out which parameter is the model and which is the texture, and then apply them yourself.

David