Commit Graph

116002 Commits

Author SHA1 Message Date
Campbell Barton
498f079d2c GHOST/Wayland: support displaying custom software cursors
Add a method to access the custom cursor from GHOST which is used
for drawing a software cursor. This means the knife tools cursor now
work as expected.

Although non-custom cursors are still not supported.
2022-06-18 17:16:42 +10:00
Campbell Barton
881d1c9bc2 Fix crash in wayland when closing a window
The focus_pointer only pointer was only cleared when the window existed,
which caused a dangling focus_pointer when closing a window.
2022-06-18 16:50:25 +10:00
Campbell Barton
35b2b9b6e6 Fix T98793: Wayland clamps cursor movement fails with gnome-shell
The current gnome-shell (v42.2) has a bug where grabbing the cursor
doesn't scale the region when confining it to the window.

For Hi-DPI displays this means the cursor may be confined to a quarter
of the window, making grab unusable.

Even though this has been fixed up-stream the issue remains in the
latest release - so workaround the problem by implementing window
confined grab using a software cursor.

This is only used gnome-shell for displays that use Hi-DPI scaling.
2022-06-18 15:06:46 +10:00
Campbell Barton
5c814e75f2 GHOST: add GHOST_Rect.clampPoint method
Method for clamping a point inside a rectangle.
2022-06-18 14:33:50 +10:00
Ray Molenkamp
600c391a65 Cleanup: Compiler Warning of Sign Conversion #2
Second attempt to silence sign-conversion warning on Linux, introduced
in rB524a9e3db810. Confirmed fix on buildbot.
2022-06-17 13:59:25 -07:00
Harley Acheson
3d3c0dfe30 Cleanup: Compiler Warning of Sign Conversion
rB524a9e3db810 introduced sign-conversion warning on Linux.

Own Code
2022-06-17 12:46:37 -07:00
Aras Pranckevicius
5b5811c97b USD: speed up large USD imports by not rebuilding material name map for each object
Previous code was rebuilding "name to material" map for each object
being imported. Which means O(N*M) complexity (N=object count,
M=material count). There was already a TODO comment suggesting that
a single map that's maintained for the whole import would be enough.
This commit does exactly that.

While importing Moana USD scene (260k objects, 18k materials) this
saves about 6 minutes of import time.

Reviewed By: Bastien Montagne
Differential Revision: https://developer.blender.org/D15222
2022-06-17 22:28:22 +03:00
Aras Pranckevicius
230f72347a IO: speed up large Alembic & USD imports by doing fewer collection syncs
Previous code was doing N collection syncs when importing N objects
(essentially quadratic complexity in terms of object count). New
code avoids all the intermediate syncs by using
BKE_layer_collection_resync_forbid and
BKE_layer_collection_resync_allow, and then does one
BKE_main_collection_sync + BKE_main_collection_sync_remap for the
whole operation. The things done on the importer objects that are
dependent on the sync happening (marking them selected) are done in a
separate loop after the sync.

Timings: importing Moana USD scene (480k objects) on Windows, VS2022
Release build, AMD Ryzen 5950X: 12344sec -> 10979sec (saves 22 minutes).

Reviewed By: Bastien Montagne
Differential Revision: https://developer.blender.org/D15215
2022-06-17 22:22:30 +03:00
Patrick Huang
257b4d138c Fix T93446: search box active result does not reset when typing
Whenever the user edits the query in a search box, the active (highlighted)
result resets to the first. Previously, it would remain at the last
highlighted result, jumping around as the results update.

This is better than the previous behavior. If a user highlights a choice either
on purpose or by accidental mouse movement and continues to type, it is likely
that they are not looking for the currently highlighted choice, so setting it
to the top search result is more useful.

Differential Revision: https://developer.blender.org/D15211
2022-06-17 19:51:13 +02:00
Jim Eckerlein
33bad77043 Draco: update to version 1.5.2
Differential Revision: https://developer.blender.org/D15233
2022-06-17 19:40:01 +02:00
Harley Acheson
524a9e3db8 BLF: Fallback Font Stack
Allow use of multiple fonts acting together like a fallback stack,
where if a glyph is not found in one it can be retrieved from another.

See D12622 for much more detail

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

