Commit Graph

84434 Commits

Author SHA1 Message Date
Campbell Barton
1d96493c2f Merge branch 'blender-v2.93-release' 2021-04-19 17:36:56 +10:00
Campbell Barton
969cc22a89 Merge branch 'blender-v2.93-release' 2021-04-19 17:36:54 +10:00
Campbell Barton
eae39a4973 Merge branch 'blender-v2.93-release' 2021-04-19 17:36:51 +10:00
Campbell Barton
3b4b231be5 Cleanup: re-order gizmo handling checks
Non-functional change in preparation for fix.
2021-04-19 17:18:57 +10:00
Campbell Barton
0b903755a9 Fix spin-gizmo not allowing click events to select vertices 2021-04-19 17:18:52 +10:00
Campbell Barton
9175911ffa Fix spin-gizmo button tool-tip placement
gizmo_button2d_bounds result wasn't valid when the gizmo was part
of a 3D gizmo group.

Regression in cf6d17a6aa
2021-04-19 17:17:49 +10:00
Germano Cavalcante
0af28f007f Cleanup: Rename variables to indicate what is evaluated
`ob` --> `ob_eval`
`me` --> `me_eval`
`em` --> `em_eval`
2021-04-19 00:24:43 -03:00
Germano Cavalcante
950d8360f8 Fix typo in previous commit
`has_loose_edge` -> `has_loose_vert`
2021-04-18 20:45:06 -03:00
Germano Cavalcante
1825e67dea Transform Snap Object: Improve code that detects updates
The previous code had unclear hacks to avoid updating while transforming,
it was also duplicated in two functions causing an inconsistent
initialization of the looptris bvhtree (which could even generate
unpredictable snapping results).

Now, detection update and inicializatiom of common members are contained in
`snap_object_data_mesh_get` and `snap_object_data_editmesh_get`.

Also, the "Hack to avoid updating while transforming" is more evident.
2021-04-18 20:07:05 -03:00
Germano Cavalcante
c8dd684b65 Cleanup: Use utility to init userdata in 'transfrom_snap_object.c'
This deduplicates the code making it easier to edit.
2021-04-18 20:07:05 -03:00
Germano Cavalcante
6879868814 Merge branch 'blender-v2.93-release' 2021-04-18 20:06:32 -03:00
Germano Cavalcante
063c9938f1 Fix snap mixed with vertices ignored for meshes with vertices only
The logic assumed that there were only 3 basic snapping modes.
2021-04-18 20:04:58 -03:00
Hans Goudey
9a69653b42 Merge branch 'blender-v2.93-release' 2021-04-18 11:59:36 -05:00
Hans Goudey
06888a8970 Fix compile warning
The order of the two parameters was incorrect.
2021-04-18 11:58:44 -05:00
Jacques Lucke
76eae59648 Cleanup: make format 2021-04-18 09:51:03 +02:00
Jacques Lucke
01448ee7ce Cleanup: clang tidy readability-else-after-return 2021-04-18 09:49:14 +02:00
Germano Cavalcante
8d30a7a1cf Merge branch 'blender-v2.93-release' 2021-04-17 17:13:12 -03:00
Germano Cavalcante
4bce9c5283 Fix memory leak in the BLI_bitmap created in 'looptri_no_hidden_map_get' 2021-04-17 16:55:59 -03:00
Germano Cavalcante
1544bcfc37 Measure Tool: Snap to Cage Geometry
For Measure tool, it is more useful to snap to what is really visible.

So use the cage instead of the geometry that may be hidden with Bmesh.
2021-04-17 16:51:19 -03:00
Germano Cavalcante
4e1507bd3b Snap Gizmo Refactor: Implement options for the gizmo behavior
The Snap Gizmo now has options for occlusion, selection filter and edit
geometry.

