Implementation

 
 
 

A custom Fx operator is written as a set of pre-defined user functions which define the setup and rendering of an effect. These fall into three main areas:

These user functions communicate with the main body of code via an interface library of support functions. The UFO code is compiled and linked into a Dynamic Shared Object (.so) or Dynamically Linked Library (.dll) which is loaded into Softimage at run-time.

The symbols for the pre-defined functions are searched for in the custom Fx operator and their addresses are tabulated for future calling. The final appearance when the operator is run is as if the functions were directly linked into the product.

The interface library is written with C binding for which the following header files are supplied:

The user functions are:

Function

Description

ufoProcessDefine

process definition and initialization

ufoProcessCopyUserData

user data copy

ufoProcessDeleteUserData

user data delete

ufoProcessPreSequenceRender

pre-render sequence

ufoProcessPostSequenceRender

post-render sequence

ufoProcessCanAvoidRendering

pre-frame render function to determine if rendering can be avoided

ufoProcessPreRender

pre-render

ufoProcessPostRender

post-render

ufoProcessPreRenderPass

pre-render pass

ufoProcessPostRenderPass

post-render pass

ufoProcessRenderPixel

pixel render

ufoProcessRenderLine

line render

ufoProcessRenderRectangle

rectangle render

ufoProcessCalcDefinedRectangle

calculate rectangle which can be rendered to output(s)

ufoProcessCalcNeedRectangles

calculate rectangles which are required from inputs

ufoProcessCalcDefinedPixelType

calculate the "best" pixel type given the supplied input pixel types

ufoProcessSpecifyConvertPixelTypes

specify input and output pixel type conversions

ufoProcessParamsEdited

callback routine on parameter edits; can also set other parameters to be changed too

ufoEditorBeginViewerEditing

Called when a process is being edited in a viewer, redraw and mouse callbacks can be expected to be called.

UfoEditorEndViewerEditing

Called when a process is no longer being edited in a viewer.

ufoEditorRGBDraw

draw into RGB plane of screen

ufoEditorOverlayDraw

draw into overlay plane of screen

ufoEditorMouseDown

process mouse button down event onscreen

ufoEditorMouseUp

process mouse button up event onscreen

ufoEditorMouseDrag

process mouse drag onscreen

ufoEditorMousePosition

process mouse move (no buttons down) event onscreen

ufoEditorKeyEvent

process key event onscreen

ufoEditorSetParamGroup

set/change parameter group to be drawn or displayed in GUI

The minimum requirement is that an operator defines ufoProcessDefine, and one of the following: ufoProcessRenderPixel, ufoProcessRenderLine and ufoProcessRender-Rectangle. If this requirement is not met, then the operator process cannot be used and will not appear in Fx tree.

The minimum requirement for screen interaction is that an operator defines ufoEditorCreate, and one of the following: ufoEditorRGBDraw, ufoEditorOverlayDraw, ufoEditorMouseDown, ufoEditorMouseUp, ufoEditorMouseDrag, ufoEditorMousePosition, and ufoEditorKeyEvent.

The minimum requirement for a user-defined X Motif GUI is that anoperator defines both ufoEditorCreate and ufoEditorUpdateGui.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License