Commit Graph

401 Commits

Author SHA1 Message Date
b8a6cd0140 Cleanup: comments, style 2015-03-23 22:52:33 +11:00
d28bfb5022 Cleanup: constify view3d/camera 2015-03-21 22:44:13 +11:00
e0611ca832 View3D: fix view-selected zoom logic
- Correct logic converting radius to view distance.
- Wasn't taking view-zoom into account converting lens to angle.
- Support framing the selection in the camera bounds (for camera locked views).

Add ED_view3d_radius_to_dist to handles these details.
2015-03-21 15:33:10 +11:00
e160da30ea View3D: Quad-view opposite axis switching
Pressing Numpad9 now orbits to the opposite side in any viewport,
with the advantage that it can switch locked-quadview axis to their opposite side.
2015-03-13 04:48:23 +11:00
56f794fce6 Cleanup: de-duplicate view3d clipping 2015-03-12 23:49:15 +11:00
780bb88a7a Refactor 'fit in camera view' code, and expose it to RNA.
This changes BKE's fitting code to use `BKE_camera_params_compute_viewplane` instead of
`BKE_camera_view_frame`. This allows that code to work with orthographic projection too.

Also, two funcs were added to rna's Object, to resp. get the projection matrix of that
object (mostly useful for cameras and lamps objects), and return position this object
should be to see all (to fit) a given set of points.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D961
2015-01-03 12:05:23 +01:00
bcbbc66795 Cleanup: unused headers 2014-11-28 15:52:30 +01:00
92f13f7287 Fix T42618: Lock to view + autokey bug
in fact support for this combination wasn't added at all.
2014-11-24 00:27:50 +01:00
bfa24aa945 Keymap: PKey only runs BGE when engine is set 2014-10-28 13:34:11 +01:00
d968a1ebb0 Fix T42189
Own mistake - not copying enough data.
2014-10-20 12:35:49 +02:00
1377847e7b View3D: Add ED_view3d_dist_range_get
remove hard coded limits
2014-08-25 14:20:40 +10:00
7df4fc5eaf Spelling 2014-08-13 09:34:37 +10: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
374527ab03 Code cleanup: de-duplicate calls wmOrtho, wmFrustum 2014-06-19 17:36:00 +10:00
3db4d70b1f Code cleanup: use const passing rects 2014-06-19 17:36:00 +10:00
31e15b56a4 Fix T40617: Ortho view selects objects behind camera 2014-06-16 16:55:57 +10:00
48881ad1e0 Code cleanup: doxy comments 2014-05-14 15:00:47 +10:00
45163387d2 Fix T39988: Selected object count invalid after exiting local-view 2014-05-02 05:56:57 +10:00
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
48446870a8 Code cleanup: remove redundant CTX calls 2014-04-30 08:11:47 +10:00
cdaff06026 Fix T38905: view3d.object_as_camera didn't store the last-view 2014-04-30 07:34:33 +10:00
4e3c9b01a0 View3d: api naming, for setting the view matrix. 2014-04-22 22:01:52 +10:00
bb507e4941 View3D: use smoothview for localview switching 2014-04-18 00:27:16 +10:00
69d127cade Code cleanup: use const for array args 2014-04-18 00:27:16 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
a99a8a6070 Code cleanup: style and warnings 2014-03-26 07:53:56 +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
aee30184f3 View3D: avoid matrix multiply using ED_view3d_boundbox_clip 2014-03-20 12:20:15 +11:00
26133a96ae Fix for VIEW3D_OT_camera_to_view with quadview, disable in camera view 2014-02-27 11:33:27 +11:00
dde6642dde Fix T38784: smoothview using perspective transition with ortho camera 2014-02-25 01:04:18 +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
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
a82700b961 Fix for view lock checks with ndof ops, was incorrectly comparing flags 2014-02-04 21:45:13 +11:00
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
6c1c6f22ce Removed the omat matrix from DupliObject.
This was storing the original object matrix, which builds on the
assumption that obmat is modified during dupli construction, which is a
bad hack.

