Take the 2-minute tour ×
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It's 100% free, no registration required.

I am animating objects that will be rendered with video footage in the compositor. My difficulty is how to apply a mask so that the objects disappear when they expand past a certain point.

Objects within circle mesh should be visible enter image description here

Objects outside of circle mesh should be invisible enter image description here

Current nodes set-up for object materials: enter image description here

What masking options are at my disposal to achieve this effect, and how can I apply them?

Thanks for any insights.

share|improve this question

1 Answer 1

up vote 7 down vote accepted

There are a good many ways of doing this, but here are a few:

Mask editor

  1. In the UV image editor, set the mode to Mask and press New:

    enter image description here

  2. Press ⇧ ShiftA>Circle to add a circle mask, the position it with G:

    enter image description here

  3. Use the mask to control the alpha over factor in the compositor:

    enter image description here

    You could even feather or blur the mask to make the objects fade out instead of disappearing abruptly.

Object/material id mask

You could also use the circle object in the 3D view to do this, using ID masks (see my answer here).

Note that this will only work if you have the circle object visible in the render and filled with a face, or use multiple renderlayers.

Holdout material:

If you want to replace part of a scene with transparency, you can use an object with a holdout shader to make that object render as alpha transparency:

enter image description here

Boolean modifier

This is probably not a good option in this case, but this can be useful when you need to "mask" whole objects:

enter image description here

Collision object

If the object is in a particle system, you can use a sphere with collision physics, set to kill particles:

enter image description here

No particles will be able to escape the sphere.

share|improve this answer
    
Is there a way to do the reverse (inverse?) of this? Everything inside the circle needs to be visible; everything outside needs to be invisible. –  KTS Sep 1 at 7:41
    
@KTS Ah, I misunderstood. Simply remove the invert node in the compositing setup. –  gandalf3 Sep 1 at 7:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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