Welcome to WSL!

Make yourself at home, but before posting, please may I ask you to read the following topics.


Posting 101
Server space, screenshots, and you

Thank you!

PS. please pretty please:


Image

how to get the size of the mask input of a background tool ?

User avatar
Kenzor
Fusioneer
Posts: 103
Joined: Wed Aug 06, 2014 11:32 pm
Contact:

how to get the size of the mask input of a background tool ?

#1

Post by Kenzor » Tue Jun 30, 2020 3:02 am

I'm using fusion to process some sprites for a game, which means every frame has a different size.
I need to code the size of various background nodes to deal with the size changes

hunting around the web i found these useful bits of code.

Merge1.Background.OriginalWidth
Merge1.Background.OriginalHeight

Loader1.Output.OriginalWidth
Loader1.Output.OriginalHeight

So my question is how do i find the size of the mask input of a background tool ?
by Millolab » Tue Jun 30, 2020 4:23 am
not sure if I understand your needs correctly but if you want to set the size of a BG from its mask input you should use self.EffectMask.OriginalWidth and self.EffectMask.OriginalHeight
But I'm not really sure I understand your question.
Anyway I suggest you to use the WSL search tools (clicking the cog right on the side of the search bar) to look if you can find your answer in vfxpedia
Go to full post

User avatar
ShadowMaker SdR
Fusionista
Posts: 896
Joined: Sun Sep 21, 2014 6:17 am
Answers: 8
Been thanked: 36 times

Re: how to get the size of the mask input of a background tool ?

#2

Post by ShadowMaker SdR » Tue Jun 30, 2020 4:17 am

Are you asking about the Fusion BG tool? Or 'a random tool in the background'?

Added in 1 minute 43 seconds:
This is from the Quick tips on the forum:

To query a node's image size in an expression, use [nodename].Output.OriginalHeight and [nodename].Output.OriginalWidth
You can use just Height and Width, but the dimensions will change in proxy mode if you do.

User avatar
Millolab
Fusionista
Posts: 535
Joined: Wed Oct 24, 2018 6:26 am
Answers: 2
Been thanked: 72 times
Contact:

Re: how to get the size of the mask input of a background tool ?

#3

Post by Millolab » Tue Jun 30, 2020 4:23 am

not sure if I understand your needs correctly but if you want to set the size of a BG from its mask input you should use self.EffectMask.OriginalWidth and self.EffectMask.OriginalHeight
But I'm not really sure I understand your question.
Anyway I suggest you to use the WSL search tools (clicking the cog right on the side of the search bar) to look if you can find your answer in vfxpedia

User avatar
ShadowMaker SdR
Fusionista
Posts: 896
Joined: Sun Sep 21, 2014 6:17 am
Answers: 8
Been thanked: 36 times

Re: how to get the size of the mask input of a background tool ?

#4

Post by ShadowMaker SdR » Tue Jun 30, 2020 4:36 am

@Kenzor Here is a background tool that changes its size based on the image that feeds it, which sounds a lot like what you need.
  1. {
  2.     Tools = ordered() {
  3.         Background = Background {
  4.             CtrlWZoom = false,
  5.             NameSet = true,
  6.             Inputs = {
  7.                 GlobalOut = Input { Value = 500, },
  8.                 Width = Input {
  9.                     Value = 25,
  10.                     Expression = "ReferenceInput.OriginalWidth",
  11.                 },
  12.                 Height = Input {
  13.                     Value = 25,
  14.                     Expression = "ReferenceInput.OriginalHeight",
  15.                 },
  16.                 ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
  17.                 TopLeftRed = Input { Value = 1, },
  18.             },
  19.             ViewInfo = OperatorInfo { Pos = { 440, 16.5 } },
  20.             UserControls = ordered() {
  21.                 ReferenceInput = {
  22.                     LINK_Main = 2,
  23.                     LINKID_DataType = "Image",
  24.                     ICS_ControlPage = "Controls",
  25.                     INPID_InputControl = "ImageControl",
  26.                     LINKS_Name = "Reference image"
  27.                 }
  28.             }
  29.         }
  30.     }
  31. }
Last edited by ShadowMaker SdR on Tue Jun 30, 2020 8:11 am, edited 2 times in total.

User avatar
Millolab
Fusionista
Posts: 535
Joined: Wed Oct 24, 2018 6:26 am
Answers: 2
Been thanked: 72 times
Contact:

Re: how to get the size of the mask input of a background tool ?

#5

Post by Millolab » Tue Jun 30, 2020 5:01 am

hey @ShadowMaker SdR I think there's a naming issue in your setup. :)

User avatar
ShadowMaker SdR
Fusionista
Posts: 896
Joined: Sun Sep 21, 2014 6:17 am
Answers: 8
Been thanked: 36 times

Re: how to get the size of the mask input of a background tool ?

#6

Post by ShadowMaker SdR » Tue Jun 30, 2020 5:11 am

Hi Milo, thanks for mentioning it. I think I've fixed it in the original post. (I dissected a Macro and I think I've made a mistake in the ungrouping/copy/pasting of the modified BG)

User avatar
Millolab
Fusionista
Posts: 535
Joined: Wed Oct 24, 2018 6:26 am
Answers: 2
Been thanked: 72 times
Contact:

Re: how to get the size of the mask input of a background tool ?

#7

Post by Millolab » Tue Jun 30, 2020 5:36 am

☺️👍🏻

User avatar
Kenzor
Fusioneer
Posts: 103
Joined: Wed Aug 06, 2014 11:32 pm
Contact:

Re: how to get the size of the mask input of a background tool ?

#8

Post by Kenzor » Tue Jun 30, 2020 10:30 am

Thanks for your help guys @Millolab had the perfect answer for me.

I've been scanning: the fusion tools ref pdf, the fusion scripting pdf , and vfxpedia. I could not find the reference for these commands.

Did i miss somenthing? Where is the help reference for self.EffectMask.OriginalWidth ?