Commit Graph

75472 Commits

Author SHA1 Message Date
Sergey Sharybin
72b4d444f6 Particles: Fix missing hair dynamics
Only if all the nasty looking bugs had such a simple solution...
2018-03-29 12:43:00 +02:00
Sergey Sharybin
44cd24a9ce Particles: Remove dedicated recalc field from ParticleSettings
Use more generic id->recalc flag.

Also sanitize flag flush from settings to particle system.
Need to do such flush before triggering point cache reset, since
point cache reset will do some logic based on what flags are set.

This will solve crash caused by threaded update which will set
some bitflags while point cache reset is in progress.
2018-03-29 12:41:11 +02:00
Sergey Sharybin
526719bccb Cleanup, silence compiler warning in release build 2018-03-29 12:40:23 +02:00
Sergey Sharybin
95b9680597 Draw manager: Make particle code drawing closer to old viewport
The way how particle state is to be accessed or used did not change
in Blender 2.8, so the drawing code should follow old design.

This code is somewhat duplicated from drawobject.c, but old draw
code is on the way to be removed anyway.

This fixes issue with disappearing particles when tweaking number
of particles.
2018-03-29 12:31:32 +02:00
Sergey Sharybin
0cbf747ffa Draw manager: Make evaluation context a part of context state
This way we don't have to re-initialize the full evaluation
context in every area we need it.
2018-03-29 12:18:07 +02:00
Sergey Sharybin
3177023104 Draw manager: Use C99 struct initialization
Allows us to easily add fields which we never want to
be initialized, but still keep sane order of fields in
the structure itself.
2018-03-29 12:07:11 +02:00
Sergey Sharybin
90e1a5fd27 Draw manager: Use utility functions for dealing with state memset 2018-03-29 11:43:42 +02:00
Sergey Sharybin
f42c6960d2 Draw manager: Cleanup, early output
Do early output and reduce level of indentation.
2018-03-29 10:34:42 +02:00
Sergey Sharybin
05c76990c8 Depsgraph: Tag datablock with original update flag
Tagging based on components might not be granular enough.

For example, for particles we would want to know what part
of particles was changed exactly. For the flushing we wouldn't
worry too much, because we will want less granular updates
there anyway.
2018-03-29 10:08:56 +02:00
Dalai Felinto
6456d59b6b Move to Collection - Add new collection
Include option to create new collection and move objects to this
collection.

Based on suggestion by Pablo Vazquez (venomgfx) and my own feedback.
2018-03-28 17:15:33 -03:00
Dalai Felinto
ba90597f22 Move to Collection - Skip Master Collection nested level
Have the Master Collection always opened. This removes one level of nesting.
As suggested by Pablo Vazquez (venomgfx).
2018-03-28 17:15:01 -03:00
Dalai Felinto
f167226b79 Move to Collection - initial operator
How to use: Select a few objects, and press "M" in the viewport.

If you hold ctrl the objects will be added to the selected collection.
Otherwise they are removed from all their original collections and moved
to the selected one instead.

Development Notes
=================
The ideal solution would be to implement an elegant generic multi-level
menu system similar to toolbox_generic() in 2.49.

Instead I used `uiItemMenuF` to acchieve the required nesting of the menus.

The downside is that `uiItemMenuF` requires the data its callback uses to be
always valid until the menu is discarded. But since there is no callback we
can call when the menu is discarded for operators that exited with
`OPERATOR_INTERFACE`.

That means we are using static allocated data, that is only freed next time
the operator is called. Which also means there will always be some
memory leakage.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D3117
2018-03-28 17:14:51 -03:00
Aaron Carlisle
1953de335e Cleanup: Tooltip spelling 2018-03-28 13:09:00 -04:00
Gaia Clary
8afc9c1e7d Fix Collada: broken tangents with Camera Animation import for xfov
When importing an xfov curve, we must transformed the data to
Lens opening angles in degrees. While the curve value itself is
correctly transformed, the transformation of the tangents has been
forgotten. this is fixed now.
2018-03-28 18:01:32 +02:00
Clément Foucault
205fe8afd7 Clay: Remove warning. 2018-03-28 11:33:23 +02:00
Campbell Barton
e49d66f22c Cleanup: typo in function name 2018-03-28 11:23:38 +02:00
Campbell Barton
a970ac5d55 BLI_array: utility to check memory is zerod 2018-03-28 11:13:54 +02:00
Clément Foucault
873c23456b UI: Perf: Don't use implicit Attrib.
Implicit attrib is doing memcpy which seems to be slower compared to
individual immAttrib*.

