Basic macro question: how to hide stuff manually?

User avatar
ShadowMaker SdR
Fusionista
Posts: 486
Joined: Sun Sep 21, 2014 6:17 am
Been thanked: 30 times

Basic macro question: how to hide stuff manually?

#1

Post by ShadowMaker SdR » Sat Feb 03, 2018 2:36 pm

Hi, I'm still trying to wrap my head about user controls and how they can be used to control stuff in macros.
So I'm building a very basic - and not very useful - macro.

It's basically a B/C tool with only a gain slider that's animated with a shake.
Now I thought it'd be fun if I had a on-screen widget to control the min/max values of the shake.
So I managed to create a macro with a circular position control where the x/y values affect the min/max values of the shake.
Yes. It works.

But...for now I only want the on-screen widget to be part of the GUI. So I want to hide the internals from the viewer.
How do I do this? I've only found info on *adding* user controls, not hiding stuff.
The main advice is: don't use the built-in macro-editor if you can avoid it, but it's the only place where I can check whether or not controls appear.
But when I uncheck the expression controlled controls they seem to disappear completely.

Any tips will be greatly appreciated.

  1. [c]{
  2.     Tools = ordered() {
  3.         ShakingGain = MacroOperator {
  4.             CtrlWZoom = false,
  5.             Inputs = ordered() {
  6.                 MainInput1 = InstanceInput {
  7.                     SourceOp = "BrightnessContrast1",
  8.                     Source = "Input",
  9.                 },
  10.                 Input2 = InstanceInput {
  11.                     SourceOp = "BrightnessContrast1",
  12.                     Source = "Gain",
  13.                     Default = 1,
  14.                 },
  15.                 Input3 = InstanceInput {
  16.                     SourceOp = "Shake1",
  17.                     Source = "Smoothness",
  18.                     Default = 2.78,
  19.                 },
  20.                 Input4 = InstanceInput {
  21.                     SourceOp = "Shake1",
  22.                     Source = "LockXY",
  23.                     Default = 1,
  24.                 },
  25.                 Input5 = InstanceInput {
  26.                     SourceOp = "Shake1",
  27.                     Source = "XMinimum",
  28.                     Expression = "VisualSmoothness.X",
  29.                     Default = 0,
  30.                 },
  31.                 Input6 = InstanceInput {
  32.                     SourceOp = "Shake1",
  33.                     Source = "XMaximum",
  34.                     Expression = "VisualSmoothness.Y",
  35.                     Default = 1,
  36.                 },
  37.                 Input7 = InstanceInput {
  38.                     SourceOp = "Shake1",
  39.                     Source = "YMinimum",
  40.                     Default = 0,
  41.                 },
  42.                 Input8 = InstanceInput {
  43.                     SourceOp = "Shake1",
  44.                     Source = "YMaximum",
  45.                     Default = 1,
  46.                 },
  47.                 VisualSmoothness = Input { Value = { 0.521084337349398, 0.516071428571429 }, },
  48.                 Input1 = InstanceInput {
  49.                     SourceOp = "BrightnessContrast1",
  50.                     Source = "EffectMask",
  51.                 }
  52.             },
  53.             Outputs = {
  54.                 MainOutput1 = InstanceOutput {
  55.                     SourceOp = "BrightnessContrast1",
  56.                     Source = "Output",
  57.                 }
  58.             },
  59.             ViewInfo = GroupInfo { Pos = { 385, 82.5 } },
  60.             Tools = ordered() {
  61.                 BrightnessContrast1 = BrightnessContrast {
  62.                     CtrlWZoom = false,
  63.                     CtrlWShown = false,
  64.                     Inputs = {
  65.                         Gain = Input {
  66.                             SourceOp = "Shake1",
  67.                             Source = "X",
  68.                         },
  69.                     },
  70.                     ViewInfo = OperatorInfo { Pos = { 0, 10.15 } },
  71.                 },
  72.                 Shake1 = Shake {
  73.                     CtrlWZoom = false,
  74.                     CtrlWShown = false,
  75.                     Inputs = {
  76.                         Smoothness = Input { Value = 2.78, },
  77.                         XMinimum = Input {
  78.                             Value = 0.1,
  79.                             Expression = "VisualSmoothness.X",
  80.                         },
  81.                         XMaximum = Input { Expression = "VisualSmoothness.Y", },
  82.                     },
  83.                 }
  84.             },
  85.             UserControls = ordered() {
  86.                 VisualSmoothness = {
  87.                     LINKS_Name = "VisualSmoothness",
  88.                     LINKID_DataType = "Point",
  89.                     INPID_PreviewControl = "CrosshairControl",
  90.                     INP_DefaultX = 0.5,
  91.                     INP_DefaultY = 0.5,
  92.                     CHC_Style = "Circle",
  93.                     ICS_ControlPage = "Controls"
  94.                 }
  95.             }
  96.         }
  97.     },
  98.     ActiveTool = "ShakingGain"
  99. }[/c]