Reviewed by Brecht Van Lommel
2022-06-17 10:31:48 -07:00
Brecht Van Lommel
5485057a27 Cleanup: compiler warnings 2022-06-17 19:18:47 +02:00
Bastien Montagne
0ea173165b Revert "TEST COMMIT: API doc generation changes."
This reverts commit d86af604290be0507db113dc8c82540bb30d4fd3.
2022-06-17 18:21:28 +02:00
Ray Molenkamp
9bae9d97b1 deps: fix llvm using system python
llvm was using system python, rather than our copy
this went unnoticed on both linux and windows until
sergey tried to build the deps on a clean system with
no system python installed.
2022-06-17 09:38:25 -06:00
Bastien Montagne
d86af60429 TEST COMMIT: API doc generation changes.
This commit is intended to be reverted within a few minutes.

commit 50adc860a652508570dbc7102ef288049a9ffed4
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:43:13 2022 +0200

    Py API Doc: add runtime changelog generation to `sphinx_doc_gen.py`.

    Optionally use `sphinx_changelog_gen.py` to dump current version of the
    API in a JSON file, and use closest previous one listed in given index
    file to create a changelog RST page for Sphinx.

commit 88fc683e78f866f1b3cda379c3b90e1f2916ce00
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:36:19 2022 +0200

    Py API Doc: refactor changelog generation script.

    Main change is to make it use JSON format for its dump files, instead of
    some Python code.

    It also introduces an index for those API dump files, mapping a blender
    version to the relevant file path.

    This is then used to automatically the most recent (version-number wise)
    previous API dump to compare against current one, when generating the
    change log RST file.
2022-06-17 17:07:37 +02:00
Bastien Montagne
3c0162295f Revert "TEST COMMIT: API doc generation changes."
This reverts commit 52b93c423dc0db774dbcfb656702ecc01f8d6818.
2022-06-17 17:03:32 +02:00
Jacques Lucke
0d43117a40 Cleanup: deduplicate generating transform matrices in curves brushes 2022-06-17 16:57:36 +02:00
Jacques Lucke
23662a9a84 Cleanup: simplify Add Curves brush 2022-06-17 16:57:36 +02:00
Bastien Montagne
52b93c423d TEST COMMIT: API doc generation changes.
This commit is intended to be reverted within a few minutes.

commit 9442d8ef0f255d3c18b610b42aff71229904aaee
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:43:13 2022 +0200

    Py API Doc: add runtime changelog generation to `sphinx_doc_gen.py`.

    Optionally use `sphinx_changelog_gen.py` to dump current version of the
    API in a JSON file, and use closest previous one listed in given index
    file to create a changelog RST page for Sphinx.

commit f7fb537078641d2e2de015c08554f5281ce9debd
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:36:19 2022 +0200

    Py API Doc: refactor changelog generation script.

    Main change is to make it use JSON format for its dump files, instead of
    some Python code.

    It also introduces an index for those API dump files, mapping a blender
    version to the relevant file path.

    This is then used to automatically the most recent (version-number wise)
    previous API dump to compare against current one, when generating the
    change log RST file.
2022-06-17 16:39:36 +02:00
Bastien Montagne
b8f489c65b Revert "TEST COMMIT: API doc generation changes."
This reverts commit 510f3fe9a977798d44e81add078944745c1585bf.
2022-06-17 16:30:42 +02:00
Jacques Lucke
133095fff4 Curves: refactor Add brush
This splits out the code that samples points on a surface and the
code that initializes new curves. This code will be reused by D15134.

Differential Revision: https://developer.blender.org/D15216
2022-06-17 15:31:21 +02:00
Hans Goudey
18def163f8 Cleanup: Simplify syntax in curves draw cache file
Also remove some unnecessary logic and change a variable name.
2022-06-17 15:11:41 +02:00
Bastien Montagne
f0b4aa5d59 LibOverride: Handle dependencies in both directions in partial override cases.
When creating etc. a liboverride based on a partial hierarchy
pre-selection (e.g: override hierarchy on the rig object of a
character), now all linked data also using that rig (e.g. all meshes
deformed by that armature) will also automatically be overridden.

This si achieved by following dependencies in the reversed order (from
used IDs to using IDs) when we find one tagged for override.
2022-06-17 14:10:51 +02:00
Bastien Montagne
8d61ca5815 BKE_main: Relations: Add TO/FROM variants of processed flags.
In some cases, it can be usefull to distinguish when an entry has been
processed in which direction (`to` when handling ID pointers used by
the entry, `from` when handling ID using this entry).

