IMPORTANT UPDATE! May 12 13, 2026



Tomorrow Today Last Wednesday, on the 13th of May, the manual Patrons group (the one that gives you your green username AND access to dedicated Patrons spaces on WSL) will be has been DELETED.

This means that your access to those spaces will be has been revoked until you connect your Patreon account to WSL using the link below, which will give you access to the NEW, future-proof Patrons+++ group.

With the imminent release of ZEPPO BETA 2 - tentatively planned for released Friday today yesterday (!!) - I wouldn't dawdle... with Beta 2 (i.e. all my late nights in the past month), Zeppo has become something truly special, battle-tested and multi-user hardened in an actual production.

Yes, there will be a Reactor release eventually, and no, it won't have all the bells and whistles - those are for Patrons, because they are the ones keeping WSL afloat, which is still only barely these days...

I'd better get back to prepping that done did release then!

Thank you,

Pieter


Layers and expressions. Help out testing a potentinal bug!

User avatar
JustCropIt
Fusionator
Posts: 1249
Joined: 2 years ago
Reactions score: 296
Has thanked: 264 times
Been thanked: 286 times

Layers and expressions. Help out testing a potentinal bug!

#1

Unread post by JustCropIt »

Not sure if it's a bug or if it's just my old potato mac or if it's intended or if there's some user error but appreciated if anyone could test this out. It's real simple!

Copy this code into Fusion (it's just three nodes and two super basic expressions):

  1. {
  2. {
  3.         Tools = ordered() {
  4.                 The_Source = Mandel {
  5.                         CtrlWZoom = false,
  6.                         NameSet = true,
  7.                         Inputs = {
  8.                                 GlobalOut = Input { Value = 78, },
  9.                                 Width = Input { Value = 303, },
  10.                                 Height = Input { Value = 242, },
  11.                                 ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, }
  12.                         },
  13.                         ViewInfo = OperatorInfo { Pos = { -550, -1402.5 } },
  14.                 },
  15.                 Swizzler = Swizzler {
  16.                         PassThrough = true,
  17.                         NameSet = true,
  18.                         Inputs = {
  19.                                 LayerOrder = Input { Value = ScriptVal { {
  20.                                                         [0] = 1
  21.                                                 } }, },
  22.                                 Input1 = Input {
  23.                                         SourceOp = "The_Source",
  24.                                         Source = "Output",
  25.                                 },
  26.                                 LayerName1 = Input { Value = "Layer1", }
  27.                         },
  28.                         ViewInfo = OperatorInfo { Pos = { -550, -1369.5 } },
  29.                 },
  30.                 Lab_rat = Plasma {
  31.                         CtrlWZoom = false,
  32.                         NameSet = true,
  33.                         Inputs = {
  34.                                 GlobalOut = Input { Value = 78, },
  35.                                 Width = Input {
  36.                                         Value = 303,
  37.                                         Expression = "Swizzler.Output.Width",
  38.                                 },
  39.                                 Height = Input {
  40.                                         Value = 242,
  41.                                         Expression = "Swizzler.Output.Height",
  42.                                 },
  43.                                 ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, }
  44.                         },
  45.                         ViewInfo = OperatorInfo { Pos = { -550, -1336.5 } },
  46.                 }
  47.         }
  48. }

Lab_Rat get the Width and Height from the output of the (in the code initially disabled) Swizzler node (using default settings so nothing weird). In practice, since the Swizzler is disabled, Lab_Rat gets the Width/Height from the source (The_Source). And that should work as expected.

Now enable the Swizzler. The expectation would be that Lab_Rat gets the Width and Height from the Swizzler, which should be the same as the output from The_Source. But for me I get an error message like this:

Lab_rat cannot get Parameter for Width at time 0, layer [Main]
Lab_rat failed at time 0

And the expressions on Lab_Rat results in 0 instead of the expected values.

