maya2egg -pd

I was under the impression that you could set the directory that Panda would search for a particular model’s textures using -pd… but passing different paths to it as parameters doesn’t seem to change the resulting EGG file’s textures’ filepaths. How is this supposed to be used correctly?

From maya2egg -h:

  -pd path_directory
               Specifies the name of a directory to make paths relative
               to, if '-ps rel' or '-ps rel_abs' is specified.  If this
               is omitted, the directory name is taken from the name of
               the output file.

Thus, the correct way to use it is in conjunction with -ps rel.


I was under the impression that that was set by default.

So it’s not? Or I have to explicitly state it anyway when I use -pd?

Hmm, good point. Well, have you tried it? What happens? These texture filenames that aren’t changing–do they exist? (As the -ps comment explains, textures that don’t exist aren’t affected by this parameter.)


Oh yes, they do exist. I can view the textured model without problem, so long as the textures are placed in the directory specified within EGG format. I think I’m just not passing the path in the correct format for maya2egg to use properly.

What I’m trying to do: I want to put all my models in one folder, and all the textures of each model in another folder.



The filepath for the attribute in the model should be something along the lines of: …/textures/model.fbm/tex.png

Whenever I pass …/textures/ as the argument for -pd, my filepath is “…/model.fbm/tex.tga”

Why wasn’t the textures folder appended to the path?

Try omitting the trailing slash from “…/textures/”. It’s thinking you’re putting the egg file into a directory that’s a child of the textures directory.

But actually, the proper value of -pd is “c:/MyPandaApp/models”. What you are telling maya2egg is the name of the directory in which the egg file will ultimately reside. It will figure out the correct relative path to the textures from there.


Same result, unfortunately.

Ah… I was hoping it would be possible to actually specify the path of the textures myself. There is no way to do this?

Yes, but to do this, you will use the -pr option. This stands for path replace, and replaces whatever current (full) path the textures are indicated with the new path of your choosing. If the textures are in different directories, you’ll have to repeat it for each one.


Still haven’t had much luck getting the effect I needed, so I’ve resorted to just manually setting the path in the EGG file. Doesn’t take all that much effort anyway, and I could write a script to automate it if necessary. Much thanks anyhow.