SessionPaths Struct

Session paths are identical to bitmap/photometric paths and xref paths, except they are never saved when 3ds Max exits.

The list of session paths is always empty when 3ds Max boots up.

However, if session paths are configured before a file is loaded, then they will be used to search for resources in the file.

NOTE:The session paths are NOT displayed in the Configure Paths dialog!

There are four functions available through the sessionPaths structure. In each function, the keyword #map can be replaced with #xref to specify an xref path.

The two lists of session paths (bitmaps and xrefs) are maintained separately from each other.

   

<boolean>sessionPaths.add (#map |	#xref ) <String path> 	 

Adds a new bitmap or xref session path. Returns true on success. Adding the same path more than once will result in a single path stored in the session paths.

   

<integer>sessionPaths.count ( #map |	#xref )   

Returns the number of bitmap or xref session paths.

   

<string>sessionPaths.get ( #map | #xref ) <Integer index> 

Returns the indexed bitmap or xref session path.

   

<boolean>sessionPaths.delete ( #map | #xref ) <Integer index> 

Deletes the indexed bitmap or xref session path. Returns true on success.

EXAMPLE

sessionPaths.count #map --the number of session bitmap paths
0 --there are none at this point
sessionPaths.add #map "d:/maps" --add a bitmap session path
true --success!
sessionPaths.count #map --has the number of paths changed?
1 --of course it did!
sessionPaths.get #map 1 --get the first bitmap session path
"d:/maps" --what you put in, comes out...
sessionPaths.delete #map 1 --delete the first bitmap session path
true --dead you are!
sessionPaths.count #map --and the number of session paths is...
0 --none.

One suggested use for session paths is to create a "project" system of asset management. Each project has certain folders for bitmaps and xrefs. Before a user loads a file, they would first load the project settings, which would set up the appropriate session paths. Any files loaded as part of that project will automatically have access to the correct library of maps and xrefs. If a project is closed, the session paths would be deleted.

See Also