Commit Graph

104948 Commits

Author SHA1 Message Date
Jacques Lucke f56fddbf9a Clang Tidy: disable WarningsAsErrors
This makes regular development more pleasant, because one does not have
to fix unrelated clang tidy mistakes when one is in the middle of something.
Before this change, I would usually turn clang-tidy off entirely, but then
forget to turn it on again.

This change has been agreed on by Sergey as well.
2021-03-29 11:04:34 +02:00
Sybren A. Stüvel 3681a619de Fix T78650: Lattice evaluation writes to shared data
Fix the data management bug where evaluation of lattice objects would
write back to the CoW copy of the Lattice ID, even when that copy was
shared between objects.

Each lattice object evaluation now stores its own evaluated data copy
via `BKE_object_eval_assign_data()`.

Reviewed By: sergey

Maniphest Tasks: T78650

Differential Revision: https://developer.blender.org/D10790
2021-03-29 11:00:32 +02:00
Jacques Lucke 8034b276ba Fix T86876: cannot modify float properties of geometry nodes modifier from Python
Previously, the code expected the id property to have the `IDP_FLOAT` type.
However, when assigning a Python float (which is a double internally)
to an id property, it would change the type to `IDP_DOUBLE`.
The fix is to allow both types in the geometry nodes modifier.
2021-03-29 10:54:04 +02:00
Jacques Lucke fa1569a072 Fix T86966: crash when rendering with geometry nodes
UI hints should only be modified when the depsgraph is active.
Otherwise two threads evaluating the same object in different depsgraphs
can conflict with each other.
2021-03-29 10:14:54 +02:00
Jeroen Bakker 4e34baddb9 Overrides: Make Experimental API Fail On Usage.
It used to give a warning so test cases couldn't fail. This has been
changed in the test case so we could use an error here.
2021-03-29 09:57:06 +02:00
Jeroen Bakker 87f9405c9a Overrides: API to create an override template.
This is functionality that isn't accessible via the user interface. The
API allows the creation and modification of an override template that
holds rules that needs to be checked when overriding the asset.

The API is setup that it cannot be changed after creation. Later on when
the system is more mature we will allow changing overrides operations.

NOTE: This is an experimental feature and should not be used in productions.

Reviewed By: mont29, sebbas

Differential Revision: https://developer.blender.org/D10792
2021-03-29 09:54:34 +02:00
Jacques Lucke 27fa2507a1 Fix T86972: transform node transforms shape keys 2021-03-29 09:35:19 +02:00
Campbell Barton 240f15c1b6 Comments: improve docstring for ED_view3d_clipping_test
The meaning of the return value wasn't obvious.
2021-03-29 18:30:45 +11:00
Jeroen Bakker b9734f7716 Cleanup: Remove unused node.c.
Was wrongly added back with the anti aliasing node patch.
2021-03-29 09:25:08 +02:00
Campbell Barton 80cbbd2843 Knife: support vert/edge snapping when not directly over a face
Respect the distance argument to EDBM_face_find_nearest,
when zero, sample a single pixel, otherwise sample a region.

Knife uses the selection-buffer to pick a face when the ray-cast failed.
This was meant to allow snapping to nearby faces however as the margin
was ignored, it was only used in edge cases where the ray-cast missed
but the pixel didn't.

Now the face-picking threshold is working as expected.

Note that other callers to EDBM_face_find_nearest have been updated
so set their distance argument to zero so this only impacts the knife.
Regular selection and path select could be modified separately if users
prefer this behavior.
2021-03-29 18:08:57 +11:00
Campbell Barton 3659340571 Cleanup: logical error in path select picking
Resolve logical error in edbm_shortest_path_pick_invoke
where any discrepancy between EDBM_unified_findnearest and
edbm_elem_find_nearest caused the active-object to be cleared.

