When working with particles it is often a waste of resources to distribute the particles outside the area visible from the camera. Fortunately the particle distribution can be controlled by a vertex group but weight painting the visible area by hand is a bit cumbersome. I therefore created a simple script that offers the option to paint the vertices of a mesh in the active vertex group with a weight of one if they are visible from the camera and zero otherwise. With a toggle switch you can select whether objects in the scene should be taken into account as well.
Availability and usage
The simple add-on presented in this article is available from GitHub (right click the link to download the script somewhere then install it from Blender with
File -> User Preferences -> Addons -> Install from file. Don't forget to enable the check box).
Once installed it's available in weight paint mode from the Weights menu as shown below:
Simply select the mesh you want to paint, switch to weight paint mode and click
Weights -> Visible Vertices. It will adjust the weights of the active vertex group and if the mesh hasn't got one, a new vertex group will be added. If you toggle the
Full Scene option (in the VisibleVertices tab of the toolbar, you might need to press control-T to show it) objects in the scene might block the view as well as shown in the image below, where a cube and a sphere are shown in wireframe mode to reveal that blocked portions of the plane have been assigned a weight of zero.
The add-on was presented in this BlenderArtists thread.