NEW in 3ds Max 2019: The
CustomSceneStreamManager interface is used to query, add, modify and remove
CustomFileStreams in the current 3ds Max scene file.
Interfaces > Core Interfaces > CustomSceneStreamManager |
Custom file streams have three flags that determine how they are handled by the CustomFileStreamManager:
Because the CustomSceneStreamManager code may be loaded and invoked at different times, depending on system configuration, the order in which it and other 3ds Max components will receive file operation notifications can be unpredictable. For this reason, you should use the interface's methods for registering callbacks if you need to operate on the CustomSceneStreamManager itself, or on the scene file (such as copying and storing it).
Properties:
.numEntries : integer : Read
The number of entries in the CustomSceneStreamManager's cache.
.locked : bool : Read|Write
Whether the CustomSceneStreamManager is locked. When locked, the CustomSceneStreamManager does not react to any notifications from 3ds Max. This means that the manager does not automatically load or save data streams.
Methods:
<string>getStreamName <index>index
Returns the name of the stream for the specified cache entry index.
<index>getStreamByName <string>name
Returns the index of the named stream. Throws an exception if the named stream does not exist.
<bool>doesStreamExist <value>which
Returns true if the specified stream exists. The which parameter can be either a stream name or a stream index.
<integer>getStreamFlag <value>which privateFlag:<bool> privateFlag default value: false <void>setStreamFlag <value>which <integer>value privateFlag:<bool> privateFlag default value: false
Gets or sets the specified stream's public or private flags value. The "private" integer contains the persistence, save, and cache flags in the first 3 bits. The remaining bits are reserved for future use. The "public" integer can contain any flags or other data you wish. The which parameter can be either a stream name or a stream index. Throws an exception if the specified stream does not exist.
<bool>isStreamDataAnArray <value>which
Returns true if the specified stream's content is an array of strings. The which parameter can be either a stream name or a stream index. Throws an exception if the specified stream does not exist.
<string>getStreamData <value>which
Returns the specified stream's content as a string. If the content is an array of strings, the first string is returned. The which parameter can be either a stream name or a stream index. Throws an exception if the specified stream does not exist.
<string by value array>getStreamDataAsArray <value>which
Returns the specified stream's content as an array of strings. If the content is a single string, it is returned in a 1 element array. The which parameter can be either a stream name or a stream index. Throws an exception if the specified stream does not exist.
<void>setStreamData <value>which <string>string
Sets the specified stream's content as a string. The which parameter can be either a stream name or a stream index. Throws an exception if the specified stream does not exist.
<void>setStreamDataAsArray <value>which <&string array>string_array string_array is In parameter
Sets the specified stream's content as an array of strings. The which parameter can be either a stream name or a stream index. Throws an exception if the specified stream does not exist. Note: if you store an empty array, isStreamDataAnArray() returns false.
<bool>isStreamPersistent <value>which <void>setStreamPersistent <value>which <bool>persistent
Gets or sets the specified stream is flagged as persistent when written to the scene file. The which parameter can be either a stream name or a stream index. Throws an exception if the specified stream does not exist.
<bool>getSaveNonPersistentStream <value>which <void>setSaveNonPersistentStream <value>which <bool>val
Gets or sets whether the specified stream is flagged as to be written to the scene file even if not flagged as persistent file. The which parameter can be either a stream name or a stream index. Throws an exception if the specified stream does not exist.
<bool>getNoLoadOnSceneLoad <value>which <void>setNoLoadOnSceneLoad <value>which <bool>val
Gets or sets whether the specified stream is flagged as not to be loaded on scene file load when written to the scene file. The which parameter can be either a stream name or a stream index. Throws an exception if the specified stream does not exist.
<void>deleteStream <value>which
Deletes the specified stream. The which parameter can be either a stream name or a stream index.
<index> createStream <string>name persistent:<bool> saveNonPersistentStream:<bool> noLoadOnSceneLoad:<bool> persistent default value: true saveNonPersistentStream default value: true noLoadOnSceneLoad default value: false
Creates a cache entry with the specified name and flag values. The content of the entry will be an empty string. Throws an exception if a cache entry with the same name already exists.
<void>registerCallback <value>callback_fn <value>callback_id <enum>event event enums: {#postLoad|#preSave|#postSave}
Registers a callback function that is called when the corresponding CustomSceneStreamManager event occurs. The callback_id must be a name value. The callback function must take 2 arguments: the first argument is the file name and the second argument is the event type as a name value (#postLoad, #preSave, or #postSave). If an exception occurs while executing a callback function, that function is automatically unregistered.
<void>unregisterCallbacks callback_fn:<value> callback_id:<value> event:<enum> callback_fn default value: undefined callback_id default value: undefined event enums: {#postLoad|#preSave|#postSave} event default value: -1
Unregisters any callback functions that match all the values specified via the keyword arguments.
<value>getCallbacks callback_fn:<value> callback_id:<value> event:<enum> callback_fn default value: undefined callback_id default value: undefined event enums: {#postLoad|#preSave|#postSave} event default value: -1
Returns an array of all callback functions that match all the values specified via the keyword arguments.