While it's not a problem at the moment, using a larger threshold
for path picking exposes the error.
2021-03-29 18:08:57 +11:00
Campbell Barton 8994f09a4a Knife: scale points & snapping threshold by the DPI factor
The points were too small on hi-dpi displays.
2021-03-29 18:08:57 +11:00
Campbell Barton fc889615f7 Fix vert/edge knife snapping when the cursor wasn't over a face
In this case, the cage location was left zeroed which was then
projected back onto the screen to find the nearest screen space
edge/vertex.

This made snapping to the vertex/edge fail in some corner-cases
where it was intended to work.
2021-03-29 18:08:57 +11:00
Jeroen Bakker ab26be8ff7 Cleanup: use pragma once. 2021-03-29 08:20:21 +02:00
Jeroen Bakker 25c02ea703 Cleanup: Add namespace to compositor. 2021-03-29 08:18:33 +02:00
Jeroen Bakker 9975af5ffa Cleanup: Add `override` Keyword. 2021-03-29 08:04:58 +02:00
Habib Gahbiche 805d947810 Compositor: Add Anti-Aliasing node
This is an implementation of Enhanced Subpixel Morphological Antialiasing (SMAA)

The algorithm was proposed by:
  Jorge Jimenez, Jose I. Echevarria, Tiago Sousa, Diego Gutierrez

This node provides only SMAA 1x mode, so the operation will be done with no spatial
multisampling nor temporal supersampling. See Patch for comparisons.

The existing AA operation seems to be used only for binary images by some other nodes.
Using SMAA for binary images needs no important parameter such as "threshold", so we
perhaps can switch the operation to SMAA, though that changes existing behavior.

Notes:
1. The program code assumes the screen coordinates are DirectX style that the
   vertical direction is upside-down, so "top" and "bottom" actually represent bottom
   and top, respectively.

Thanks for Habib Gahbiche (zazizizou) to polish and finalize this patch.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D2411
2021-03-29 07:56:58 +02:00
Campbell Barton 6af4163a3f Knife: reduce redundant face picking queries
Reduce the maximum number of queries to find the face under the
mouse cursor from 6x to 2x on cursor motion.

Calculating the screen-space detail could perform 2x look-ups
which have already been calculated.
2021-03-29 14:31:05 +11:00
Campbell Barton 27a7b2e27a Fix T83391: Knife sometimes snaps to object center
Knife snapping logic assumed having a face under the cursor meant
the projected positions were set.

This is not always the case as failure to ray-cast uses the back-buffer
as a fallback.
2021-03-29 13:29:14 +11:00
Jacques Lucke e47f5cf197 Cleanup: deduplicate attribute creating code 2021-03-28 12:50:14 +02:00
Jacques Lucke 9289c358fb Cleanup: use parentheses in macro 2021-03-28 12:50:14 +02:00
Campbell Barton afcfc6eb08 Fix T86060: Texture Paint clone tool misleading texture UI
For projection painting tools besides the `DRAW` tool:

- Don't show the texture from viewport stencil drawing.
- Don't show the texture panel.

Based on D10564 by @lichtwerk with own changes.
2021-03-28 19:45:56 +11:00
Campbell Barton 3944560b4a Cleanup: re-order expensive checks for indirect ID use
Check for indirect ID use after other simple user count checks are made.

Also assert ED_object_base_free_and_unlink_no_indirect_check object
argument isn't indirectly used.
2021-03-28 18:48:57 +11:00
Campbell Barton 0a6bca1f75 Cleanup: revert part of da160dc32d
The grease-pencil parent check was enabled when deleting objects,
when previously it was only done when unlinking.

While harmless, the previous logic is correct.
2021-03-28 18:48:57 +11:00
Campbell Barton 46d980228b Fix T86992: Tagged ID deletion conflicts with freeing objects
Check LIB_TAG_COPIED_ON_WRITE instead of LIB_TAG_NO_MAIN,
matching the behavior of rigid-body shared data.
2021-03-28 18:16:07 +11:00
Campbell Barton 5b1980859a Workaround T86992: Tagged ID deletion conflicts with freeing objects
da160dc32d exposed a bug in
`BKE_id_multi_tagged_delete` causing a memory leak in soft-body that
made `physics_softbody` test fail.