Only fixed the ones who appeared in my profilling logs.
2018-03-28 00:05:57 +02:00
Clément Foucault
0acf655f9d UI: Perf: Group drawcalls inside ui_draw_panel_dragwidget
16 Drawcalls > 1 Drawcall

Do I need to say more?
2018-03-28 00:05:57 +02:00
Clément Foucault
637993fafe UI: Perf: Make icon_draw_texture use GWN_draw_primitive.
This bypass the use of immediate mode for theses drawcalls. Placement and
and icon select (via uvs) is done inside the vertex shader.
2018-03-28 00:05:51 +02:00
Clément Foucault
3bb720a7de GPUShader: Cleanup: Remove unused uniform_interface. 2018-03-27 23:51:23 +02:00
Clément Foucault
7a94d4362a DRW: Opti: Make cursor use batch instead of immediate API.
This is also much cleaner and taking 1 drawcall instead of 2.
2018-03-27 23:50:26 +02:00
Clément Foucault
2117680094 UI: Fix assert cause by vertex count being too small. 2018-03-27 17:58:05 +02:00
Clément Foucault
2cbd7cc269 UI: Perf: Optimize widgetbase_draw.
Drawcall per window redraw on default layout:
- 4100+ without patch
- 1270 with patch

Theses drawcalls meant a lot of driver overhead since they each correspond
to one glMapBuffer which is slow.
2018-03-27 17:03:42 +02:00
Campbell Barton
e4d82c0dcf Fix T54435: Quit prompt fails w/ fractional scale 2018-03-27 16:46:10 +02:00
Campbell Barton
90b7bcb48d Merge branch 'master' into blender2.8 2018-03-27 15:09:00 +02:00
Campbell Barton
e22b870b4a Cleanup: global undo (minor changes to internals)
- Get memory usage from MemFile instead of MEM API
  avoids possible invalid when threads alloc memory.
- Use size_t instead of uint and uintptr_t to store size.
- Rename UndoElem.str -> filename
- Rename MemFileChunk.ident -> is_identical
2018-03-27 14:56:54 +02:00
Campbell Barton
ddecf23711 Merge branch 'master' into blender2.8 2018-03-27 07:08:58 +02:00
Campbell Barton
3bca1ef26b Cleanup: move paint curve undo into own file 2018-03-27 07:06:14 +02:00
Germano
17a4a5a553 Eevee Shaders: Fix "No matching overloaded function"
invert -> inverse
2018-03-26 19:11:02 -03:00
Clément Foucault
dff7f55cd0 GPUFramebuffer: Fix compiler warning about return value. 2018-03-26 17:54:46 +02:00
Sergey Sharybin
21aca14e43 Merge branch 'master' into blender2.8 2018-03-26 14:56:00 +02:00
Sergey Sharybin
64e5f83133 BLF: Don't use user preferences
BLF is a low level module, which might (and is) used without Blender.