It will be useful to implement in current tools.
2021-04-17 16:51:19 -03:00
Germano Cavalcante
1fc446a908 Fix recent snap refactor
It is important to check if editmesh eval cage is also bmesh.
2021-04-17 16:50:49 -03:00
Germano Cavalcante
aca9a1bac3 Transform Snap Refactor: Use enum for cage snap options
This allows the addition of the `SNAP_GEOM_CAGE` option.
Currently unused.
2021-04-17 15:45:08 -03:00
Howard Trickey
ebcf49fe1a Merge branch 'blender-v2.93-release' 2021-04-17 14:22:57 -04:00
Howard Trickey
2d5a715f44 Fix T86805 Inconsistent results for exact boolean.
The fast triangulator from Blenlib could leave a non-manifold mesh
after removing degenerate triangles. Switched to an exact triangulator.
2021-04-17 14:18:03 -04:00
Jacques Lucke
3516ee5a14 Merge branch 'blender-v2.93-release' 2021-04-17 19:23:12 +02:00
Jacques Lucke
ddbfae7a0d Cleanup: quiet compiler warning on macos 2021-04-17 19:19:46 +02:00
Jacques Lucke
1a010450bc BLI: add unit tests for recently added methods 2021-04-17 19:06:48 +02:00
Jacques Lucke
eff2b89446 BLI: support multiple parameters in Stack.push_as 2021-04-17 19:06:48 +02:00
Jacques Lucke
686452fb1b BLI: add Vector.append_as method
This method is similar to `std::vector::emblace_back` in that it constructs
the new object inplace in the vector, removing the need for a move.

The `_as` suffix is consistent with similar behavior in Map and Set data structures.
2021-04-17 19:06:48 +02:00
Germano Cavalcante
e4990a5658 Fix wrong logic used in 'ED_view3d_depth_read_cached'
It is important to limit the pixels read on `BLI_array_iter_spiral_square`.

Fortunately `ED_view3d_depth_read_cached` was not being called with a
`margin` parameter.

Wrong logic introduced in rB44c76e4ce310.
2021-04-17 13:52:31 -03:00
Germano Cavalcante
fa2c00ae91 Fix wrong logic used in 'ED_view3d_depth_read_cached'
It is important to limit the pixels read on `BLI_array_iter_spiral_square`.

Fortunately `ED_view3d_depth_read_cached` was not being called with a
`margin` parameter.

Wrong logic introduced in rB44c76e4ce310.
2021-04-17 13:51:33 -03:00
Jacques Lucke
d0d85742fc BLI: support multiple arguments for value in *_as methods of Map
This allows us to build more complex values in-place in the map.
Before those values had to be build separately and then moved into the map.

Existing calls to the Map API remain unchanged.
2021-04-17 18:39:35 +02:00
Jacques Lucke
5cf6f570c6 Geometry Nodes: use virtual arrays in internal attribute api
A virtual array is a data structure that is similar to a normal array
in that its elements can be accessed by an index. However, a virtual
array does not have to be a contiguous array internally. Instead, its
elements can be layed out arbitrarily while element access happens
through a virtual function call. However, the virtual array data
structures are designed so that the virtual function call can be avoided
in cases where it could become a bottleneck.

Most commonly, a virtual array is backed by an actual array/span or
is a single value internally, that is the same for every index.
Besides those, there are many more specialized virtual arrays like the
ones that provides vertex positions based on the `MVert` struct or
vertex group weights.

Not all attributes used by geometry nodes are stored in simple contiguous
arrays. To provide uniform access to all kinds of attributes, the attribute
API has to provide virtual array functionality that hides the implementation
details of attributes.

Before this refactor, the attribute API provided its own virtual array
implementation as part of the `ReadAttribute` and `WriteAttribute` types.
That resulted in unnecessary code duplication with the virtual array system.
Even worse, it bound many algorithms used by geometry nodes to the specifics
of the attribute API, even though they could also use different data sources
(such as data from sockets, default values, later results of expressions, ...).

This refactor removes the `ReadAttribute` and `WriteAttribute` types and
replaces them with `GVArray` and `GVMutableArray` respectively. The `GV`
stands for "generic virtual". The "generic" means that the data type contained
in those virtual arrays is only known at run-time. There are the corresponding
statically typed types `VArray<T>` and `VMutableArray<T>` as well.