User avatar
SecondMan
Site Admin
Posts: 2707
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 104 times
Contact:

Re: Basic macro question: how to hide stuff manually?

#2

Post by SecondMan » Sat Feb 03, 2018 2:44 pm

With User Controls (RMB -> Edit Controls) you can not only add controls, you can also remove existing ones.

User avatar
ShadowMaker SdR
Fusionista
Posts: 486
Joined: Sun Sep 21, 2014 6:17 am
Been thanked: 30 times

Re: Basic macro question: how to hide stuff manually?

#3

Post by ShadowMaker SdR » Sat Feb 03, 2018 2:55 pm

SecondMan wrote:
Sat Feb 03, 2018 2:44 pm
With User Controls (RMB -> Edit Controls) you can not only add controls, you can also remove existing ones.
How do you do that? Is that in the manual somewhere? Because if I set everything to 'none' they still show up. And I can't find a 'delete button'.

User avatar
Midgardsormr
Fusionista
Posts: 745
Joined: Wed Nov 26, 2014 8:04 pm
Location: Los Angeles, CA, USA
Been thanked: 76 times
Contact:

Re: Basic macro question: how to hide stuff manually?

#4

Post by Midgardsormr » Sat Feb 03, 2018 3:21 pm

I think the ability to hide controls with Edit Controls went away in Fusion 9. However, in this case, I think all you need to do is to open the macro in a text editor and delete all of the Instanced Inputs except for MainInput1, VisualSmoothness and Input1. The inputs still exist on the BC inside the group, but only the Crosshair control will be visible on screen.

It seems to work just fine for me after I've done that.

Cool idea, too!

User avatar
SecondMan
Site Admin
Posts: 2707
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 104 times
Contact:

Re: Basic macro question: how to hide stuff manually?

#5

Post by SecondMan » Sat Feb 03, 2018 4:43 pm

Really? That went away?

Time for Suck Less User Controls Plus then... :D

User avatar
Midgardsormr
Fusionista
Posts: 745
Joined: Wed Nov 26, 2014 8:04 pm
Location: Los Angeles, CA, USA
Been thanked: 76 times
Contact:

Re: Basic macro question: how to hide stuff manually?

#6

Post by Midgardsormr » Sat Feb 03, 2018 7:15 pm

It seems so. I tried to hide some controls a few months ago, and all I could manage to do was to move them onto a different tab. I haven't experimented with trying to override visibility with a text editor. I don't see any reason why that shouldn't still work—you can change other attributes on a control, after all.

I've been thinking that a new User Controls script would be a good thing anyway given that there are a few control types and options that aren't present in the existing command.

User avatar
SecondMan
Site Admin
Posts: 2707
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 104 times
Contact:

Re: Basic macro question: how to hide stuff manually?

#7

Post by SecondMan » Sat Feb 03, 2018 7:38 pm

One of the things I've always wanted to try to write is a kind of UI builder for Fuses and Macros with a live preview. Just see it being built as you either write it click options. So a view with all the options like User Controls, a text editor on the side, and a mock UI view in a separate panel.

User avatar
Midgardsormr
Fusionista
Posts: 745
Joined: Wed Nov 26, 2014 8:04 pm
Location: Los Angeles, CA, USA
Been thanked: 76 times
Contact:

