Moving object to trigger A/B visibility switch

The most specific example of what I’m on about is cutting grass; lawn mower moving for the audience, but for Blender, an object travels with it over particles (?) instanced particles (?) and as that goes forward, ‘uncut’ grass switches visibly with cut grass.

  • I see mention of visibility actuators but understand this is for the game engine?

I also imagined there might be a Dynamic Paint option for this too. But with so many possible directions, I haven’t looked far into it yet.

Just putting this out there again…

You are right, there are several ways to do that…
In the following I will try to explain two of them.

Solution 1
control the length of the particles with a texture created by dynamic paint

  • add a dynamic paint brush to your mower, maybe change the type to mesh + proximity and adjust the paint distance
  • animate your mower (we need to bake the mowed “path” as a texture)
  • add a dynamic paint canvas to your UV-unwrapped floor plane, set type to image sequence, in the dynamic paint output panel choose a file path and bake it!
  • (takes some time)
  • create the “grass” particles, go to the “textures” panel in the particles tab, add a texture (new)
  • go to the textures tab, select the added texture, open the generated image sequence
  • Choose as influence “lenght”

Solution 2
adjust the visibility of your grass material

  • create your grass material
  • add a dynamic paint brush to your mower, maybe change the type to mesh + proximity and adjust the paint distance
  • add a dynamic paint canvas to your ground plane which has some subdivisions
  • in the dynamic paint output panel of the canvas klick the “+” next to the wetmap layer
  • go back in your material, add a new attribute and name it as the wetmap layer (dp_wetmap)
  • use this to adjust the visibility (feed it into a mix node that mixes your material with a transparent sharder):

(explanation: the green nodes add some “basic visibility” to the material (grass root) based on its height; the red one is not interesting for you, instead feed in a color ramp or texure)


Comparison

  • Solution 1 needs an already finished animation (baking), solution 2 is more flexible
  • Solution 2 needs probably more render time as solution 1
  • Solution 2 is physically incorrect (=faked), while solution 1 is almost real

I know this post is kind of complicated, feel free to ask again!!

I’m very grateful for your response! It sure is tricky but I understand the basics of it for sure. You’re very thorough.

I included this wire/render image specifically because the instanced Grass on Layer 2 (selected) disappears the higher it is no matter what X and Y it’s on, AND the particle grass will disappear too if it gets over a certain height. But it will ALL disappear at the level, not just what the mower Cube has been over.


I’ll continue experimenting with this tonight but I’ve noticed that each layer of transparency adds up quickly for the Cycles resulting in pitch black unless I extend the Maximum Transparency Bounces.

I know. Found that out too. This is caused by the green part of the node setup in my post above: I used the Z position of the object to be able to adjust the lenght of the cutted grass. But if you increase the heigth of the object, it will eventually disappear (as you already noticed).

To fix this (or at least to understand what happens), set up (as a test) another material for your grass:



By adjusting the ColorRamp, you can adjust which part of the grass is cut (white) and which not (black). If the range of the ColorRamp is too little to adjust it properly, add a mapping node inbetween the geometry and the seperate xyz node. Then play around with either the Z location or the Z scale (in both cases experiment with values less than 1)

Yes, that is right, it may, if you have a huge landscape, heavily increase your render time.

To adjust length instead of opacity, I’ve decided that this is worth the first suggestion and am willing to Bake paths and use that to drive length and density.

BUT this 2.76 running on my laptop is making that incredibly difficult. It seems whether Hair or Emitter, there are bugs in the process. Density is coming and going with no pattern until I hit the Offset Button for the Image Sequence.

I’ll post a good picture when I can get this stabilized.