Jump to: Board index » General » Fusion

Sherlock balance effect

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline
User avatar

Leonhard Wolf

  • Posts: 24
  • Joined: Sat Jul 01, 2017 11:10 am

Sherlock balance effect

PostSat Jul 08, 2017 11:34 am

Hi everyone,

I recently watched Sherlock season 4 and noticed this cool effect: He throws a bag to someone and guesses the weight of it. To demonstrate this there is an animation like you see on a balance (weighing device? I hope this is the proper translation).
It's basically just a text animated to go from let's say 1 to 1000 and back down again. Also you only see rounded numbers.
I couldn't think of a way to animate the actual text in Fusion. But I would really like to recreate this effect. Could this be possible with some kind of expression? I sadly don't know anything about this or Python etc. .
Mainboard: Asus Maximus Ranger VII
CPU: Intel i7-4790k (not overclocked)
GPU: AMD Radeon HD 6870
RAM: 12 GB
Soundcard: Avid Eleven Rack
HDD: 2 TB
OS: Windows 10 Home, 64 bit
Offline
User avatar

Bryan Ray

  • Posts: 2491
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: Sherlock balance effect

PostMon Jul 10, 2017 6:10 pm

Sure, you can put an expression on the Styled Text field in a Txt+ tool, and connect it to another tool with a number slider. Here's an example (just copy and paste the code into your Flow (though it looks like the Select All button doesn't work at the moment)).

