A two layer cross fade
A user pin must also be created
The code for this macro is below
-- The purpose of this macro is to create a simple two-layer crossfader, controlled by a single user pin. Using a MacroManager User Pin, we can set the values of Layer 1 and 2 to be inversely related to the user pin, such that the user pin acts as a sort of A/B mix handle. -- Declare host variable host = host or HippoNet.LocalHost -- Find Engine and MacroManager components on host engine = engine or host:FindComponent("Engine") -- Find level pins for Layer 1 and 2 on Mix 1 l1_level = l1_level or engine:FindPin("Mix1/Layer1/Mixer/Level") l2_level = l2_level or engine:FindPin("Mix1/Layer2/Mixer/Level") -- Establish relationship between fader pin and layers l1_level.Value = 1 - UserPins["CrossFader"] l2_level.Value = UserPins["CrossFader"]
Thanks for your feedback.