Commit Graph

115760 Commits

Author SHA1 Message Date
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
Dalai Felinto
8b9469ec36 Cleanup: Fix build for make lite and add . to code comments
Issue introduced on e6eefdd4020e.
2022-06-16 16:37:54 +02:00
Bastien Montagne
5a30fe29ef Revert "Revert "TEST COMMIT: API doc generation changes.""
This reverts commit 502089f275ded113732c24cad2a96e2a899ecd5c.

Enable again temporarily the new test code for API doc generation.
2022-06-16 16:36:42 +02:00
Antonio Vazquez
e0c966a3b9 Fix T98904: GPencil sculpt brushes break after you delete a brush
There were two problems here:

1) Console warnings due to brush was None.
2) It was impossible to recreate a brush.

This patch fixes both issues and it is now possible to recreate any brush.

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

Reviewed by: @dflelinto
2022-06-16 16:29:11 +02:00
Jacques Lucke
49b068bc63 Fix T98847: missing null check in versioning code
It's perfectly legal for `nmd->settings.properties` to be null if
there are no properties.
2022-06-16 16:23:45 +02:00
Hamdi Ozbayburtlu
e6eefdd402 Fix T86076: MPEG Settings Ignored at Render
Add a RNA update function for output video codec setting to update
properties that are incompatible with defaults.

Previously video output bitrate settings were omitted because of the
Constant Rate Factor (CRF) default. CRF setting for video codec is only
available for H264, MPEG4 and WEBM/VP9 outputs, so for the others
changing encoder quality mode to constant bitrate (CBR) as CRF is not
supported.

Reviewed By: ISS, mano-wii

Differential Revision: https://developer.blender.org/D15201
2022-06-16 16:03:37 +02:00
Bastien Montagne
dce03ecd5c LibOverride: 3DView: simplification and improvements of override creation.
This commit:
* Removes the popup to choose the root collection when called with a
  linked object selected (in typical cases there is only one valid
  option, if more then the operator fails and report to the user).
* Ensures that the linked reference of newly overridden collections are
  also removed from the ViewLayer (i.e. their local parent collections).
2022-06-16 15:58:40 +02:00
Dalai Felinto
798b49109b ID Type: Sort the items alphabetically
This also renames Hair Curves to Curves. Meaning that until we get
rid of the old curve type we will have both of those entires there:

* Curve
* Curves

This rna enum is used among other things in the driver UI to pick
which data-block you want the property from.
2022-06-16 15:25:09 +02:00
Campbell Barton
9bed68de13 Fix T98860: VectorProperty type renamed to COORDS (breaking scripts)
Regression in [0] unintentionally renamed COORDINATES.
There was a naming discrepancy when two (nearly) identical arrays,
de-duplicating them caused the error.

[0]: 94444aaadf238ab2de4226d6b1b66284d479a931
2022-06-16 18:10:02 +10:00
Bastien Montagne
36307d8fba Fix (studio-reported) broken 'system override' filtering in liboverride view of the Outliner.
Regression from recent rB717ab5aeaecc.
2022-06-16 09:56:15 +02:00
Campbell Barton
1064bf58c3 Cleanup: differentiate region/screen relative coordinates
- Avoid ambiguity which caused these values to be confused, use `mval`
  for region relative mouse coordinates, otherwise `event_xy`.

- Pass region relative coordinates to sample_detail_dyntopo &
  sample_detail_voxel as there is no reason to use screen-space values.

- Rename invalid use of mval for screen-space coordinates.
2022-06-16 16:32:35 +10:00
Campbell Barton
b19751bee2 Fix mouse coords for sculpt ignore background click, sample voxel detail
Both operations used screen-relative coordinates when region-relative
coordinates were expected.
2022-06-16 15:57:28 +10:00
Campbell Barton
65b1b1cd34 GHOST/Wayland: workaround inability to access window position
Wayland doesn't support accessing the position making functionality that
would map events to other windows fail, sometimes considering windows
overlapping when they weren't (as all window positions were zeroed).

Disable dragging between windows when accessing the window the position
isn't supported.
2022-06-16 15:22:46 +10:00
Campbell Barton
a17f74ab34 Fix memory leak plugging in new keyboards in wayland 2022-06-16 14:55:37 +10:00
Campbell Barton
0d644e6d06 Cleanup: return const vector for system & window outputs() method
Move the enter/leave logic into methods so the method can return a const
vector which isn't to be manipulated from other functions.
2022-06-16 14:27:57 +10:00
Campbell Barton
9dd5c2a7ec Fix error selecting the window scale in wayland
Regression in [0] caused all output to be considered when updating
after monitor outputs changed.

