Commit Graph

98307 Commits

Author SHA1 Message Date
Jacques Lucke
8cbbdedaf4 Refactor: Update integer type usage
This updates the usage of integer types in code I wrote according to our new style guides.

Major changes:
* Use signed instead of unsigned integers in many places.
* C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`).
* Hash values for C++ containers are 64 bit wide now (instead of 32 bit).

I do hope that I broke no builds, but it is quite likely that some compiler reports
slightly different errors. Please let me know when there are any errors. If the fix
is small, feel free to commit it yourself.
I compiled successfully on linux with gcc and on windows.
2020-07-20 12:16:20 +02:00
Sybren A. Stüvel
686ab4c940 T77086 Animation: Passing Dependency Graph to Drivers
Custom driver functions need access to the dependency graph that is
triggering the evaluation of the driver. This patch passes the
dependency graph pointer through all the animation-related calls.

Instead of passing the evaluation time to functions, the code now passes
an `AnimationEvalContext` pointer:

```
typedef struct AnimationEvalContext {
  struct Depsgraph *const depsgraph;
  const float eval_time;
} AnimationEvalContext;
```

These structs are read-only, meaning that the code cannot change the
evaluation time. Note that the `depsgraph` pointer itself is const, but
it points to a non-const depsgraph.

FCurves and Drivers can be evaluated at a different time than the
current scene time, for example when evaluating NLA strips. This means
that, even though the current time is stored in the dependency graph, we
need an explicit evaluation time.

There are two functions that allow creation of `AnimationEvalContext`
objects:

- `BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float
  eval_time)`, which creates a new context object from scratch, and
- `BKE_animsys_eval_context_construct_at(AnimationEvalContext
  *anim_eval_context, float eval_time)`, which can be used to create a
  `AnimationEvalContext` with the same depsgraph, but at a different
  time. This makes it possible to later add fields without changing any
  of the code that just want to change the eval time.

This also provides a fix for T75553, although it does require a change
to the custom driver function. The driver should call
`custom_function(depsgraph)`, and the function should use that depsgraph
instead of information from `bpy.context`.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D8047
2020-07-20 11:51:09 +02:00
Antonio Vazquez
6fbfa522e6 GPencil: Fix unreported wrong SNAP menu in Point Context menu
It was using the mesh menu instead of GPencil one.
2020-07-20 11:10:47 +02:00
Antonio Vazquez
e4daac84b6 Fix T79094: GPencil Snap menu with Shift+S not pie menu
In order to keep UI consistency, now it's a pie menu.
2020-07-20 11:07:28 +02:00
Campbell Barton
eb5cd628bd Fix T79089: Crash changing themes
Regression from 2840782d8478f.
2020-07-20 17:52:58 +10:00
Campbell Barton
b219ae4498 Fix T79077: Off-screen rendering ignores shading argument
Thumbnails used the 3D view shading mode when a camera wasn't used.
2020-07-20 11:32:26 +10:00
Campbell Barton
615af4e239 DRW: draw hook relationship lines
This wasn't added back from 2.7x, making "Recenter Hook" applier to
do nothing.
2020-07-20 09:25:26 +10:00
Campbell Barton
9db4e44961 DRW: overlay engine support for drawing isolated points
This matches similar functionality for drawing lines.
2020-07-20 09:19:50 +10:00
Yevgeny Makarov
78e40ad21f UI: use "Recalculate" instead of "Recalc" 2020-07-20 07:23:16 +10:00
Clément Foucault
6247ec7827 Fix T78977 GPU: blf fonts are not gamma corrected 2020-07-19 23:00:22 +02:00
Jacques Lucke
3884d78e49 Particles: Make it easier to add attributes internally 2020-07-19 22:06:35 +02:00
Jacques Lucke
5063820c9b Particles: Emit particles over time
This adds a basic internal emitter for every particle simulation.
The emitter cannot be controlled by the user yet. That will
come next.
2020-07-19 13:58:58 +02:00
Campbell Barton
8c90910dcc Fix T66937: Blank view on navigation with auto-deph & large clip-end 2020-07-19 21:27:13 +10:00
Campbell Barton
ccd2af43b3 Fix T78624: Crash running operators from Python in background mode 2020-07-19 18:59:14 +10:00
Campbell Barton
52a7c724b5 Cleanup: unused argument warning 2020-07-19 17:43:59 +10:00
Campbell Barton
71d0f6f896 Cleanup: spelling 2020-07-19 17:37:02 +10:00
Hans Goudey
b8601b64c7 Correct Blender version after last commit
c08d84748804 incremented the patch version instead of the file subversion
for versioning code when adding new options. This commit resets the patch
version and instead bumps the file subversion.
2020-07-18 12:26:32 -04:00
Harley Acheson
c08d847488 UI: Status Bar Statistics and Other Options
Status Bar can show scene statistics, memory usage, version, etc set by context menu. Part two of T75672.

Differential Revision: https://developer.blender.org/D7557

Reviewed by Julian Eisel
2020-07-18 07:49:25 -07:00
Jacques Lucke
fe49e4139c Simulation: cleanup deduplicating attribute input nodes 2020-07-18 10:51:38 +02:00
Jacques Lucke
9eaa48f520 Simulation: cleanup how data inputs are handled 2020-07-18 10:19:26 +02:00
Jacques Lucke
fd67b521b9 Simulation: deduplicate code that finds particle simulation names 2020-07-18 10:08:53 +02:00
Jacques Lucke
63db971a00 Simulation: fix memory leak 2020-07-18 10:06:36 +02:00
Campbell Barton
1dd381828f UV: edge-ring selection support
Matches edit-mesh edge-ring selection.
2020-07-18 16:09:17 +10:00
Campbell Barton
c48ccb38cb BMesh: utility for checking shared edge with limit argument 2020-07-18 15:54:04 +10:00
Campbell Barton
4e73ba2cab Cleanup: split UV loop select out of mouse picking function 2020-07-18 15:43:37 +10:00
Campbell Barton
f24ccedc18 UV: utility functions for sticky select setting
Support setting vert/edge/face selection, using the sticky option
without performing a second loop over all faces to flush selection.

Existing selection code didn't take advantage of BMesh connectivity
since the logic is from before BMesh was included.
2020-07-18 15:37:33 +10:00
Campbell Barton
016253a648 Cleanup: spelling 2020-07-18 14:27:53 +10:00
Campbell Barton
fd08d6f391 Cleanup: unused warning 2020-07-18 14:27:30 +10:00
Campbell Barton
d99b343b31 Cleanup: UV selection
Remove commented code, move penalty calculation into own function.
2020-07-18 14:15:02 +10:00
Clément Foucault
d9228c557b Cleanup: KnifeTool: Replace glPolygonOffset by GPU_polygon_offset 2020-07-18 03:46:12 +02:00
Clément Foucault
4c28b1c74e Cleanup: GPU: Encapsulate clipDistances
This also remove some non functionnal state changes that were left
from legacy code.
2020-07-18 03:43:52 +02:00
Clément Foucault
59975b0adf Cleanup: WM: Encapsulate stereo draw buffers binding 2020-07-18 03:43:52 +02:00
Clément Foucault
8dfc31f61f Cleanup: GPU: Encapsulate glProvokingVertex 2020-07-18 03:43:52 +02:00
Clément Foucault
264b1e1e15 Cleanup: GPU: Encapsulate glFrontFace 2020-07-18 03:43:52 +02:00
Clément Foucault
5993c53a6d Cleanup: GPU: Encapsulate Backface culling 2020-07-18 03:43:52 +02:00
Clément Foucault
c14e6cdd56 Cleanup: View3D: Encapsulate OpenGL calls
Removes GL_DEPTH_RANGE query as it is not changed anywhere.
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
35f1b3e43b Cleanup: GPU: Wrap GL_UNPACK_ROW_LENGTH in GPU_state
Also go back to default value of 0 after usage.
2020-07-18 03:43:52 +02:00
Clément Foucault
faeaf53255 Cleanup: Sequencer: Use GPUTexture instead of opengl 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
0ef57d3fc0 Cleanup: glutil: Use GPUTexture in immDrawPixelsTexScaled_clipping
This also cleanup the code for readability.
2020-07-18 03:43:51 +02:00
Clément Foucault
122d0c8f4b Cleanup: ClipDraw: Use GPUTexture api and fix a vmem leak
Leak was silent as it was an opengl handle.
2020-07-18 03:43:51 +02:00
Clément Foucault
dcf6e12a60 Cleanup: GPUShader: Remove unused builtin shader 2020-07-18 03:43:51 +02:00
Clément Foucault
7e66616b7e Cleanup: ClipDraw: Remove usage of GPU_SHADER_3D_IMAGE_MODULATE_ALPHA 2020-07-18 03:43:51 +02:00
Clément Foucault
6d160f199c Cleanup: PaintCursor: Use GPUTexture instead of opengl calls 2020-07-18 03:43:51 +02:00
Clément Foucault
99b424334d GPU: Add immBindTexture and immBindTextureSampler 2020-07-18 03:43:51 +02:00
Clément Foucault
5b4a862f83 GPUTexture: Add better swizzle support 2020-07-18 03:43:51 +02:00