Code: Select all
{
   Tools = ordered() {
      CustomTool1 = Custom {
         CtrlWZoom = false,
         CustomData = {
            Settings = {
               [1] = {
                  Tools = ordered() {
                     CustomTool1 = Custom {
                        Inputs = {
                           LUTIn3 = Input {
                              SourceOp = "CustomTool1LUTIn3",
                              Source = "Value"
                           },
                           LUTIn1 = Input {
                              SourceOp = "CustomTool1LUTIn1",
                              Source = "Value"
                           },
                           Image1 = Input {
                              SourceOp = "TimeSpeed1",
                              Source = "Output"
                           },
                           Image2 = Input {
                              SourceOp = "ChangeDepth1_1",
                              Source = "Output"
                           },
                           LUTIn4 = Input {
                              SourceOp = "CustomTool1LUTIn4",
                              Source = "Value"
                           },
                           LUTIn2 = Input {
                              SourceOp = "CustomTool1LUTIn2",
                              Source = "Value"
                           }
                        },
                        Name = "CustomTool1",
                        CtrlWZoom = false,
                        ViewInfo = OperatorInfo { Pos = { 550, 181.5 } },
                        CustomData = {
                        }
                     },
                     CustomTool1LUTIn1 = LUTBezier {
                        Name = "CustomTool1LUTIn1",
                        NameSet = true,
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        SplineColor = { Green = 0, Blue = 0, Red = 204 }
                     },
                     CustomTool1LUTIn2 = LUTBezier {
                        Name = "CustomTool1LUTIn2",
                        NameSet = true,
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        SplineColor = { Green = 204, Blue = 0, Red = 0 }
                     },
                     CustomTool1LUTIn3 = LUTBezier {
                        Name = "CustomTool1LUTIn3",
                        NameSet = true,
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        SplineColor = { Green = 0, Blue = 204, Red = 0 }
                     },
                     CustomTool1LUTIn4 = LUTBezier {
                        Name = "CustomTool1LUTIn4",
                        NameSet = true,
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        SplineColor = { Green = 204, Blue = 204, Red = 204 }
                     }
                  }
               },
               [2] = {
                  Tools = ordered() {
                     CustomTool1 = Custom {
                        Inputs = {
                           LUTIn3 = Input {
                              SourceOp = "CustomTool1LUTIn3",
                              Source = "Value"
                           },
                           LUTIn4 = Input {
                              SourceOp = "CustomTool1LUTIn4",
                              Source = "Value"
                           },
                           Image2 = Input {
                              SourceOp = "ChangeDepth1_1",
                              Source = "Output"
                           },
                           RedExpression = Input { Value = "c1-c2" },
                           GreenExpression = Input { Value = "c1-c2" },
                           LUTIn1 = Input {
                              SourceOp = "CustomTool1LUTIn1",
                              Source = "Value"
                           },
                           Image1 = Input {
                              SourceOp = "TimeSpeed1",
                              Source = "Output"
                           },
                           BlueExpression = Input { Value = "c1-c2" },
                           LUTIn2 = Input {
                              SourceOp = "CustomTool1LUTIn2",
                              Source = "Value"
                           }
                        },
                        CtrlWZoom = false,
                        ViewInfo = OperatorInfo { Pos = { 550, 181.5 } },
                        CustomData = {
                        }
                     },
                     CustomTool1LUTIn1 = LUTBezier {
                        SplineColor = { Green = 0, Blue = 0, Red = 204 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     },
                     CustomTool1LUTIn2 = LUTBezier {
                        SplineColor = { Green = 204, Blue = 0, Red = 0 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     },
                     CustomTool1LUTIn3 = LUTBezier {
                        SplineColor = { Green = 0, Blue = 204, Red = 0 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     },
                     CustomTool1LUTIn4 = LUTBezier {
                        SplineColor = { Green = 204, Blue = 204, Red = 204 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     }
                  }
               },
               [3] = {
                  Tools = ordered() {
                     CustomTool1 = Custom {
                        Inputs = {
                           LUTIn3 = Input {
                              SourceOp = "CustomTool1LUTIn3",
                              Source = "Value"
                           },
                           LUTIn4 = Input {
                              SourceOp = "CustomTool1LUTIn4",
                              Source = "Value"
                           },
                           Image2 = Input {
                              SourceOp = "ChangeDepth1_1",
                              Source = "Output"
                           },
                           RedExpression = Input { Value = "c1+c2" },
                           GreenExpression = Input { Value = "c1+c2" },
                           LUTIn1 = Input {
                              SourceOp = "CustomTool1LUTIn1",
                              Source = "Value"
                           },
                           Image1 = Input {
                              SourceOp = "TimeSpeed1",
                              Source = "Output"
                           },
                           BlueExpression = Input { Value = "c1+c2" },
                           LUTIn2 = Input {
                              SourceOp = "CustomTool1LUTIn2",
                              Source = "Value"
                           }
                        },
                        CtrlWZoom = false,
                        ViewInfo = OperatorInfo { Pos = { 550, 181.5 } },
                        CustomData = {
                        }
                     },
                     CustomTool1LUTIn1 = LUTBezier {
                        SplineColor = { Green = 0, Blue = 0, Red = 204 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     },
                     CustomTool1LUTIn2 = LUTBezier {
                        SplineColor = { Green = 204, Blue = 0, Red = 0 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     },
                     CustomTool1LUTIn3 = LUTBezier {
                        SplineColor = { Green = 0, Blue = 204, Red = 0 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     },
                     CustomTool1LUTIn4 = LUTBezier {
                        SplineColor = { Green = 204, Blue = 204, Red = 204 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     }
                  }
               },
            }
         },
         Inputs = {
            NumberIn1 = Input { Value = 300, },
            LUTIn1 = Input {
               SourceOp = "CustomTool1LUTIn1",
               Source = "Value",
            },
            LUTIn2 = Input {
               SourceOp = "CustomTool1LUTIn2",
               Source = "Value",
            },
            LUTIn3 = Input {
               SourceOp = "CustomTool1LUTIn3",
               Source = "Value",
            },
            LUTIn4 = Input {
               SourceOp = "CustomTool1LUTIn4",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 605, 181.5 } },
      },
      CustomTool1LUTIn1 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 204, Green = 0, Blue = 0 },
         NameSet = true,
      },
      CustomTool1LUTIn2 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 0, Green = 204, Blue = 0 },
         NameSet = true,
      },
      CustomTool1LUTIn3 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 0, Green = 0, Blue = 204 },
         NameSet = true,
      },
      CustomTool1LUTIn4 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 204, Green = 204, Blue = 204 },
         NameSet = true,
      },
      Text1 = TextPlus {
         CtrlWZoom = false,
         Inputs = {
            GlobalIn = Input { Value = 1, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input {
               Value = "300g",
               Expression = "Text(CustomTool1.NumberIn1 .. \"g\")",
            },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
            ShadingGradient1 = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1 },
                     [1] = { 1, 1, 1, 1 }
                  }
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 605, 148.5 } },
      }
   }
}


