Commit Graph

84446 Commits

Author SHA1 Message Date
Antonio Vazquez
f99f884444 GPencil: Rename Draw" mode to Draw Mode` 2021-04-19 17:12:39 +02:00
Campbell Barton
feedf28549 Changes missed from 4402c2324b 2021-04-20 00:25:54 +10:00
Campbell Barton
4402c2324b Cleanup: use 'wmOperator.ptr' in draw functions
Draw functions used RNA_pointer_create to create the pointer,
however this already exists in the operator.
2021-04-20 00:14:37 +10:00
Antonio Vazquez
e1acefd45e GPencil: Add multiframe support to Reproject operator
Before only active frame was supported

Related to T87425
2021-04-19 15:58:41 +02:00
Campbell Barton
46a13482cb Cleanup: spelling 2021-04-19 23:56:12 +10:00
Campbell Barton
33440760a6 Merge branch 'blender-v2.93-release' 2021-04-19 23:54:06 +10:00
Campbell Barton
8245805ce3 Fix creating operator properties without an owner_id
Any dynamic enum access would not use the callback.
Always set the owner_id to avoid this causing problems.

Oversight in 919558854d
2021-04-19 23:52:59 +10:00
Falk David
eb06ccc324 Fix T87448: Avoid uiBut update if value was same
Previously, clicking into a number field, changing nothing and then
clicking outside the field again would trigger an update (RNA prop
would be set to the same value again). This could potentially cause
an expensive operation (like a modifer) to run again, even if all the
parameters were identical.

The fix prevents this by treating unchanging values in the field as a
cancel operation.

Reviewed By: Severin

Maniphest Tasks: T87448

Differential Revision: https://developer.blender.org/D10976
2021-04-19 12:20:05 +02:00
Brecht Van Lommel
c75b2019e1 Fix incorrect compositor denoise node message about SSE on macOS Arm
Ref T78710
2021-04-19 12:12:23 +02:00
Eitan
799f532f46 Geometry Nodes: new Switch node
This is a first iteration of a switch node. It can only switch between
two inputs values based on a boolean. A more sophisticated switch
node that has an integer selector will probably come later.

Currently, the geometry nodes evaluator does not support lazy evaluation
of individual inputs. Therefore, all inputs will be computed currently.
An improvement to the evaluator will be worked on separately.

Ref: T85374

Differential Revision: https://developer.blender.org/D10460
2021-04-19 10:38:50 +02:00
Campbell Barton
112fb77157 Merge branch 'blender-v2.93-release' 2021-04-19 17:36:59 +10:00
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
6dffdb02fa Fix drag event leaving the gizmo not under the cursor highlighted
Prevent drag events from changing the highlighted gizmo
unless the drag event activates the gizmo.

This resolves a glitch where testing a drag event would highlight
at the point the drag was initiated even when the event was not handled.
2021-04-19 17:18:59 +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