Commit Graph

102732 Commits

Author SHA1 Message Date
Brecht Van Lommel
d4cc0d02cb UV: disable best fit rotation of all islands at end of UV packing
This has a tendency to place islands diagonally in the image which is
not usually wanted, even if it's maximimizing the number of pixels for
the island.

Fix #109906: UV unwrap packs island diagonally instead of straight

Pull Request: https://projects.blender.org/blender/blender/pulls/112295
2023-09-14 18:57:26 +02:00
Weizhen Huang
f014e44e8b Refactor: EEVEE: add utility function for 3D texture read
with manual trilinear interpolation. Currently only used for GGX BSDF LUT

Pull Request: https://projects.blender.org/blender/blender/pulls/112386
2023-09-14 18:46:07 +02:00
Hans Goudey
05045c3e50 Fix: Duplicate node tool catalog in point cloud edit mode
This isn't available in releases yet, but point cloud edit mode is
partially working with node group operators anyway.
2023-09-14 11:45:07 -04:00
Hans Goudey
cc83951951 Geometry Nodes: Update node tool menus dynamically
See #101778

Remove the requirement of restarting Blender to refresh the
extended 3D view menus for node group changes. Also avoid
rebuilding the tree of relevant assets and catalogs on every
redraw, since parsing asset libraries, etc. could become more
expensive than we want. Those two goals combined mean we
have to be more rigorous in how we invalidate the cached
catalog tree.

The first main change required is to clear the tree as asset libraries
are being read, similar to other dynamic asset menus. This is done
with a 3D view header listener rather than a menu listener in this case.

However, that isn't enough, because there is an issue with the asset
system where the "all" library isn't updated when the current file library
changes. The solution is to explicitly rebuild the "all" library's catalogs
when other asset libraries are changed.

The other necessity for dynamic updates is clearing the catalog tree
to be rebuilt when the node group "asset traits" are changed. This is
done with a new notifier type (with the goal of being a bit selective
about when we re-read assets). This _also_ requires running the
"presave" callback that builds asset metadata when updating the
property. Otherwise saving the file and sending the notifier is
necessary, which is too confusing.

Pull Request: https://projects.blender.org/blender/blender/pulls/112166
2023-09-14 17:43:33 +02:00
Hans Goudey
d2d4de8c71 Geometry Nodes: Show uncategorized assets in separate menus
In the add modifier menu, 3D viewport menus for node tools, and the node
editor add menu, assets not in catalogs are added to an "No Catalog"
menu rather than not being accessible at all.

This makes the default behavior when adding a node tool "not broken"
so at least something happens by default. The question of "How do I
add a catalog?" is much better than "Why didn't anything happen?"

Implements #111529
See #101778

---

![image](/attachments/b943e2c4-f660-4812-b9ab-f7c116b68b98)
![image](/attachments/e6ee94d7-cd14-475f-8fa6-abcc6774fd7e)
![image](/attachments/b1718d0c-4182-49c5-867a-1399082e98f0)

Pull Request: https://projects.blender.org/blender/blender/pulls/112355
2023-09-14 17:35:24 +02:00
Lukas Tönne
4aa3735d0f Node drawing: Fix unused variables in release builds
Pull Request: https://projects.blender.org/blender/blender/pulls/112384
2023-09-14 16:33:08 +02:00
Weizhen Huang
d10a87da48 Fix: EEVEE: wrong reflectance at IOR == 0.0
should be 1 instead of 0
2023-09-14 16:13:14 +02:00
Lukas Tönne
9433a1701a Nodes: Support for input/output sockets in same vertical space
Declarations can use the `add_input_output` method to create a combined input/output socket. The drawing code supports moving sockets up one vertical slot to align them with the predecessor.

Closes #112235

Pull Request: https://projects.blender.org/blender/blender/pulls/112250
2023-09-14 16:08:04 +02:00
Weizhen Huang
5baf652374 Cleanup: EEVEE: rename glass BTDF to BSDF at several places
because it contains reflectance and transmittance, so BSDF would be a
morep proper name.
Also rename BSDF to BRDF at places where only reflectance is returned.
2023-09-14 16:06:26 +02:00
Weizhen Huang
4e00410d9e Fix: EEVEE: use inverse IOR in BSDF LUT refract()
the `refract()` function require the relative IOR of the media where V
is in to the media where L is in. Because this only affects the
visibility term, the difference is quite small
2023-09-14 16:06:26 +02:00
Julian Eisel
bb7a220e89 UI: Improve/correct vertical widget positioning in header-like regions
There was code to vertically offset layouts in header-like regions to
ensure widgets are centered properly. It wasn't clear why this was
necessary so far. I noticed this is region alignment dependent though:
The offset is only needed when the upper region edge matches the upper
area edge. I'm not entirely sure if it is the edge drawing or a slightly
smaller drawable surface of the region (clipped to be 1px less than the
area height), think it is the latter. But either way, this offsetting
makes a lot more sense now. Fix is to only apply the offset for regions
sharing the upper edge with the area. Edges at the window differ a bit,
so the offset is not applied there.

