Interface: CustomFileStream
The CustomFileStream
interface is used to query, add, modify and remove CustomFileStream
s from an external scene file. Available in 3ds Max 2019 and higher. CustomFileStream
s 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.
Methods:
<string 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.
<boolean>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.
<boolean> 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 CustomFileStream
s written by external applications are valid.
<boolean>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.
<string>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.
<boolean>writeStream <filename>fileName
<string>streamName <string>content
persistent:<boolean> noLoadOnSceneLoad:<boolean>
append:<boolean>
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.
<string 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.
<boolean>writeStreamArray <filename>fileName
<string>streamName <string array>contentArray
persistent:<boolean> noLoadOnSceneLoad:<boolean>
append:<boolean>
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.
<integer>getStreamFlags <filename>fileName
<string>streamName getPrivate:<boolean>
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.
<boolean>setStreamFlags <filename>fileName
<string>streamName <integer>flags
setPrivate:<boolean>
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.
<boolean>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.