Commit Graph

252 Commits

Author SHA1 Message Date
1377847e7b View3D: Add ED_view3d_dist_range_get
remove hard coded limits
2014-08-25 14:20:40 +10:00
f81b6e57cb Add missing forward declaration and missing 'struct' keyword 2014-08-05 10:50:35 -04:00
eb016eb3ae Fix T41258: Crash when entering edit mode while viewport render is enabled
The issue was caused by the render engine loading edit mesh, which re-allocates
mesh array which might be referenced by other object's derived meshed.

Worst thing about this is that updating render engine happens from the end of
scene update function, after all the objects are updated and so. This is needed
so render engine gets the update objects which is correct.

The only proper way to solve the issue is to make it so viewport engine does not
leave objects in inconsistent state, meaning nobody will reference to freed data.

In order to reach this we do edit mesh loading before running objects update so
all the objects which uses that mesh will have proper references in the derived
mesh.

This also solves old creepyness which happened before when having single object
in edit mode. tweaking it will calculate derived mesh as a part of scene update,
then this derived mesh will be freed by edit mesh loading and viewport will be
creating derived mesh again.

Now render engine is expected to do nothing with meshes which are in edit mode,
but they still need to load edit data for non0meshes. It's not really easy to
do from the BKE level because needed functions are implemented in the editor.

Thanks Campbell for the review!

Differential Revision: https://developer.blender.org/D697
2014-07-31 20:25:11 +06:00
17021171f1 Occlusion Query based selection.
This patch creates an interface for selection mechanisms in opengl. This
makes it possible to switch between occlusion query based or select
rendermode based selection transparently.

This is really useful on graphics drivers that do not accelerate the
select rendermode path (some ATI cards are notorious for this, and the
new path is used by default there), since occlusion queries are always
hardware accelerated due to their use in games.

The option can be found under system - selection. Auto just enables
occlusion queries for ATI users while the rest of the options enforce
one of the two methods always.

There is just one known change, previous code enforced nearest bone to
always get selected, even when mouse selecting near the same position, I
couldn't replicate the behaviour though.

patch by me with edits and review by Campbell.

Thanks!
2014-07-23 15:26:08 +02:00
f745564e4e GSOC 2013 paint
Yep, at last it's here!

There are a few minor issues remaining but development can go on in
master after discussion at blender institute.

For full list of features see:

http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.72/Painting

Thanks to Sergey and Campbell for the extensive review and to the
countless artists that have given their input and reported issues during
development.
2014-07-21 12:02:05 +02:00
730a1556a6 Fix T40867: Autokeyframe in camera view 2014-06-30 13:37:37 +10:00
3db4d70b1f Code cleanup: use const passing rects 2014-06-19 17:36:00 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
bd57ec686c Fix T39397: Leaving leaving camera from quadview set ortho 2014-03-25 15:14:34 +11:00
e5f1c0bd63 View3D: remove orbit snapping LUT, allow to snap axis but not roll 2014-03-20 15:19:02 +11:00
57dba73917 View3d: take pixelsize into account for selection distance 2014-03-11 15:34:19 +11:00
021b07e87c NDOF: various fixes for view3d
- allow zooming when in ortho+user mode
- fix for using VIEW3D_OT_ndof_orbit_zoom when the camera is locked.
- fix for locked camera changing the dist value when used with ndof.
- de-duplicate ndof_pan_zoom and ndof_all operators
2014-02-24 15:17:47 +11:00
ea58918171 NDOF: define 2 default navigation modes: free & orbit
After some discussion it seems both are valid defaults but useful for
very different purposes.

- 'free' lets you explore the scene with full 6dof (like fly mode)
- 'orbit' is closer to typical mouse view orbit, constraining to orbiting about a central location.