Re: Basic macro question: how to hide stuff manually?

#8

Post by Midgardsormr » Sat Feb 03, 2018 10:21 pm

Start the clock. I'm guessing less than 36 hours until Andrew has a UI Manager prototype of some kind.

User avatar
ShadowMaker SdR
Fusionista
Posts: 486
Joined: Sun Sep 21, 2014 6:17 am
Been thanked: 30 times

Re: Basic macro question: how to hide stuff manually?

#9

Post by ShadowMaker SdR » Sat Feb 03, 2018 11:36 pm

Midgardsormr wrote:
Sat Feb 03, 2018 3:21 pm
I think the ability to hide controls with Edit Controls went away in Fusion 9. However, in this case, I think all you need to do is to open the macro in a text editor and delete all of the Instanced Inputs except for MainInput1, VisualSmoothness and Input1. The inputs still exist on the BC inside the group, but only the Crosshair control will be visible on screen.

It seems to work just fine for me after I've done that.
This is great. I never realized before that the Instanced Inputs were technically only the GUI part of the tool. I thought they were necessary for the operations to actually be performed. I've done some looking into a lot of the macro posts, but this one never clicked with me.
Cool idea, too!
Thanks. It's not really an idea yet, but it's something I need to do if I'm ever going to make truly useful things. :-)

User avatar
Midgardsormr
Fusionista
Posts: 745
Joined: Wed Nov 26, 2014 8:04 pm
Location: Los Angeles, CA, USA
Been thanked: 76 times
Contact:

Re: Basic macro question: how to hide stuff manually?

#10

Post by Midgardsormr » Sun Feb 04, 2018 12:06 am

ShadowMaker SdR wrote:
Sat Feb 03, 2018 11:36 pm
Midgardsormr wrote:
Sat Feb 03, 2018 3:21 pm
Cool idea, too!
Thanks. It's not really an idea yet, but it's something I need to do if I'm ever going to make truly useful things. :-)
I meant the notion of connecting non-spatial Inputs to a Point control. By putting the controller on the image itself, the user doesn't have to look away to find a slider while making adjustments. It's a simple thing, but I don't think I would ever have thought of it on my own.

User avatar
ShadowMaker SdR
Fusionista
Posts: 486
Joined: Sun Sep 21, 2014 6:17 am
Been thanked: 30 times

Re: Basic macro question: how to hide stuff manually?

#11

Post by ShadowMaker SdR » Sun Feb 04, 2018 12:16 am

I meant the notion of connecting non-spatial Inputs to a Point control. By putting the controller on the image itself, the user doesn't have to look away to find a slider while making adjustments. It's a simple thing, but I don't think I would ever have thought of it on my own.
Thanks. That's something that surprises me. Your stuff is so well thought out and way over my head (for me) that I'd thought that it be a given.
I'm trying to come up with a way to make better Rectangle Mask this way. I've got the right-angled version almost working, now I have to find a way to make the angle work as well.

User avatar
Midgardsormr
Fusionista
Posts: 745
Joined: Wed Nov 26, 2014 8:04 pm
Location: Los Angeles, CA, USA
Been thanked: 76 times
Contact:

Re: Basic macro question: how to hide stuff manually?

#12

Post by Midgardsormr » Sun Feb 04, 2018 12:37 am

