Eyeon:Script/Reference/Applications/Fuse/Classes/ScriptOperator/BeginControlNest

From VFXPedia

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

Contents


Summary

The BeginControlNest function is found in the Create portion of a Fuse tool. It is used to create a control nest enclosing one or more controls within the tool into a collapsible section. All controls specified after the BeginControlNest function is called will be included in the nested section, until the EndControlNest function is called to close the nest.

Usage

self:BeginControlNest(string controlname, string scriptname, boolean is_expanded, table taglist)

controlname (string, required)
The label applied to the control nest in the tools Controls.
scriptname (string, required)
The name used to access the control via scripting.
is_expanded (boolean, required)
A boolean value which specifies whether the nest should default to open or closed when created. Set to false if the nest should be closed.
taglist (table, required)
Optional taglist arguments that further affect the behavior of this control. Currently undocumented. Use an empty table for this argument.

Example

The following example shows a control nest called Velocity Controls which encloses two slider controls. It is a truncated version of the example ParticleEmitterTest.Fuse

	self:BeginControlNest("Velocity Controls", "VelocityControls", false, {})
		InVelocity = self:AddInput("Velocity", "Velocity", {
			LINKID_DataType = "Number",
			INPID_InputControl =  "SliderControl",
			INP_Default =       0.0,
			INP_MinScale =      0.0,
			INP_MaxScale =      1.0,
			})
 
		InVelocityVar = self:AddInput("Velocity Variance", "VelocityVariance", {
			LINKID_DataType = "Number",
			INPID_InputControl =  "SliderControl",
			INP_Default =       0.0,
			INP_MinScale =      0.0,
			INP_MaxScale =      1.0,
			})
	self:EndControlNest()


Tips for BeginControlNest (edit)

  • A ControlNest is just a LabelControl with a dropdown button that shows/hides a certain number of inputs that follow. This means, you can save what is returned by self:BeginControlNest() and hide the dropdown button of the ControlNest by setting IC_Visible to false. Unfortunately, this will not automatically hide all inputs inside the ControlNest. You have to do this yourself. The upside of this is that you can now indent a number of controls using a hidden control nest:
-- hide by default:
InTestNest = self:BeginControlNest("Nest1", "Nest1", true, {IC_Visible = false})
   -- indented controls go here...
self:EndControlNest
-- show dropdown button again
InTestNest:SetAttrs({IC_Visible = true})
  • The little pick buttons that had been introduced for 3D positions in Fusion 6.14 can also be added to a ControlNest. You have to add LBLC_PickButton = true as an attribute to add a pick button that feeds its values to all the inputs inside the ControlNest. Each input needs an appropriate IC_ControlID parameter that defines which channel of the image gets picked (a list of channel numbers can be found here). This is an example for picking XYZ position values:
self:BeginControlNest("Something", "SomethingNest", true, {LBLC_PickButton = true });
 
   Input1 = self:AddInput("X Offset", "XOffset", {
       LINKID_DataType = "Number",
       INPID_InputControl = "SliderControl",
       IC_ControlID = 25 })
   Input2 = self:AddInput("Y Offset", "YOffset", {
       LINKID_DataType = "Number",
       INPID_InputControl = "SliderControl",
       IC_ControlID = 26 })
   Input3 = self:AddInput("Z Offset", "ZOffset", {
       LINKID_DataType = "Number",
       INPID_InputControl = "SliderControl",
       IC_ControlID = 27 })
self:EndControlNest()