opentoonz / opentoonz_docs

OpenToonz User Manual
http://opentoonz.readthedocs.io
28 stars 26 forks source link

Something I don't understand about gradients #139

Open F-Burning opened 1 year ago

F-Burning commented 1 year ago

Ask a question related to OpenToonz

Why are gradients created in separated columns, and not inbetween nodes?

I ask this because to apply a gradient to a silhouette, you have to create a matte and...wouldn't it be better if the gradient had the option to apply alpha as the blending nodes?

RodneyBaker commented 1 year ago

There is part of this that I almost understand but am not confident enough to suggest. (More research required until I can talk intelligently about that but in general my thoughts apply to nodes that generate data versus manipulate data and zerary FX in general)

But... According to the documentation:

Effects that create computer generated images, such as the Radial Gradient, that are exposed in Xsheet columns (and Timeline layers) and therefore are similar to columns; they are displayed with an orange node with only an output port on the right. These effect nodes have to be connected to the Xsheet node to be rendered, or can be connected to other effect nodes.

There are some advantages to having these nodes exposed to the xsheet/timeline as well, such as ability to animate the transforms of generator as if it were a regular column. If it was not then the node would require specific code be added to allow such manipulation.

The key takeaway I get is that these particular nodes have to be connected to the xsheet node in order to render. It achieves this by actually being exposed in the xsheet. As such we technically do not have to actually attached the node to the xsheet node (which seems to contridict the documentation no?). So this gradient FX will render even though it bypasses the actual xsheet node. The below for instance will render just fine:

image

F-Burning commented 1 year ago

I think I have more or less understood you (my language skills are limited), but I understand that there is an important reason behind it.

I wish there was also the possibility of a gradient node, even if it is more limited, but I understand that it is not that simple.

Thank you @RodneyBaker for the reply 👍

RodneyBaker commented 1 year ago

I was going to suggest that we could create a gradient Shader but those are of the same type of node that is generative and thus begin at the start of a schematic flow.

As for how to proceed now... don't limit yourself to not being able to have these particular FX nodes be at the beginning of schematic flow... we can push them down into the flow where they can act as typical nodes. Here for instance I use a Cross Dissolve and an Invert node to allow two different ways of switching on/off a gradient. If the Invert node is turned on (active) we get white on left, black on right but if we turn it off we get the reverse.

image

The real trick however is just in piping the gradient (or other generative node) into another node... even if it is a dummy node turned off so that we can use the resulting flow down stream with other nodes.

In the following case I'm not using the two (different) cross desolve nodes for any effect... I'm just using them for their ports. We can use other approaches also... I'm just using these for demonstration purposes.

image

F-Burning commented 1 year ago

I have not understood the examples, sorry :rofl: I have not reached that level of understanding in the node system, but i understand what you mean, it's a matter of experimenting.

Thanks once again.

RodneyBaker commented 1 year ago

Closing this as a question answered.

Update: Transferring over to Opentoonz-docs repo