Commit Graph

4527 Commits

Author SHA1 Message Date
Pablo Dobarro
6faa765af8 Sculpt: Split Box Mask into its own operator
Box mask is not a selection, so it should not be part of the select
operator. This allows to add more sculpt mode specific functionality and
properties and to share more code with the lasso mask operator in a
later refactor.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8456
2020-08-04 22:52:20 +02:00
Campbell Barton
0dff6b2b4b Cleanup: unused main argument 2020-08-04 21:25:28 +10:00
Campbell Barton
901ee66ea1 Cleanup: use term init instead of initialize/initialise
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
2020-08-01 13:51:05 +10:00
Clément Foucault
486c7b87fb Cleanup: GPU: Remove GPU_draw.h and move fluid gpu function to DRW 2020-07-29 23:21:33 +02:00
Clément Foucault
5f6fb5bb41 Cleanup: Split gpu_texture_image.c into BKE and IMB modules
This is in order to disolve GPU_draw.h into more meaningful code blocks.

All the Image related function are in `image_gpu.c`.
All the MovieClip related function are in `movieclip.c`.

The IMB module now has a connection with GPU. This is not strickly
necessary and the code could be move to `image_gpu.c` if needed.

The Image garbage collection is also ported to `image_gpu.c`.
2020-07-29 23:06:37 +02:00
Clément Foucault
e749643793 GPU: Refactor gpu_texture_image to not use GL calls
This is also a bit of code cleanup, reorganisation.

Tried to be DRYed but avoid too much code change to (hopefully) minimize
breakage.

- GPU: remove TEXTARGET_CUBE_MAP, this is no longer used in the codebase.
- GPUTexture: Move compressed texture upload to gpu_texture.cc
- GPUTexture: Add per texture Anisotropic filtering switch
2020-07-29 15:03:02 +02:00
Campbell Barton
ac6fbf6ba8 Cleanup: declare static variables 2020-07-29 10:50:10 +10:00
Jacques Lucke
814ca40c63 Merge branch 'blender-v2.90-release' 2020-07-28 16:37:01 +02:00
Jacques Lucke
b274d18aec Cleanup: correct usage of extern-C blocks in various places
This removes extern-C blocks around other includes and adds
such blocks for some headers that need them.
2020-07-28 16:33:43 +02:00
Sybren A. Stüvel
79312962de Cleanup: Fix compiler warning about function without prototype
No functional changes.
2020-07-27 15:48:47 +02:00
Clément Foucault
94afe7671c Cleanup: GPU: Remove glew headers part2 2020-07-26 21:07:25 +02:00
Clément Foucault
025dc31d28 GPU: Remove GL constant from BIF_glutil 2020-07-26 21:07:25 +02:00
Clément Foucault
18cca0e704 Cleanup: GPU: Remove GPU_glew.h outside of GPU module
Remove use of GL* constants and types inside the codebase. There is still
a few occurence to get rid of.
2020-07-26 17:29:49 +02:00
Jacques Lucke
f495b583be Merge branch 'blender-v2.90-release' 2020-07-24 12:40:20 +02:00
Jacques Lucke
236ca8fbe8 Allocator: make leak detection work with static variables
When definining static variables that own memory, you should
use the "construct on first use" idiom. Otherwise, you'll get
a warning when Blender exits.

More details are provided in D8354.

Differential Revision: https://developer.blender.org/D8354
2020-07-24 12:26:11 +02:00
Julian Eisel
5ccb0f46dd Merge branch 'blender-v2.90-release' 2020-07-23 18:10:28 +02:00
Julian Eisel
954aa441bf Fix: Incorrect VR pose after changing landmark
Once the base pose was changed (e.g. by changing the active landmark), we'd always run the logic to reset to the base pose. That would mess up the final viewer pose.
Think this only got exposed through 607d745a79.
2020-07-23 18:08:24 +02:00
Bastien Montagne
4619562e2f Merge branch 'blender-v2.90-release' 2020-07-23 17:15:58 +02:00
Bastien Montagne
ad586e7eeb LibOverride: Add update of overrides when reloading library data.
Pretty straight-forward, although it does not rebuild relationships
(this is a heavy process we do not want to automate for now, will be a
separate operator in near future).

Fix T78179: Library Overrides - Additional geometry not updating without reloading scene.
2020-07-23 17:15:32 +02:00
Bastien Montagne
ad6cfcef01 Fix (unreported) crash in reload library code related to shpaekeys.
Once again, we need lots of unatural twisting and convolutions to get
those nasty things to work...

Note that in previous versions of Blender, this would not crash, but was
still broken (shapekeys were never actually reloaded from libraries).
2020-07-23 17:15:32 +02:00
Sergey Sharybin
72fc70879c Cleanup: Fix strict compiler warning 2020-07-22 16:52:00 +02:00
Christian Rauch
cfa788cf9a GPU: clear color with 1.0 alpha
This impacts GHOST/Wayland which draws windows using alpha.
2020-07-22 10:57:41 +10:00
Julian Eisel
607d745a79 VR: Change how landmarks affect viewer pose
* Changing to a landmark moves the view exactly to it, rather than
  keeping the current position offset.
* Disabling positional tracking moves the viewer back to the landmark
  position.
This is a more predictable and practical way to use landmarks. See
feedback in T71347.

On the code side, I did some cleanup so the logic flow is more clear.

Note: This is entirely untested. I currently don't have access to a
device. There might be issues, tomorrow I'll hopefully get feedback.
2020-07-22 00:05:56 +02:00
Antonio Vazquez
9016a29f19 Fix T79107: Crash changing brush size in GPencil sculpt
Reviewed By: fclem

Maniphest Tasks: T79107

