MaxOpenEXR Interfaces

The MaxOpenEXR Interface provides access to the Bitmap I/O filter which lets you save and load bitmaps in the OpenEXR file format developed by ILM. Available in 3ds Max 8 and higher.

Constructor

Class instances not creatable by MAXScript

Aliases:

MaxOpenEXR

exrio

MaxOpenEXR interfaces:

Interface: iexrio

Methods:

GetVersion()

Returns the version of the OpenEXR Bitmap I/O plug-in.

OpenEXR Saver

GetSaveExponent()

Returns the Exponent value used by the OpenEXR Saver.

SetSaveExponent exponent

Sets the Exponent value used by the OpenEXR Saver.

<bool>GetSavePreMultAlpha()

Returns the state of the Pre-Multiply Alpha option.

SetSavePreMultAlpha <bool>PreMultEnabled

Sets the state of the Pre-Multiply Alpha option.

<bool>GetSaveRed()

Returns the state of the Save Red Channel option.

SetSaveRed <bool>saveRed

Sets the state of the Save Red Channel option.

GetSaveGreen()

Returns the state of the Save Green Channel option.

SetSaveGreen <bool>saveGreen

Sets the state of the Save Green Channel option.

GetSaveBlue()

Returns the state of the Save Blue Channel option.

SetSaveBlue <bool>saveBlue

Sets the state of the Save Blue Channel option.

GetSaveAlpha()

Returns the state of the Save Alpha option.

SetSaveAlpha <bool>saveAlpha

Sets the state of the Save Alpha option.

GetSaveBitDepth()

Returns the bit depth of the OpenEXR Saver. Possible return values are:

0 - "Integer - 8 bits per channel"

1 - "Half Float - 16 bits per channel"

2 - "Float - 32 bits per channel"

SetSaveBitDepth <integer>saveBitDepth

Sets the bit depth of the OpenEXR Saver.
Possible argument values are:

0 - "Integer - 8 bits per channel"

1 - "Half Float - 16 bits per channel"

2 - "Float - 32 bits per channel"

GetSaveCompressionType()

Returns the compression type used by the OpenEXR Saver.
Possible return values are:

0 - None

1 - Run Length Encoding (RLE)

2 - Zip (per scanline)

3 - Zip (16 scanline block)

4 - PIZ (wavelet compression)

SetSaveCompressionType saveCompressionType

Sets the compression type used by the OpenEXR Saver.
Possible argument values are:

0 - None

1 - Run Length Encoding (RLE)

2 - Zip (per scanline)

3 - Zip (16 scanline block)

4 - PIZ (wavelet compression)

<bool>GetSaveUseExponent()

Returns the state of the Exponent checkbox in the OpenEXR Saver.

SetSaveUseExponent <bool>saveUseExponent

Sets the state of the Exponent checkbox in the OpenEXR Saver.

<bool>GetSaveUseRealPix()

Returns whether to save using RealPixel format.

SetSaveUseRealPix <bool>saveUseRealPix

Sets whether to save using RealPixel format.

GetSaveUseDefaults()

Returns the state of the Use Defaults flag in the OpenEXR Saver. When set to true, the default settings will be used and user-defined settings will be ignored.

SetSaveUseDefaults <bool>UseSaveDefaults

Sets the state of the Use Defaults flag in the OpenEXR Saver.

GetSaveUseFrameNumDigits()

?

SetSaveUseFrameNumDigits useFrameNumDigits

?

GetSaveFrameNumDigits()

?

SetSaveFrameNumDigits frameNumDigits

?

GetNetServerSaveOverrideParams()

?

SetNetServerSaveOverrideParams NetServerSaveOverrideEnable

?

OpenEXR Loader

GetLoadStorageFormat()

Returns the Storage Buffer Format settings in the OpenEXR Loader.
Possible return values are:

0 - Integer - 8 bits/channel (RGB)

1 - Integer - 8 bits/channel (RGBA)

2 - Integer - 16 bits/channel (RGB)

3 - Integer - 16 bits/channel (RGBA)

4 - LogLuv24 Float (RGB)

5 - LogLuv24A Float (RGBA)

6 - LogLuv32 Float (RGB)

7 - RealPixel Float (RGB)

8 - 32bit Floating-Point (RGBA)

SetLoadStorageFormat storageFormat

Sets the Storage Buffer Format settings in the OpenEXR Loader.
Possible argument values are:

0 - Integer - 8 bits/channel (RGB)

1 - Integer - 8 bits/channel (RGBA)

2 - Integer - 16 bits/channel (RGB)

3 - Integer - 16 bits/channel (RGBA)

4 - LogLuv24 Float (RGB)

5 - LogLuv24A Float (RGBA)

6 - LogLuv32 Float (RGB)

7 - RealPixel Float (RGB)

8 - 32bit Floating-Point (RGBA)

GetLoadDoColorTransform()

Returns the state of the Color Transform checkbutton in the OpenEXR Loader.

