Commit Graph

56172 Commits

Author SHA1 Message Date
Stefan Werner
d53093953f Turned off clang warnings in third party includes.
The latest clang compiler (at least the one in Xcode 9.4.1) warns about the register keyword and macro expansions using defined().
Since these warnings come from third party code, we can't address them directly in Blender. Silencing them via #pramgas will
at least keep the warnings during a build down to the ones that are relevant to Blender code.
2018-06-25 23:02:01 +02:00
Bastien Montagne
8a7f317666 Cleanup: Nuke most of G.main from GPU code. 2018-06-25 12:32:48 +02:00
Bastien Montagne
f33cb522dd Cleanup: Few more validation of G_MAIN usages... 2018-06-25 12:02:20 +02:00
Campbell Barton
b09387c388 Add back header needed win32 2018-06-25 09:46:03 +02:00
574c716f2d Cycles: change AO node color default to 1.0. 2018-06-24 12:24:30 +02:00
Campbell Barton
e61bbc00b7 Cleanup: move UI context menus into own file 2018-06-24 10:43:09 +02:00
Campbell Barton
f8a3636374 UI: alternate fix for empty context menu
block and layout could be NULL and checking this everywhere
wasn't practical.

Instead of lazy initializing, add UI_popup_menu_end_or_cancel
which cancels empty popup menus.
2018-06-23 10:31:10 +02:00
Sergey Sharybin
6cd0484de8 CMake: Make language explicit for per-file strict flags removal 2018-06-22 14:40:00 +02:00
Campbell Barton
a5f046f449 Cleanup: rename 3D cursor calculation vars 2018-06-22 12:55:15 +02:00
Bastien Montagne
2fe528424d Cleanup: remove last G.main from RNA.
Again, we cannot actually get rid of G_MAIN global access here, so in
most case just 'marked' them as valid, and added assert checks to ensure
we do only work with IDs in G_MAIN in those cases.
2018-06-22 12:35:41 +02:00
Bastien Montagne
101fd7ec06 Tweak new BKE_id_is_in_global_main to accept NULL pointer (and consider them as valid). 2018-06-22 12:26:45 +02:00
Bastien Montagne
cbf5c738d6 Cleanup: get rid of last G.main's in bpy area.
Essentially 'validating' them as G_MAIN, and adding some asserts in
dubious places, that handled IDs are actually in G_MAIN.
2018-06-22 11:37:47 +02:00
Bastien Montagne
1870a1adc7 BKE_library: Add func to check an ID is actually in G_MAIN database. 2018-06-22 11:37:08 +02:00
Aaron Carlisle
a0dce6810d Edit Mode: Bevel Op: Offset Soft Max to 100
This is consistent with the modifier
2018-06-21 13:46:11 -04:00
Campbell Barton
68f4a4641e Fix T55568: second click event ignored 2018-06-21 19:26:21 +02:00
Campbell Barton
51f6b25afd Revert "Fix T55568: second click event ignored"
This reverts commit 52aa963f0ef1b6f4abba6653e9a441dee234127a.

Fixed for keyboards, broke mouse buttons.
2018-06-21 19:24:53 +02:00
Campbell Barton
84dbf949d7 UI: don't show empty button context menu 2018-06-21 16:37:19 +02:00
Campbell Barton
a4f08297ed UI: preference for developer extras
Currently only used for "Edit Source" feature.
2018-06-21 14:54:21 +02:00
Campbell Barton
52aa963f0e Fix T55568: second click event ignored
Double-click handling caused the second click to be ignored
for keymaps that only handle click.
2018-06-21 14:04:43 +02:00
Campbell Barton
f1bc9331b1 Fix T55491: Double click fail in menu popups 2018-06-21 10:07:18 +02:00
Campbell Barton
3995b33a42 WM: don't make LMB a special case for double click 2018-06-21 09:49:30 +02:00
Campbell Barton
d312dbea2d Cleanup: naming (make it clear vars are squared) 2018-06-20 15:58:46 +02:00
Campbell Barton
372754c164 Screen: split ED_area_actionzone_find_xy
Add ED_area_actionzone_refresh_xy which can tag redraw
find no longer changes changes to the action zone.
2018-06-20 15:34:20 +02:00
Campbell Barton
5cad6afac6 Cleanup: rename is_in_area_actionzone 2018-06-20 15:34:20 +02:00
Bastien Montagne
fd48e685c3 Cleanup: remove some G.main from BKE's node.c
Validate some cases using G_MAIN instead (I don't think we want to work
on any other Main than G.main one when registering/unregistering nodes
etc.).

And when freeing, all ID not in Main shall now be tagged accordingly, so
we *should* not need to do that stupi search over all ntrees in G.main
to check wether we have to free it ourself or not!
2018-06-20 12:27:26 +02:00
Campbell Barton
d4519f54b3 UI: only show "Edit Translations" when addon used 2018-06-20 10:45:03 +02:00
Bastien Montagne
0a8af46707 Final cleanup of G.mains in render area. 2018-06-19 19:25:06 +02:00
Bastien Montagne
b5893b1ba3 Fix (unreported) passing CDLayer 'ID' instead of bitflag to a cdlayer mask!
Probably harmless, since I bet CD_ORIGINDEX is nearly always generated,
but still...
2018-06-19 16:25:24 +02:00
Bastien Montagne
b09a8203e9 Cleanup DM generation code for ProjPaint.
Two branches were actually doing essentially the same thing here, no
need to artificially complicate things. ;)
2018-06-19 10:48:37 +02:00
Bastien Montagne
64a2f98062 Fix (unreported) unauthorized relesing of derived_final DM in paint projection code.
NEVER free yourself DM returned by mesh_get_derived_final(), it's always
to one assigned to ob->derived_final!
2018-06-19 10:43:54 +02:00
Campbell Barton
751189e9d6 Vertex Paint: set sculpt object mode immediately
SculptSession.mode_type wasn't initialized until painting,
making it unreliable for checks in other parts of the code.