Previous `MAINIDRELATIONS_ENTRY_TAGS_PROCESSED` tag is now a combination
of the two new ones.
2022-06-17 14:10:51 +02:00
Brecht Van Lommel
2c1bffa286 Cleanup: add verbose logging category names instead of numbers
And use them more consistently than before.
2022-06-17 14:08:14 +02:00
Brecht Van Lommel
24246d9870 Cleanup: replace uint4 by AttributeMap struct 2022-06-17 14:08:14 +02:00
Chris Clyne
838c4a97f1 Geometry Nodes: new Volume Cube node
This commit adds a Volume Cube primitive node. It outputs a volume that
contains a single "density" float grid. The density per voxel can be
controlled with a field that depends on the voxel position (using the
existing Position node). Other field inputs are not supported.

The density field is evaluated on every voxel.

Possible future improvements are listed in D15198.

Differential Revision: https://developer.blender.org/D15198
2022-06-17 13:30:44 +02:00
Jacques Lucke
75489b5887 Geometry Nodes: tweak Volume to Mesh threshold declaration
* Remove the minimum value, because that doesn't make sense in general.
* Add a description.
2022-06-17 13:30:44 +02:00
Sergey Sharybin
d54eb5ed20 Fix crash invoking layer add/remove operators without mask 2022-06-17 12:14:30 +02:00
Bastien Montagne
510f3fe9a9 TEST COMMIT: API doc generation changes.
This commit is intended to be reverted within a few minutes.

commit 088497c870630d9b0d405aaa5fd796c77b380731
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:43:13 2022 +0200

    Py API Doc: add runtime changelog generation to `sphinx_doc_gen.py`.

    Optionally use `sphinx_changelog_gen.py` to dump current version of the
    API in a JSON file, and use closest previous one listed in given index
    file to create a changelog RST page for Sphinx.

commit 91801f47ad03f4739e97ae4b4edee09687e2cb85
Author: Bastien Montagne <bastien@blender.org>
Date:   Wed Jun 15 15:36:19 2022 +0200

    Py API Doc: refactor changelog generation script.

    Main change is to make it use JSON format for its dump files, instead of
    some Python code.

    It also introduces an index for those API dump files, mapping a blender
    version to the relevant file path.

    This is then used to automatically the most recent (version-number wise)
    previous API dump to compare against current one, when generating the
    change log RST file.
2022-06-17 10:46:06 +02:00
Peter Kim
10981bc8c0 Fix T98944: Uninitialized XRFrameState can prevent VR/OpenXR viewing
This provides a workaround for the VR session stopping due to an error
in locating controller poses. The problem was that for the actions sync
on the first frame, the session's XrFrameState/predicted display time
had not been initialized yet, which led to an error in xrLocateSpace()
(the error was only observed for some OpenXR runtimes since the first
frame pose state would be inactive for other runtimes, skipping the
call to xrLocateSpace()).

The timing of action updates relative to frame state updates could be
reworked in the future, but for now simply check for a valid display
time to avoid an error on the first frame.
2022-06-17 17:25:48 +09:00
Dalai Felinto
18960c08fd UI: Custom Properties - Rename properties to remove "Use/Is"
There is no need to have use/is in the final name. This is implicitly
represented by the checkbox already.

This does not change the Python API, only the names we show in the user
interface.

* Is Library Overridable -> Library Overridable
* Use Soft Limits -> Soft Limits

Differential Revision: https://developer.blender.org/D15217
2022-06-17 10:08:17 +02:00
Hans Goudey
96764c3a1f Cleanup: Remove redundant doxygen section
Also remove const for the object argument, since the object data
is logically modified by generating the data.
2022-06-17 09:44:46 +02:00
Campbell Barton
9830603620 GHOST/Wayland: skip cursor surface operations when hiding the cursor
Also set the buffer scale before setting the cursor (matching SDL).
2022-06-17 17:35:44 +10:00
Campbell Barton
f59418fd92 Cleanup: use booleans for GHOST C-API
Also use GHOST_ prefix for public functions.
2022-06-17 17:18:06 +10:00
Campbell Barton
5cda99ff52 Cleanup: clang-tidy for GHOST 2022-06-17 17:15:06 +10:00
Campbell Barton
c756d08b4a Cleanup: remove redundant string formatting 2022-06-17 17:14:00 +10:00
Campbell Barton
1152a437e0 Cleanup: remove r_ prefix for non-return values 2022-06-17 17:13:59 +10:00
Jeroen Bakker
0ff7a7b3b5 Fix T98663: Eevee compilation error cryptomatte shaders.
On MacOS Eevee cyptomatte shaders fails as it doesn't ignore the `attrib_load`
parameter. I validated that removind the parameter works on Linux/AMD and MacOS
Intel. It could be that there are other platforms that require the dummy parameter.