[0]: ac2a56d7f3d6d20a0ed24ece11eea33e23d42f2c
2022-06-16 14:18:45 +10:00
Campbell Barton
1fed24de5a GHOST/Wayland: acquire locks before freeing data on exit 2022-06-16 12:29:22 +10:00
Campbell Barton
409c62aa61 Fix missing free for drag & drop data with GHOST/Wayland 2022-06-16 12:29:20 +10:00
Campbell Barton
02012b0cce GHOST/Wayland: account for fractional scale when picking the output
Finding the output with the largest scale now checks fractional scaling.

While this is only a minor difference in most cases, it makes the scale
deterministic instead of depending on the order outputs are added.
2022-06-16 12:29:18 +10:00
Campbell Barton
fa99323f09 Cleanup: quiet compiler warnings 2022-06-16 12:29:10 +10:00
Chris Blackbourn
e6e9f1ac5a Fix T98239: During UV Unwrap, create unique indices for each pinned UV
Originally reported in T75007.

Differential Revision: https://developer.blender.org/D15199
2022-06-16 09:53:50 +12:00
Iyad Ahmed
2804497312 io: remove unnecessary transposes when using mat3_from_axis_conversion
Some I/O code paths (Collada, OBJ) were using mat3_from_axis_conversion
followed by transpose_m3, instead of swapping the axis arguments
which achieves exactly the same result.

Reviewed By: Aras Pranckevicius
Differential Revision: https://developer.blender.org/D15158
2022-06-15 21:46:38 +03:00
Julian Eisel
43ddfdb1a5 Fix T98909: Outliner - "Show Hierarchy" only shows one level
Error in a4a7af47326.

To allow deleting tree elements while iterating, the new iterators would
get needed data out of the tree element before calling the iterator
callback. This included the info if the element is open or collapsed. So
if the callback would open or collapse elements, the iterator wouldn't
respect that change. Luckily the way the open/collapsed state is stored,
we can still query it after the callback is executed, without having to
access the (possibly freed) tree element.
2022-06-15 20:14:29 +02:00
Aras Pranckevicius
653100cd65 obj: reduce vertex colors to 4 decimal places, reenable tests
OBJ vertex color related tests were not producing identical results
across various platforms, primarily due to sRGB<->Linear color space
conversions.

While D15193 has just made the color space conversion accuracy match
much closer between platforms, it's still not 100% the same.

This change reduces the amount of decimal places used for exporting
vertex colors, to 4 digits (down from 6). Vertex normals were
already always printed with 4 digits, and colors are conceptually
similar (usually 0..1 range etc.).

This makes the vertex color tests pass again, so re-enable them
after adjusting to 4 decimals expectations.
2022-06-15 21:05:35 +03:00
Aras Pranckevicius
004d858138 math: improve accuracy of Linear->sRGB conversion SIMD path
srgb_to_linearrgb_v3_v3 is using an approximation of powf that is
SIMD. However, while the accuracy of it is ok, a larger issue is that
it produces different results on Intel compared to ARM architectures.

On ARM (e.g. AppleSilicon), the result of the SIMD code path is much
closer to the reference implementation. This seems to be because of
_mm_rsqrt_ps usage in _bli_math_fastpow512. The ARM/NEON code path
emulates inverse square root with a combination of vrsqrteq_f32
followed by two Newton-Raphson iterations, because blender uses the
SSE2NEON_PRECISE_SQRT define.

This commit adds similar NR iterations to the "actual SSE" code path
as well.

Max error of srgb->linear->srgb conversion roundtrip goes from
0.000211 down to about 0.000062.

Reviewed By: Sergey Sharybin
Differential Revision: https://developer.blender.org/D15193
2022-06-15 20:51:25 +03:00
Dalai Felinto
7e89bbb2ff UI: Implement icons for the curve sculpt tools brushes
I'm using the tool icons for the brush themselves.

Note: This includes a few brushes that are only defined in D15134.
Those are simply the icons rendered with a world background of #282828.
2022-06-15 18:59:33 +02:00
Dalai Felinto
0a3650210f UI: Fix sculpt curve not being able to get brush icons
This commit doesn't add the brush icons themselves, but
it fix the code that allow them to be used.
2022-06-15 18:31:13 +02:00
Sergey Sharybin
d3edb3cfc7 Fix missing translation hint in tracking code
Is likely harmless due to Camera being covered by other areas,
but is still good to do a proper hint.
2022-06-15 17:15:05 +02:00
Bastien Montagne
502089f275 Revert "TEST COMMIT: API doc generation changes."
This reverts commit 298372fa06cbe0887534b95c9b23b491e46419d4.
2022-06-15 17:11:00 +02:00
Bastien Montagne
298372fa06 TEST COMMIT: API doc generation changes.
This commit is intended to be reverted within a few minutes.