Also remove unnecessary initialization,
matching sculpt mode more closely.
2018-06-19 08:50:35 +02:00
Bastien Montagne
579631819f Fix T55503: File browser filter not working correctly.
There were two issues here, introduced by rB66aa4af836:
* Forgot to change length of some filter_glob var deep in filebrowser code.
* Truncating filter_glob in general can be dangerous, generating
unexpected patterns.

Last point was the root of the issue here, truncating to 63 chars string
left last group as 'match everything' `*` pattern.

To fix that to some extent, added a new BLI_path_extension_glob_validate
helper to BLI_path_util, which ensures we do not have last
wildcards-only group in our pattern, when there are more than one group.
2018-06-18 12:26:47 +02:00
Campbell Barton
b66ae8259e RNA: disable animation for file output options 2018-06-18 07:31:21 +02:00
Campbell Barton
2ceff8bd63 Python: Allow untrusted py-drivers to run limited expressions
Limit to a restricted set of built-ins, as well as the math module.
Also restrict of op-codes, disallowing imports and attribute access.

This allows most math expressions to run
without any performance cost once the initial check is done.

See: D1862 for details.
2018-06-17 20:01:05 +02:00
Campbell Barton
a24b4e6090 Cleanup: trailing space for remaining source/ 2018-06-17 17:06:28 +02:00
Campbell Barton
76c2203f9c Cleanup: trailing space for blenloader 2018-06-17 17:06:07 +02:00
Campbell Barton
6fc8a74886 Cleanup: trailing space for blenkernel 2018-06-17 17:05:51 +02:00
Campbell Barton
a262ea8c47 Cleanup: trailing space for compositor 2018-06-17 17:05:29 +02:00
Campbell Barton
410880552b Cleanup: trailing space for freestyle 2018-06-17 17:05:14 +02:00
Campbell Barton
e74bd46ede Cleanup: trailing space for imbuf module 2018-06-17 17:04:54 +02:00
Campbell Barton
1eed46c788 Cleanup: trailing space for modifiers 2018-06-17 17:04:27 +02:00
Campbell Barton
78fbd146f3 Cleanup: trailing space for DNA headers 2018-06-17 17:04:09 +02:00
Campbell Barton
4be752a93c Cleanup: trailing space in source/gameengine/ 2018-06-17 17:03:10 +02:00
Campbell Barton
5513da65b2 Cleanup: trailing space for BLI 2018-06-17 16:32:54 +02:00
Campbell Barton
f19ecdeec6 Cleanup: remove unused BLI_rebase_path 2018-06-17 16:26:47 +02:00
Campbell Barton
a0a1fc8938 Cleanup: BLI path extension API
Use BLI_path_extension_* prefix.
2018-06-17 16:13:24 +02:00
Campbell Barton
6453814ec0 BLI_path: add string size debug define
Off by default, only for debugging.
2018-06-17 15:35:00 +02:00
Campbell Barton
42103a3eb8 CMake: add missing headers 2018-06-17 11:56:20 +02:00
Campbell Barton
2f1e34cfcc Cleanup: use clamp_* from BLI_math (replace macro) 2018-06-17 11:50:56 +02:00
Bastien Montagne
ace8ad861d Fix T55427: Removing Vertex Group used by Data Transfer Modifier results in crash.
Only fixing crash, proper handling (a.k.a remapping) of all
possible cases here, for all possible data layers, is rather involved...
2018-06-16 16:22:00 +02:00
Campbell Barton
35c71aed25 UI: refactor drag-toggle for other button types 2018-06-16 16:04:26 +02:00
Campbell Barton
73abca1da0 UI: minor changes from 2.8
- Option to skip multi-data edits.
- Open hold buttons on drag.
- Utility function to set default value.
2018-06-16 15:44:13 +02:00
Lukas Stockner
799779d432 Cycles: change Ambient Occlusion shader to output colors.
This means the shader can now be used for procedural texturing. New
settings on the node are Samples, Inside, Local Only and Distance.

Original patch by Lukas with further changes by Brecht.

