2
$\begingroup$

I have an image as plane imported in Blender 2.91:

enter image description here

Now I want to mask off the red wine and then animate it so it would fill the glas:

enter image description here

Yes, it must be solved in Blender.

Tried it in Compositor with Set Alpha node, but the size of the mask does not fit and the alpha is not correct. Not to mention that I can not figure out how to bring this into shader editor...

enter image description here

Any help very very welcome.

Edit:

lehuan5062 had the idea to solve it with a shader: https://blenderartists.org/t/mask-roto-texture-of-image-plane/1278656/4

But still, animated masking in shader editor??

$\endgroup$
0
5
$\begingroup$

Boolean Modifier

Since you will have to separate lines of glass from red wine and white line on wine surface (that has to be part of animated section), seems to me easier to recreate pictogram in some vector app (so you can work with always sharp and clean shapes), import as SVG and animate with Boolean Modifier.

  • add the glass Solidify modifier to get thickness, it will prevent from z-fight, or bring this object a bit above
  • convert wine object (named Wine_Mask) to mesh and give it a Solidify modifier to get thickness (needed for later boolean operation)
  • add a Plane to use it as a wine, split face into two, upper part for white wine surface line, the rest as wine volume, add Solidify modifier with less thickness than Wine_Mask object
  • add Boolean Modifier > Intersect > Object - Wine_Mask

enter image description here

It can be animated in similar way as shader version too.


Shader

Shader controlled by Empty

  • keeps wine surface horizontal (independent on glass rotation)
  • volume controll
  • parented to glass keeps location

enter image description here

enter image description here

Roto-Mask

From what I know it's the worst way ever to do something like this. Mask's shape can be animated by simply pressing I in Image Editor, but in a very limited way. From UI point of view there is not any feedback that key framing is happening, so open Dope Sheet Editor to to see them. The biggest issue is that animated points of mask transit along shortest way from key to key (see this question). It isn't such a big problem to animate straight point movement, but curvy part would has to be animated frame by frame = time consuming.

enter image description here

$\endgroup$
6
  • $\begingroup$ Thanks for this solution, pretty cool! However, imagine using Blender as an AE replacement, I would still like to know how to roto textures. $\endgroup$
    – linuxmarc
    Jan 17 at 12:32
  • $\begingroup$ There was also the idea to solve it shader wise: blenderartists.org/t/mask-roto-texture-of-image-plane/1278656/6 $\endgroup$
    – linuxmarc
    Jan 17 at 12:59
  • $\begingroup$ Sure, shader is fine I just preferred curves since it is scaleable without caring about image source resolution. Yet I'm not sure why to use roto-mask, that is harder to animate and also hard to re-adjust if needed. If you need you can use camera output merge in compositor or in VSE as well. Anyway, you solved it with shader, right? Or do you have still a question? It would be also nice if you can create your answer here with shader solution. Thanks $\endgroup$
    – vklidu
    Jan 17 at 15:06
  • $\begingroup$ I'd still like to know how to use and animate masks on an image texture, this could be helpful for further ideas I have in mind! $\endgroup$
    – linuxmarc
    Jan 17 at 16:20
  • $\begingroup$ @linuxmarc explore also the UV mapping node, see: blender.stackexchange.com/questions/6942/… $\endgroup$
    – susu
    Jan 17 at 18:18
0
$\begingroup$

Thanks to the help of the community, the current solution to solve the wine is using shader nodes with a map range and a texture with a glas full of wine and one without wine.

shader

enter image description here

see blend file:

https://blenderartists.org/uploads/short-url/4prveEYzpwiD9OONGNXiTXJTiCy.blend

This is a solution, but still wondering how to create an animated mask on an image texture.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.