Commit Graph

99634 Commits

Author SHA1 Message Date
Hans Goudey
30a20b4def Nodes: Remove deprecated useless width_hidden property
See 7b82d8f029
2023-05-18 13:37:55 -04:00
Hans Goudey
0eba8ac85a Fix #108034: Multires simple subdivide crash
Before 9f78530d80, the -1 coarse_edge_index values in the
foreach_edge calls would return false in BLI_BITMAP_TEST_BOOL,
which made them look like loose edges. BitSpan doesn't have this
problem, so the return for negative indices must be explicit.
2023-05-18 13:28:37 -04:00
Sergey Sharybin
406cfd214a Refactor ImBuf buffer access
The goal is to make it more explicit and centralized operation to
assign and steal buffer data, with proper ownership tracking.

The buffers and ownership flags are wrapped into their dedicated
structures now.

There should be no functional changes currently, it is a preparation
for allowing implicit sharing of the ImBuf buffers. Additionally, in
the future it is possible to more buffer-specific information (such
as color space) next to the buffer data itself. It is also possible
to clean up the allocation flags (IB_rect, ...) to give them more
clear naming and not have stored in the ImBuf->flags as they are only
needed for allocation.

The most dangerous part of this change is the change of byte buffer
data from `int*` to `uint8_t*`. In a lot of cases the byte buffer was
cast to `uchar*`, so those casts are now gone. But some code is
operating on `int*` so now there are casts in there. In practice this
should be fine, since we only support 64bit platforms, so allocations
are aligned. The real things to watch out for here is the fact that
allocation and offsetting from the byte buffer now need an explicit 4
channel multiplier.

Once everything is C++ it will be possible to simplify public
functions even further.

Pull Request: https://projects.blender.org/blender/blender/pulls/107609
2023-05-18 10:19:01 +02:00
Campbell Barton
07058765b9 Merge branch 'blender-v3.6-release' 2023-05-18 13:32:23 +10:00
Campbell Barton
6dcebc68d6 Fix "~" expanding to the default document directory instead of HOME
Originally this function expanded to the home however on WIN32
functionality changed to return the default Documents directory & the
function was renamed. Always expand "~" to the users home directory
since that's what it represents when used at the beginning of a path.
2023-05-18 13:30:40 +10:00
Hans Goudey
180c72a708 Cleanup: Add version after linking function for 4.0 series 2023-05-17 17:02:07 -04:00
Hans Goudey
468295cb7c Cleanup: Add a function to sample mesh point normals
This simplifies #108014 and is consistent with the existing function
for face corners, `sample_corner_normals`.
2023-05-17 16:54:22 -04:00
Hans Goudey
f106579a9a Cleanup: Add function to check if named custom data layer exists 2023-05-17 16:16:54 -04:00
Hans Goudey
9bdfb15e98 Cleanup: Remove redundant writing of old face set type
Face sets are now always saved with the generic float type
2023-05-17 14:34:52 -04:00
Hans Goudey
d41021a7d4 Mesh: Remove deprecated face/vert custom data API
Remove six collection properties from Mesh that are redundant
with the attribute API which has a nicer API and more features.
- `vertex_layers_float`
- `vertex_layers_int`
- `vertex_layers_string`
- `polygon_layers_float`
- `polygon_layers_int`
- `polygon_layers_string`
2023-05-17 14:10:00 -04:00
Hans Goudey
6805657a39 Mesh: Remove sculpt vertex colors from RNA API
Added in f7bbc7cdbb, these were never exposed in an
official release, and were eventually replaced by the attribute system.

Ref #100153
2023-05-17 13:41:16 -04:00
Hans Goudey
1b63a290c6 Core: Write mesh and movieclip with new format
Finish the transition from #95966 and fe38715600 by
writing files with the new format for meshes and some movie clip fields.
This removes overhead when saving files, and makes meshes saved in
files smaller (a file with a 1 million face grid changed from 32 to 28 MB).

3.6 can still read files saved with this format, but older versions will
crash. Older files are automatically converted by versioning code when
opened.

This also allows removing all the code that converts from the new
format to the legacy format, previously used when saving files.

Pull Request: https://projects.blender.org/blender/blender/pulls/108015
2023-05-17 19:03:16 +02:00
Julian Eisel
39a5025032 UI: Use fixed width for grid view items, don't stretch to full width
No user visible changes expected (since grid-views are only used in
branches right now).