Differential Revision: https://developer.blender.org/D3479
2018-06-15 22:16:06 +02:00
Campbell Barton
2b9edbc98b WM: suppress drag events if motion is handled 2018-06-15 19:09:43 +02:00
Bastien Montagne
d645b1a78a Cleanup: some more G.main removal.
We are really starting to scratch the last bits here...
2018-06-15 17:42:17 +02:00
Bastien Montagne
49915e3241 Cleanup: validate G.main's in creator code.
Using G_MAIN here is valid!
2018-06-15 17:36:44 +02:00
Bastien Montagne
da9b1b14ed Cleanup: some more G.main removal/validation... 2018-06-15 17:21:07 +02:00
Howard Trickey
b84fad2ba3 Fix T55490, intersect two triangles fails.
Need to use the 'use_partial_connect' option in island connect,
so changed signatures of various functions to pass that into and
then down from BM_mesh_intersect (making true for intersect, false
for boolean).
Then fix bm_face_split_edgenet_partial_connect to work when
input edges are not necessarily wire, but at least not in the
face they are being connected in. That caused generalization
of core BM_vert_separate_hflag_wire (which is only used in
this one place in all Blender).
2018-06-15 08:48:45 -04:00
Philipp Oeser
284e0ea756 Fix (unreported) Text Editor: scrollbar exiting early
caused by recent clickdrag changes
2018-06-15 10:27:30 +02:00
Campbell Barton
cbc7ee28d7 WM: 2.8 screen compatibility
Without these minor changes loading files from 2.8 will crash.

Manually applied edits from 26786a2b87a08
2018-06-15 10:24:53 +02:00
Bastien Montagne
fd19069999 Cleanup: remove last G.main's from Collada code. 2018-06-14 15:15:51 +02:00
Bastien Montagne
66407e15cb Cleanup: Remove last G.main's from WM code.
Was mostly validating valid usages of G.main -> G_MAIN actually.
2018-06-14 12:34:13 +02:00
Bastien Montagne
0eb3246713 Fix T55470: Add option to not fix polygons' winding to Edit Normals modifier.
this is actually adding option to add buggy behavior, but.. NPR often
expects buggy behaviors, and its one of the main targets for normal editing.
So think it's reasonable to add that option (disabled by default of
course).

Note that am not really happy with UI, but:
* Not sure where to put it, it's kind of own self-contained area option.
* Don't to make it too much visible, using this should be the exception!
2018-06-14 11:41:12 +02:00
4d58fac1b4 Fix undo group to use human readable name, since this shows in the UI. 2018-06-13 18:39:30 +02:00
3102833962 Fix undo of transform after frame change undoing too much.
For grouped undo we should not skip the undo push, rather replace the
previous undo push. This way undo goes back to the state after the last
operation in the group.
2018-06-13 18:39:30 +02:00
Campbell Barton
57cd52a4ab WM: check release event for particle edit mode
Caused by drag event.
2018-06-13 18:23:09 +02:00
Bastien Montagne
f61c30f804 Cleanup: get rid of last G.main in BMesh code. 2018-06-13 16:29:12 +02:00
Bastien Montagne
5ff1d845ea Cleanup: moar ugly G.main removal...
Note that due to RNA get/setters issue, that one may actually add some
G.main usages to the total... But at least it's not hidden anymore in a
very low-level, dark corner of BKE pointcache code!
2018-06-13 14:28:05 +02:00
Philipp Oeser
2002fe27d9 Fix T55467: nodes cant be resized after recent clickdrag change 2018-06-13 14:03:46 +02:00
Campbell Barton
5788f24337 Cleanup: swapped X/Y UI_UNIT 2018-06-13 11:10:55 +02:00
Bastien Montagne
67e8c1e1c7 Cleanup: remove more G.main from BKE area. 2018-06-13 10:57:10 +02:00
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
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
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
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
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
5165d62931 WM: correct recent change to click/drag detection
fb1915d87090a - 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
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
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
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
Campbell Barton
df4525d1d9 Fix key repeat events resetting the click timer 2018-06-07 16:52:40 +02:00
Campbell Barton
863e395ad8 Cleanup: trailing space for windowmanager 2018-06-07 16:43:52 +02:00
Campbell Barton
e19686a35a WM: check for release instead of not pressed
Makes reasoning about events more predictable.
2018-06-07 16:19:59 +02:00
Bastien Montagne
8a2db3ed21 Fix crash due to missing init of new bAnimContext bmain member in transform code.
From own previous G.main-busting commit.
2018-06-07 15:38:31 +02:00
Campbell Barton
6242940639 Fix double free in dyntopo-sculpt mode undo 2018-06-07 14:54:09 +02:00
Campbell Barton
5330f1c5d1 Fix sculpt assert on initialization 2018-06-07 13:39:49 +02:00
Bastien Montagne
b3a7a75a26 Cleanup: remove moar G.main usages.
Notes:
* Really need to address RNA setters case, end up adding way too much
G.main here these days... :/
* Added Main pointer into bAnimContext, helps a lot in anim code ;)
2018-06-07 12:48:29 +02:00
Bastien Montagne
54f9cd5283 Cleanup: Nuke moar G.main usages... 2018-06-07 11:11:46 +02:00
Campbell Barton
409cfba1a3 Python API: Initial 'imbuf' API
Support only basic operations new/load/write & resize.