You'll notice that I've appended a "g" to the end using the .. operator, which can be used to combine strings.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline
User avatar

Leonhard Wolf

  • Posts: 24
  • Joined: Sat Jul 01, 2017 11:10 am

Re: Sherlock balance effect

PostTue Jul 11, 2017 11:15 am

Hey,

thanks! That worked.

How can you round those numbers displayed in the styled text field?
Mainboard: Asus Maximus Ranger VII
CPU: Intel i7-4790k (not overclocked)
GPU: AMD Radeon HD 6870
RAM: 12 GB
Soundcard: Avid Eleven Rack
HDD: 2 TB
OS: Windows 10 Home, 64 bit
Offline
User avatar

Bryan Ray

  • Posts: 2491
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: Sherlock balance effect

PostTue Jul 11, 2017 6:04 pm

There are two ways:

You can add a function in the expression on the Text+ tool:
Text(floor(CustomTool1.NumberIn1) .. "g")

floor() will round a decimal number down. Or ceil() to round up. Round to nearest is more difficult and would require a rather long and complex expression.

The other way is to modify the control you are getting your number from. Right-click that CustomTool and choose "Edit Controls…". In the dialog that appears, use the ID: dropdown menu to locate NumberIn1. Then tick the "Integer" box. It's a good idea to also select "Controls" in the Page window so the control doesn't move to a new tab. You can also set a new Range for the slider if you would like it to be more responsive. 0 to 100 might be less frustrating to use.

Untitled.png
Untitled.png (34.56 KiB) Viewed 1014 times


The modified control will move to the bottom of the panel. For convenience, you can turn off all the unused controls in the CustomTool's Config tab. You can also re-label the slider there so it's easier to remember what it does.

edit: I thought of two other options: You could connect the expression to a control that's already limited to integer values, like the Width of a Background node. That's not the best option, obviously, since it would be hard to communicate that you're driving a text field with the width of a solid.

You could use that Edit Controls dialog to add a control directly to the Text+ node, then link the expression to that. That would actually be my preferred method since it would keep all of the controls on a single tool.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline
User avatar

Chad Capeland

  • Posts: 3025
  • Joined: Mon Nov 10, 2014 9:40 pm

Re: Sherlock balance effect

PostTue Jul 11, 2017 6:27 pm

Text(floor((NumberToBeRounded + RoundingInterval / 2) / RoundingInterval ) * RoundingInterval)

Example: Text(floor((time+5/2) / 5 ) * 5) will count up the current frame by 5's.
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline
User avatar

Leonhard Wolf

  • Posts: 24
  • Joined: Sat Jul 01, 2017 11:10 am

Re: Sherlock balance effect

PostTue Jul 11, 2017 7:18 pm

Thanks for your help! It worked.
Mainboard: Asus Maximus Ranger VII
CPU: Intel i7-4790k (not overclocked)
GPU: AMD Radeon HD 6870
RAM: 12 GB
Soundcard: Avid Eleven Rack
HDD: 2 TB
OS: Windows 10 Home, 64 bit
Offline
User avatar

Bryan Ray

  • Posts: 2491
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: Sherlock balance effect

PostTue Jul 11, 2017 8:23 pm

I should revisit some of my expressions to see if I can pack them down better. That's more efficient than the one I use.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com

Return to Fusion

Who is online

Users browsing this forum: No registered users and 42 guests