This doesn't effect orbit/pan which are available with modifier keys.
2014-02-20 12:02:59 +11:00
7731a940d1 View3d: add utility function to get the quat from a view axis 2014-02-12 14:16:02 +11:00
5c8d5c70cf View3d: ensure locked views are on an axis - behavior wasn't well defined. 2014-02-12 11:26:02 +11:00
afadaaf8e0 Code cleanup: fix a few visual studio compiler warnings. 2014-02-11 18:49:32 +01:00
0b5d0f9818 View3d: move lock check for orbit into a function and use for dolly too 2014-02-04 21:45:13 +11:00
77089a3bf2 Fix T38358: Face snapping fails on Orthographic view
Issue is caused by start point of ray used to detect faces under the mouse is set rather far away in ortho 3dviews.
The loss of precision on the ray location induced by this can lead to face snapping failures.

Solution is to do the raycasting with a temp start point, much closer to the object we check, and add back
to the found distance the diff to the real start point once detection is done (as we need all hit distances
from all tested objects to be relative to a common point!).

Note this commit only addresses the "face snapping on mesh" case, other kind of snapping do not seem to suffer
from this issue.

Reviewers: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D268
2014-01-29 20:10:03 +01:00
90e7be4710 Fix T37727: z-offset problems with camera view 2013-12-09 21:20:08 +11:00
75348e6c13 View3D API: rename view3d_camera_get to ED_view3d_camera_data_get 2013-12-09 21:20:07 +11:00
ff7dbdbaee rename give_cursor to ED_view3d_cursor3d_get 2013-10-26 04:07:18 +00:00
bae2b9dea3 Pampa Project request: FPS in sequencer editor
perhaps ED_scene_draw_fps is actually better to be placed
to a better place, but consider this is good for now.
2013-10-17 21:17:33 +00:00
8cdeba8d67 Fix #36948: blender internal viewport render crashes holding shift+Z pressed
to quickly toggle it on/off.