Add now so we can extend as needed & more easily accept patches.
2018-06-07 08:00:13 +02:00
Campbell Barton
0e68751b8a Fix BLI_ASSERT_UNIT macro w/ non-finite numbers 2018-06-06 19:49:27 +02:00
Aaron Carlisle
70b705b5fe UI: NLA: Influence should be a factor (RNA) 2018-06-06 12:09:13 -04:00
Sybren A. Stüvel
de702a4803 Alembic export: only free duplilists when not NULL 2018-06-06 15:54:03 +02:00
Campbell Barton
bfbd85e9d6 Fix error using freed bmain
Regression in 481cdb08ed6f3
2018-06-06 09:36:50 +02:00
Bastien Montagne
1628a6858e Fix crash in owmn previous commit. 2018-06-05 17:54:53 +02:00
Bastien Montagne
481cdb08ed Cleanup: use new accessors to blendfile path (Main.name). 2018-06-05 16:33:46 +02:00
Bastien Montagne
1d97e948d2 Cleanup: add hleper functions to get filepath from Main.
This helps making things clearer and cleaner. Func returning filepath of
G.main is separate, so that we can easily track its usages, and
hopefully deprecate it at some point. Though that usage of G.main is
likely the less evil one, you nearly always want current blendfile path
in those cases anyway.
2018-06-05 16:33:46 +02:00
Campbell Barton
6fee105943 Cleanup: correct menu name 2018-06-04 19:09:52 +02:00
Campbell Barton
58e8c71cbd Cleanup: strip ghost trailing space 2018-06-04 18:47:57 +02:00
Campbell Barton
747534af00 Particle System: move data creation into RNA update
Relying on evaluation to initialize data causes issues w/ 2.8.
2018-06-04 17:55:19 +02:00
Bastien Montagne
7277f8973b Fix T55260: load Text File with Python from GUI Button results in 0 User
Let's just always ensure user_one when loading text from operator...
2018-06-04 12:46:59 +02:00
Campbell Barton
44505b38df Cleanup: strip trailing space in editors 2018-06-04 09:31:30 +02:00
Campbell Barton
6654e109df Cleanup: strip trailing space in GPU module 2018-06-04 09:09:12 +02:00
Campbell Barton
7719c11006 Cleanup: strip trailing space in Python module 2018-06-04 08:54:40 +02:00
Campbell Barton
854db8951b Cleanup: strip trailing space in bmesh module 2018-06-04 08:49:47 +02:00
Campbell Barton
38eb91c848 Cleanup: correct variable name, doxy sections 2018-06-03 17:06:13 +02:00
Campbell Barton
335b193336 Cleanup: add argument names to screen callbacks 2018-06-03 15:11:31 +02:00
Campbell Barton
6221180963 Cleanup: remove blockscale & handler
Replace with link_flag, currently unused,
needed for dynamic space types which is planned.
2018-06-03 11:12:50 +02:00
Dalai Felinto
fec317de8d --debug-gpu-shader: Dump GLSL shaders to disk
This is really convenient for development. Either for profiling the
generated shaders or to check if the generated code is correct.

It writes the shaders to the temporary blender session folder.

(ported over from blender2.8)
2018-06-02 20:29:27 +02:00
Campbell Barton
c140f11946 Cleanup: warning 2018-06-02 11:58:01 +02:00
Campbell Barton
75fc1c3507 Cleanup: trailing whitespace (comment blocks)
Strip unindented comment blocks - mainly headers to avoid conflicts.
2018-06-01 18:19:39 +02:00
Bastien Montagne
051e186d5c Cleanup: some more G.main removal from editor code. 2018-06-01 17:08:38 +02:00
Ray Molenkamp
7c75c2db4f Add Asan support for clang on windows.
This will currently only work for the RelWithDebInfo configuration since asan
does not support the debug crt. for source line information in the reports,
you need a copy of llvm-symbolizer in the blender folder or set the
ASAN_SYMBOLIZER_PATH environment variable to point to it. Currently (as of
6.0.0) llvm-symbolizer does not ship with the binary clang/llvm distribution.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D3446
2018-05-31 11:50:30 -06:00
Bastien Montagne
cfea9c261c Cleanup: Remove G.main from some editor files. 2018-05-31 18:23:20 +02:00
Bastien Montagne
da11e33b26 Cleanup: remove G.main from BKE mball code. 2018-05-31 16:44:05 +02:00
Bastien Montagne
16100f8261 Cleanup: get rid of last G.main usages in BKE library code. 2018-05-31 16:04:04 +02:00
Bastien Montagne
b53d358261 Cleanup: remove G.main from BKE modifier. 2018-05-31 15:24:30 +02:00
Bastien Montagne
28369f725c Cleanup: remove G.main from BKE object
Had to add some G.main to modifiers, but in 2.8 we do not need that
anymore, so it's not that bad! ;)
2018-05-31 12:27:47 +02:00
Bastien Montagne
24d1829243 Cleanup: nuke G.main out of BKE PackedFile code. 2018-05-31 11:07:14 +02:00
Campbell Barton
84a9647f22 Cleanup: use doxy sections for space types
Also use struct names in enum/define comments.
2018-05-31 09:49:58 +02:00
Campbell Barton
d9324b61d5 Cleanup: return types in stubs 2018-05-31 09:49:44 +02:00
Bastien Montagne
10a2562bc5 Fix missing movieclip ID type in allowed ones for Outliner... 2018-05-30 16:14:55 +02:00
Campbell Barton
18c12803bd Edit Mode: add success return value
Also remove fix for T6614, since BKE_object_obdata_is_libdata
no longer checks proxy.
2018-05-30 08:41:06 +02:00
Campbell Barton
2c03d6a12b DNA: add OB_DATA_SUPPORT_EDITMODE macro 2018-05-30 07:31:35 +02:00
Bastien Montagne
f7af08b5fe Cleanup: Get rid of G.main in BKE_material.
Note that in some cases, this only moves the G.main case to somne other
places - in particular, RNA getters/setters are becoming annoying here...
2018-05-29 15:49:21 +02:00
Ray Molenkamp
81060ff6b2 Windows: Add support for building with clang.
This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming

Things to note:

1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it)

2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370)

victor_cpu
	msvc:3099.51
	clang:2796.43

pavillon_barcelona_cpu
	msvc:1872.05
	clang:1827.72

koro_cpu
	msvc:1097.58
	clang:1006.51

fishy_cat_cpu
	msvc:815.37
	clang:722.2

classroom_cpu
	msvc:1705.39
	clang:1575.43

bmw27_cpu
	msvc:552.38
	clang:561.53

barbershop_interior_cpu
	msvc:2134.93
	clang:1922.33

3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs.

4) X64 only currently, X86 builds but crashes on startup.

5) Tested with llvm/clang 6.0.0

6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration

7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc.

8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows.

9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D3304
2018-05-28 14:34:47 -06:00
Campbell Barton
fd2c48726f UI: center align number buttons w/o text
This makes supporting split properties and text possible, see T54951
2018-05-27 21:08:50 +02:00
Bastien Montagne
38cb29d67e Cleanup: Nuke most of remaining evil G.main from RNA.
The few ones in getters/setters we cannot remove as easily, for now we
can live with those I think...
2018-05-27 18:46:39 +02:00
Campbell Barton
56254a42e0 UI: replace BLI_strncpy w/ memcpy
Size is already checked.
2018-05-27 12:50:03 +02:00
Campbell Barton
bc3727a943 Recently added IES conflicts w/ EEVEE 2018-05-27 11:01:46 +02:00
Campbell Barton
06cb460cd7 3D View: minor change to NDOF view orbit
This change is needed for 2.8, where the NULL check isn't a reliable way
of testing if dynamic offset is needed.
2018-05-27 10:34:01 +02:00
Campbell Barton
12a9e9ae33 Fix restrict error in BLI_str_format_byte_unit
Don't use sprintf to append a string to it's self.

Also correct BLI_str_rstrip_float_zero's return value.
2018-05-27 10:28:04 +02:00
Lukas Stockner
48155c210a Cycles: Add Support for IES files as textures for light strength
This patch adds support for IES files, a file format that is commonly used to store the directional intensity distribution of light sources.
The new IES node is supposed to be plugged into the Strength input of the Emission node of the lamp.

Since people generating IES files do not really seem to care about the standard, the parser is flexible enough to accept all test files I have tried.
Some common weirdnesses are distributing values over multiple lines that should go into one line, using commas instead of spaces as delimiters and adding various useless stuff at the end of the file.

The user interface of the node is similar to the script node, the user can either select an internal Text or load a file.
Internally, IES files are handled similar to Image textures: They are stored in slots by the LightManager and each unique IES is assigned to one slot.

The local coordinate system of the lamp is used, so that the direction of the light can be changed. For UI reasons, it's usually best to add an area light,
rotate it and then change its type, since especially the point light does not immediately show its local coordinate system in the viewport.

Reviewers: #cycles, dingto, sergey, brecht

Reviewed By: #cycles, dingto, brecht

Subscribers: OgDEV, crazyrobinhood, secundar, cardboard, pisuke, intrah, swerner, micah_denn, harvester, gottfried, disnel, campbellbarton, duarteframos, Lapineige, brecht, juicyfruit, dingto, marek, rickyblender, bliblubli, lockal, sergey

Differential Revision: https://developer.blender.org/D1543
2018-05-27 01:24:57 +02:00
ef502854fe Threads: add spinlock hit for hyperthreading processors on Windows.
Suggested by Percy Ross Tiglao.
2018-05-26 22:35:30 +02:00
Diego Gangl
4dee702332 Add number and memory size formatting throughout the UI
This commit adds number formatting (thousands separator) to the baking panel. It also adds a new function to format memory sizes (KB/GB/etc) and applies it to the baking panel and scene stats. The new function is unit tested.

Reviewers: Severin
Tags: #user_interface
Differential Revision: https://developer.blender.org/D1248
2018-05-25 22:41:49 +02:00
Campbell Barton
9812943931 WM: check modal handlers for keymap lookups
Keep in sync with 2.8x
2018-05-25 10:51:05 +02:00
Campbell Barton
e31b8303ed UI: fix assert
Replace hard-coded button size check with UI_UNIT_X.

Caused icon-only buttons to have strings assigned based on UI-scale.
2018-05-25 10:45:48 +02:00
Campbell Barton
d02335a195 3D View: add pixelsize function w/o UI scale 2018-05-25 10:00:51 +02:00
Lukas Stockner
6862762685 Cycles/Compositor: Add arctan2 operation to the Math node
The Math node currently has the normal atan() function, but for
actual angles this is fairly useless without additional nodes to handle the signs.

Since the node has two inputs anyways, it only makes sense to add an arctan2 option.

Reviewers: sergey, brecht

Differential Revision: https://developer.blender.org/D3430
2018-05-24 16:46:02 +02:00
Campbell Barton
8d9faf840b 3D View: remove poll 3D view for copy/paste
These operators only need selected objects.
2018-05-24 16:40:33 +02:00
Philipp Oeser
1318660b04 Fix T55034: Setting duplication group for multiple selected items only
affects one item

