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.
#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>
Public Member Functions | |
Framebuffer () | |
~Framebuffer () | |
Framebuffer (const CRef &in_ref) | |
Framebuffer (const Framebuffer &in_obj) | |
bool | IsA (siClassID in_ClassID) const |
siClassID | GetClassID () const |
Framebuffer & | operator= (const Framebuffer &in_obj) |
Framebuffer & | operator= (const CRef &in_ref) |
RenderChannel | GetRenderChannel () |
CString | GetResolvedPath (const CTime &in_rTime) |
CString | GetResolvedPath () |
CStringArray | GetFormats () |
CStringArray | GetDataTypes () |
CLongArray | GetBitDepths () |
XSI::siImageBitDepth | GetDisplayBitDepth () |
CString | GetResolvedPath (const CTime &in_rTime, const CRef &in_rCtx) |
CString | GetResolvedPath (const CRef &in_rCtx) |
Framebuffer | ( | ) |
Default constructor.
~Framebuffer | ( | ) |
Default destructor.
Framebuffer | ( | const CRef & | in_ref | ) |
Constructor.
in_ref | constant reference object. |
Framebuffer | ( | const Framebuffer & | in_obj | ) |
Copy constructor.
in_obj | constant class object. |
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
in_ClassID | class type. |
Reimplemented from ProjectItem.
siClassID GetClassID | ( | ) | const [virtual] |
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.
in_obj | constant class 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.
in_ref | constant class 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.
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.
in_rTime | The time to resolve the path template at. |
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.
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.
CStringArray GetDataTypes | ( | ) |
Returns a list of the available output data types for the image output file format selected for this framebuffer.
CLongArray GetBitDepths | ( | ) |
Returns a list of the available bit depths for the selected output data type for this framebuffer.
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.
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.
in_rTime | The time to resolve the path template at. |
in_rCtx | The renderer context given, used to resolve context specific tokens such as the current camera used |
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.
in_rCtx | The renderer context given, used to resolve context specific tokens such as the current camera used |