Eyeon:Script/Reference/Applications/Fusion/Classes/Object/SetData

From VFXPedia

Jump to: navigation, search

Contents

Object : SetData

Arguments

SetData(name, value)

  • name (required, string)

This is the name of the attribute to set. As of 5.1, this name can be in "table.subtable" format, to allow setting persistent data within subtables.

  • value (required, number|string|boolean|table)

This is the value to be recorded in the object's persistent data. It can be of almost any type.

Returns

Nothing is returned.

Remarks

Persistent data is a very useful way to store names, dates, filenames, notes, flags, or anything else, in such a way that they are permanently associated with this instance of the object, and are stored along with the object. This data can be retrieved at any time by using GetData().

The method of storage varies by object: SetData() called on the Fusion app itself will save its data in the Fusion.prefs file, and will be available whenever that copy of Fusion is running. Calling SetData() on any object associated with a Composition will cause the data to be saved in the .comp file, or in any settings files that may be saved directly from that object. Some ephemeral objects that are not associated with any composition and are not otherwise saved in any way, may not have their data permanently stored at all, and the data will only persist as long as the object itself does.

Requirements

  • eyeonScript 5.0
  • Fusion 5.0

Examples

tool:SetData("Modified.Author", fusion:GetEnv("USERNAME"))
tool:SetData("Modified.Date", os.date())


Tips for SetData (edit)

You can use SetData to add a key called HelpPage to any tool. Its value can be a URL to a web page (for example a link to a page on Vfxpedia) and will override this tool's default help when the user presses F1 (requires Fusion 6.31 or later). It's most useful for macros.

Background1:SetData("HelpPage", "http://www.vfxpedia.com")