Commit Graph

388 Commits

Author SHA1 Message Date
d0a2a8086c Fix T46222: Eyedrop picking objects inconsistently 2015-09-24 01:45:19 +10:00
114e7eaa09 Add WM_framebuffer_to_index_array
Convert buffer to index in one loop,
also minor cleanup to backbuf/selection functions.

- Use IMB_rectcpy instead of inline pixel copy.
- Redundant WM_framebuffer_to_index call.
2015-07-11 23:21:41 +10:00
aa880bb815 Cleanup: use ED_view3d_backbuf_* prefix 2015-04-21 03:19:27 +10:00
57d9badc21 Cleanup: use bool /w flag checks 2015-04-21 01:50:20 +10:00
50e9868abe Fix T43785 crash with border select.
Naming here is slightly misleading. We have:

* Number of elements (objects) that can be picked
* Buffer size
* Number of integers in buffer.

Interestingly enough, bufsize in OpenGL (as far as I could find in
examples on the web) and in most of the code refers to the latter and
actual buffer size is only used whenever we do allocations on the heap.
Added an extra defines here to make things a bit clearer:

* MAXPICKELEMS refers to the number of objects that can be picked
* MAXPICKBUF   refers to the number of integers in the selection buffer

Also made all buffers use MAXPICKBUF where some used MAXPICKBUF * 4.
That means that some parts of blender will use less space for selection
now. MAXPICKBUF is set to 10000 for 2500 object selection, which can be
changed at any time, but I think 10000 integers on the stack touches the
borders of uglyland anyway.
2015-02-24 17:19:07 +01:00
bcbbc66795 Cleanup: unused headers 2014-11-28 15:52:30 +01:00
5c6e333780 UI Refactor T41640
Make the UI API more consistent and reduce confusion with some naming.

mainly:
- API function calls
- enum values

some internal static functions have been left for now
2014-11-10 23:06:54 +01:00
33f388d7bf Cleanup: style 2014-10-21 20:14:26 +02:00
d968a1ebb0 Fix T42189
Own mistake - not copying enough data.
2014-10-20 12:35:49 +02:00
101a1dddae Fix T41995: Box selection - Edit mode - Header not updated. 2014-09-28 23:47:05 +02:00
fc3753b8f6 gooseberry request:
Attempt to select closest bones when possible.

Occlusion query selection does't support this well because we can't
really derive depth information from occlusion tests. May be possible to
improve this somewhat in the future.
2014-09-24 18:22:02 +02:00
3906782406 Fix possible buffer overflow in selection code. We want to copy the
number of selected data since the offset, not the offset!
2014-09-23 19:05:41 +02: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
d419e2e90c WM: add WM_operator_properties_create_ptr
Call operator types directly and avoid a lookup when their known.
2014-07-11 15:07:55 +10:00
7df2717727 Add ED_paint.h, split out ED_sculpt.h
also rename some functions to match our convention
2014-06-23 22:00:44 +10:00
9a7bfca448 WM: set circle select minimum radius to 1 2014-06-22 13:03:20 +10:00
a6bd6a8366 Add notifiers and reuse update calls for flood fill operators 2014-05-29 04:48:06 +03:00
b82d639f3d Stop all dynamic enums using translations (from blend file data) 2014-05-05 15:23:35 +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
c67bd49e56 Code cleanup: use 'const' for arrays (editors) 2014-04-27 00:25:15 +10:00
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
0a3850fde4 Fix T39123: Border select without "extend" does nor clear selection of bezier nodes in 3D view
This is a regression introduced in fbc7ab30f and caused by the wrong object
being passed to the function.