Fixes the slightly off vertical positioning of widgets in the asset
shelf header.
2023-09-14 15:47:53 +02:00
Christoph Lendenfeld
1bf789c4f4 Animation: Graph Editor locked key drawing
As people have pointed out, the changes to key drawing
in #106052 are not ideal under all conditions.

The fact that an X is drawn to indicate a key
can't be manipulated adds too much noise
on dense data and is generally confusing.

To combat that, the drawing style changed it back to dots,
but this time in gray ( the same color as disabled curves)
and slightly smaller.

This was discussed in the A&R module meeting on 2023-09-07

Pull Request: https://projects.blender.org/blender/blender/pulls/111986
2023-09-14 15:09:08 +02:00
Christoph Lendenfeld
8f1bd71992 Fix #112085: Not able to insert keys on subframes
When subframes were enabled, and the time cursor was at a subframe position,
the keying would still insert the key at the full frame.

This was because the value passed to the key insertion
functions was just the full frame value and not the subframe part.
Fixing it by using `BKE_scene_frame_get()` which
returns the floating point frame including the subframe part.

I've added unit tests to ensure that inserting keys at subframe values doesn't cause issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/112131
2023-09-14 15:07:08 +02:00
Sybren A. Stüvel
456d65b00a Show FCurve modifier toggle widget as 'inactive' when there are no modifiers
In the animation editors, show the FCurve Modifier toggle widget (the
wrench) as 'inactive' when the FCurve has no modifiers on it. Previously
the (lack of) existence of FCurve modifiers was not reflected in the
wrench icon at all.

Note: this only affects FCurves, and not FCurve *Groups*.

Pull Request: https://projects.blender.org/blender/blender/pulls/106214
2023-09-14 15:03:34 +02:00
Lukas Tönne
d2f4ebcd6a Fix #112331: Add update tags directly in bNodeTreeInterface API methods
Calling an API function after the node panels patch does not internally
tag the node tree with `NTREE_CHANGED_INTERFACE` any more, because the
node tree is not directly accessible from `bNodeTreeInterface`. Before
node panels the API functions for interfaces could tag the tree directly
for later update consideration, which now requires explicit tagging
calls.

The fix is to add a flag and mutex directly to `bNodeTreeInterface`, so
API methods can tag after updates. This mostly copies runtime data
concepts from `bNodeTree`. The `ensure_interface_cache` method is
equivalent to `ensure_topology_cache` and should be called before
accessing `interface_inputs` and similar cache data.

Pull Request: https://projects.blender.org/blender/blender/pulls/111741
2023-09-14 14:13:07 +02:00
Jacques Lucke
346b83ca01 Fix #112333: assert when creating node group with unavailable link 2023-09-14 12:41:43 +02:00
Christoph Lendenfeld
8a387d8ed6 Fix: Graph Editor first key handles not drawn
The first keyframe's handle wasn't drawn due to the recent optimizations.
This PR fixes the issue by moving `prevbezt` out of the loop again.
That is needed due to the checks in within the loop having special cases
for the first loop where `prevbezt` is a `nullptr`

Was caused by #112126

Pull Request: https://projects.blender.org/blender/blender/pulls/112365
2023-09-14 12:14:34 +02:00
Jacques Lucke
340b3ca9cb Fix #112094: negative delta time values in simulation nodes 2023-09-14 12:03:24 +02:00
Jacques Lucke
e09ee01848 Fix #112094: pass through simulation before first simulated frame
This is more expected than outputting empty data.
2023-09-14 12:02:13 +02:00
Jacques Lucke
e914004678 Fix #111411: crash with group node that references linked-but-not-found group
These group nodes currently don't have a socket declaration for every socket.
Instead we just don't touch the sockets at all so that things have not changed
when the node group is found again.
2023-09-14 11:51:05 +02:00
Jacques Lucke
11b2ac54a6 Fix #111166: crash when enabling render pass with equally named AOV
There were two issues:
* The check for conflicting AOVs was done after the Render Layer node
  was updated. This led to an unexpected state in the node.
* The check for conflicting AOVs did not work, because AOVs that already
  had the conflict-flag set were ignored.
2023-09-14 11:26:25 +02:00
Jacques Lucke
726bd3887f Fix #112335: particle instance modifier outputs wrong attributes
This was caused by a mistake in 16fbadde36.
2023-09-14 10:24:47 +02:00
Campbell Barton
d2fac8ba84 Cleanup: remove redundant text access (missed in review) 2023-09-14 16:51:53 +10:00
Matheus Santos
96339fc313 Text Editor: Auto Close Pairs on Selected Text
When the auto-close preference is enabled & brackets or quotes are
entered with a selection, the selection is surrounded by those
characters - instead of replacing the selection.