This just makes grid view UIs feel more "stable" while scaling areas,
since things don't move around as much anymore. The tradeoff is that
there may be some empty space on the right, if there's not enough space
for a full column. This is how the file browser already behaves, and can
be mitigated by a smaller preview size.
2023-05-17 18:20:34 +02:00
Julian Eisel
c89354da80 UI: Properly center text under previews
The text under previews would be quite close to the preview, so that
there was more space below it than above. Center it vertically in the
available space now. Also, the horizontal padding was only applied to
the right side of the text rectangle, meaning horizontally centered text
would be too far left. Apply the padding equally, this doesn't affect
available space for the text too much.

See #108018 for before/after pictures.

Pull Request: https://projects.blender.org/blender/blender/pulls/108018
2023-05-17 18:10:54 +02:00
Hans Goudey
479aa64326 Merge branch 'blender-v3.6-release' 2023-05-17 12:00:39 -04:00
Hans Goudey
112a5196f6 Fix: Missing loose vertices converting BMesh to Mesh
Mistake in 6323d56eb5
2023-05-17 11:58:49 -04:00
Julian Eisel
76112f1439 Fix double highlighting of preview tiles in asset view template
The highlighting of preview tiles would be too strong in asset view
templates and grid views (only used in branches so far). This is because
two buttons are overlayed on top of each other, and both would
highlight. Ensure the overlayed preview tile button doesn't use any
highlighting.
2023-05-17 17:54:35 +02:00
Julian Eisel
d4217c278e Fix excessive vertical margin between items in asset view template
The UI list and asset view preview size calculations were out of sync,
so the UI list made more space than the preview actually used. Making
them match made the previews quite large though, so compensate that by
scaling the layout down.
Remove the related TODO comment, since this uses a common function for
getting the preview size now.

Before/after:
![Screenshot from 2023-05-17 17-33-19.png](/attachments/0ac713a3-12d9-41b6-ab50-85790da765a9) ![Screenshot from 2023-05-17 17-42-15.png](/attachments/0def65b5-6b16-4431-9a9e-592ed3d9675f)

Pull Request: https://projects.blender.org/blender/blender/pulls/108017
2023-05-17 17:49:16 +02:00
Miguel Pozo
430b2716c8 Workbench Next: Volumes: Don't draw on top of "in front" objects 2023-05-17 17:34:16 +02:00
Bastien Montagne
a9193a9ad2 Refactor ID liblinking on readfile to take ID pointer.
The usage of the lib pointer was cryptic to say the least, it was
essentialy used to allow or not local IDs results in the mapping
old_id_pointer -> new_id_pointer lookup result.

Now:
- Explicitely pass a boolean to allow or not local ID as result in
  lower-level code.
- Pass the 'self ID' pointer instead of its library to the whole
  liblinking code (that was already the case in a few places).

Note that naming of the 'self id' pointer is currently very inconsistent
throughout the readfile liblink code, this will have to be cleaned up in
a separate step later. For now, `self_id` has been chosen for new code
as it matches the terminology in lib_query code.

The later change can also allow finer handling of lookup on undo, based
on how it was re-read (or not), should the need for this arise.
2023-05-17 16:38:56 +02:00
Julian Eisel
ac6af0be7b Cleanup: Add enum type for drag data type definitions
Adds type safety and enables compiler features like warnings on missing
enumerator in switches.
2023-05-17 16:10:51 +02:00
Sonny Campbell
5531d610f9 Fix warning in USD curves exporter
Use timecode.GetValue() to fix warning about passing correct 'double' type to 'WM_reportf'

Co-authored-by: DESKTOP-ON14TH5\Sonny Campbell <sonny.campbell@unity3d.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/108008
2023-05-17 14:43:59 +02:00
Sonny Campbell
df48490db2 Fix warning in USD curves exporter
Use timecode.GetValue() to fix warning about passing correct 'double' type to 'WM_reportf'

