Commit Graph

99660 Commits

Author SHA1 Message Date
Hans Goudey
f17ea1f2a7 Geometry Nodes: Remove realize instances legacy behavior
The option was added f5ce243a56 when the node was
rewritten to add support for propagating instance attributes.
2023-05-19 14:02:53 -04:00
Hans Goudey
ea64b2ce08 Cleanup: Remove deprecated unused fields in raycast node 2023-05-19 14:02:53 -04:00
Clément Foucault
c435d2f856 Metal: Always add GPU_TEXTURE_USAGE_ATTACHMENT flag
Texture clearing is done using framebuffer clear.
To avoid adding the flag everywhere we add it as part
of the texture creation process.

This should have no performance impact.
2023-05-19 18:48:07 +02:00
Clément Foucault
b40b59935d Metal: Force Compute shaders workgroup max thread count
This forces the max thread count to be inlined with what
blender expects. While this will make some shaders less
eficient it avoid crashes / assert on shaders that
could not compile. The performance impacts can be fixed
by tackling the individual cases.
2023-05-19 18:08:49 +02:00
Germano Cavalcante
e0e182d5e9 Cleanup: deduplicate code to obtain the object for the transform space 2023-05-19 11:09:50 -03:00
Philipp Oeser
b060beae17 Merge branch 'blender-v3.6-release' 2023-05-19 15:53:44 +02:00
Philipp Oeser
370b7ae917 Fix #107889: Scale Cage gizmo wrong in editmode with rotated objects
Object transforms were already respected, issue was just pre vs. post
matrix multiplication when local axis were used.

Should go into LTS as well I guess.

Pull Request: https://projects.blender.org/blender/blender/pulls/108076
2023-05-19 15:51:28 +02:00
Hans Goudey
2a56403cb0 Mesh: Move bevel weight to generic attribute
Store bevel weights in two new named float attributes:
- `bevel_weight_vert`
- `bevel_weight_edge`

These attributes are naming conventions. Blender doesn't enforce
their data type or domain at all, but some editing features and
modifiers use the hard-coded name. Eventually those tools should
become more generic, but this is a simple change to allow more
flexibility in the meantime.

The largest user-visible changes are that the attributes populate the
attribute list, and are propagated by geometry nodes. The method of
removing this data is now the attribute list as well.

This is a breaking change. Forward compatibility is not preserved, and
the vertex and edge `bevel_weight` properties are removed. Python API
users are expected to use the attribute API to get and set the values.

Fixes #106949

Pull Request: https://projects.blender.org/blender/blender/pulls/108023
2023-05-19 14:31:31 +02:00
Campbell Barton
e620ae054f Merge branch 'blender-v3.6-release' 2023-05-19 19:26:01 +10:00
Campbell Barton
8a4ab1b3fe Fix assertion in BLI_path_normalize & add test 2023-05-19 19:25:08 +10:00
Sergey Sharybin
9e5e06136a Fix motion tracking not tracking at all
A mistake in the recent ImBuf API refactor: the Libmv image accessor
was copying destination to destination (possibly using the wrong
number of channels as well).

Pull Request: https://projects.blender.org/blender/blender/pulls/108070
2023-05-19 10:48:49 +02:00
Jason Fielder
c267256f01 Fix #105830: Add depth bias for overlay faces in Metal
Resolves z-fighting blocking artifacts on faces due to limited
depth precision at certain camera positions. Depth bias
offsets the calculation enough without affecting display.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/108048
2023-05-19 09:23:17 +02:00
Campbell Barton
712d177aa3 Cleanup: avoid strcpy for initializing ID names
While strcpy is safe in this case, it's use requires extra scrutiny
and can cause problems if the strings are later translated.

Also move the ID code assignment into material_init_data
as the ID-code is more of an internal detail.
2023-05-19 15:01:03 +10:00
Campbell Barton
ec8a4cfcb7 Merge branch 'blender-v3.6-release' 2023-05-19 14:34:42 +10:00
Campbell Barton
2c6e88da96 Fix memory leak in copy_to_selected_button
Memory leak introduced in [0] early return cleanup.