Use a loop to remove ID's to keep tests working until T86992 is fixed.
2021-03-28 17:32:37 +11:00
Antonio Vazquez a9e7d503dd Cleanup: Apply clang format 2021-03-27 15:01:41 +01:00
Marcelo Demian Gómez e7c4c9e538 Fix T86967 : Artifacts when tracing image to Grease Pencil
Tracing images to grease pencil objects creates sometimes artifacts, as seen, for example, when tracing the attached image.  {F9910821}
I have found the same behavior both in the 2.92 release and in the current 2.93 master.
The artifacts are caused by a variable that's not initialized or updated when finding a point tagged as POTRACE_CORNER.
This patch solves this issue.

Maniphest Tasks: T86967

Differential Revision: https://developer.blender.org/D10832
2021-03-27 15:01:36 +01:00
Antonio Vazquez dc873c4a7b Fix T86975: GPencil interpolate sequence error when strokes are not selected
If the selection order is not used, need to put the strokes in inverse order because the Hash Iter returns the strokes in inverse order.
2021-03-27 12:51:18 +01:00
Habib Gahbiche c4ab1891cc Automated testing: selection operators test cases
added 22 more test cases for following operators:
    - edges select sharp
    - loop multi select
    - select all
    - select faces by sides
    - select interior faces
    - select less
    - select linked

{F9853218}

Reviewed By: calra, mont29

Differential Revision: https://developer.blender.org/D10400
2021-03-27 09:48:54 +01:00
Pratik Borhade 99dabc156a Cleanup: spelling and comments
- comment added in struct `KnifeTool_OpData`
- struct pointer name `lst` updated to `list` ( Guess its more readable )
- `KNF_MODEL_IGNORE_SNAP_ON` updated to `KNF_MODAL_IGNORE_SNAP_ON`
- `KNF_MODEL_IGNORE_SNAP_OFF` updated to `KNF_MODAL_IGNORE_SNAP_OFF`

Ref D10824
2021-03-27 16:21:37 +11:00
Siddhartha Jejurkar 9f3d41d4ee Fix T86924: UV Sync selection breaks individual origin calculation
Use uvedit_uv_select_test which accounts for UV Sync selection.

Ref D10830
2021-03-27 15:58:31 +11:00
Campbell Barton a6ec2de96a Correct header rename error 10cfa75e1d 2021-03-27 15:48:59 +11:00
Fabrício Luis 8e6e8dd871 UV Editor: Add cursor center operator
This matches cursor center operator from the 3D view.

Reviewed By: campbellbarton

Resolves T70142

Ref D8271
2021-03-27 15:07:26 +11:00
Campbell Barton 414017ac86 Cleanup: clang-format 2021-03-27 14:49:59 +11:00
Campbell Barton ee367084a7 Comment: note that structs are zeroed instead of using defaults 2021-03-27 14:48:26 +11:00
Campbell Barton 10cfa75e1d Cleanup: use .hh extension for C++ headers
Follow documented convention for file naming.
2021-03-27 14:05:30 +11:00
Campbell Barton da160dc32d Object: faster object deletion
The `object_delete_exec` lead to `BKE_library_ID_is_indirectly_used`
being called twice. With this patch deleting is around 20% faster.

Example when deleting 10000 objects:
Current: 35.6s
This patch: 18.8s (updated, last rev 29.7s)

Reviewed By: campbellbarton

Ref D9857
2021-03-27 13:38:44 +11:00
Vincent Blankfield 9b87d3f029 Win32: Allow return from fullscreen to maximized
If window is maximized when toggling fullscreen, go back to maximized when done.

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