Co-authored-by: DESKTOP-ON14TH5\Sonny Campbell <sonny.campbell@unity3d.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/108008
2023-05-17 13:39:26 +02:00
Thomas Dinges
feaeb7e6ad Revert "Release cycle: 3.6 enters beta, Bcon3."
This reverts commit 2dd0a08aff.
2023-05-17 13:05:32 +02:00
Thomas Dinges
04166c0af6 Merge branch 'blender-v3.6-release' 2023-05-17 13:05:15 +02:00
Thomas Dinges
2dd0a08aff Release cycle: 3.6 enters beta, Bcon3.
Splash screen: Pet Projects, Blender Studio.
2023-05-17 13:02:49 +02:00
Thomas Dinges
7be3a0a727 Release cycle: Bcon1 for Blender 4.0, alpha. 2023-05-17 12:39:01 +02:00
Clément Foucault
2d66a0ef84 EEVEE: Add Transparent Render-Pass option
This renderpass pass outputs alpha blender surface
to allow combining them with the opaque passes.

Limitation: This only supports monochromatic opacity.
Colored opacity will show differently than in combined pass.

Pull Request: https://projects.blender.org/blender/blender/pulls/107890
2023-05-17 11:57:36 +02:00
Clément Foucault
39644e7f71 Workbench: Fix compiler warnings 2023-05-17 11:52:49 +02:00
Philipp Oeser
eac3d37ab1 Fix #107422: Mesh context menus do not open with the last used option
Caused by 99e5024e97

Above commit changed behavior in that it only flagged the `uiBlock` with
`UI_BLOCK_POPUP_MEMORY` in case a Menu's title was provided to
`ui_popup_menu_create_block`. Now when is the title provided? This
depends on the `bl_label` set in the menu class. But this is not always
the case, there are some menus that have a blank `bl_label` (as seen
with `VIEW3D_MT_edit_mesh_context_menu` for example -- this specifies its
own label inside the draw function depending on vertex/edge/face mode).
Thus the provided title is not really reliable as source information to
do the flagging (also see for example
a38b98478a), flagging should **always** be
done [and only check a title for actually inserting in the puphash].

Choosing an entry in a menu will still handle puphash later (see
`button_activate_exit`) though multiple menus without a label might fight for the
same storage of the menu memory. Using idname instead (or in combination with
the label) for the hash could be looked at to solve this.

Pull Request: https://projects.blender.org/blender/blender/pulls/107427
2023-05-17 10:41:17 +02:00
Campbell Barton
a5207ae24d Fix error returning the path length from BLI_path_normalize
Error in [0] caused the returned length to be wrong when skipping the
prefix. Also fix normalized path comparison failing on windows.

[0]: f45a985217
2023-05-17 17:47:35 +10:00
Campbell Barton
e27cb91442 BLI_path: add native path canonicalize function
This function handles cleaning valid system paths that are functional
when passed to `open(..)` but may be relative to the current working
directory or have redundant slashers that can be normalized.
2023-05-17 13:42:51 +10:00
Campbell Barton
0099f51cdd Cleanup: sort file, uppercase booleans, add missing headers
Also update files to ignore for check_cmake.
2023-05-17 13:13:10 +10:00
Campbell Barton
139f4981d4 Cleanup: return early, reduce indentation 2023-05-17 13:13:10 +10:00
Campbell Barton
1d32a36540 Cleanup: add utility functions for checking WIN32 drive letters
Avoid character checks in-line.
2023-05-17 13:13:10 +10:00
Campbell Barton
52eb1f2ba0 Cleanup: use BLI_rename where overwriting isn't needed
Use BLI_rename as the destination is removed before renaming.
2023-05-17 13:13:10 +10:00
Campbell Barton
f45a985217 Cleanup: use BLI_path_slash_ensure instead of performing this in-line
- Add BLI_path_slash_ensure_ex which takes the string length.
- Normalize functions now return the string length,
  so ensuring trailing a trailing slash is a simple check.

This would have avoided the off-by-one error from
761eac2f5d.
2023-05-17 13:12:49 +10:00
Campbell Barton
761eac2f5d Fix buffer overflow in BLI_path_append 2023-05-17 13:11:17 +10:00
Campbell Barton
0ae286be03 Fix trailing slashes causing normalized path comparison to fail 2023-05-17 13:11:17 +10:00
Colin Basnett
f1d436a3aa Core: Improve error message for make relative/make absolute operators
This improves the warning messages when make relative/absolute fails to add more context and help in tracking down problems.