No regressions are expected from this refactor. It does come with one
improvement for users. The attribute API can convert the data type
on write now. This is especially useful when writing to builtin attributes
like `material_index` with e.g. the Attribute Math node (which usually
just writes to float attributes, while `material_index` is an integer attribute).

Differential Revision: https://developer.blender.org/D10994
2021-04-17 16:41:39 +02:00
Antonio Vazquez
4dca44086f Merge branch 'blender-v2.93-release' 2021-04-17 15:40:22 +02:00
Antonio Vazquez
d9224f64a1 Fix T87321: GPencil Arrange strokes not consistent with industry standards
Now if one stroke in the extremes of the stack is selected, other strokes are moved.

Reviewed By: pepeland, Dantti

Maniphest Tasks: T87321

Differential Revision: https://developer.blender.org/D10997
2021-04-17 15:38:36 +02:00
Jacques Lucke
3608891282 Functions: extend virtual array functionality
This adds support for mutable virtual arrays and provides many utilities
for creating virtual arrays for various kinds of data. This commit is
preparation for D10994.
2021-04-17 15:13:20 +02:00
Germano Cavalcante
e524a6ecf7 Snap Gizmo: Improve event comparison code
Better distinction between modifier key events and mouse position events.

No functional changes.
2021-04-16 14:44:10 -03:00
Philipp Oeser
cf6d10ef46 Merge branch 'blender-v2.93-release' 2021-04-16 17:44:36 +02:00
Philipp Oeser
0f81dafe6c Fix T87010: VSE: adding strips crashes in certain files
Caused by {rB571362642201} where versioning code for new sequencer tool
settings was only done for scenes already having sequencer scene->ed.

If scene->ed was not present, sequencer tool settings were never
initalized for this scene [if the VSE was then used later], leading to
crashes in some places.

Now just use the versioning code to initalize sequencer tool settings
for all scenes not having them yet.

Maniphest Tasks: T87010

Differential Revision: https://developer.blender.org/D10996
2021-04-16 17:42:10 +02:00
Campbell Barton
537460b86d Merge branch 'blender-v2.93-release' 2021-04-17 01:32:28 +10:00
Campbell Barton
0bf630493f Fix missing owner_id values from 919558854d
This prevented dynamic enum callbacks being called.
2021-04-17 01:29:51 +10:00
Campbell Barton
c7a8bcfa37 Merge branch 'blender-v2.93-release' 2021-04-17 00:21:30 +10:00
Campbell Barton
fa4b2d25cb WM: remove redundant click-drag offset for gizmo highlight checking
Tweak and click-drag events already apply this offset, this was a no-op.
2021-04-17 00:20:19 +10:00
Campbell Barton
bfc0f483c6 Merge branch 'blender-v2.93-release' 2021-04-16 23:53:04 +10:00
Campbell Barton
7bbead1e87 WM: prevent drag events being continually tested
Click-drag events that weren't handled would continually be tested
for each mouse-motion event.

As well as being redundant, this added the overhead of querying
gizmos twice per motion event.

Now click-drag is only tested once when the drag threshold is reached.

This mitigates T87511, although the single drag test still causes
the snap gizmo to flicker.
2021-04-16 23:50:05 +10:00
Campbell Barton
7aa38de085 Merge branch 'blender-v2.93-release' 2021-04-16 22:14:56 +10:00
Campbell Barton
0edfa5350e Merge branch 'blender-v2.93-release' 2021-04-16 22:14:53 +10:00
Campbell Barton
278b19745b Cleanup: clang-format 2021-04-16 22:13:05 +10:00
Campbell Barton
afd8e4bce7 Fix BLO_library_temp_load_id loading temporary ID's into G.main
The intention with this API function was to temporarily load
ID's tagged LIB_TAG_TEMP_MAIN,
however the way the `real_main` was used,
these ID's were loaded into the G.main.
2021-04-16 22:13:05 +10:00
Jacques Lucke
be34d14575 Merge branch 'blender-v2.93-release' 2021-04-16 13:46:21 +02:00