If this should use a forward declaration and implement an emoty function in the
cryptomatte vertex shader.
2022-06-17 08:25:21 +02:00
Campbell Barton
62346abc02 Cleanup: spelling in comments 2022-06-17 07:33:06 +10:00
Campbell Barton
483bc6c9c1 Cleanup: unused variable warning 2022-06-17 07:23:21 +10:00
Philipp Oeser
e2975cb701 Geometry Nodes: add 'Intersecting Edges' output for boolean node
This patch adds a 'Intersecting Edges' output with a boolean selection
that only gives you the new edges on intersections.

Will work on a couple of examples next, this should make some
interesting effects possible (including getting us closer to the "bevel-
after-boolean-usecase")

To achieve this, a Vector is passed to `direct_mesh_boolean` when the
iMesh is still available (and intersecting edges appended), then from
those edge indices a selection will be stored as attribute.

Differential Revision: https://developer.blender.org/D15151
2022-06-16 20:34:27 +02:00
Damien Picard
209bf7780e UI: Add file browser operator to edit directory field
This allows using a shortcut from the file browser to edit the directory
path. The shortcut Ctrl + L is quite standard and used in multiple
GNU/Linux desktop desktop environments, Windows, as well as most web
browsers. Safari on macOS uses Cmd + L.

Reviewed by: Jacques Lucke, Julian Eisel

Differential Revision: https://developer.blender.org/D15196
2022-06-16 19:46:37 +02:00
Julian Eisel
650d2f863d Cleanup: Use const in File Browser filtering operator 2022-06-16 19:46:37 +02:00
Bastien Montagne
b6b5f317a3 Revert "Revert "Revert "TEST COMMIT: API doc generation changes."""
This reverts commit 5a30fe29ef2e1f424df0403284b3ebba5644403f.
2022-06-16 19:35:55 +02:00
Julian Eisel
23d2e77a54 UI: Add initial "grid view"
Part of T98560.
See https://wiki.blender.org/wiki/Source/Interface/Views

Adds all the basic functionality needed for grid views. They display
items in a grid of rows and columns, typically with a preview image and
a label underneath. Think of the main region in the Asset Browser.

Current features:
- Active item
- Notifier listening (also added this to the tree view)
- Performance: Skip adding buttons that are not scrolled into view
  (solves performance problems for big asset libraries, for example).
- Custom item size
- Preview items (items that draw a preview with a label underneath)
- Margins between items scale so the entire region width is filled with
  column, rather than leaving a big empty block at the right if there's
  not enough space for another column (like the File and current Asset
Browser does it).
- "Data-View Item" theme colors. Not shown in the UI yet.

No user visible changes expected since the grid views aren't used for
anything yet.

This was developed as part of a rewrite of the Asset Browser UI
(`asset-browser-grid-view` branch), see T95653. There's no reason to
keep this part in a branch, continuing development in master makes
things easier.

Grid and tree views have a lot of very similar code, so I'm planning to
unify them to a degree. I kept things separate for the start to first
find out how much and what exactly makes sense to override.
2022-06-16 19:25:50 +02:00
Sergey Sharybin
69d3f41d75 Cleanup: Spelling in comment 2022-06-16 17:36:58 +02:00
Sergey Sharybin
6562a11c60 Cleanup: use proper variable name
The `SpaceClip *sc` got incorrectly renamed to `SpaceClip *screen`
in the ad85989a3f88.
2022-06-16 16:58:33 +02:00
Jacques Lucke
dc11e1164a Fix T98796: avoid unnecessary mesh copy
The call to `get_component_for_write` would sometimes copy the mesh
even when the mesh is replaced with itself. The `replace_mesh` method
handles that case already, so just use that instead.
2022-06-16 16:45:31 +02:00
Yiming Wu
947ece8d39 LineArt: Variable name cleanups.
Use more descriptive names for some of the two character variables.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D15192
2022-06-16 22:43:53 +08:00