16
$\begingroup$

I'm currently weight painting and find myself glancing back and forth between camera view and user perspective view to check where I'm painting in relation to my camera boundaries (for an environment scene). Is there a way to view the camera boundaries from within the user perspective view? Weight Painting

$\endgroup$

6 Answers 6

15
$\begingroup$

Another option is to simply scale up the camera object. It doesn't effect the FOV at all. Select the camera, go to the properties panel and Camera > Display > Size.

scale camera display only

Scale it up until the frustrum covers your painting area. You can see it from any angle. Alternatively you could parent a lamp with a square cone to match the camera frustrum.

Add a spot lamp and constrain it to the camera and copy the camera's Field Of View to lamp Size. You will have to scale the lamp's Y axis to fit aspect ratio.

lamp constrained to camera

Copy camera FOV

match lamp to camera position and rotation

$\endgroup$
2
  • $\begingroup$ Hardly intuitive, but highly effective results! $\endgroup$
    – Patdog
    Commented Aug 21, 2016 at 11:39
  • $\begingroup$ Thanks I think it would make a neat little addon if automated. $\endgroup$
    – 3pointedit
    Commented Aug 21, 2016 at 12:09
12
$\begingroup$

I don't think it's possible as of 2.77, but a quick workaround would be to use Clipping Border to visualize what's visible from camera regarding its field of view angle setup.

  1. Enter camera view (Numpad 0) and enable Clipping Border tool with Alt+B.
  2. Draw the rectabgle which should be the same as camera boundaries.

Now once exiting the camera view you'll see large grey cone of nearly the same area visible to the camera.

GIF of drawing clipping border

Note:

  1. Clipping border means that any geometry out of its boundaries is hidden.

  2. The border drawn may be not the most convenient while in 3D Viewport because of grey area it consists of.

$\endgroup$
3
  • $\begingroup$ Well that just makes my method look stupid haha. $\endgroup$ Commented Aug 18, 2016 at 14:28
  • $\begingroup$ @RayMairlot well I wouldn't say as Clipping Border hides any other geometry which may be undesirable and it has quite strange visualization in 3D Viewport (it's much more friendly with mesh), but the method is faster. $\endgroup$
    – Mr Zak
    Commented Aug 18, 2016 at 14:39
  • $\begingroup$ Thanks for this, have never used that before but looks like it should work. I also thought your idea Ray was good! $\endgroup$
    – Dan
    Commented Aug 18, 2016 at 20:43
3
$\begingroup$

Blender has an option to display camera bounds. The option is only available for the 3D stereoscopy camera. If we want to use it for a normal camera it is possible to enable the multi-view option without altering the camera view, this needs to be disabled again to render unless you setup the camera properly.

views options

Once enable we have the stereoscopy panel in the 3Dview properties panel (N)

stereo settings

3dview with camera volume

$\endgroup$
2
$\begingroup$

Currently there is no built in way to do this. Someone did start building a patch for this here, with the developer, Ulysse Martin, stating:

I'm not convinced about the usefulness of this too finally. So I close the task for the moment, and if users request such a feature, I'll reopen it.

If you feel this is an important feature I would suggest commenting on the patch as Ulysse Martin suggested.

However, I was able to make a rough camera frustrum by modelling it with geometry:

enter image description here

  1. Select the camera, press Shift+S and choose Cursor to selected.
  2. Go to the camera view (Numpad 0) and add a Plane with Shift+A, which results in:

enter image description here

(This depends on the Editing user preference Align To set to View, so new objects are aligned to where you are looking)

  1. Extrude the plane along its face normal until it aligns with the front of the camera.
  2. Scale down the face so it matches the camera shape. Using a local transform manipulator can help with this:

enter image description here

  1. Select the other end of the cube and press S,0 to scale down the face to a point.

  2. Select the face that aligns with the front of the camera and press G twice to perform an Edge Slide. While edge sliding press C to turn off Clamping. You can now adjust the 'camera frustrum' to be as big as necessary:

enter image description here

You could then parent the frustrum object to the camera with Ctrl+P so it follows the camera if you move it.

For convenience, while doing this I set the object to Wire display mode by going to Object Properties> Display and setting Maximum Draw Type to wire.

I'm not sure if you want to go to this effort or if this is even useful doing it in this manner (as it may still be hard to tell what is inside or outside the object), but this is the only way I know of doing it.

$\endgroup$
1
$\begingroup$

As an extension to Rays answer, this script automates making a camera frustum mesh object,

the object can also be scaled up to show it at further distances

a camera frustrum mesh object and camera object together at the same position, with the mesh scaled up

import bpy
import math

scene = bpy.context.scene
camera = scene.camera

# this script tries to recreate what the camera shows in the viewport (orange pyramid) as a mesh

# the viewport camera looks like a point and a plane, this starts by making the plane

#  get the height scale for the new plane
#  like 9/16 for a 16:9 ratio
height_ratio = scene.render.resolution_y / scene.render.resolution_x

new_plane = bpy.ops.mesh.primitive_plane_add(
    size=1,
    enter_editmode=False,
    align='WORLD',
    scale=(1, height_ratio, 1),
    location=(camera.location),
    rotation=(camera.rotation_euler),
)

# make the plane have the correct aspect ratio (like 16:9)
# (for some reason, setting scale when creating doesn't work)
bpy.ops.transform.resize(value=(1, height_ratio, 1), orient_type='LOCAL')


#  using trigonometry to figure out the plane distance from the camera point
# (imagine looking from above the camera, and halving it into two right angle triangles)
#  using half the FOV as the angle, and knowing the length of the OPPOSITE side (0.5) , we can calculate the ADJACENT side (distance from camera point to the camera rectangle shown in the viewport)


# for the Soh Cah Toa trigonometry stuff, this is half the width of the plane (the plane width is 1)
opposite = 0.5

camera.data.lens_unit = 'FOV'
field_of_view = camera.data.angle

# this is the angle for the trigonometry right angle triangle
angle_radians = camera.data.angle / 2
extrude_distance = opposite / math.tan(angle_radians)

#  turn on edit mode
bpy.ops.object.editmode_toggle()
# select the planes face
bpy.ops.mesh.select_all(action='SELECT')
# move it to the same position as the camera rectangle shown in the viewport
bpy.ops.transform.translate(value=(0, 0, -extrude_distance), orient_type='LOCAL')
# extrude it backwards to the camera point
bpy.ops.mesh.extrude_region_move(
    MESH_OT_extrude_region={},
    TRANSFORM_OT_translate={
        "value": (0, 0, extrude_distance),
        "orient_type": 'NORMAL',
        "orient_matrix_type": 'NORMAL',
        "constraint_axis": (False, False, True),
    },
)
# join the extruded face in the middle into one point, so it makes a pyramid shape
bpy.ops.mesh.merge(type='CENTER')

# turn off edit mode
bpy.ops.object.editmode_toggle()

# now there should be a mesh the same shape as the camera object
# the new mesh can be scaled to see the camera frustum at a longer distance

$\endgroup$
0
$\begingroup$

Initial Solution: AltB select the camera boundary. Pro: Simple Con: Limited view of other references.

Alternative Solution: Vertex/ Face Mask. Pro: Flexibility & control Con: N/A. enter image description here

Most Efficient Solution: Adjust Mesh to Camera View. Pro: No wasted vertices Con: Camera is set - less flexible. Less Geometry is elegant

$\endgroup$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .