Commit Graph

99649 Commits

Author SHA1 Message Date
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
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
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