I’m trying to move from absolute (/Users/username/documents/etc.) to relative paths, and I’m running into a few problems.
First I assumed that loadModel would look in the location where the .py file is; that is, all I had to do was put the .egg file in the same directory, point to it by name (i.e. loadModel(“head.egg”))… That didn’t work.
Then I tried going into Config.prc and editing it… That didn’t work at all. What’s more, I’m going back to try and edit Config.prc and my computer is no longer finding it…
I’m up a creek without a paddle. Help?
Yes, it works with relative paths, so you’d better post a specific example because the problem belongs to your specific code.
PS Don’t put the file extension inside the loadModel i.e. use loadModel(“head”) - it allows to load the correct model (egg or bam) depending on what you’ve in your folder (tipically you’ve eggs during development and bam for releases, so you needn’t modify code between the two versions).
To be more explicit, models are searched along the model-path, which is a series of directories named in your Config.prc file. The model-path does not automatically include the directory that contains your .py file, though you can usually add that explicitly if you want that behavior. It does, however, usually contain the current directory ("."), so if you cd to the directory containing your py file before starting it, you’ll probably be OK.
You can print your list of prc files that you are loading with the command:
That may give some insight into the problems with your prc file.