Public Member Functions
Framebuffer Class Reference

Detailed Description

The Framebuffer object controls the file output of a RenderChannel object. It can be created using the Pass::CreateFramebuffer function.

The framebuffer format can be selected from the list of formats provided by the rendering engine selected on the framebuffer's Pass object.

See also:
RenderChannel SceneRenderProperty Pass
Since:
6.0
Example:
This example demonstrates how to list all framebuffers from all passes and the resolved paths they point to.
        #include <xsi_project.h>
        #include <xsi_scene.h>
        #include <xsi_pass.h>
        #include <xsi_passcontainer.h>
        #include <xsi_framebuffer.h>
        #include <xsi_parameter.h>
        #include <xsi_time.h>
        using namespace XSI;

        // Helpers
        void ListPasses()
        {
            Application xsi = Application();
            CRefArray passes = xsi.GetActiveProject().GetActiveScene().GetPasses();
            xsi.LogMessage(L"# of passes found: "+CString(passes.GetCount()));
            for ( LONG i=0; i<passes.GetCount(); i++ )
            {
                Pass oPass = Pass(CRef(passes[i]));
                xsi.LogMessage( L"Pass '"  + oPass.GetName() + L"': " );

                CRefArray buffers = oPass.GetFramebuffers();
                xsi.LogMessage(L"# of buffers found: "+CString(buffers.GetCount()));
                for( LONG j=0; j<buffers.GetCount(); j++ )
                {
                    Framebuffer oFramebuffer = Framebuffer(CRef(buffers[j]));
                    xsi.LogMessage( L"Framebuffer '" + oFramebuffer.GetName() + L"' writes to '" +
                        oFramebuffer.GetResolvedPath(CTime()) + L"'" );
                }
            }
        }

        CValue NewScene( const CString& in_ProjectPathName, const bool& in_Confirm )
        {
            CValueArray args(2);
            CValue retval;

            args[0]= in_ProjectPathName;
            args[1]= in_Confirm;

            Application app;
            CStatus st = app.ExecuteCommand( L"NewScene", args, retval );

            return retval;
        }

        Application app = Application();
        NewScene( L"", false );
        Scene oScene = app.GetActiveProject().GetActiveScene();
        Pass oNewPass = oScene.GetPassContainer().AddPass( L"", L"" );
        Framebuffer oDiffuseBuffer = oNewPass.CreateFramebuffer( L"Diffuse" );
        oDiffuseBuffer.PutParameterValue(L"FileName", L"diffuse.[Frame #4]");

        // Invoke the ListPasses( ) function
        ListPasses( );

        // Expected results:
        // INFO : Pass 'Default_Pass':
        // INFO : Framebuffer 'Main' writes to '<factorypath>\Data\XSI_SAMPLES\Render_Pictures\Default_Pass_Main.1.pic'

#include <xsi_framebuffer.h>

Inheritance diagram for Framebuffer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Framebuffer ()
 ~Framebuffer ()
 Framebuffer (const CRef &in_ref)
 Framebuffer (const Framebuffer &in_obj)
bool IsA (siClassID in_ClassID) const
siClassID GetClassID () const
Framebufferoperator= (const Framebuffer &in_obj)
Framebufferoperator= (const CRef &in_ref)
RenderChannel GetRenderChannel ()
CString GetResolvedPath (const CTime &in_rTime)
CString GetResolvedPath ()
CStringArray GetFormats ()
CStringArray GetDataTypes ()
CLongArray GetBitDepths ()
XSI::siImageBitDepth GetDisplayBitDepth ()

Constructor & Destructor Documentation

Default constructor.

Default destructor.

Framebuffer ( const CRef in_ref)

Constructor.

Parameters:
in_refconstant reference object.
Framebuffer ( const Framebuffer in_obj)

Copy constructor.

Parameters:
in_objconstant class object.

Member Function Documentation

bool IsA ( siClassID  in_ClassID) const [virtual]

Returns true if a given class type is compatible with this API class.

Parameters:
in_ClassIDclass type.
Returns:
true if the class is compatible, false otherwise.

Reimplemented from ProjectItem.

siClassID GetClassID ( ) const [virtual]

Returns the type of the API class.

Returns:
The class type.

Reimplemented from ProjectItem.

Framebuffer& operator= ( const Framebuffer in_obj)

Creates an object from another object. The newly created object is set to empty if the input object is not compatible.

Parameters:
in_objconstant class object.
Returns:
The new Framebuffer object.
Framebuffer& operator= ( const CRef in_ref)

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:
in_refconstant class object.
Returns:
The new Framebuffer object.

Reimplemented from ProjectItem.

RenderChannel GetRenderChannel ( )

Returns the RenderChannel this Framebuffer represents. All rendering takes place in a render channel and is output to disk by the framebuffer object.

Returns:
The RenderChannel object.
See also:
RenderChannel siRenderChannelType
CString GetResolvedPath ( const CTime in_rTime)

Takes the output file name path template given in the framebuffer and resolves it, for the specified time, into a real path name and returns it as a CString. See section "Output Path Templates" in the Softimage User Guide for more details.

The in_rTime parameter controls the result of the [Frame] and [Field] tokens.

Parameters:
in_rTimeThe time to resolve the path template at.
Returns:
The resolved file name path template at the given time.
See also:
Pass::GetResolvedArchivePath XSIUtils.ResolveTokenString
Since:
6.01
CString GetResolvedPath ( )

Takes the output file name path template given in the framebuffer and resolves it into a time-independent path, where any instance of [Frame] is substituted with the a sequence of '#' symbols, that represent the current frame number and padding width. See section "Output Path Templates" in the Softimage User Guide for more details.

Returns:
The time-independent resolved file name path template.
See also:
Pass::GetResolvedArchivePath XSIUtils.ResolveTokenString
Since:
6.01
CStringArray GetFormats ( )

Returns a list of the available image output file formats that can be set for this framebuffer. The format selection is dependent on the current rendering engine and the channel type of the RenderChannel object represented by this framebuffer.

Returns:
A list of format extensions corresponding to the image file formats available to this framebuffer.
See also:
RenderChannel siRenderChannelType
CStringArray GetDataTypes ( )

Returns a list of the available output data types for the image output file format selected for this framebuffer.

Returns:
An array of data types for the selected image output format. Although the data type can be any string, many of them are predefined in siImageDataType.
See also:
RenderChannel siRenderChannelType siImageDataType
CLongArray GetBitDepths ( )

Returns a list of the available bit depths for the selected output data type for this framebuffer.

Returns:
A list of siImageBitDepth values available for the selected output data type.
See also:
RenderChannel siRenderChannelType siImageDataType siImageBitDepth
XSI::siImageBitDepth GetDisplayBitDepth ( )

Returns the bit depth to use for returning color data back to Softimage for display at render time. This value will be passed to RendererImageFragment::GetScanlineRGBA when Softimage asks for image fragment data.

Returns:
A color bit depth for display data.
See also:
RendererImageFragment
Since:
7.0

The documentation for this class was generated from the following file: