Difference between revisions of "Projdir (lx-projdir.hpp)"
Latest revision as of 21:02, 19 February 2018
nexus supports the concept of project directories to help users organize their content. There are two parts to a project: a template and an index file.
The template defines a series of relative paths that can be instanced as directories on disk. project.makeDirs will create directories for the entire hierarchy and place a project file in the root. This is really all that the template is for.
The project file contains a list of paths and their associated file types. This is used to set the initial paths for the varaious load/save dialogs, ensuring that they're always relative to the project. The project state is cached with the scene in memory to avoid excessive disk access, and switching between scenes automatically switches to the other scene's project paths, if neccessary.
Project Directory Override
The project directory is normally found by walking up the directory hierarchy containing the scene file itself to look for a .luxproject file. This can be overridden to look in an arbitrary path by implmenting an ILxProjDirOverride server.
(1) SDK: LXu_PROJDIROVERRIDE, etc. defines
The interface has a single method. Returning a failure code will cause the search to walk up the hierarchy of the scene as normal. A success code will cause the search to start from the path provided by the method. If that path is empty or doesn't exist, we will not try to find a project directory.
We only really expect one server to exist at a time, since this interface is intended for special cases only. If multiple servers are found, the order is undefined and the first one that returns a success code is the path that is tested.
(2) SDK: ProjDirOverride::OverrideWith
Empty ProjDirOverride Python user class.
(3) PY: empty ProjDirOverride user class