Commit Graph

70429 Commits

Author SHA1 Message Date
Bastien Montagne 2788202417 Cleanup: moar G.main removal from BKE area. 2018-06-12 17:57:24 +02:00
Bastien Montagne f27ecd56ef Cleanup: BKE_scene_free should not have to worry about cleaning its usages.
This is supposed to be handled by calling code! Henceforce, no need to
call BKE_sequencer_clear_scene_in_allseqs() here, and... no need for
that ugly G.main case. ;)
2018-06-12 17:46:16 +02:00
Campbell Barton b00d840359 WM: remove sloppy region type access
Avoid accidentally operating on the wrong region type.
2018-06-12 17:34:44 +02:00
Campbell Barton 760e79d809 WM: rename BKE_regiontype_from_id
This returns the first as a fallback, causing confusing usage.
Renamed and added a version of the function that doesn't.
2018-06-12 17:26:38 +02:00
Bastien Montagne ec4ce908db Fix T55452: Crash on saving with visible particle system.
Missing Main pointer in recent refactor/cleanup of G.main usages...
2018-06-12 16:17:05 +02:00
Bastien Montagne a6585fa4b1 Cleanup: moar removal of G.main in BKE area... 2018-06-12 15:16:45 +02:00
Bastien Montagne d617a6c85b Cleanup/simplify G.main usages.
Using G.main only to get main bled filepath, or built-in fonts, is OK.
So now using the 'valid' G_MAIN macro here instead.
2018-06-12 15:03:51 +02:00
Bastien Montagne be57cf9b2a Cleanup: remove moar G.main from BKE area. 2018-06-12 12:53:27 +02:00
Bastien Montagne 5508b572ea Cleanup: remove some G.main from ED's animsys.
The easy ones - there some much, much trickier to tackle there...
2018-06-12 12:28:14 +02:00
Bastien Montagne 75bcb70c60 Cleanup: remove some G.main from BKE area. 2018-06-12 11:21:54 +02:00
Lukas Stockner 7bf4023689 Fix T55448: Typo in Cycles CUDA debug output
Reviewers: sergey, lukasstockner97

Reviewed By: lukasstockner97

Tags: #cycles, #bf_blender

Differential Revision: https://developer.blender.org/D3472
2018-06-12 10:45:32 +02:00
Bastien Montagne 78a8d3685b Cleanup: remove moar ugly G.main usages...
BKE_image was an ugly nest, could fix all but the ones from compositor,
so moved ugly G.main there, at least we know where the Evil is that way ;)
2018-06-11 15:40:37 +02:00
Sergey Sharybin b763c34e80 Cycles: Cleanup, silence strict compiler warning
There is one legit place in the code where memcpy was used as an
optimization trick. Was needed for older version of GCC, but now
it should be re-evaluated and checked if it still helps to have
that trick.

In other places it's somewhat lazy programming to zero out all
object members. That is absolutely unsafe, at the moment when
less trivial class is used as a member in that object things
will break.

Other cases were using memcpy into an object which comes from
an external library. We don't control that object, and we can
not guarantee it will always be safe for such memory tricks
and debugging bugs caused by such low level access is far fun.