Pull Request: https://projects.blender.org/blender/blender/pulls/107914
2023-05-17 05:02:39 +02:00
Chris Blackbourn
c8b5b17d40 Cleanup: format 2023-05-17 11:35:46 +12:00
Richard Antalik
354ef89d20 Fix lite build error
Missing dummy function definition in 4dc026ec8e.
2023-05-17 01:03:47 +02:00
Richard Antalik
4dc026ec8e VSE: Smooth transition for retiming tool
This feature implements smooth transition between 2 retimed segments.

A transition can be added by dragging retiming handle while holding
shift key. When any handle defining transition is removed, the
transition segment is removed and 2 linear segments are restored to
state before transition was created.

These transitions work with video and sound and changes are reflected
in waveforms with correct seeking, therefore it replaces usage of
`speed_factor` or earlier sound `pitch` property.

Smooth transition is achieved by evaluating Y value of circular arc,
that is tangent to lines of linear retimed segments. Because of this,
when transition length is changed both handles are moved symetrically.
This way it is possible to make transition without affecting content in
linear segments.
When linear segment after transition is further retimed, this shifts
content inside of a transition segment.

To support sound, `SEQ_retiming_sound_animation_data_set` and related
data structures has been updated to build speed table for each smooth
transition segment. Layering of retiming data via meta strips is still
fully supported.

Pull Request: https://projects.blender.org/blender/blender/pulls/107197
2023-05-16 22:33:13 +02:00
Harley Acheson
35be844c34 Fix #106621: Crash Adding GN Menus to Quick Favorites
Check for empty AssetItemTree when accessing Quick Favorite menu items.

Pull Request: https://projects.blender.org/blender/blender/pulls/107984
2023-05-16 20:50:46 +02:00
Erik Abrahamsson
75c2d511ad Fix: Add 'typename' to fix build error
A `typename` was missing in 3195c1a669 which caused build errors
on all platforms except Windows.
2023-05-16 20:05:17 +02:00
Sonny Campbell
1164976dd8 USD Export: New Curves/Hair Support
Previous patch location: https://archive.blender.org/developer/D16545

This patch addresses https://projects.blender.org/blender/blender/issues/102376

A new writer is added, the usd_writer_curves.cc to handle transforming the new curves system into USD.

The goal was to enable export of the new curves type, but @HooglyBoogly mentioned there is a `curve_legacy_to_curves` utility function that could also handle converting legacy curves to the new Curves type. This very trivially enables the legacy curves for export too so I have included that change in this patch.

Co-authored-by: DESKTOP-ON14TH5\Sonny Campbell <sonny.campbell@unity3d.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/105375
2023-05-16 20:04:18 +02:00
Harley Acheson
6ae44c4770 UI: Allow Configuration of Some Operator Confirmations
Allow users to disable/enable 14 operator confirmations in the Keymap
Editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/107765
2023-05-16 20:03:45 +02:00
Harley Acheson
fc70eb1fb5 Fix #106655: Update Mesh Symmetry Buttons
Update the XYZ Symmetry buttons if they are toggled without mouse
click, for example from a script or keyboard shortcut.

Pull Request: https://projects.blender.org/blender/blender/pulls/106679
2023-05-16 19:24:44 +02:00
Erik Abrahamsson
3195c1a669 Geometry Nodes: Add Sample Volume node
This commit adds a new experimental node "Sample Volume".
It's purpose is to be able to sample values from a volume grid given
a position field.
The 'Grid' input accepts a named attribute input with the name
of the volume grid to sample. Values will be implicitly converted
from the grid type to the specified value type.

Pull Request: #107656
2023-05-16 19:08:08 +02:00
Bastien Montagne
cc498697ab Cleanup: Core: lib_query: Make names of self and owner ID data consistent.
Internal private struct was using `owner_id`/`self_id`, while the public
callback data struct was using `id_owner`/`id_self`.

Now using internal naming everywhere in lib_query related code, as
`owner_id` is already used in very low-level 'fundamental' part of the
code, e.g. in the `PointerRNA` struct, or in ID's 'loopback' pointers
for embedded data.

Note that this is only a very small first step toward proper naming
consistency for these type of data, the mismatch is currently spread all
over the code base.

We also need to document more formally the meaning and differences
between `self` and `owner` here.
2023-05-16 18:37:35 +02:00