DavidBrainard / RenderToolbox3

Matlab toolbox for managing graphics rendering for psychophysics
MIT License
11 stars 4 forks source link

Optional Absolute Paths for MakeSceneFiles() #27

Closed benjamin-heasly closed 11 years ago

benjamin-heasly commented 11 years ago

Currently, MakeSceneFiles() resolves absolute path names for resources on the Matlab path that are referenced in mappings and conditions files. For example, spectrum .spd files and texture image files.

This simplifies calls to renderers, because this way we don't need to configure the shell path used by the renderers. This pays off when the Matlab path is very long because Matlab's setenv won't accept large values.

But this approach also makes the generated scene files host-specific. If someone wanted to generate portable scene files, they would encounter problems with the absolute paths in their scene files.

It would be straightforward to add a hint for MakeSceneFiles() that toggles the absolute path behavior. Perhaps hints.isAbsoluteResourcePaths. It could default to true and do continue the current behavior.

If hints.isAbsoluteResourcePaths were set to false, it would be up to users to make sure that the renderers were able to locate resources referenced in scene files.

benjamin-heasly commented 11 years ago

SupplementGenericObjects() also usees which() to locate some default spectrum files. Perhaps it should not.

benjamin-heasly commented 11 years ago

b77432cfe8a0c5bfd017fd7ba418de26606f8270 contains the new isAbsoluteResourcePaths hint, which defaults to true.