[0]: a25a1f39aa
2023-05-19 14:29:46 +10:00
Hans Goudey
71d22331b1 Cleanup: Rename mesh loose edges tag function
To match the more recently added `tag_loose_verts_none`.
2023-05-18 23:06:15 -04:00
Hans Goudey
381fae91b1 Geometry Nodes: Keep loose vert/edge tags for extrude and split edges
If there are no loose vertices or edges, it's basically free to
propagate that information to the result and save calculating
it later in case it's necessary. I observed a peformance increase
from 3.6 to 4.1 FPS when extruding a 1 million face grid.
2023-05-18 23:06:15 -04:00
Campbell Barton
c7a508be50 Cleanup: pass boolean to text_drawcache_tag_update
Also remove redundant CTX_wm_space_text(C) calls.
2023-05-19 13:02:15 +10:00
Campbell Barton
6fbad2ce7e Merge branch 'blender-v3.6-release' 2023-05-19 12:53:53 +10:00
Campbell Barton
bb543620ae Fix invalid UTF8 strings being copied into the Python console
Add a ensure_utf8 argument to WM_clipboard_text_get so callers don't
have to handle validation themselves.

Copying non-utf8 text into the Python console and buttons was possible,
causing invalid cursor position and a UnicodeDecodeError accessing
ConsoleLine.body from Python.
2023-05-19 12:49:27 +10:00
Campbell Barton
8ad2ee7f12 Cleanup: function style C++ casts, use printing & ELEM macros 2023-05-19 11:35:59 +10:00
Campbell Barton
2aa01c3807 Cleanup: quiet discard const warning 2023-05-19 11:34:45 +10:00
Harley Acheson
dad9e8e621 Fix #102574: Don't Show "Rename" for Volume and & System lists
For File Browser "System" and "Volumes" lists, the item names cannot be
changed by users yet the tooltip says "Double click to rename". This PR
just removes that text for these non-editable lists.

Pull Request: https://projects.blender.org/blender/blender/pulls/106873
2023-05-19 01:17:28 +02:00
Harley Acheson
b34ece48f8 Fix #106484: Show all rotations with same precision
Increase precision of some rotational inputs so that they all show the
same precision.  And have the arrows change in full degrees.

Pull Request: https://projects.blender.org/blender/blender/pulls/106515
2023-05-19 00:25:05 +02:00
Lukas Stockner
8cde7d8f8a Cycles: Merge Anisotropic BSDF node into Glossy BSDF node
Used to be https://archive.blender.org/developer/D17123.

Internally these are already using the same code path anyways, there's no point in maintaining two distinct nodes.

The obvious approach would be to add Anisotropy controls to the Glossy BSDF node and remove the Anisotropic BSDF node. However, that would break forward compability, since older Blender versions don't know how to handle the Anisotropy input on the Glossy BSDF node.

Therefore, this commit technically removes the Glossy BSDF node, uses versioning to replace them with an Anisotropic BSDF node, and renames that node to "Glossy BSDF".

That way, when you open a new file in an older version, all the nodes show up as Anisotropic BSDF nodes and render correctly.

This is a bit ugly internally since we need to preserve the old `idname` which now no longer matches the UI name, but that's not too bad.

Also removes the "Sharp" distribution option and replaces it with GGX, sets Roughness to zero and disconnects any input to the Roughness socket.

Pull Request: https://projects.blender.org/blender/blender/pulls/104445
2023-05-18 23:12:20 +02:00
Hans Goudey
fc06a471f1 Geometry Nodes: Only use realized geometry in mesh boolean node
Since 44e4f077a9 and related commits, geometry nodes doesn't
try to hide the difference between real geometry data and instances from
the user. Other nodes were updated to only support real geometry, but
the "Mesh Boolean" node was never updated and still implicitly gathered
all the instances. This commit removes the special instance behavior in the
boolean node and adds realize instances nodes to keep existing behavior
in most cases. Typically this doesn't make a difference in the result,
though it could in the union mode for instance inputs. Shifting more of
the work to realizing instances should generally be better for
performance, since it's much faster.
2023-05-18 15:08:53 -04:00
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