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:

<float>GetVersion()

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

OpenEXR Saver

<float>GetSaveExponent()

Returns the Exponent value used by the OpenEXR Saver.

<void>SetSaveExponent <float>exponent

Sets the Exponent value used by the OpenEXR Saver.

<bool>GetSavePreMultAlpha()

Returns the state of the Pre-Multiply Alpha option.

<void>SetSavePreMultAlpha <bool>PreMultEnabled

Sets the state of the Pre-Multiply Alpha option.

<bool>GetSaveRed()

Returns the state of the Save Red Channel option.

<void>SetSaveRed <bool>saveRed

Sets the state of the Save Red Channel option.

<integer>GetSaveGreen()

Returns the state of the Save Green Channel option.

<void>SetSaveGreen <bool>saveGreen

Sets the state of the Save Green Channel option.

<integer>GetSaveBlue()

Returns the state of the Save Blue Channel option.

<void>SetSaveBlue <bool>saveBlue

Sets the state of the Save Blue Channel option.

<bool>GetSaveAlpha()

Returns the state of the Save Alpha option.

<void>SetSaveAlpha <bool>saveAlpha

Sets the state of the Save Alpha option.

<integer>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"

<void>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"

<integer>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)

<void>SetSaveCompressionType <integer>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.

<void>SetSaveUseExponent <bool>saveUseExponent

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

<bool>GetSaveUseRealPix()

Returns whether to save using RealPixel format.

<void>SetSaveUseRealPix <bool>saveUseRealPix

Sets whether to save using RealPixel format.

<bool>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.

<void>SetSaveUseDefaults <bool>UseSaveDefaults

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

<integer>GetSaveUseFrameNumDigits()

 

<void>SetSaveUseFrameNumDigits <integer>useFrameNumDigits

 

<integer>GetSaveFrameNumDigits()

 

<void>SetSaveFrameNumDigits <integer>frameNumDigits

 

<integer>GetNetServerSaveOverrideParams()

 

<void>SetNetServerSaveOverrideParams <integer>NetServerSaveOverrideEnable

 

OpenEXR Loader

<integer>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)

<void>SetLoadStorageFormat <integer>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)

<bool>GetLoadDoColorTransform()

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

<void>SetLoadDoColorTransform <bool>doLoadColorTransform

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

<float>GetLoadExponent()

Returns the Exponent value used by the OpenEXR Loader.

<void>SetLoadExponent <float>exponent

Sets the Exponent value used by the OpenEXR Loader.

<float>GetLoadBlackPoint()

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

<void>SetLoadBlackPoint <float>blackPoint

Sets the Bloack Point value in the OpenEXR Loader.

<float>GetLoadWhitePoint()

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

<void>SetLoadWhitePoint <float>whitePoint

Sets the White Point value in the OpenEXR Loader.

<float>GetLoadRGBLevel()

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

<void>SetLoadRGBLevel <float>rgbLevel

Sets the RGB Level value in the OpenEXR Loader.

<float>GetLoadRGBOffset()

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

<void>SetLoadRGBOffset <float>rgbOffset

Sets the RGB Offset value in the OpenEXR Loader.

<integer>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.

<void>SetLoadUseDefaults <bool>UseLoadDefaults

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

<integer>GetNetServerLoadOverrideParams()

 

<void>SetNetServerLoadOverrideParams <integer>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.

<integer>AddAttrib <enum>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.

<boolean>RemoveAttrib <integer>Index

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

<void>RemoveAllAttribs()

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

<integer>GetAttribIndex <enum>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.

<integer>GetNumAttribs()

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

<enum>GetAttribType <integer>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.

 

<string>GetAttribFileTag <integer>Index

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

<boolean>SetAttribFileTag <integer>Index <string>File Tag

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

 

<boolean>IsAttribActive <integer>Index

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

<boolean>SetAttribActive <integer>Index <boolean>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).

 

<string>GetAttribContent <integer>Index

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

<boolean>SetAttribContent <integer>Index <string>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!

 

 

<integer>AddChannel <enum>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.

<boolean>RemoveChannel <integer>ChannelIndex

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

<void>RemoveAllChannels()

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

<integer>GetChannelIndex <enum>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.

<integer>GetNumChannels()

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

<enum>GetChannelType <integer>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.

 

<string>GetChannelFileTag <integer>Index

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

<boolean>SetChannelFileTag <integer>Index <string>File Tag

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

 

<boolean>IsChannelActive <integer>Index

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

<boolean>SetChannelActive <integer>Index <boolean>State

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

 

<enum>GetChannelDataType <integer>Index

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

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

<boolean>SetChannelDataType <integer>Index <enum>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