UI editing multiple selected items missed the case of PROP_POINTER
properties

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3373
2018-05-24 09:02:17 +02:00
Philipp Oeser
3e9b592b08 Fix Extend property of Lasso select tool in Mask editor not working
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3361
2018-05-24 08:41:13 +02:00
Philipp Oeser
54f2e58452 Fix T54336: Extend property of Lasso select tool in Node editor does not
work

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3360
2018-05-24 08:34:31 +02:00
Lukas Stockner
176e18436c Fix T55137: Compilation failing on non-x86-64 architectures
Some conversion helper functions were (most likely by accident) contained
inside an ifdef for SSE2 support, so on e.g. ARM they would be undefined
and therefore cause compilation to fail.
2018-05-24 01:41:18 +02:00
Campbell Barton
d886e32270 Cleanup: strip trailing space from interface files 2018-05-23 10:48:50 +02:00
Campbell Barton
3ada840e65 blenderplayer: add stubs 2018-05-22 17:56:56 +02:00
Campbell Barton
76ece90d4a Fix T55093: Bisect + fill crash 2018-05-22 17:23:25 +02:00
Campbell Barton
9f66d00287 CMake: only include licences for enabled libs 2018-05-21 18:41:59 +02:00
Campbell Barton
605e184167 Cleanup: use const for transform internal API 2018-05-21 17:24:14 +02:00
Campbell Barton
882daeffc5 RNA: support for PARM_OUTPUT & PARM_RNAPTR 2018-05-21 12:34:11 +02:00
9f2ae547c0 Fix/workaround RNA build error in C++ API.
It seems output parameter needs to be the last one.
2018-05-21 11:13:56 +02:00
Campbell Barton
4198c18f15 Cleanup: correct variable names 2018-05-21 10:53:50 +02:00
Campbell Barton
12a60265cd WM: utility to find a keymap item from an operator
Also RNA access to WM_keyconfig_update,
needed when generating dynamic keymaps used in menus immediately after.
2018-05-21 10:35:44 +02:00
Philipp Oeser
5e7a21a5f5 Fix T55115: crash when iterating SmokeDomainSettings color_grid property
through python
2018-05-18 14:34:27 +02:00
Campbell Barton
1cc4ab481e Fix crash drawing polygon curves 2018-05-18 14:23:53 +02:00
Campbell Barton
cb50c288d4 Add missing header 2018-05-18 13:43:41 +02:00
Campbell Barton
278e3f7d5f Logging: add --show-log-backtrace
Useful in debug builds to see a functions callers.
2018-05-18 11:00:47 +02:00
Aaron Carlisle
96fba1e101 Color: Assume Rec 709 in remaining comp nodes
Part of T54798
2018-05-17 17:20:32 -04:00
Campbell Barton
0e0d99161a RNA: move enums to rna_rna.c
Needed for use in rna non runtime code.
2018-05-17 19:10:45 +02:00
Campbell Barton
b290048257 makesrna: error check from 2.8 2018-05-17 19:05:46 +02:00
Campbell Barton
4461be1b72 Fix T55032: Redo w/ file saved in edit-mode failed
It's important edit-mode has a step stored for redo to work,
file load now ensures this in a generic way.
2018-05-15 19:37:06 +02:00
Campbell Barton
91504ed26e Fix assert using '//' on an unsaved file
Annoying for debug builds.
2018-05-15 17:27:36 +02:00
Campbell Barton
3eb9cc69f2 Cleanup: last spacetype enum name 2018-05-15 11:12:49 +02:00
Campbell Barton
9636cab009 Undo System: remove nested edit-mode undo calls
Regression in recent undo system changes,
This caused T55048.

When each mode had its own undo stack it was important
to initialize it when entering edit-mode.
2018-05-15 10:10:48 +02:00
Campbell Barton
ae8225ba6d Fix BMesh bisect not flagging dirty indices 2018-05-15 09:04:12 +02:00
Campbell Barton
43ee4d5d7c Cleanup: quiet GCC -Wtype-limits
While the warning can normally be disabled, we don't have have as much
control of warnings when macros are used.
2018-05-14 09:00:42 +02:00
Campbell Barton
c1d737eb95 BLI_utildefines: re-ordering array delete macro 2018-05-14 08:38:53 +02:00
Campbell Barton
b99d064e91 Cleanup: trailing space 2018-05-13 06:44:03 +02:00
Campbell Barton
c84b8d4801 Cleanup: modifier arg wrapping 2018-05-12 08:04:56 +02:00
Campbell Barton
925e775818 EditMesh: remove duplicate rip macro
Change the fill setting in the keymap,
this allows tool access the macro with either setting.
2018-05-11 20:02:12 +02:00
Campbell Barton
73a7885ab3 WM: initialize last used macro properties 2018-05-11 20:01:51 +02:00
Bastien Montagne
d5c1c0b10d Fix (unreported) broken freeing code for Sequencer.
Freeing sequencer would always do usercount, which is now forbidden when
called from main ID freeing code.

Annoying in 2.7x, much more critical issue in 2.8!