I'm not sure if all of it works in User Controls, but there is some extra stuff you can do in Fuses for on-screen Rectangle (and Ellipse) controls. Let's see if I can remember some of what this does… (comments inline)
  1.     inCenter = self:AddInput("Center", "Center", {
  2.         LINKID_DataType = "Point",
  3.         INPID_InputControl = "OffsetControl",
  4.         INPID_PreviewControl = "CrosshairControl",  -- This makes the control visible in the Viewer
  5.         CHC_Style = "NormalCross",                  -- This sets the style of the widget
  6.         IC_Visible = false,                         -- These lines can hide the control. I doubt these will work
  7.         PC_Visible = false,                             -- in a Macro since you don't have the ability to modify the
  8.     })                                                  -- control panel on the fly.
  9.    
  10.     inShapeAngle = self:AddInput("Angle", "ShapeAngle", {
  11.         LINKID_DataType = "Number",
  12.         INPID_InputControl = "ScrewControl",
  13.         INPID_PreviewControl = "AngleControl",
  14.         ACID_Center = "Center",                     -- This connects the pivot of the rotation to the named Input
  15.         INP_MinScale = 0,
  16.         INP_MaxScale = 90,
  17.         IC_Visible = false,
  18.         PC_Visible = false,
  19.     })
  20.    
  21.     inShapeWidth = self:AddInput("Width", "RectWidth", {
  22.         LINKID_DataType = "Number",
  23.         INPID_InputControl = "SliderControl",
  24.         INPID_PreviewControl = "RectangleControl",
  25.         INP_Default = 0.5,
  26.         INP_MinScale = 0,
  27.         INP_MaxScale = 1,
  28.         PC_ControlGroup = 1,                        -- Links the Width and Height to the same widget. They must share a ControlGroup
  29.         PC_ControlID = 0,                           -- Sets which part of the widget is associated with this Input. Must be unique for the ControlGroup
  30.         RCID_Center = "Center",                     -- I don't recall what the difference between the ECID and RCID is, but they connect the widget's
  31.         ECID_Center = "Center",                         -- pivot to an existing Input. You can find it in the SDK somewhere if you're motivated.
  32.         RCID_Angle = "ShapeAngle",
  33.         ECID_Angle = "ShapeAngle",
  34.         IC_Visible = false,
  35.         PC_Visible = false,
  36.     })
  37.    
  38.     inShapeHeight = self:AddInput("Height", "RectHeight", {
  39.         LINKID_DataType = "Number",
  40.         INPID_InputControl = "SliderControl",
  41.         INPID_PreviewControl = "RectangleControl",
  42.         INP_Default = 0.5,
  43.         INP_MinScale = 0,
  44.         INP_MaxScale = 1,
  45.         PC_ControlGroup = 1,
  46.         PC_ControlID = 1,
  47.         RCID_Center = "Center",
  48.         ECID_Center = "Center",
  49.         RCID_Angle = "ShapeAngle",
  50.         ECID_Angle = "ShapeAngle",
  51.         IC_Visible = false,
  52.         PC_Visible = false,
  53.     })

User avatar
ShadowMaker SdR
Fusionista
Posts: 486
Joined: Sun Sep 21, 2014 6:17 am
Been thanked: 30 times

Re: Basic macro question: how to hide stuff manually?

#13

Post by ShadowMaker SdR » Sun Feb 04, 2018 12:48 am

Wow. That's some good stuff. Unfortunately it's precisely the math that I was kinda bad at in Math Class, so I have no idea how to connect everything to each other - yet. But it's very interesting and motivating. Thank you!

User avatar
ShadowMaker SdR
Fusionista
Posts: 486
Joined: Sun Sep 21, 2014 6:17 am
Been thanked: 30 times

Re: Basic macro question: how to hide stuff manually?

#14

Post by ShadowMaker SdR » Sun Feb 04, 2018 1:44 am

@Midgardsormr One thing I don't know yet is if it's possible to make expressions 'two way'.
I.e. I can use the x/y position of a cross-hair user control to set the width/height of my rectangle through an expression, but as soon as I do that the slider is 'fixed'
It would be great if moving the cross-hair would update the expression, but moving the slider would also move the move the cross-hair.
I'm pretty sure it can be done, but I don't know where to start.

User avatar
Midgardsormr
Fusionista
Posts: 745
Joined: Wed Nov 26, 2014 8:04 pm
Location: Los Angeles, CA, USA
Been thanked: 76 times
Contact:

Re: Basic macro question: how to hide stuff manually?

#15

Post by Midgardsormr » Sun Feb 04, 2018 8:25 am

You can't get a two-way Expression, as far as I know. As soon as you set an Expression on something, the sliders and widgets lock. You can get two-way operation of controls that are Published and Connected. That is, right-click a control and choose 'Publish." Right-click a different control and choose 'Connect To' > Published control.

Trouble is, I can't figure out how to Connect a pair of 1d Number controls to a 2d Point control. I've tried several approaches, but I'm just not sure it can work.