Eyeon:Script/Reference/Applications/Fuse/Classes/Output/Set

From VFXPedia

< Eyeon:Script | Reference | Applications | Fuse | Classes | Output
Revision as of 07:02, 4 September 2007 by Peter (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents


Summary

The Set function is used to assign a specific image in memory to the Output. Typically this is the last step in a Process event before a tool is done rendering.

Usage

Output:Set(object request, object image)

request (object, required)
The Request object is always passed to the Process event function as an argument. See the pages for the Request object and Process event function for more information.
image (object, required)
This argument should be set to an image which will be used as the final output for the tool.

Example

Virtually all Fuse tools use this function. See any of the Example Fuses for details. The following is the complete source code for Null.Fuse.

    FuRegisterClass("Null", CT_Tool, {
        REGS_Category = "Script",
        REGS_OpIconString = "Nul",
        REGS_OpDescription = "Null Tool",
        REG_OpNoMask = true,
        REG_NoBlendCtrls = true,
        REG_NoObjMatCtrls = true,
        REG_NoMotionBlurCtrls = true,
        })
 
    function Create()
 
        InBlank = self:AddInput(" ", "Blank", {
            INPID_InputControl = "LabelControl",
            INP_External = false,
            })            
 
        InImage = self:AddInput("Input", "Input", {
            LINKID_DataType = "Image",
            LINK_Main = 1,
            })
 
        OutImage = self:AddOutput("Output", "Output", {
            LINKID_DataType = "Image",
            LINK_Main = 1,
            })                
    end
 
    function Process(req)
        OutImage:Set(req, InImage:GetValue(req))
    end


Tips for Set (edit)

  • While image outputs are the most common ones, you can of course create Outputs for numbers or strings as well. In this case, you would have to set LINKID_DataType correctly and pass a Number or Text object to the Set() method. See the Lines Fuse for an example of a second output which takes a Point object. Your own precalc handling is necessary in this case since by default, Fusion will only pass the main image input to the main image output.