How to add a gradient to an attribute mask - 3D geo

   3768   3   2
User Avatar
Member
13 posts
Joined: Nov. 2018
Offline
Hi all,

I'm creating a mograph style setup when a mask moves up some geo which is used to affect the pscale of some geo scattered on the surface.
I'm trying to add a gradient to the mask I've created. So that the top of the mask is white/value of 1 and if gradually fades to black/0.
This is so the geo at the top has the highest pscale value and it slowly fades out.
The mask is animated and moves up the box so the gradient needs to follow the mask opposed to being over the whole geo.

I've thought of various ways to do it but they all seem very long winded... For instance, using a pop sim and the age attribute. Or combining two masks from two separate transfer sources.

Vex would be ideal but my understanding is very basic... finding the highest point in the mask on the Y axis and then measuring the distance of each subsequent point from it and using that value to multiply the mask to create the gradient.

Am I over complicating this?

Hope someone can help

Attachments:
SideFX_MoGraph_Question001.jpg (178.5 KB)
SideFX_MoGraph_Question002.jpg (262.5 KB)

User Avatar
Member
474 posts
Joined: Feb. 2012
Offline
https://www.motionoperators.com/ [www.motionoperators.com]
User Avatar
Member
13 posts
Joined: Nov. 2018
Offline
(Y)

One node.
Edited by AJVisuals - Dec. 21, 2021 17:50:27

Attachments:
SideFX_MoGraph_Question003.jpg (1.0 MB)

User Avatar
Member
447 posts
Joined: April 2018
Online
You can do the same thing in H19, with Attribute Adjust nodes for either vector or float attributes, or even colour gradients.

When set to Line, you also get handy viewport controls to tweak the position of your gradient directly in the viewport.
Edited by eikonoklastes - Dec. 29, 2021 02:40:25

Attachments:
Screenshot 2021-12-29 110648.png (258.0 KB)
Screenshot 2021-12-29 110945.png (313.8 KB)

  • Quick Links