Now the obmats are still modified, but this only happens outside of the
dupli system itself and the original ("omat") is stored as local
variables in the same place where the obmat manipulation takes place.
This is easier to follow and avoids hidden hacks as much as possible.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D254
2014-01-23 10:20:42 +01:00
709041ed0b Threaded object update and EvaluationContext
Summary:
Made objects update happening from multiple threads. It is a task-based
scheduling system which uses current dependency graph for spawning new
tasks. This means threading happens on object level, but the system is
flexible enough for higher granularity.

Technical details:

- Uses task scheduler which was recently committed to trunk
  (that one which Brecht ported from Cycles).

- Added two utility functions to dependency graph:
  * DAG_threaded_update_begin, which is called to  initialize threaded
    objects update. It will also schedule root DAG node to the queue,
    hence starting evaluation process.

    Initialization will calculate how much parents are to be evaluation
    before current DAG node can be scheduled. This value is used by task
    threads for faster detecting which nodes might be scheduled.

  * DAG_threaded_update_handle_node_updated which is  called from task
    thread function when node was fully handled.

	This function decreases num_pending_parents of node children and
	schedules children with zero valency.

    As it might have become clear, task thread receives DAG nodes and
    decides which callback to call for it.

    Currently only BKE_object_handle_update is called for object nodes.

    In the future it'll call node->callback() from Ali's new DAG.

- This required adding some workarounds to the render pipeline.
  Mainly to stop using get_object_dm() from modifiers' apply callback.
  Such a call was only a workaround for dependency graph glitch when
  rendering scene with, say, boolean modifiers before displaying
  this scene.

  Such change moves workaround from one place to another, so overall
  hackentropy remains the same.

- Added paradigm of EvaluaitonContext. Currently it's more like just a
  more reliable replacement for G.is_rendering which fails in some
  circumstances.

  Future idea of this context is to also store all the local data needed
  for objects evaluation such as local time, Copy-on-Write data and so.

  There're two types of EvaluationContext:

  * Context used for viewport updated and owned by Main. In the future
    this context might be easily moved to Window or Screen to allo
    per-window/per-screen local time.

  * Context used by render engines to evaluate objects for render purposes.
    Render engine is an owner of this context.

  This context is passed to all object update routines.

Reviewers: brecht, campbellbarton

Reviewed By: brecht

CC: lukastoenne

Differential Revision: https://developer.blender.org/D94
2013-12-26 17:24:42 +06: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
63caaa2b12 Code Cleanup: rename vars for detecting change to be more consistent
rename change/is_change/is_changed/modified -> changed
also use bools over int/short/char and once accidental float.
2013-11-26 06:39:14 +11:00
ff7dbdbaee rename give_cursor to ED_view3d_cursor3d_get 2013-10-26 04:07:18 +00:00
c80c1c6f5c add copy_v4_fl4, replace QUATSET macro. 2013-10-22 03:31:21 +00:00
ebc2cc15c0 fix [#37067] Bone Crash
Holding Ctrl+RMB is supposed to select objects, while in editmode,
however it would end up calling editmode selection as well as pose selection while an armature was in editmode (which caused the crash).

Add the ability for view3d_opengl_select() to skip editmode selection.
2013-10-15 02:23:28 +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
b21b24573d lots of operator descriptions were incorrectly copy/pasted.
update some descriptions, others were removed and operators tagged as internal.

add a script to detect duplicate operator descriptions.
2013-09-30 05:50:41 +00:00
23626e0149 fix [#36444] view3d.viewnumpad operator should not animate
when running viewport operations with exec() rather then invoke(), perform the action immediately rather then using smoothview.
makes viewport operations usable from python scripts.
2013-09-16 04:04:44 +00:00
384b8aafbf patch to add backkbacks for game engine start/end,
by sjoerd_de_vries
2013-08-23 15:45:18 +00:00