My favorites | Sign in
Project Home Downloads Issues
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 336: Filepath relativity problem with OBJWidget
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


 
Reported by vanquish...@gmail.com, Sep 6, 2010
Right now, the Obj Widget included in the examples fails to load any texture that isn't in the project root folder. This makes it impossible to put textures inside subfolders, as in root/assets/textures/myTexture.jpg

What steps will reproduce the problem?
1. Modify the 3Dviewer example to load an obj model file that has textures (the default monkey has none)
2. place model and textures in an 'assets' subfolder (relative to your module's path)
3. Start up the 3Dviewer example, giving it the filepath to the model (which should include the 'assets' subfolder)

What is the expected output? What do you see instead?
The model should load with it's textures, but pygame throws an error saying it couldn't load the texture file. Note that the filename is stripped of any subfolders in the error message (it should be prefixed with subfolders relative to the module's path).


What version of the product are you using? On what operating system?
PyMT 0.5 Portable on Win7 64-bit

Please provide any additional information below.
I believe that at some point in the texture loading routines, the filename is being stripped of it's subfolder prefixes. Any subfolders specified with the model name when calling the ObjWidget constructor should be also used for textures. This would allow us to at least place the models and textures in their own subfolders and not mess up the project's file structure 

Cheers


Powered by Google Project Hosting