Relative Paths
 
 
 

Version 9 of the 3ds Max SDK introduces the notion of a user defined project folder and a library of functions that facilitate the use of relative paths (relative to the project folder) for managing users' assets. MaxSDK::Util::Path is a type designed for doing path-related string manipulations. It also works well with the newly introduced methods of IPathConfigMgr.

The following is a summary of the more conspicuous of the numerous methods provided:

Method .h File Description
ConvertToRelativeTo Path.h Convert this absolute Path so that it points to the same location but relative to the new base path.
ConvertToAbsolute Path.h Converts a given relative path to an absolute path rooted at the current project folder.
GetResolvedAbsolutePath Path.h Get the fully-resolved, lower case, path converted to absolute rooted at the current project folder.
ConvertToRelativeToProjectFolder Path.h Get the fully-resolved, lower case, path converted to absolute rooted at the current project folder.
Normalize Path.h Transforms a path in to its normal form (without extra relative indicators).
SearchForExternalFiles IPathConfigMgr.h Resolves a given path using a predefined path search order for external files.
MakePathRelativeToProjectFolder IPathConfigMgr.h Converts an absolute path into a path that is relative to the current project folder.
GetProjectFolderPath IPathConfigMgr.h Returns the fully-qualified path of the project file, given the root folder of an existing project.
SetCurrentProjectFolder IPathConfigMgr.h Sets the current project folder.

The library supports the free conversion to and from Universal Naming Convention (UNC) paths. See maxsdk\include\Path.h and maxsdk\include\IPathCOnfigMgr.h.