Skip to content

loadShape doesn't load OBJ files in subdirectories properly #2003

Description

@additv

When trying to load an OBJ file which is in a subdirectory of the data directory it interprets any referenced paths as being relative to the data directory rather than relative to the path of file which you are loading.

As an example of this problem:
From the examples open Basics > Shape > LoadDisplayOBJ
Open the sketch folder and move put rocket.obj, rocket.mtl and rocket.png to a subfolder like rocket or models.
Change the path in the sketch and run.

As a result, you should see the model being loaded, but displayed untextured. In the console it will say: rocket.mtl does not exist or could not be read

This makes it difficult to organize multiple models and textures, as they all have to be at the root of the data folder.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions