Weight paint vertices visible from the active camera

Hi,

I created a tiny utility that sets the weights of vertices that are in the field of view of the camera. May come in handy if you want to restrict the distribution of particles for example. Details and download instructions in this article.

cheers,

– Michel.

Really nice and useful, thanks!!

The script now can also take into account any objects in the scene that might block the view from the camera.

cheers,

– Michel.

Added new functionality: Weight diminishes further away from the camera, an optional margin around the camera frame and a vertex weight edit modifier.

cheers,

– Michel.

Hi varkenvarken,

Thanks alot for this new kind of add-on: very nive idea!
Congrats.

Hi.

I’m experiencing two issues clearly visible on the screenshot: there is a bald spot just near the camera and there is a specular weighting also rear the camera!


@Ray Tracer: the reflected weights are clearly a bug: i probably forgot to check if the point of intersection with the view frame was negative. I am pretty sure all my testcases were with the camera outside the plane being weighted, so thank you for reporting it!
The bald spot i don’t understand, i don’t think it has to do with the clipping distance (because i do not take that into account) but it might be a precision issue. Can you post the .blend somewhere? (or just tell me what the dimension of the plane and the positions of the plane and the camera are ?

I fixedthe reflected weights.The bald spot is not a bug: from the camera view some vertices ‘near your feet’ are in fact not visible, so if you look from the top there is an area around the camera position that is indeed not weighted :slight_smile: (To verify this behaviour: if you increase the field of view of the camera, i.e. decrease its focal lenght, this bald spot will be smaller).

cheers,

– Michel.

Yep, I figured it out :slight_smile:

Thanks for the quick fix!

Hi,

I noticed that having a displace modifier unapplied can lead to strange result, as you can see in the test below.
Applying the displace modifier seems to fix the problem.
Can you look into this?