Match functionality from visual-studio code.

Ref !111900.
2023-09-14 16:25:36 +10:00
Campbell Barton
b3f9663011 Cleanup: use a mask combining all pie menu directions
Avoid looping over buttons to check which directions are in use.
2023-09-14 16:10:36 +10:00
Campbell Barton
a8db828618 UI: remove unnecessarily dead zones for pie menus
Previously when there were 5 or more menu items in a pie menu
the acceptable angle to select an item was limited to 45 degrees.

This makes sense when all 8 menu items are set, however it unnecessarily
restricts the range for menu items that don't have adjacent items.

Resolve using a 90 degree angle range then checking of the adjacent
buttons exist and are a better match.

This also resolves a very small dead-zone between adjacent buttons
for both 4 or 8 button pie menus. It was possible for a direction to
select neither. Compare the direction enum as a tie breaker.

Ref !112311.
2023-09-14 15:43:33 +10:00
Campbell Barton
c7cd1c8d0b Cleanup: use enum literals for space_type & region_type arguments
Also remove unique names for grease pencil keymaps.
There was not advantage in having separate names for each grease pencil
key-map.
2023-09-14 13:36:34 +10:00
Campbell Barton
b7f3e0d84e Cleanup: spelling & punctuation in comments
Also remove some unhelpful/redundant comments.
2023-09-14 13:25:24 +10:00
Campbell Barton
ee6b39ae86 Cleanup: always run both FOREACH_MAIN_ID_BEGIN & END macros
Also correct the "END" macro being used in the wrong scope.
2023-09-14 11:46:32 +10:00
Campbell Barton
fad72f6daa Cleanup: always run both RNA_STRUCT_BEGIN & END macros
In this case it didn't cause any problems however macros with a
BEGIN/END must always run both, not optionally run based on knowledge
of the iterator implementation cleanup requirement.
2023-09-14 10:28:55 +10:00
Miguel Pozo
f42b02cccc Workbench: Sculpt fixes
* Fix #112284 and other non-reported sculpt-related regressions in the
   new Workbench.
* Cleanup ObjectState setup.
* Update `sculpt_batches_get` to support getting per material batches
   while passing SculptBatchFeatures.
* Make material indices 0 based in Workbench.

Pull Request: https://projects.blender.org/blender/blender/pulls/112344
2023-09-13 22:36:37 +02:00
Bastien Montagne
27c8dd89e3 Fix (unreported) crash when showing VSE in some cases.
Recent refactor (4d668e6825) forgot that a Scene will have by
default no allocated VSE data. So nullptr check is needed before
trying to access it.
2023-09-13 22:01:51 +02:00
Hans Goudey
b67bf17139 Cleanup: Remove unnecessary extern "C" from Python files 2023-09-13 15:23:17 -04:00
Miguel Pozo
27a36ccc0f Fix: EEVEE-Next: SSS image rendering
Compute SSS samples location at the render function,
once sampling.rng functions return valid data.
2023-09-13 21:05:46 +02:00
Harley Acheson
fa32379def UI: Allow Integer Thumbnail Size Range
Instead of four discrete thumbnail sizes, allow the user to instantly
zoom to any integer size from 16-256. This also changes the default to
96 from the current 128.

Pull Request: https://projects.blender.org/blender/blender/pulls/105815
2023-09-13 19:56:53 +02:00
Thomas Barlow
6dd3c90185 UI: Change menu icons of single-choice enums to radio buttons
Show radio buttons for enum list items that are not multi-select (not
PROP_ENUM_FLAG).

Pull Request: https://projects.blender.org/blender/blender/pulls/111796
2023-09-13 19:24:16 +02:00
Lukas Tönne
150f226797 Fix #112330: Group sockets not initialized when created by link-drag
The link-drag operator creates the group interface socket, but then did
not initialize the default value.

Pull Request: https://projects.blender.org/blender/blender/pulls/112337
2023-09-13 17:10:08 +02:00
Miguel Pozo
6e24ecac03 Fix #112289: Workbench: Always clear depth_in_front 2023-09-13 16:35:28 +02:00
Julian Eisel
36f31f1eff Asset shelf: Remove unnecessary separator between buttons in header
We don't usually add such a separator after search buttons.
2023-09-13 15:29:33 +02:00
Julian Eisel
5470ce4cf3 Cleanup: Improve comment on asset shelf header size
Now explains the why, not the what (which is obvious anyway).
2023-09-13 15:28:00 +02:00
Amelie Fondevilla
08eb7f1c97 GPv3: Snap selected grease pencil frames
Update of the ACTION_OT_snap to take into account grease pencil frames.
Implemented modes are snap to current frame, nearest second, and nearest marker.