Also, moved RNA sequencer API functions to proper rna_scene_api.c file.
2018-05-11 11:23:11 +02:00
Bastien Montagne
13beeb5892 Fix (unreported) load image code calling icin/preview update from non-Main thread.
Icin/preview only works in main thread, while image loading can be done
from others too... This could have generated random crashes and such.
2018-05-11 10:48:04 +02:00
Bastien Montagne
0385b33f0b Fix broken 'check/validate libs' code with indirect libs.
Readcode always set relative paths of indirectly linked libs relative to
*current* .blend file, not to the library using it.

But BKE_library_filepath_set was then setting them relative to their
parent library, breaking checking code (and saved files even :((( ).
2018-05-09 15:52:29 +02:00
Philipp Oeser
69f2305415 Fix T54992: Lattice modifier on another Lattice object does not take the
Influence vertexgroup into account
2018-05-09 14:41:25 +02:00
Philipp Oeser
34c474e695 Fix T54997: simple typo in property description 2018-05-09 14:26:47 +02:00
Bastien Montagne
f3efa9e15f Fix (unreported) bug in BVHTree 'free tessfaces' flag setting.
Could lead to atempt to free NULL pointer, and/or memory leak.
2018-05-09 12:33:21 +02:00
Campbell Barton
b59b812400 MSVC: resolve near/far issue take2
Previous fix failed w/ compositor,
tested on MSVC2015, full build.
2018-05-09 11:23:32 +02:00
Campbell Barton
598216c36e MSVC: remove hack for near/far name collision
windows headers define these, conflicting w/ View3D.near/far.
2018-05-09 10:00:55 +02:00
Aaron Carlisle
80844fdfc0 Color: Combine/Separate YCbCrA node default to rec. 709
This commit is part of T54798

Differential Revision: https://developer.blender.org/D3183
2018-05-08 22:24:58 -04:00
Campbell Barton
e0a436fcff Cleanup: includes 2018-05-08 18:01:47 +02:00
Campbell Barton
0012082c10 Cleanup: move mesh conversion into own function 2018-05-08 17:54:25 +02:00
Bastien Montagne
4e4a93bc45 Fix building with latest versions of ffmpeg.
Some years-old deprecated stuff has now been removed.

Correct solution is probably to use valid defines etc. in own code, but
this is more FFMEPG maintainer task (since it also may change how old
FFMPEG we do support...).
2018-05-08 16:00:52 +02:00
Bastien Montagne
43e0e8defa Fix (unreported) bloody modifiers messing with ID user count in copy.
User count of IDs is handled by higher-level, generic function,
low-level copydata functions *MUST NOT* touch them anymore, ever!
2018-05-08 15:27:10 +02:00
Bastien Montagne
3740f7593d Cleanup: Nuke empty dummy wrappers around modifier_copyData_generic().
This also changes signature of modifier copy callback, first (source)
parameter is now a const, which is saner anyway!
2018-05-08 15:04:10 +02:00
Bastien Montagne
49fe27ee46 Modifiers: sanitize/cleanup modifiers' copying & freeing code.
Should also fix T55000: Crash with hooks and curves in Cycles render.
2018-05-08 14:22:14 +02:00
Campbell Barton
5358026511 Cleanup: quiet -Warray-bounds warning 2018-05-08 13:32:52 +02:00
Sergey Sharybin
59ce30f32b Tracking: Use bmain from context 2018-05-08 11:58:42 +02:00
Campbell Barton
433aaa8c2e Cleanup: remove unused wmReport struct 2018-05-08 07:52:13 +02:00
Bastien Montagne
c09e22306a Fix (unreported) memleak when copying object with some modifiers. 2018-05-07 17:59:23 +02:00
Campbell Barton
f74d85ffc8 Cleanup: rename char/float conversion functions
- FTOCHAR       -> unit_float_to_uchar_clamp
- F3TOCHAR3     -> unit_float_to_uchar_clamp_v3 (swap args)
- F4TOCHAR4     -> unit_float_to_uchar_clamp_v4 (swap args)
- FTOUSHORT     -> unit_float_to_ushort_clamp
- USHORTTOUCHAR -> unit_ushort_to_uchar
2018-05-07 17:51:40 +02:00
Campbell Barton
905eeb0bc7 Cleanup: move unit char/short/float to functions
This caused GCC 8.1 to crash at build time,
but was also not very nice use of macros.
2018-05-07 17:50:25 +02:00
Philipp Oeser
66ec3c7e7f Fix Movieclip editors 'graph' and 'dopesheet' view using themes region
background setting

mentioned in T54942

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3200
2018-05-07 14:57:05 +02:00
Philipp Oeser
1f76e6c326 Fix T54525: crash when setting number of frames to use between dupoff
frames

caused division by zero if both dupli_frames_on and dupli_frames_off are
zero. doing this doesnt seem useful, dupliframes can be disabled in
other ways.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3132
2018-05-07 14:49:09 +02:00
Sergey Sharybin
6c243b7e40 More tweaks to strict compiler flags 2018-05-07 14:28:22 +02:00
Sergey Sharybin
592c3881ba Silence compilation error around possible fall-through 2018-05-07 14:19:12 +02:00
Howard Trickey
cd3f5983cd Fix Bevel percent mode bug 54228
Previous new adjust pass commit should have excluded percent mode.
2018-05-07 07:05:41 -04:00
Philipp Oeser
9eb5aa32b8 Fix T54324: remove stencil entries from weight paint keymap
Reviewed By: mont29

Differential Revision: http://developer.blender.org/D3178
2018-05-07 12:28:15 +02:00
Sergey Sharybin
ea1751a038 Fix T54594: Lattice with Armature modifier not updating correctly 2018-05-07 12:05:09 +02:00
Bastien Montagne
a3b4c3823c Fix T54966: mathutils.noise.voronoi Memory leak
C code was not correctly handling release of temp data, not technically
a memory leak, but indeed rather annoying bug! ;)
2018-05-07 11:07:11 +02:00
9bd2e9104a Nodes: show node labels (like image name) in material properties node view. 2018-05-06 19:28:23 +02:00
Campbell Barton
046904e3fc Cleanup: split rotation_from_view
Add a function that takes only a quat, instead of the 3D view.

Allows for using non-view orientations.
2018-05-06 18:32:18 +02:00
Campbell Barton
84474b0171 Object Snap: add object & matrix to view ray cast
Some snap functions already exposed this.
2018-05-06 15:56:09 +02:00
Campbell Barton
632f2b5c18 WM: include macros in last-properties
Needed for 2.8 tool system storage of macro properties.
2018-05-06 08:57:53 +02:00
Campbell Barton
9e3bfd9210 IDProp API: use stored string length for IDP_repr
Also NULL check ID pointers.
2018-05-06 08:57:19 +02:00
Campbell Barton
d3b3df0371 IDProp API: add native C repr function
Was using Python which wasn't very efficient (even for logging).
2018-05-05 14:41:25 +02:00
Campbell Barton
d83681807e PyAPI: add pop method to RNA struct types
This fits in with existing dict style access.
2018-05-05 09:53:30 +02:00
Campbell Barton
d2591e5c2d IDProp Py API: Add default argument to pop
Match dict.pop behavior.
2018-05-05 09:48:06 +02:00
Campbell Barton
86c2c4d513 IDProp API: Avoid redundant group replace lookup 2018-05-05 09:31:17 +02:00
Germano
b27b4743a2 BKE: bvhuils: remove member sphere_radius.
This member currently doubles the value of `ray->radius` or is not even used.
2018-05-04 11:57:01 -03:00
Germano
02788a9d1a Fix erroe in previous commit. 2018-05-04 11:22:50 -03:00
Germano
e78ef82827 BKE: bvhutils: Unifies static functions oh bvhtrees creation. 2018-05-04 11:15:21 -03:00
Sergey Sharybin
aa0380a6a5 Cleanup: Remove G.main from framechange_poses_clear_unkeyed() 2018-05-04 15:18:47 +02:00
Germano
78fde19e68 BKE: Smoke: Fix error with implicit declaration of function due recent changes. 2018-05-04 10:11:30 -03:00
Germano
aea637456e BKE: BVHtree: Replace all external references of bvhtree_from_mesh_looptri with bvhtree_from_mesh_get. 2018-05-04 09:21:42 -03:00
Germano
3dd6912fce Mesh Remap: Face Corner Data: Do not use large epsilon values to create bvhtrees.
Use ray radius instead.
2018-05-04 09:01:56 -03:00
Germano
8c6a1d8f95 Mesh Remap: Face Data: Do not use large epsilon values to create bvhtree.
If you need the approximation, use raycast radius.
2018-05-04 08:29:00 -03:00
Sergey Sharybin
fa11dc6730 Depsgraph: Fix extra operations and relations created for shared armatures 2018-05-04 12:49:48 +02:00
Germano
b886cdf81d Mesh Remap: Change the sphere_radius parameter instead of creating a bvhtree with epsilon equal to the value of ray_radius.
This is the desirable behavior.
It also removes one more use of `bvhtree_from_mesh_looptri`.
2018-05-04 07:43:08 -03:00
Germano
3d26cf112b Constraint: Shrink Warp: Replace bvhtree_from_mesh_looptri with bvhtree_from_mesh_get.
The value of epsilon was never used to create this bvhtree because whenever we activate this constraint, a bvhtree with parameter epsilon 0.0 was created and cached.
2018-05-04 07:39:07 -03:00
Germano
82d59c6588 Mesh Lapacian: Use isect_ray_tri_watertight_v3 instead of Epsilons to prevent corners errors in raycast.
Using FLT_EPSILON can fail with large coordinate values.
This commit also avoids storing bvhtrees with different settings in BVHCache.
2018-05-04 07:33:26 -03:00
Sergey Sharybin
d1be30f779 Fix T54935: Particle group instances don't render when hidden in viewport
Seems to be only related on linked nature of particles.

This is caused by some conflicting optimization done for viewport, which
does not do particles re-calculation if they do not depend on time
(which is crucial for big layout scene grass fields) and particle render
setting  switch which was relying on fact that render pipeline will do
particle update via time dependency.

Now we extent an old workaround for invisible objects, which now also
deals with particles in the same way as old dependency graph was dealing
with this: tag object data for update if there is particle system.

There shouldn't be any speed difference between old and new depsgraph,
since tagging was already needed and was happening.

In Blender 2.8 such things should be easier to deal with since the whole
depsgraph is to be evaluated for render engine anyway.
2018-05-04 11:40:27 +02:00