SetLoadDoColorTransform <bool>doLoadColorTransform

Sets the state of the Color Transform checkbutton in the OpenEXR Loader.

GetLoadExponent()

Returns the Exponent value used by the OpenEXR Loader.

SetLoadExponent exponent

Sets the Exponent value used by the OpenEXR Loader.

GetLoadBlackPoint()

Returns the Bloack Point value in the OpenEXR Loader. Default is 0.0.

SetLoadBlackPoint blackPoint

Sets the Bloack Point value in the OpenEXR Loader.

GetLoadWhitePoint()

Returns the White Point value in the OpenEXR Loader. Default is 1.0.

SetLoadWhitePoint whitePoint

Sets the White Point value in the OpenEXR Loader.

GetLoadRGBLevel()

Returns the RGB Level value in the OpenEXR Loader. Default is 1.0.

SetLoadRGBLevel rgbLevel

Sets the RGB Level value in the OpenEXR Loader.

GetLoadRGBOffset()

Returns the RGB Offset value in the OpenEXR Loader. Default is 0.0.

SetLoadRGBOffset rgbOffset

Sets the RGB Offset value in the OpenEXR Loader.

GetLoadUseDefaults()

Returns the state of the Use Defaults flag in the OpenEXR Loader. When set to true, the default settings will be used and user-defined settings will be ignored.

SetLoadUseDefaults <bool>UseLoadDefaults

Sets the state of the Use Defaults flag in the OpenEXR Loader.

GetNetServerLoadOverrideParams()

?

SetNetServerLoadOverrideParams NetServerLoadOverrideEnable

?

OpenEXR Attributes and Channels

new.gif NEW in 3ds Max 9: In previous releases of 3ds Max, accessing various settings through this Interface used to reset the OpenEXR UI to defaults not found in the Plugcfg/openexr.ini file.

The following 24 new MAXScript methods expose the Attributes and Channels. This way, the OpenEXR output can be completely customized via MAXScript.

AddAttrib Type