Pull Request: https://projects.blender.org/blender/blender/pulls/111507
2023-09-13 12:10:23 +02:00
Philipp Oeser
564716d5a2 Fix #112285: Sculpt Mode: Mask brush smoothing is broken
Mistake in cc01bb83f6.

Above commit tried to be smart about early out, but wasnt.
Now corrected.

NOTE: fix needs to go into 3.6 LTS

Pull Request: https://projects.blender.org/blender/blender/pulls/112292
2023-09-13 11:04:52 +02:00
Campbell Barton
9a0eaa2062 Fix crash using the key-map editor after refreshing internal data
Any action that triggered the key-map to be rebuilt causes the key-map
UI to display freed data.

Recently key-map refreshing happens during transform, while this should
be resolved - it's still good to avoid a crash in this situation as it's
possible scripts perform actions that tag the key-map to be rebuilt
which is out of our control.
2023-09-13 16:46:59 +10:00
Campbell Barton
b1b6f73487 PyAPI: add keyconfig.keymaps.clear()
Add a utility function to clear all key maps from a key configuration.

This allows the add-ons key-config to be cleared so the exported
configuration wont include add-on keymap items,
needed for bl_keymap_validate.py to properly compare the
exported key-map with the data in:
./scripts/presets/keyconfig/keymap_data/blender_default.py
2023-09-13 15:09:05 +10:00
Campbell Barton
ec7785fffc Cleanup: include the type name as a prefix for RNA keymap functions
RNA defines KeyMap & KeyMaps types, name functions to avoid confusion.
2023-09-13 15:06:12 +10:00
Campbell Barton
d154009910 Fix error messages removing keymaps from keyconfigs 2023-09-13 15:02:08 +10:00
Campbell Barton
ec58f3d4cd RNA: move the "contains" checks into the RNA API
C++ callers must ensure the arguments are valid,
reserve validity for the RNA API for raising errors.

This is already the case for most RNA API calls that wrap BKE API's.
2023-09-13 15:01:49 +10:00
Andrej730
0f6444a3ef Docs: add note to mathutils.Matrix.normalize()
Ref !111253.
2023-09-13 13:04:48 +10:00
Lukas Stockner
4c229070a9 Cycles: Rework Principled BSDF Emission
- Changes defaults from Emission Color 0.0, Emission Strength 1.0 to be the
  other way around (Color 1.0, Strength 0.0), suggested by @brecht
- Makes emission component occluded by sheen and coat
  (to simulate e.g. dust-covered light sources)
- Moves transparency into the Principled SVM/OSL node, to allow for future
  support for e.g. transparent shadows in thin sheet mode.

Note that there are optimization opportunities here (mostly skipping the
non-transparent components for transparent shadow evaluation, and skipping
the parts that don't affect emission for light evaluation), but I have a
separate point for those in the Principled V2 planning since there's some
other optimization topics as well.

Co-authored-by: Weizhen Huang <weizhen@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/111155
2023-09-13 03:05:27 +02:00
Lukas Stockner
d7aee5a580 Cycles: Tweak Principled BSDF Subsurface parameters
Previously, the Principled BSDF used the Subsurface input to scale the radius.
When it was zero, it used a diffuse closure, otherwise a subsurface closure.
This sort of scaling input makes sense, but it should be specified in distance
units, rather than a 0..1 factor, so this commit changes the unit and renames
the input to Subsurface Scale.

Additionally, it adds support for mixing diffuse and subsurface components.
This is part of e.g. the OpenPBR spec, and the logic behind it is to support
modeling e.g. dirt or paint on top of skin. Before, materials would be either
fully diffuse (radius=0) or fully subsurface.

For typical materials, this mixing factor will be either zero or one
(just like metallic or transmission), but supporting fractional inputs makes
sense for e.g. smooth transitions at boundaries.

Another change is that there is no separate Subsurface Color anymore - before,
this was mixed with the Base Color using the Subsurface input as the factor,
but this was not really useful since that input was generally very small.

And finally, the handling of how the path enters the material for random walk
subsurface scattering is changed. Before, this always used lambertian (diffuse)
transmission, but this caused some problems, like overly white edges.

Instead, two different methods are now used, depending on the selected mode.
In Fixed Radius mode, the code assumes a simple medium boundary, and performs
refraction into the material using the main Roughness and IOR inputs.

Meanwhile, when not using Fixed Radius, the code assumes a more complex
boundary (as typically found on organic materials, e.g. skin), so the entry
bounce has a 50/50 chance of being either diffuse transmission or refraction
using the separate Subsurface IOR input and a fixed roughness of 1.
Credit for this method goes to Christophe Hery.

Pull Request: https://projects.blender.org/blender/blender/pulls/110989
2023-09-13 02:45:33 +02:00