Reviewed by Harley Acheson
2021-03-26 14:30:57 -07:00
Ankit Meel 0ec82477af macOS/bpy: install into site-packages
Reviewed By: #platform_macos, brecht
Maniphest Tasks: T86579
Differential Revision: https://developer.blender.org/D10664
2021-03-27 01:14:45 +05:30
Ankit Meel ad31b13f91 macOS/bpy: add support for OpenMP
Changes made:
* Add OpenMP linker flags.
* Copy the libomp.dylib to `2.93/lib/libomp.dylib`.
* Change the `LC_LOAD_DYLIB` item such that
  the lib is found at `bpy.so/../../Resources/2.93/lib/libomp.dylib`.
Installation is done by D10664.

Reviewed By: #platform_macos, brecht
Maniphest Tasks: T86579
Differential Revision: https://developer.blender.org/D10657
2021-03-27 01:08:51 +05:30
Hans Goudey 35d5cc8982 Cleanup: Use enum for "in" vs. "out" node sockets 2021-03-26 14:25:52 -04:00
Vincent Blankfield 12193035ed Fix T86859: Allow covering of Taskbar when Fullscreen from Maximized
When the window is already maximized allow covering Windows Taskbar when toggling fullscreen.

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

Reviewed by Harley Acheson
2021-03-26 10:19:50 -07:00
Bastien Montagne 8408a8fda2 LibOverride: Fix outliner menu showing 'override editing' entries for linked overrides.
One can only resync, reset, delete etc. locl overrides, linked ones are
basically regular linked IDs and fully not editable.

Reported by Demeter from the Studio, thanks.
2021-03-26 18:15:20 +01:00
Hans Goudey 80530edcae Geometry Nodes: Rename "Plane" primitive to "Grid"
Although "Grid" may not be techincally correct since a grid could be 3D,
it was decided to rename the "Plane" primtive to "Grid". The primitive
node allows subdivisions, so the name is more consistent with the
operator in the 3D view.

Ref T86819

This commit includes a file subversion bump for the versioning.
2021-03-26 13:09:35 -04:00
Yevgeny Makarov e684c170f9 UI: Change Usages of 'WPaint' to 'Weight Paint'
Changing to a more informative 'Weight Paint' rather than 'WPaint'.

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

Reviewed by Julian Eisel
2021-03-26 09:58:07 -07:00
Charlie Jolly 70061c69b7 Geometry Nodes: Implicit conversion change for float/int/color to bool
Change `float to boolean` and `int32 to boolean` to return false for zero and negative values.

This aligns with how artists would expect these values to work. This is in contrast to what a coder would expect. It was determined on blender.chat that this was a better default. This means that a negative float value would give a boolean false.

Change `Color4f to boolean` to return false for zero and negative grayscale values.

Likewise, for color to boolean, to account for negative value colors, the grayscale value would be used for determining if a colour was false or not.

See {T86454}

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10685
2021-03-26 16:29:48 +00:00
Fabian Schempp 1e855149b2 Nodes: match Multi-input socket activation distance
Activation distance for multi input sockets had different length
dependend of dpi factor. That caused jumping when activation distance
became shorter than snapping distance.

Fixed by removing activation distance and using same function
which is used to evaluate snapping.

Reviewer: Dalai Felinto

Differential Revision: https://developer.blender.org/D10809
2021-03-26 17:29:10 +01:00
Ray Molenkamp f560bc90c7 OSL: add basic OSL shader template
Add a basic OSL shader that shows how inputs
and outputs work and do some simple math with
them.

This template is a happy medium between the
templates we already ship, empty_shader is a
little too bare, and the other templates are
a little "too much" and you end up having to
delete a whole bunch of stuff.

a great starting point for some experimentation!

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

reviewed by: brecht
2021-03-26 10:27:31 -06:00
Jeroen Bakker 689d6032ff Compositor: Fix array out of bounds. 2021-03-26 17:23:14 +01:00