Thanks Campbell for review!
2018-03-26 14:49:23 +02:00
Sergey Sharybin
0476f8277a BLF: Cleanup, indentation inside of preprocessor 2018-03-26 14:07:19 +02:00
Bastien Montagne
13f80a152a Fix T53800: Bad data editing during DEG evaluation?
Remain convinced that it should not be possible for undo code to run in
parallel with DEG eval... But for now, this whould prevent static
override code to dive into this collection.
2018-03-26 10:41:31 +02:00
Clément Foucault
0c49d83b49 Eevee: Use named EEVEE_EffectsFlag for effects flag. 2018-03-26 10:02:53 +02:00
Clément Foucault
b9ec7a9272 Eevee: Fix feedback loop warning. 2018-03-26 10:01:46 +02:00
Clément Foucault
92b61dc16d GPUTexture: Fix compilation issue. 2018-03-26 09:59:12 +02:00
Clément Foucault
41852c8a8c DRW: Fix crash/broken Metaballs display. 2018-03-25 20:06:12 +02:00
Clément Foucault
42b5328c36 DRW: Rename DRW_shgroup_uniform_buffer into DRW_shgroup_uniform_texture_ref
This is in order to not mix it with the incomming buffer textures.
2018-03-25 20:06:12 +02:00
Clément Foucault
94dd81941f DRW: Remove mentions of DRWInterface.
Theses are no longer relevant. Better talk about shgroup directly.
2018-03-25 20:06:12 +02:00
Clément Foucault
bc15ec0896 GPUFramebuffer: Refactor (Part 2)
This refactor modernise the use of framebuffers.
It also touches a lot of files so breaking down changes we have:
 - GPUTexture: Allow textures to be attached to more than one GPUFrameBuffer.
   This allows to create and configure more FBO without the need to attach
   and detach texture at drawing time.
 - GPUFrameBuffer: The wrapper starts to mimic opengl a bit closer. This
   allows to configure the framebuffer inside a context other than the one
   that will be rendering the framebuffer. We do the actual configuration
   when binding the FBO. We also Keep track of config validity and save
   drawbuffers state in the FBO. We remove the different bind/unbind
   functions. These make little sense now that we have separate contexts.
 - DRWFrameBuffer: We replace DRW_framebuffer functions by GPU_framebuffer
   ones to avoid another layer of abstraction. We move the DRW convenience
   functions to GPUFramebuffer instead and even add new ones. The MACRO
   GPU_framebuffer_ensure_config is pretty much all you need to create and
   config a GPUFramebuffer.
 - DRWTexture: Due to the removal of DRWFrameBuffer, we needed to create
   functions to create textures for thoses framebuffers. Pool textures are
   now using default texture parameters for the texture type asked.
 - DRWManager: Make sure no framebuffer object is bound when doing cache
   filling.
 - GPUViewport: Add new color_only_fb and depth_only_fb along with FB API
   usage update. This let draw engines render to color/depth only target
   and without the need to attach/detach textures.
 - WM_window: Assert when a framebuffer is bound when changing context.
   This balance the fact we are not track ogl context inside GPUFramebuffer.
 - Eevee, Clay, Mode engines: Update to new API. This comes with a lot of
   code simplification.

This also come with some cleanups in some engine codes.
2018-03-25 20:06:12 +02:00
Clément Foucault
f937123116 GPUFramebuffer: Refactor (part 1)
Move some DRWFramebuffer functions to GPUFramebuffer.
2018-03-25 20:06:12 +02:00
Clément Foucault
e5ee1ed818 Basic Engine: Remove unneeded use of Framebuffers. 2018-03-25 20:06:12 +02:00
Clément Foucault
9c1ab47fc4 GPUOffscreen: Remove unused offscreen blit. 2018-03-25 20:06:12 +02:00
Clément Foucault
619d977e1a GPULamp: Move GPU_frambuffer_blur to GPU_lamp.c
This is a bit useless because gpu lamps are only used by the game engine
and it is planned to be "remove" in some way.

Doing this to clean gpu_framebuffer.c.
2018-03-25 20:06:12 +02:00
Clément Foucault
4c66068790 GPUFramebuffer: Make current framebuffer thread local.
This make sense since we are using multiple olg contexts and two contexts
can be active at the same time with different framebuffers.
2018-03-25 20:06:12 +02:00
Clément Foucault
a78f5accbb GPUTexture: Style: Respect 120 char per line limit. 2018-03-25 20:06:12 +02:00
Clément Foucault
37a7cd8344 GPUViewport: Small simplifications + fixes.
- Use GPU_SHADER_2D_IMAGE_ALPHA.
 - Add alpha uniform.
 - bypass reseting the scissors and depth test because we used
   another context for drawing.
2018-03-25 20:06:12 +02:00
Clément Foucault
6d6c292cf8 Clay: Fix alpha problem cause by FXAA pass. 2018-03-25 20:06:12 +02:00