Ideally we need to use more proper C++, but needs to be done with
big care, including benchmarks of each change, For now do
annoying but simple cast to void*.
2018-06-11 13:02:10 +02:00
Sergey Sharybin a6e582164f Libmv: Cleanup, make strict compiler more happy
In C++ it is not really safe to memcpy objects, and newer GCC will warn
about this. However, we don't use our vector for unsafe-to-memcpy objects,
so just explicitly silence that warning.
2018-06-11 13:02:10 +02:00
Bastien Montagne d0956e9cb3 Cleanup: Moar G.main removal of Hell.
This commit actually adds some G.main... but at much, much higher level
than the ones it removes, so should still be better ;)
2018-06-11 12:15:14 +02:00
Bastien Montagne 8055ed2741 Cleanup: remove some G.main usages... 2018-06-11 12:15:14 +02:00
Sergey Sharybin 13d238729b Fix bad level stubs 2018-06-11 11:36:22 +02:00
Sergey Sharybin 28c34ae7e2 Cleanup: Use BLI_strncpy
It has behavior which we expect, and silences strict compiler warning.
2018-06-11 11:06:15 +02:00
Philipp Oeser 4d339f56fe Fix T55278: Lightmap Pack > New Image broken when active object is None
thanx bblanimation (Christopher Gearhart) for spotting the issue and
providing the fix!

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3449
2018-06-11 11:02:07 +02:00
Campbell Barton 9e8bd3a072 path_util: avoid overflow w/ strtoll use
Also style cleanup.
2018-06-11 10:46:02 +02:00
Philipp Oeser 1d8d4e03f5 Fix PyConsole: Drag events finished early in modal text selection 2018-06-11 10:18:51 +02:00
Philipp Oeser 7ac0272b77 Fix T55140: opened image doesn't show up in movie clip editor
atoi usage in BLI_stringdec could overflow, use strtoll instead and
check
valid range with INT_MIN and INT_MAX

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3452
2018-06-11 09:57:16 +02:00
Philipp Oeser 474a145d78 Fix T55349: crash adding paint slot when object is on hidden layer
use better poll and get ob with 'ED_object_active_context' (instead of
'CTX_data_active_object')

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3467
2018-06-11 09:12:29 +02:00
Campbell Barton d0a16772ad WM: add macros to check mouse button/gesture/wheel
Use to check click/drag,
fixes issue with mouse wheel triggering pie menu.
2018-06-10 12:08:09 +02:00
Campbell Barton ae01df5779 Cleanup: trailing space in CMake files 2018-06-10 08:19:03 +02:00
Campbell Barton 2e14b7fb97 RNA: remove Layout.introspect
This was added as an experiment to extract information for docs
but this was never all that useful for its intended purpose.
2018-06-09 18:55:51 +02:00
Campbell Barton 83cb34ccd1 Cleanup: unused functions 2018-06-09 18:47:39 +02:00
Bastien Montagne 638de72277 Cleanup: remove some G.main usages. 2018-06-09 15:17:04 +02:00
Campbell Barton fb565ddb68 Cleanup: trailing space in RNA 2018-06-09 14:40:09 +02:00
Campbell Barton 56a47e58f4 Cleanup: style 2018-06-09 14:30:32 +02:00
Campbell Barton 9bcced83ee GHOST/X11: Print the keycode w/ debug enabled 2018-06-09 12:53:39 +02:00
Campbell Barton 6f4c7f1f01 GHOST/X11: Correct non-latin kb workaround case
Harmless since this is always enabled,
only do this for easier troubleshooting when disabling the define.
2018-06-09 12:04:07 +02:00
Campbell Barton f3427cbc98 GHOST/X11: support accessing physical keycodes
This means we can check keys such as tilde in a generic way.
2018-06-09 11:23:41 +02:00
Campbell Barton 5165d62931 WM: correct recent change to click/drag detection
fb1915d870 - caused click/drag events not to be detected.

Now check a key is a mouse or keyboard event.
2018-06-08 22:17:21 +02:00
Campbell Barton 1857823839 WM: fix panel drag event handling 2018-06-08 18:58:41 +02:00
Campbell Barton 2dc7555522 WM: fix node link & background drag 2018-06-08 18:55:47 +02:00
Campbell Barton 540e85d567 GHOST/X11: Map unknown es,dk keys to accentgrave 2018-06-08 15:21:20 +02:00
Campbell Barton 4127aeb7a5 GHOST/X11: Map unknown de,fr keys to accentgrave
This still uses the correct string when typing text,
it just allows the key to be used in keymaps.

We should eventually add scan-code support.
2018-06-08 14:53:03 +02:00
Campbell Barton fb1915d870 Prevent wheel causing spurious click/drag events 2018-06-08 14:09:45 +02:00
Bastien Montagne 7b6af843c2 Cleanup: getting rid of G.main.
Sometimes one needs a *lot* of changes for a single G.main... :/
2018-06-08 12:17:22 +02:00
Jeroen Bakker 55606dbdbc CMake: disable WITH_COMPILER_ASAN for CMAKE_BUILD_TYPE Release 2018-06-08 11:45:53 +02:00
Campbell Barton dff8a7db73 Fix regression in grease pencil drawing
Drag events finished drawing early.
2018-06-08 10:52:49 +02:00
Campbell Barton 20367898fe Fix T55301: Transform confirm on release fails w/ MMB 2018-06-08 08:48:21 +02:00
Campbell Barton e3fe8ce00b WM: backport event/keymap type util from 2.8 2018-06-08 08:46:31 +02:00
Campbell Barton a25c11fd8d Cleanup: trailing space
Remove from blender/nodes, collada, blenfont & render.
2018-06-08 08:07:48 +02:00
Campbell Barton 009c38df53 Fix recently added drag events closing menus 2018-06-08 08:01:43 +02:00
Campbell Barton 8f49299134 WM: fix drag events applying after release 2018-06-07 20:39:17 +02:00
Campbell Barton cfc1ddeff7 GHOST/X11: Xinput/XIM support caused double key-up
All keyboard events were sending double key events (including modifiers)
when xinput was enabled with gnome (causing much confusion!).

I cant test if XIM works,
but this isn't useful to send double events, so disabling for now.
2018-06-07 20:35:06 +02:00
Bastien Montagne 80dcb2ced8 Cleanup: typo, and 0 -> false for booleans. 2018-06-07 18:36:16 +02:00
Campbell Barton d274c64d22 WM: add support for drag events
This allows for a single key to be mapped to both release and drag,
useful for pie menus to share a key with a different action.
2018-06-07 17:06:01 +02:00