Problem is accessing freed data, now the job is ended immediately. Fix based
on patch from Sergey and investigation from Bastien.
2013-10-04 12:30:00 +00:00
17c32df7ef fix [#36732] Auto depth feature misbehaves on orbit with mouse cursor outside the model.
ortho mode didn't store the depth for re-use when the cursor had no depth.
2013-09-16 08:59:54 +00:00
092d9c31a1 Bug fix, irc submitted:
3D Viewport render (internal) didn't render bump maps (it was black even).
2013-05-25 11:52:52 +00:00
562ed2b42e add in asserts when rv3d->viewmatob, rv3d->persmatob are not initialized.
This is often hard to spot since in many cases it works correctly even
when not initialized but may still fail in other situations.
2013-05-08 13:00:52 +00:00
a947ea0a1e disable view3d dolly, move, pan -- when the view offset is locked, also corrected fly modes offset lock check
and added ED_view3d_offset_lock_check() to reuse between functions.
2013-05-03 07:29:25 +00:00
c8cf9415de Fix #35149: solidify modifier + vertex parent not working after going in and out
of editmode on the child object.

Problem was that the object custom data mask was not taken into account when
rebuilding the derivedmesh in some cases, which is needed for the derivedmesh
to contain the mapping back to the original vertices. Now this data mask is
used for any derivedmesh build that will be cached.

Also problematic was that the datamask for the active object was applied to
all objects in the scene, which caused the parent object to be recalculated
when it didn't need to be. Now this datamask is only used for the active object.
2013-05-01 14:34:12 +00:00
36e7a98459 fix [#35007] clipping border error
add clip option to ED_view3d_win_to_ray(), ED_view3d_win_to_segment()
2013-04-22 20:00:37 +00:00
c9a10b99ff Cycles: optimization for 3D viewport border render with heavy scenes, the OpenGL
render of objects could slow things down when redrawing the view each time a new
sample is displayed.

Now it does a partial redraw of the viewport with only the render border area,
skipping OpenGL object drawing while the render is refining.
2013-04-14 21:42:58 +00:00
120fe74ffe Fix #34817: improve OpenGL preview render speed, it got quite a bit slower since 2.60.
Doing linearization with GLSL was already faster, but even faster is to just read the
bytes instead of floats and convert those to linear, since byte => float is just a quick
256 entry table lookup. Also made it assign the bytes directly to the image buffer so
they do not need to be converted back from float to byte for file saving, and made sky
render write the background color with OpenGL instead of doing it on the CPU.
2013-04-11 15:15:06 +00:00
1c3c4f3954 code cleanup: use bool's for vgroup and editmode. 2013-04-05 14:58:30 +00:00
09721bffc0 replace view3d_get_view_aligned_coordinate with ED_view3d_win_to_3d_int() 2013-03-26 02:37:29 +00:00
8655be437d code cleanup: use bool where values are true/false, for view3d and related functions. 2013-03-20 23:14:18 +00:00
e7c15beaf6 code cleanup: use booleans for mesh and selection code. 2013-03-19 23:17:44 +00:00
7049bf0598 Fix: Setting cursor to semitransparent objects will fail because of clip
alpha, added option when drawing depth to disable alpha clip override.
We use that in texture paint cursor now. Not too common but may be
useful for people dealing with cloning plugins.

Reported by kgeogeo on irc, thanks.
2013-03-17 20:24:47 +00:00
3dababa7ec code cleanup: name mesh functions more consistently, also use bools for mesh args. 2013-03-17 19:55:10 +00:00
2d21e6521f Fix: multisample viewport drawing didn't work well with selection or particle
brushes, due to issues with color coded drawing or slow/buggy reading from such
a buffer on some systems.

In case multisample is enabled now, it uses an offscreen buffer for such drawing,
which is not multisampled and so should not cause issues. This does mean there is
some extra GPU memory usage when multisample is enabled, and we could optimize
triple buffer to work together here somehow to share buffers, but it's better than
having selection not working.
2013-03-15 19:56:33 +00:00
8dd2464626 minor knife refactor to prepare for running non interactively. 2013-03-14 13:58:56 +00:00
1158f06b57 code cleanup: de-duplicate view clipping function for paint and knife tool, minor changes to knife initialization. 2013-03-14 07:56:40 +00:00
abd1748e48 code cleanup: move runtime var zfac out of RegionView3D. rename initgrabz() -> ED_view3d_calc_zfac() and have it return the zfac to use. 2013-03-09 11:40:42 +00:00
4a01ba4ba5 ruler3d: replace ED_view3d_cursor3d_position() with lower level function view3d_get_view_aligned_coordinate() 2013-03-09 10:28:28 +00:00
ddddb7bab1 code cleanup: favor braces when blocks have mixed brace use. 2013-03-09 03:46:30 +00:00
9b5edeb881 code cleanup: view3d_clipping_test was making a vector copy for no reason. 2013-03-04 07:15:09 +00:00
4f4e45540d fix for harmless glitch rotating the camera in camera mode, having the center point so close to the viewpoint caused the helper line to erratically move about because of float precision. 2013-02-28 11:29:27 +00:00
13670e1e06 code cleanup: pass mval to ED_view3d_cursor3d_position() rather then event x/y 2013-02-21 17:11:38 +00:00
fa0805e287 Changes for opengl render to reflect new alpha premul pipeline
without hurting quick texture painting

- ED_view3d_draw_offscreen will now output buffer with
  transparent alpha, if sky needed it should be alpha-undered
  later.

- ED_view3d_draw_offscreen_imbuf now accepts alpha mode as an
  argument which could be either R_ADDSKY or R_PREMULALPHA

- OpenGL render and sequencer's opengl preview will now reflect
  scene's Alpha Mode

- Quick Edit will use OpenGL with transparent alpha mode
2013-01-05 15:33:18 +00:00
cffd10a7c8 Todo item:
- Drop group into 3d window now puts itself at mouse cursor location.
- Drop objects into 3d window now doesn't move the 3d cursor anymore.

Added new function ED_view3d_cursor3d_position() to handle this,
so the temporarily object-drop operator macro also could go away.
(Which was setting 3d cursor)
2012-12-26 16:24:50 +00:00
4612bbf7db add zbuf/depth option to weight paint lasso select. 2012-12-23 03:04:19 +00:00
c27d22ab71 fix own regression in 2.65 [#33643] Rotation does not work at certain zoom level
caused by not projecting points behind the perspective view,
even though this worked in 2.64 the values were flipped (rotating direction was reversed and the center point was flipped).

added V3D_PROJ_TEST_CLIP_NEAR, when omitted ED_view3d_project_*** will project points from behind a perspective view plane.
2012-12-21 03:49:47 +00:00