commit 39ffb045a52d16994c1c87ccf3249ff3222a8fca
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 fbe354d3fcfa2ad1ed430c3c27e19b99a0266dda
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-15 16:48:30 +02:00
Falk David
f0fa90e156 GPencil: Fix crash when using time offset modifier
This fixes a mistake in 60bf561d379a, which did not account for offset
frames by the time offset modifier.
2022-06-15 16:15:45 +02:00
Ray Molenkamp
fe988f6c7f depsbuilder: build_deps.cmd look for pythonw rather than python
There is a check to be sure no system python is in the path
on windows to be sure deps do not accidentally build against it.

The problem arises on certain versions of windows that ship a
python.exe that just opens up the MS store to download their
python version. The check takes this to be a real python
installation and refuses to build.

This change fixes the issue by looking for pythonw.exe which a
real python install would have, but the MS store opening one that
windows ships (as of now) would not.
2022-06-15 07:47:28 -06:00
filedescriptor
60bf561d37 Fix T98853: Blender crashes when moving grease pencil object has any invisible layers
Whats happening is that the modifier keeps adding new frames to the evaluated object resulting in an exponential increase. This is because when preparing the data for the modifiers we only copy visible strokes to the eval object. But the modifiers do not consider visibility and will generate the mirrored strokes even for layers that are hidden. Because those layers have not been copied (only their structure) we run into this issue.

The solution is always copy the active frame of all layers (even if the layer is hidden).
2022-06-15 15:37:39 +02:00
Kevin Curry
2e33172719 Assets: Don't show duplicated catalog name when dragging assets
While dragging assets over a catalog, we would show both the name and
the full catalog path in the drag tooltip. For catalogs at the root
level (catalogs without parents) the name and the full path are the
same, so it would just display the name twice. This is more confusing
than helpful. Now skip displaying the full path in that case.

Reviewed by: Julian Eisel
Addresses T92855

Differential Revision: https://developer.blender.org/D15190
2022-06-15 15:27:20 +02:00
Dalai Felinto
15b4120064 Make Instance Face: Support instanced collections too
Differential Revision: https://developer.blender.org/D15204
2022-06-15 13:53:37 +02:00
Antonio Vazquez
41053deba4 GPencil: Avoid console warnings when no Sculpt brush selected
If the brush is deleted, the panel must not be filled.

To recreate the missing Brush is necessary to use `Reset All`

This fix part of T98904
2022-06-15 13:30:14 +02:00
Sergey Sharybin
2e6cd70473 Clip editor: Default to average error sort in dopesheet
This is what we agreed on during the workshop.

Differential Revision: https://developer.blender.org/D15194
2022-06-15 12:37:35 +02:00
Sergey Sharybin
216a2c0f37 Clip editor: Use Ascending/Descending order instead of "Inverse"
This is more intuitive for artists.
2022-06-15 12:37:31 +02:00
Sergey Sharybin
c1a231f40b Clip editor: Sort tracks alphabetically when they have matched error
Is nice to ensure order of tracks when their error is the same or
is not known yet (the clip was not solved yet).
2022-06-15 12:37:31 +02:00
Dalai Felinto
412c468893 UI: Icons - Rename Density and Slide sculpt curve icons
Those tools will get renamed to follow the standard we have
for the other tools (i.e., add sculpt_ in their name).
2022-06-15 11:46:08 +02:00
Campbell Barton
7cc8f2743e Cleanup: remove redundant key entry from key_repeat_payload_t 2022-06-15 19:33:41 +10:00
Campbell Barton
e550e400cd Cleanup: internalize struct members for internal wayland types
Missed from 9978689595f87a6b4d8244ee3d014c8fb239e38d.
2022-06-15 19:33:41 +10:00
Sergey Sharybin
ea39d808b5 Fix T98765: Regression: Unable to select mask points in clip editor
Re-organize de-selection so that there is less conflict between tracking
and masking operators.

Still not fully ideal: the LMB selection does not de-select everything
now since the `mask.select` with `deselect_all` is only added to the
keymap when the RMB is the select mouse. While this is sub-optimal, this
seems to be how mask selection behaved in the Image Editor in 3.1.

Not sure it worth looking into a more complete fix, as it will likely be
too big to be safe for a corrective release.

Differential Revision: https://developer.blender.org/D15183
2022-06-15 10:24:04 +02:00