Differential Revision: https://developer.blender.org/D8353
2020-07-20 15:23:00 +02:00
Campbell Barton
fd08d6f391 Cleanup: unused warning 2020-07-18 14:27:30 +10:00
Clément Foucault
59975b0adf Cleanup: WM: Encapsulate stereo draw buffers binding 2020-07-18 03:43:52 +02:00
Clément Foucault
1f2edba1fb Cleanup: GPU: Encapsulate scissor test 2020-07-18 03:43:52 +02:00
Clément Foucault
d19b3019d9 Cleanup: GPU: Encapsulate glScissor 2020-07-18 03:43:52 +02:00
Clément Foucault
a6bd7777c2 Cleanup: GPU: Encapsulate glViewport calls 2020-07-18 03:43:52 +02:00
Clément Foucault
e2305690eb Cleanup: WM: Use GPUTexture for radial control drawing 2020-07-18 03:43:52 +02:00
Clément Foucault
2d9eee15c5 Cleanup: GPU: Set default GL_UNPACK_ALIGNMENT to 1
Ogl default is 4 but for almost all cases, blender use tightly
packed format. This avoid confusion and state change for the
common case.

The only case that __might__ need alignement is DDS loader
(untested) so leaving this as it is.
2020-07-18 03:43:52 +02:00
Clément Foucault
acad0d75b1 Cleanup: GPU: Replace glBlendFunc by GPU equivalent 2020-07-18 03:43:51 +02:00
Hans Goudey
69d14c0ddb Fix T78959: Show current frame indicator when interface is locked
When the playhead drawing moved to an overlay, a check was added to keep
it from drawing with a locked interface. This is necessary for some overlays,
but not this one, so this removes the check, making it the responsibility of
the editor.

A context function is added to make that check easier in the future.

Differential Revision: https://developer.blender.org/D8313
2020-07-17 15:18:54 -04:00
Clément Foucault
07d70a76df Cleanup: WM: Use GPUTexture API instead of raw ogl calls 2020-07-16 18:01:44 +02:00
Clément Foucault
5099cbeec9 Cleanup: GPU: Move depth/color masks functions to GPU_state 2020-07-16 18:01:44 +02:00
Clément Foucault
71ac137662 Cleanup: GPU: Move quad buffer stereo check to GPU module 2020-07-16 18:01:44 +02:00
Clément Foucault
8084b7e6e2 Cleanup: GPU: Replace all glReadPixels by GPU equivalent 2020-07-16 18:01:44 +02:00
Clément Foucault
ab19abe223 Cleanup: Port glClear calls to GPU module functions 2020-07-16 18:01:44 +02:00
Bastien Montagne
16989c4d1d Fix T78037: fresh install of blender 2.83.0 not able to save user startup file.
Simply remove that check ob userdef's themes, we are never read any
userdef from startup file anymore, so this check makes no more sense.

To be backported to 2.83.
2020-07-13 16:17:35 +02:00
Jacques Lucke
725973485a Clang Tidy: enable readability-non-const-parameter warning
Clang Tidy reported a couple of false positives. I disabled
those `NOLINTNEXTLINE`.

Differential Revision: https://developer.blender.org/D8199
2020-07-13 11:27:09 +02:00
Campbell Barton
0c58970da7 Cleanup: spelling 2020-07-07 12:49:13 +10:00
Hans Goudey
a856de700b Fix T77730: ShaderFx Missing Update Notifier
This adds a notification type for shaderfx so the properties editor can
be properly notified to redraw.

Another possible solution would be to also redraw the shaderfx tab
 with a ND_MODIFIER update, but this solution allows us to avoid
 some unecessary redraws too. There were no existing cases of
ND_OBJECT | NC_MODIFIER updates, so those cases were
removed from buttons_area_listener.

Differential Revision: https://developer.blender.org/D8159
2020-07-06 13:17:07 -04:00
Hans Goudey
19ff145e66 Clang-Tidy: Enable readability-redundant-control-flow 2020-07-03 09:41:55 -04:00
Clément Foucault
35481fde40 GPUOffScreen: Remove the sample parameter
This is because the DRW module is no longer compatible with drawing using
MSAA.

This also change the Python API.
2020-07-02 17:28:41 +02:00
Brecht Van Lommel
b5660f71fe Fix missing GPU image free in background mode
This is legacy code from before Eevee and Workbench rendering in background
mode was supported. Avoid memory leak by only queueing GPU textures to be
freed when we know they have been allocated.

Differential Revision: https://developer.blender.org/D8172
2020-07-01 16:05:54 +02:00
Campbell Barton
ab0d02b704 UI: use term 'Current Frame' instead of 'Playhead'
Keep terminology consistent, 'Current Frame' is used nearly everywhere.
2020-07-01 20:16:27 +10:00
Campbell Barton
36d6aa428f Cleanup: spelling 2020-07-01 13:12:24 +10:00
Brecht Van Lommel
95ee06d068 Fix T77825: autosave missed too often while sculpting
Previously if a modal operator is active, which might leave Blender in a state
where it's not safe to autosave, it would try again in 10s. Now try again in
10ms so it's much less likely to be missed, since overhead of such a timer is
negligble anyway.

Also remove the debug print that was added to investigate a bug at some point.
2020-06-30 18:12:08 +02:00
Campbell Barton
4b96f47831 Docs: correct invalid doxygen params & references 2020-06-27 15:43:20 +10:00
Julian Eisel
2dd60e6c2c Fix T77830: Crash in VR session when opening material preview
Draw-manager mutex has to be set before activating OpenGL/GPU context.
Otherwise, parallel jobs (like preview rendering) may try to activate
the context from another thread.

Also: Use WM wrappers for activating/releasing OpenGL context, which
have an additional assert check.

Suggest to backport this for 2.83.1.
2020-06-23 17:28:53 +02:00