Type enums: {#comment|#computerName|#systemTime|#localTime|#versionOpenEXR|#version3dsMax}

new.gif NEW in 3ds Max 9: Add the specified attribute type to the OpenEXR output. Returns the index of the attribute, or 0 if the attribute with this type already existed.

RemoveAttrib Index

new.gif NEW in 3ds Max 9: Removes the indexed attribute from the OpenEXR output. Returns true on success, false otherwise.

RemoveAllAttribs()

new.gif NEW in 3ds Max 9: Removes all attributes from the OpenEXR output.

GetAttribIndex Type

Type enums: {#comment|#computerName|#systemTime|#localTime|#versionOpenEXR|#version3dsMax}

new.gif NEW in 3ds Max 9: Returns the index of the specified attribute type from the OpenEXR output, or 0 if an attribute of this type does not exist.

GetNumAttribs()

new.gif NEW in 3ds Max 9: Returns the number of attributes in the OpenEXR output.

GetAttribType Index

GetAttribType enums: {#comment|#computerName|#systemTime|#localTime|#versionOpenEXR|#version3dsMax}

new.gif NEW in 3ds Max 9: Returns the type of the indexed attributes from the OpenEXR output.

?

GetAttribFileTag Index

new.gif NEW in 3ds Max 9: Returns the file tag of the indexed attribute as a string.

SetAttribFileTag Index File Tag

new.gif NEW in 3ds Max 9: Sets the file tag of the indexed attribute to the specified string.

?

IsAttribActive Index

new.gif NEW in 3ds Max 9: Returns the active state of the indexed attribute.

SetAttribActive Index State

new.gif NEW in 3ds Max 9: Sets the active state of the indexed attribute to the given boolean value. Returns true on success, false on failure (for example if the indexed attribure does not exist).

?

GetAttribContent Index

new.gif NEW in 3ds Max 9: Returns the content of the indexed attribute.

SetAttribContent Index Content

new.gif NEW in 3ds Max 9: Sets the content of the indexed attribute to the given string value.

?

Examples:

exrio.AddAttrib #comment --add a new comment attribute

1 --it will have index 1

exrio.GetAttribContent 1 --check out the content

undefined --there is no content yet

exrio.SetAttribContent 1 "Test 1,2,3" --set the content -

true --the operation succeeded.

exrio.GetAttribContent 1 --get the content again to verify -

"Test 1,2,3" --it is what we told it to be

exrio.AddAttrib #computerName --add another attribute

2 --it will have index 2

exrio.GetNumAttribs() --check the number of attribures -

2 --there are 2 attributes now.

exrio.GetAttribIndex #comment --get the index of the comment

1 --the comment is the first attribute

exrio.GetAttribType 1 --get the type of the first attribute

#comment --it is the comment attribute

exrio.RemoveAttrib 1 --remove the first attribute

true --success!

exrio.GetNumAttribs() --check the number again -

1 --there is one left

exrio.GetAttribIndex #comment --try to get the comment's index

0

exrio.GetAttribType 1 --get the type of the first attribute

#computername

exrio.GetAttribFileTag 1 --get the file tag of the first attribute

"computerName"

exrio.SetAttribFileTag 1 "workstation" --change the file tag

true

exrio.GetAttribFileTag 1 --get the new file tag

"workstation"

exrio.SetAttribContent 1 "my computer" --try to set the content

false --this is a system attribute that cannot be set by the user

exrio.IsAttribActive 1 --check whether it is active -

true --it is!

exrio.SetAttribActive 1 false --deactivate it

true --successfully deactivated

exrio.IsAttribActive 1 --check again -

false --it is off now.

exrio.RemoveAllAttribs() --remove all attributes...

OK

exrio.GetNumAttribs() --check the attribure count -

0 --none left!

?

?

AddChannel Type

Type enums: {#ZBuffer|#objectID|#materialID|#nodeRenderID|#UVCoords|#velocity|#normal|#coverage}

new.gif NEW in 3ds Max 9: Adds a channel of the given type. Returns the index of the channel.

RemoveChannel ChannelIndex

new.gif NEW in 3ds Max 9: Removes the indexed channel. Returns true on success, false othewise.

RemoveAllChannels()

new.gif NEW in 3ds Max 9: Removes all channels.

GetChannelIndex Type

Type enums: {#ZBuffer|#objectID|#materialID|#nodeRenderID|#UVCoords|#velocity|#normal|#coverage}

Returns the index of the channel with the specified type. Returns 0 if the channel of the specified type does not exist.

GetNumChannels()

new.gif NEW in 3ds Max 9: Returns the number of channels.

GetChannelType Index

GetChannelType enums: {#ZBuffer|#objectID|#materialID|#nodeRenderID|#UVCoords|#velocity|#normal|#coverage}

new.gif NEW in 3ds Max 9: Returns the type of the indexed channel.

?

GetChannelFileTag Index

new.gif NEW in 3ds Max 9: Returns the file tage of the indexed channel.

SetChannelFileTag Index File Tag

new.gif NEW in 3ds Max 9: Sets the file tage of the indexed channel to the specified string value.

?

IsChannelActive Index

new.gif NEW in 3ds Max 9: Returns true if the indexed channel is active, false otherwise.

SetChannelActive Index State

new.gif NEW in 3ds Max 9: Sets the active state of the the indexed channel to the given boolean value.

?

GetChannelDataType Index

GetChannelDataType enums: {#Uint|#Half|#Float}

new.gif NEW in 3ds Max 9: Returns the data type of the indexed channel.

SetChannelDataType Index DataType

DataType enums: {#Uint|#Half|#Float}

new.gif NEW in 3ds Max 9: Sets the data type of the indexed channel to the specified type.

?

Examples:

exrio.GetNumChannels() --check the number of channels

0 --by default there are none

exrio.AddChannel #ZBuffer --add a Z buffer channel

1 --it will have index 1

exrio.AddChannel #materialID --add a material ID channel

2 --it will have index 2

exrio.GetNumChannels() --check the number of channels again

2 --now we have two

exrio.GetChannelIndex #ZBuffer --get the index of the Z buffer

1 --it is channel 1

exrio.GetChannelIndex #materialID --get the index of the mat. ID

2 --it is channel 2

exrio.GetChannelType 1 --get the type of channel 1

#zBuffer --it is the Z buffer

exrio.GetChannelType 2 --get the type of channel 2

#materialID --it is the material ID

exrio.GetChannelFileTag 1 --get the file tag of channel 1

"Z" --the file tag is "Z"

exrio.GetChannelFileTag 2 --get the file tag of channel 2

"materialID" --the file tag is "materialID"

exrio.SetChannelFileTag 1 "Z-Buffer" --set the file tag of channel 1

true --the operation was successful

exrio.GetChannelFileTag 1 --get the file tag of channel 1 again

"Z-Buffer" --it was changed as requested

exrio.IsChannelActive 1 --see whether the channel 1 is active

true --it is

exrio.SetChannelActive 1 false --deactivate channel 1

true --it was deactivated successfully

exrio.IsChannelActive 1 --check again the active state...

false --now it is deactivated

exrio.GetChannelDataType 1 --get the data type of channel 1

#Half --it is Half Float

exrio.GetChannelDataType 2 --get the data type of channel 2

#Uint --it is Unsigned Integer

exrio.SetChannelDataType 1 #Float --change channel 1 to Float type

true --change was successful

exrio.GetChannelDataType 1 --check the new type to verify

#float --it is indeed Float type now.

exrio.RemoveChannel 1 --remove the first channel

true --removal was a success

exrio.GetChannelType 1 --get the type of the new channel 1

#materialID --it is the previous channel 2

exrio.RemoveAllChannels() --remove all channels

OK

exrio.GetNumChannels() --and check the number of channels

0 --all have been removed!

See also

BitmapIO Classes