Not sure passing editnurb as an argument is a good thing to do..
2014-03-12 14:07:26 +06:00
4cfd14644b 3D Text: textbox selection while in editmode
D395 from Henrik Aarnio with some improvements.
2014-03-11 17:16:08 +11:00
57dba73917 View3d: take pixelsize into account for selection distance 2014-03-11 15:34:19 +11:00
9742a6f6cb Resolve T38899: changes to Ctrl+Selectmouse conflict with LMB select 2014-03-01 19:26:55 +11:00
4a61df9c95 Fix T38837: Ctrl+RMB can't select posemode
This used to work (unintentionally), now check for paint-select
modes as well as editmode for ctrl+rmb to force object selection.
2014-02-26 16:05:29 +11:00
081a3412a9 Paint API: add BKE_paint_select_elem_test: to check on paint selection 2014-02-26 16:00:54 +11:00
1dd7e759a0 Sculpt: allow to select objects when in sculpt mode
This was disabled with circle select (which makes sense), but all other
paint modes allow this and sculpt isnt using select mouse.
2014-02-26 15:41:42 +11:00
Kevin Mackay
fbc7ab30ff Curves: save active point to file
Changed curve active point from pointer to index. Allows curve active point to be saved to file and retained between modes for free. Also some small optimisations by removing pointer look up code.

- Made active point access functions into BKE API calls.
- Fixes operators where curve de-selection resulted in unsel-active point.
- Split curve delete into 2 functions
2014-01-27 15:21:04 +11:00
1fb9bb815a Fix for own regression, editmode object selection (Ctrl+RMB)
Wasn't working because of editmode override (which uses regular object selection in editmode)
2014-01-15 00:28:55 +11:00
6734936c13 RNA API: use bool's for enum itemf callbacks. 2014-01-04 18:10:01 +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
aed672ac1e Border select for sculpting, using B shortcut, warmup for more advanced
masking, like lasso selection.
2013-10-27 03:31:19 +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
03602dc158 use BLI_bitmap for editmesh selection buffer to save some memory. 2013-10-10 22:30:16 +00:00
bfd6f6041d remove redundant NULL checks 2013-10-08 19:47:53 +00:00
d6a52c67d5 fix [#36861] In face select masking circle select selects all when out of focus. 2013-09-30 07:58:38 +00:00
ea94411db6 Enable vertex snapping to bundle positions
This means it's possible now to snap stuff to
reconstructed tracks positions.
2013-09-09 11:37:37 +00:00
8119791703 fix error in pose bone selection - head/tail mixup 2013-08-03 17:10:00 +00:00
78820edafc use bmesh for loop macros for looping over mesh verts/edges/faces 2013-08-01 18:33:35 +00:00
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00
bbc1945f36 revert part of own commit r58304, gives different behavior when de-selecting with the lasso in some cases, will look into this after release. 2013-07-16 03:41:09 +00:00
cf20aa8344 move ED_armature_edit_bone_select() into a more general utility function so view3d-select bone operators can use it and get matching selection behavior when entering editmode.
- specifically - write to the connected parents tipsel flag when setting the rootsel flag.
2013-07-16 01:49:20 +00:00
a91f51b67b allow deselection when bones BONE_UNSELECTABLE flag is set (lasso/box/circle select) 2013-07-15 02:03:31 +00:00
c749301a3b patch [#35765] Improve performance during select object in viewport. Up to 3x speedup.
from Alex Babahin (tamerlan311)

replace goto's with static functions.
2013-06-17 06:17:19 +00:00
f9f7654497 Bugfix #35747
Lasso select could crash if there was an Armature in PoseMode somewhere.
Issue also in previous release(s).
2013-06-15 15:10:21 +00:00
6a60bf2f03 Added support for Vertex Weight panel in weight Paint Mode 2013-06-15 10:18:16 +00:00
e9d2cd8db2 code cleanup: remove checks for (select == LEFTMOUSE), this happened to work because its defined at 1, but confusingly checks against RIGHTMOUSE fail. 2013-06-15 06:03:15 +00:00
ec8d277c64 BLI_math rename functions:
- mult_m4_m4m4 -> mul_m4_m4m4
- mult_m3_m3m4 -> mul_m3_m3m4

these temporary names were used to avoid problems when argument order was switched.
2013-05-26 18:36:25 +00:00
f74201190d code cleanup: remove references to BLI_rand.h 2013-05-08 12:59:35 +00:00