NEW in 3ds Max 2019:The
CustomFileStream interface is used to query, add, modify and remove
CustomFileStreams from an external scene file.
CustomFileStreams in the current scene file are managed with the
CustomSceneStreamManager interface. See the overview topic
Custom File Streams.
For a description of the possible pre-defined flag values and the "public" customizable flag value, see CustomSceneStreamManager.
Interfaces > Core Interfaces > CustomFileStream |
Methods:
<TSTR by value array>getStreamNames <filename>fileName
Returns an array of the CustomFileStream names in the specified file. If the specified file does not exist, or if it does not support custom file stream storage (for example, has a file version older than 3ds Max 2019), an exception is thrown.
<bool>doesStreamExist <filename>fileName <string>streamName
Returns true if the specified CustomFileStream is present in the specified file. If the specified file does not exist, or if it does not support custom file stream storage, an exception is thrown.
<bool> isCustomFileStreamOperable <filename>fileName <string>streamName
Returns true if the specified stream in the specified file is a valid CustomFileStream. If the specified file does not exist, if it does not support custom file stream storage, or if the named stream does not exist, an exception is thrown. This method is intended primarily to test whether CustomFileStreams written by external applications are valid.
<bool>deleteStream <filename>fileName <string>streamName
Deletes the specified CustomFileStream in the specified file. Returns false if the file exists but cannot be opened with write access. If the specified file does not exist, if it does not support custom file stream storage, or if the named CustomFileStream does not exist, an exception is thrown.
<TSTR by value>readStream <filename>fileName <string>streamName
Returns the content of the specified CustomFileStream in the specified file as a string. If the content is an array of strings, the first string is returned. If the specified file does not exist, if it does not support custom file stream storage, or if the named CustomFileStream does not exist, an exception is thrown.
<bool>writeStream <filename>fileName <string>streamName <string>content persistent:<bool> noLoadOnSceneLoad:<bool> append:<bool> persistent default value: true noLoadOnSceneLoad default value: false append default value: false
Creates and sets the content of the specified CustomFileStream in the specified file to the specified string, setting the corresponding flag values if it is a new stream. If the stream already exists, its contents are replaced unless append:true is specified, in which case the specified string is appended to the current contents. Returns false if the file exists but cannot be opened with write access. If the specified file does not exist, or if it does not support custom file stream storage, an exception is thrown. If appending and the stream has existing array content, an exception is thrown.
<TSTR by value array>readStreamArray <filename>fileName <string>streamName
Returns the content of the specified CustomFileStream in the specified file as an array of strings. If the content is a single string, it is returned in a one element array. If the specified file does not exist, if it does not support custom file stream storage, or if the named CustomFileStream does not exist, an exception is thrown.
<bool>writeStreamArray <filename>fileName <string>streamName <string by value array>contentArray persistent:<bool> noLoadOnSceneLoad:<bool> append:<bool> persistent default value: true noLoadOnSceneLoad default value: false append default value: false
Creates and sets the content of the specified CustomFileStream in the specified file to the specified array of strings, setting the corresponding private flag values if it is a new stream. If the stream already exists, its contents are replaced unless append:true is specified, in which case the specified array of strings is appended to the current contents. Returns false if the file exists but cannot be opened with write access. If the specified file does not exist or if it does not support custom file stream storage, an exception is thrown. If appending and the stream has existing string content (not an array), an exception is thrown.
<DWORD>getStreamFlags <filename>fileName <string>streamName getPrivate:<bool> getPrivate default value: false
Returns the flag value of the specified CustomFileStream in the specified file. If the specified file does not exist, if it does not support custom file stream storage, or if the named CustomFileStream does not exist, an exception is thrown.
<bool>setStreamFlags <filename>fileName <string>streamName <DWORD>flags setPrivate:<bool> setPrivate default value: false
Sets the flag value of the specified CustomFileStream in the specified file. Returns false if the file exists but cannot be opened with write access. If the specified file does not exist, if it does not support custom file stream storage, or if the named CustomFileStream does not exist, an exception is thrown.
<bool>isStreamDataAnArray <filename>fileName <string>streamName
Returns true if the content of the specified CustomFileStream in the specified file is an array of strings. If the specified file does not exist, if it does not support custom file stream storage, or if the named CustomFileStream does not exist, an exception is thrown.