Eyeon:Script/Reference/Applications/Fuse/Functions/FuRegisterClass

From VFXPedia

Jump to: navigation, search

Contents

Summary

The FuRegisterClass function is executed when Fusion first loads the Fuse tool or ScriptViewShader. The arguments to this function provide Fusion with the information needed to properly present the tool for use by the artist. Fusion must be restarted before edits made to this function will take effect.

The FuRegisterClass function is required for all Fuse tools and ScriptViewShaders, and generally appears as the first few lines of the Fuse script.


Usage

FuRegisterClass(string name, enum ClassType, table attributes)


Returns

This event function does not return a value.


Arguments

name(string, required)

The name argument is a unique identifier that is used to identify the plugin to Fusion. It is also used as the base for the tool's default name. For example, the first instance a ScriptPlugin with the name 'Bob' would be added to the flow as Bob1.

Note : The name should use only characters between A-Z, 0-9 and the underscore, and should not start with a number. For example, a Fuse named sample-tool would appear to work, but would actually create compositions which can not be re-opened.


ClassType (enum, required)

The ClassType is a predefined variable which identifies the type of Fuse for Fusion. Some valid values for the ClassType are :

  • CT_Tool
  • CT_ParticleTool
  • CT_SourceTool
  • CT_Modifier
  • CT_ViewLUTPlugin

attributes (table, required)

The attributes table defines all the remaining options needed to define a Fusion tool. There are a wide variety of possible attributes, and not all are required. The following table lists the most common attributes, and their expected values. A more comprehensive list can be found at FuRegisterClass Attributes.

REGS_Category
Required. A string value which sets the category a tool will appear in. For example, REGS_Category = "Script" will place the tool in the Scripts category of the tool menu. If the category does not exist, it will be created to hold the tool. Nested Categories can be defined using a \ character as a seperator. For example, REGS_Category = "Script\\Color" will create a Color category under the Script category of the tool menu. Remember to use \\ instead of \ in a regular string, as \ is considered an escape character unless the [[]] syntax is used.
REGS_OpIconString
Required. A string value that defines the abbrieviation of the tools name. This is used in the toolbar menu and by the bins.
REGS_OpDescription
Required. A short description of the tool, used in the various parts of the Fusion interface.
REGS_Name
Optional. Only needed if the ViewShader's displayed name is different to its unique ID.

Examples

The following shows the FuRegisterClass function used to create a Source tool called SourceTest (ST) which will appear in the Script category.

FuRegisterClass("SourceTest", CT_SourceTool, {
	REGS_Category = "Script",
	REGS_OpIconString = "ST",
	REGS_OpDescription = "Source Test",
	REG_OpNoMask = true,
	REG_NoBlendCtrls = true,
	REG_NoObjMatCtrls = true,
	REG_NoMotionBlurCtrls = true,
	
	REG_Source_GlobalCtrls = true,
	REG_Source_SizeCtrls = true,
	REG_Source_AspectCtrls = true,
	REG_Source_DepthCtrls = true,
	
	REG_TimeVariant = true,
	})

Here is the declaration of a simple ViewShader called OverlayFuse:

FuRegisterClass("OverlayFuse", CT_ViewLUTPlugin, {		-- ID must be unique
	REGS_Name = "Overlay Fuse",
	})