This plays out the same in both the latest stable Fusion Studio (20.3.2 build5) and version 21b3. Not tested in Resolve (but my tummy says it's probably the same there).


Since checking the Width and/or Height (or more likely OriginalWidth/OriginalHeight) of inputs/outputs is a fairly common thing, certainly in a lot of my over 40 shared macros here, this is currently a bit of a bummer since layers are kinda neat. And having to warn people that a macro breaks if the source uses layers blows whale balls big time:/

So I thought that maybe I should do a bug report but just wanted to do a sanity check here first:)


User avatar
Davy Alves
Fusioneer
Posts: 83
Joined: 2 years ago
Reactions score: 4
Real name: Davy Alves
Mood:
Has thanked: 2 times
Been thanked: 2 times

Re: Layers and expressions. Help out testing a potentinal bug!

#2

Unread post by Davy Alves »

I haven't fixed your code but I added a Size Control to both Nodes and the error is no longer there. My assumption is Fusion tries to sort the size of an image before anything else but the Swizzler comes a bit later in your flow. I know very little of these things.

Code: Select all

{
	Tools = ordered() {
		SizeControl = Background {
			CtrlWZoom = false,
			NameSet = true,
			Inputs = {
				GlobalOut = Input { Value = 119, },
				Width = Input { Value = 517, },
				Height = Input { Value = 587, },
				["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, }
			},
			ViewInfo = OperatorInfo {
				Pos = { 379.415, -67.6938 },
				Flags = {
					ShowPic = true
				}
			},
		},
		Lab_rat = Plasma {
			NameSet = true,
			Inputs = {
				GlobalOut = Input { Value = 119, },
				Width = Input {
					Value = 517,
					Expression = "SizeControl.Width",
				},
				Height = Input {
					Value = 587,
					Expression = "SizeControl.Height",
				},
				["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, }
			},
			ViewInfo = OperatorInfo { Pos = { 707.153, 44.7388 } },
		},
		Swizzler = Swizzler {
			NameSet = true,
			Inputs = {
				KeepMainLayers = Input {
					Value = Number {
						Value = 1
					},
				},
				LayerOrder = Input { Value = ScriptVal { {
							[0] = 1
						} }, },
				Input1 = Input {
					SourceOp = "The_Source",
					Source = "Output",
				},
				LayerName1 = Input { Value = "Layer1", },
				["Layer1.RLayer"] = Input { Value = FuID { ":Auto" }, },
				["Layer1.RChannels"] = Input { Value = FuID { "RGBA" }, },
				["Layer1.GLayer"] = Input { Value = FuID { "" }, },
				["Layer1.GChannels"] = Input { Value = FuID { "None" }, },
				["Layer1.BLayer"] = Input { Value = FuID { "" }, },
				["Layer1.BChannels"] = Input { Value = FuID { "None" }, },
				["Layer1.ALayer"] = Input { Value = FuID { "" }, },
				["Layer1.AChannels"] = Input { Value = FuID { "None" }, },
				["Layer1.ZLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.BGRLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.BGGLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.BGBLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.BGALayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.CoverageLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.ObjectIDLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.MaterialIDLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.ULayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.VLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.NormalXLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.NormalYLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.NormalZLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.VectorXLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.VectorYLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.BackVectorXLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.BackVectorYLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.PositionXLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.PositionYLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.PositionZLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.DisparityXLayer"] = Input { Value = FuID { ":Default" }, },
				["Layer1.DisparityYLayer"] = Input { Value = FuID { ":Default" }, }
			},
			ViewInfo = OperatorInfo { Pos = { 547.54, 48.4981 } },
		},
		The_Source = Mandel {
			CtrlWZoom = false,
			NameSet = true,
			Inputs = {
				GlobalOut = Input { Value = 119, },
				Width = Input {
					Value = 517,
					Expression = "SizeControl.Width",
				},
				Height = Input {
					Value = 587,
					Expression = "SizeControl.Height",
				},
				["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, }
			},
			ViewInfo = OperatorInfo { Pos = { 351.749, 49.3551 } },
		}
	}
}

User avatar
Davy Alves
Fusioneer
Posts: 83
Joined: 2 years ago
Reactions score: 4
Real name: Davy Alves
Mood:
Has thanked: 2 times
Been thanked: 2 times

Re: Layers and expressions. Help out testing a potentinal bug!

#3

Unread post by Davy Alves »

This is a long shot but can you create a modifier and get DataWindow? You get the number in pixels of the Swizzler and sent it to your Lab Rat. Sorry, I can't test it now.


User avatar
JustCropIt
Fusionator
Posts: 1249
Joined: 2 years ago
Reactions score: 296
Has thanked: 264 times
Been thanked: 286 times

Re: Layers and expressions. Help out testing a potentinal bug!

#4

Unread post by JustCropIt »

Davy Alves wrote: 4 days ago

I haven't fixed your code but I added a Size Control to both Nodes and the error is no longer there.

That unfortunately doesn't help. The assumption is that you have no control over things directly after the Swizzler. Think of the scenario being that you have a macro that contains nodes that needs to know what the incoming Width/Height is. Not an uncommon thing. Now if a node anywhere in the flow prior to the macro uses Layers (of which you have no control), then that will currently break the macro (since the internal nodes can't get the Width/Height).

Davy Alves wrote: 4 days ago

This is a long shot but can you create a modifier and get DataWindow?

I don't think one should have to use modifiers to do something as basic as getting the Width and/or Height that previously, when layers wasn't a thing, didn't need modifiers.



By making this topic what I really want to know is if my issue (with the setup I shared) is the same for everyone else. And if it is, then I would consider the way it currently works a bug. And a serious one. And I would make a bug report.


User avatar
Chad
Fusionator
Posts: 2153
Joined: 11 years ago
Reactions score: 27
Has thanked: 8 times
Been thanked: 29 times

Re: Layers and expressions. Help out testing a potentinal bug!

#5

Unread post by Chad »

If you change the Swizzler layer name to [Main], does it work?

I think the issue is that without a layer defined, it defaults to requesting [Main], and if that layer isn't available in .Output, you get the error.


User avatar
JustCropIt
Fusionator
Posts: 1249
Joined: 2 years ago
Reactions score: 296
Has thanked: 264 times
Been thanked: 286 times

Re: Layers and expressions. Help out testing a potentinal bug!

#6

Unread post by JustCropIt »

Chad wrote: 4 days ago

If you change the Swizzler layer name to [Main], does it work?

Hah, that does work!

Well... it works in the sense the Width and Height that is going out from the Swizzler can and does get picked up the expressions.

Unfortunately that doesn't solve the issue. I mean, in a sense maybe it does. But it turns into another issue. That issue being that I can't tell anyone that uses layers and my macros to be sure to rename one of the layers to [Main] (and have that layer be "active" one) or the macro breaks. Scratch that. Of course I could. But it would be a very silly thing to do:)

So... would the way it currently work be considered a bug? To me it clearly is but, again... just want to do a sanity check here!


User avatar
Chad
Fusionator
Posts: 2153
Joined: 11 years ago
Reactions score: 27
Has thanked: 8 times
Been thanked: 29 times

Re: Layers and expressions. Help out testing a potentinal bug!

#7

Unread post by Chad »

What if they input an image with two layers that have different sizes? What would you expect to happen?


User avatar
JustCropIt
Fusionator
Posts: 1249
Joined: 2 years ago
Reactions score: 296
Has thanked: 264 times
Been thanked: 286 times

Re: Layers and expressions. Help out testing a potentinal bug!

#8

Unread post by JustCropIt »

Chad wrote: 4 days ago

What if they input an image with two layers that have different sizes? What would you expect to happen?

Here's my take on it:

Using an expression like Swizzler.Output.OriginalWidth I'd expect to get the OriginalWidth of the Output of Swizzler. No matter how many layers or what sizes the individual layers might be inside the Swizzler.

The expression isn't looking for the size of a layer, it's looking for the size of the output. If one layer is 1920x1080 and other is 16x16, then whatever layer is getting shown via the output, I'd expect get the size of that layer. But again... I'm not looking for a layer, I'm looking at the output. And so getting an error (like now) seems either like a bug or that someone haven't thought things through or, you know, it fell between chairs and never got picked up again.

Either way, I'm going with "a bug" in the sense that surely this can't be right.

Does that make sense?


User avatar
Chad
Fusionator
Posts: 2153
Joined: 11 years ago
Reactions score: 27
Has thanked: 8 times
Been thanked: 29 times

Re: Layers and expressions. Help out testing a potentinal bug!

#9

Unread post by Chad »

But the output doesn't have a size. The image coming out of the output does. And if there are multiple images from that output, how would you tell it which you want, especially if the tool evaluating the expression doesn't process the same layers that the output has.

I could see BMD adding a way to set the request to a specific layer, just like you can set the request to a specific time, but layers aren't a scalar, you'd have to know the name of the layer ahead of time, which would make a macro pretty dicey.

"Getting shown via the output" is just a request. The viewer is making the request for a specific layer. If you have 10 viewers, you can request 10 different layers, each with different resolution. How would your tool know which layer you want at any given moment?


User avatar
JustCropIt
Fusionator
Posts: 1249
Joined: 2 years ago
Reactions score: 296
Has thanked: 264 times
Been thanked: 286 times

Re: Layers and expressions. Help out testing a potentinal bug!

#10

Unread post by JustCropIt »

Chad wrote: 4 days ago

"Getting shown via the output" is just a request. The viewer is making the request for a specific layer. If you have 10 viewers, you can request 10 different layers, each with different resolution. How would your tool know which layer you want at any given moment?

Ooooh.... this kinda clicked with me. Never realized the Viewer could be set up to show different layers. Which of course it could (can). That makes perfect sense.

Still.

The Viewer, no matter what it is set to, never throws out an error. It always shows something (if the node being viewed has something to show). Because (I suppose) it's by default.... set to show Default. And that fine and makes sense. Don't specify a specific layer and there's a fallback. No matter how many layers are in a "stream" or how many, if any, are "enabled", there's always something. At least based on how the Viewer seems to work.

And so (if I somehow understood it correctly) having something like NodeName.Output.OriginalWidth work the same way the Viewer does, in that if no layer is specified (in this case it's just "looking" at the Output) it should simply use Default. And that would, to me, make sense. And give me the size I would expect. And be consistent with how the Viewer works. And not make me need to put a warning on all my macros (that needs to check the incoming size of things) that they will break if layers are used upstream.

It would also make sense to me if one could specify a specific layer name too. Like NodeName.Layer3.Output.OriginalWidth. If there isn't a Layer3 then getting an error would make sense to me and so one would have to treat that as a very specific scenario. But I think one should always be able to get a value out of an output (or input) without getting an error. And the Default value makes perfect sense.

Hrm... basically having NodeName.Output.OriginalWidth be the same as something like NodeName.Default.Output.OriginalWidth (which currently isn't a thing) would solve the issue. Or if it has to be specified then NodeName.Default.Output.OriginalWidth would work too I guess.

Either way, getting an error when currently using something like NodeName.Output.OriginalWidth just because there are layers in the stream (but work perfectly well if layers aren't used), and to then not be able to use something like Default as a fallback, seems like a "bug" or at the very least a terrible workflow to me.

Does that make sense?



Edit: Might have a "haxxy" workaround! Need to test it out a bit.


User avatar
JustCropIt
Fusionator
Posts: 1249
Joined: 2 years ago
Reactions score: 296
Has thanked: 264 times
Been thanked: 286 times

Re: Layers and expressions. Help out testing a potentinal bug!

#11

Unread post by JustCropIt »

@Chad, the solution I've come up with (that works almost 100%) is to add a Swizzler at the start of the stream inside my macros (those that currently break if layers are used upstream), with the default settings except the default layer being renamed [Main]. This way no expressions that ask for the width/height on any inputs/outputs after the Swizzler will need to be changed and seem to work "as expected". And if no layers are used, it also works… but since there's a Swizzler, in practice there is a layer of course:)

Couldn't have come up with this without your input, so a huge thank you for that!

Here's a summary of the current state of affairs…



Good things with this solution (in no particular order):

  • Works as intended (99-ish%).
  • Fairly easy to implement.
  • Not really "haxxy", so shouldn't break with future updates.

Bad things with this solution (in no particular order):

  • Out of my 40+ shared macros, about half of them need this fix. This is just to say that something equivalent to Nodename.Output.Width is not uncommon.
  • The fix essentially raises the requirements to Fusion v20 even if no layers are being used, since the Swizzler requires v20+.
  • Did I mention that 23 of my macros need this update or they break if layers are used upstream?
  • While fixing a macro isn't that big of a deal, the updated version will then also need to be shared, which is a mind-numbing prospect. Not the sharing itself, that's lovely. But writing patch notes, updating version histories, adding attachments, and so on. Times 23.
  • The 1-ish% that I consider "not working" with this fix is that if the layer selection is added to the macro, you can't define what the default value should be. So double clicking on the layer selection label (or right clicking and choosing to reset to default) will break the macro, as it resets to [Main]. And that's not a viable option. The fix, if one has done a reset, is simply to pick one of the viable options in the dropdown. [Main] will not be in the dropdown, which is why the reset breaks things, I suppose. So it's a tiny thing, but it's not nothing:)


I've gone through (I think) all my shared macros and these need fixing:

  • Flake It
  • Ink It
  • Split It
  • Wave It
  • Shadow It
  • Mirror It
  • Bend It
  • Dash It
  • CRT It
  • Text It
  • Film Damage It
  • Half Tone It (Single Pattern breaks the macro, Multi Pattern throws no errors but the Anti-Aliasing scales up the footage… or rather, doesn't downscale it by the looks of it. Weird.)
  • Blend It (throws console errors but works?)
  • Range It (throws console errors but works?)
  • Mid Detail It
  • Bevel It
  • Chromate It
  • Scrape It
  • Turbulent Displace

These have been fixed/updated… locally. They seem to work but have not been shared yet:

  • Dither It
  • Background It
  • Split It
  • Prism It


Urgh. I gotta say, I still think this is "buggy" behavior. Using Nodename.Output.Width shouldn't break down just because there are layers upstream. It should return something. Be that the Default or Auto or whatever value makes sense, as a fallback. If no layer is specified, use a fallback. Not that it's currently even possible to specify a layer. And so that naturally leads to the idea that one should also be able to target specific layers, because why not. As in Nodename.Input1.Layer1.Output.Width, or something. Someone more clever than me should be able to figure out what would work.

The important thing is there should be a fallback. One shouldn't need a Swizzler just on the off chance that someone might use layers, for an expression like Nodename.Output.Width to not break. It seems to me as if expressions have yet to get the memo that layers are a thing. High time to deliver that memo.

I think.


User avatar
Chad
Fusionator
Posts: 2153
Joined: 11 years ago
Reactions score: 27
Has thanked: 8 times
Been thanked: 29 times

Re: Layers and expressions. Help out testing a potentinal bug!

#12

Unread post by Chad »

JustCropIt wrote: 3 days ago

The Viewer, no matter what it is set to, never throws out an error.

Does for me.

Code: Select all

Lab_rat cannot get Parameter for Width at time 0, layer [Main]
Lab_rat failed at time 0

It only works if you have [Main].

JustCropIt wrote: 3 days ago

It would also make sense to me if one could specify a specific layer name too. Like NodeName.Layer3.Output.OriginalWidth. If there isn't a Layer3 then getting an error would make sense to me and so one would have to treat that as a very specific scenario. But I think one should always be able to get a value out of an output (or input) without getting an error. And the Default value makes perfect sense.

Hrm... basically having NodeName.Output.OriginalWidth be the same as something like NodeName.Default.Output.OriginalWidth (which currently isn't a thing) would solve the issue. Or if it has to be specified then NodeName.Default.Output.OriginalWidth would work too I guess.

Makes sense to me.

Default isn't a layer, it's just whatever layer is "first", which right now we don't get insight into. So the "Default" should always exist.