Commit Graph

106148 Commits

Author SHA1 Message Date
Jason Fielder
190567f941 EEVEE Next: Optimize HiZ with fast image load store routines
Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/116953
2024-01-24 09:36:25 +01:00
Campbell Barton
9cc6ee75e7 Extensions: support using a default local user directory
This is needed so extensions repositories can reference
user-script directories without them having hard-coded paths
which will be invalid when upgrading a Blender version.
2024-01-24 16:50:32 +11:00
YimingWu
f54348edc9 GPv3: Smooth modifier
Smooth modifier ported to Grease Pencil 3.0

Exposed `smooth_curve_attribute()` from `grease_pencil_edit.cc`
to achieve the smoothing effect. It will not be the exact same result
as the old algorithm.

Pull Request: https://projects.blender.org/blender/blender/pulls/116975
2024-01-24 04:36:36 +01:00
Hans Goudey
99f9084bee Cleanup: Replace some CLAMP macros with C++ functions
Pull Request: https://projects.blender.org/blender/blender/pulls/117460
2024-01-23 21:10:33 +01:00
Hans Goudey
1c503c094c Outliner: Add option to apply object modifier
In discussions about #93551, some users mentioned it would be helpful
to have the ability to apply modifiers from the outliner. Adding that
ability is quite simple, and it makes sense since we already have the
option to remove modifiers there.

---

![image](/attachments/e64c0dd4-a6ec-4115-a46b-7d2fca487c07)

Pull Request: https://projects.blender.org/blender/blender/pulls/117349
2024-01-23 20:54:13 +01:00
Harley Acheson
ba096bae18 UI: TreeView Hierarchy Line with Region Zoom
Adjust size and positions of TreeView hierarchy lines as region is zoomed.

Pull Request: https://projects.blender.org/blender/blender/pulls/117420
2024-01-23 20:39:15 +01:00
Hans Goudey
91b4f9f1f6 Data Transfer: Avoid unnecessarily computing existing normals
If the mix factor means the old values won't be used at all,
the existing corner normals from before the modifier don't
matter and we can skip computing them.
2024-01-23 12:42:31 -05:00
Hans Goudey
da6405fee7 Fix #117410: Corner normals cache not reset on geometry clear
For example, the old corner normals would be used when a mesh's
geometry is completely replaced (when applying a modifier).
2024-01-23 12:42:31 -05:00
Brecht Van Lommel
e0ff7731e0 Core: make BKE_appdir functions thread safe, using optional<string>
The static variables can cause the wrong path to be used, for example
when asset indexing in a thread affects loading toolbar icons.

Fix #117416: toolbar icon randomly missing

Pull Request: https://projects.blender.org/blender/blender/pulls/117419
2024-01-23 18:38:15 +01:00
Harley Acheson
4e483dad4b Fix: String Offset Assert in Color Picker
Dragging on a color value slider in the color picker will assert for
an invalid string offset. We now using std::string for uiBut->str, the
string is empty and we are checking against str[1]. This replaces that
with an std::basic_string::find which handles this fine.

Pull Request: https://projects.blender.org/blender/blender/pulls/117455
2024-01-23 17:39:55 +01:00
Philipp Oeser
d8b085089c Fix: 3D Viewport header missing update changing paintslots
Since 3b5df8a7ea, we are displaying a "canvas picker" in the 3DView
header. In texture paint mode, this gives us the active paintslot to
paint on, however the header wasnt updating to another slot.

See https://projects.blender.org/blender/blender/pulls/
112227#issuecomment-1018440

Part of #112186.

Pull Request: https://projects.blender.org/blender/blender/pulls/115802
2024-01-23 17:27:28 +01:00
Harley Acheson
606723b3e2 UI: More Defaults for Search Placeholders
When looking for automatic placeholder string For UI_BTYPE_SEARCH_MENU,
use property UI Name as last resort.

Pull Request: https://projects.blender.org/blender/blender/pulls/113792
2024-01-23 17:15:50 +01:00
Richard Antalik
06be6c5fb1 IMB: Add gif to list of movie extensions
Pull Request: https://projects.blender.org/blender/blender/pulls/117343
2024-01-23 15:55:54 +01:00
Hans Goudey
eb23b299db Fix: Add versioning for change in object info scale behavior
When the object info node was originally created, the transform of an
object with a negative scale would also have negative scale. At some
point that behavior changed though, and the matrix always had positive
scale.

The negative scale is the more expected behavior (see #104926), and
66dc0ebf2e restored that behavior. But node setups started to
rely on the non-negative behavior in the meantime. So this commit adds
an absolute value node with versioning.

The versioning is added to the 401.10 file subversion bump, since
that's when the behavior changed back to the current state.

Pull Request: https://projects.blender.org/blender/blender/pulls/117425
2024-01-23 15:34:17 +01:00
Lukas Tönne
f72dbc1ef8 Fix #117422: Move undefined type removal behind after-linking-versioning
There are still node versioning bits running after linking, for example
`version_geometry_nodes_replace_transfer_attribute_node`. This code
relies on node types being untouched at that point.

Move the unknown node type replacement from `ntreeSetTypes` into the
`ntreeUpdateAllNew` function. This is called _after_ late versioning.

Pull Request: https://projects.blender.org/blender/blender/pulls/117441
2024-01-23 15:15:08 +01:00
Pratik Borhade
71925e9157 Fix: Debug crash when translating more than 1024 verts
Caused by 1bcf3933a8
This is due to accessing value of uninitialized variable.

Pull Request: https://projects.blender.org/blender/blender/pulls/117442
2024-01-23 12:40:48 +01:00
Jeroen Bakker
cd756143cf OpenGL: Fix Shader Linking Error
When a shader performs a geometry shader injectoin to work around
features that are not supported natively on the GPU (viewport,
barycentric coordinates, layered rendering), linking would fail.

The reason was that the geometry shader was stored in a slot that was
patched by the specialization constants, resulting in an empty geometry
shader. An empty shader can be compiled, but doesn't match the interface
with other stages, so the linking would fail.

This fixes the issue that EEVEE crashed on Intel iGPUs. These GPUs
don't support viewports.

Pull Request: https://projects.blender.org/blender/blender/pulls/117440
2024-01-23 11:12:30 +01:00
Omar Emara
46322e4927 Fix: Compositor Texture node differ between CPU and GPU
The compositor Texture node differ between CPU and GPU. That's because
CPU falls back to the texture intensity as the alpha channel if no alpha
channel exists. And it also broadcast the texture intensity to all color
channels if no RGB evaluation exist. So adjust the GPU implementation to
follow that.
2024-01-23 11:59:38 +02:00
Campbell Barton
6cc8ac7cb3 Cleanup: rename ImBuf anim & anim_index structs
Rename: anim -> ImBufAnim
Rename: anim_index -> ImBufAnimIndex

There were cases where removing redundant "struct" qualifier caused
a warning since the name of the struct member was also anim.

Use uppercase type name to conform with other types names.

Ref !117394
2024-01-23 20:26:55 +11:00
Jeroen Bakker
30a152216e EEVEE: Change UI Naming
This PR renames the UI names of EEVEE render engines, due to the decision to
postpone EEVEE-Next to Blender 4.2.

* `EEVEE` is now named `EEVEE-Next`.
* `EEVEE (Legacy)` is now named `EEVEE`.

Pull Request: https://projects.blender.org/blender/blender/pulls/117437
2024-01-23 10:06:15 +01:00
Philipp Oeser
c16b0216fe Fix #68436: External Particle Disk Cache Playback Is Broken
This has been broken since 2.8.

The highlevel reason for this is that the "info file" (saved as frame
zero) was not written anymore.
Reason for that in turn is that when calling BKE_ptcache_write outside
the bake job, the PTCacheID calldata (a psys in our case) is not the
evaluated particle system, causing a check for totpoint to fail (these
were always zero).

Deeper reasoning is unclear, no further investigations were done as to
why/when this happened.

The solution proposed here is using the evaluated psys when writing the
info frame (and this is isolated to just this spot and only to particle
systems). File then gets
written and can/will be read when using this as an external disk cache
in another file.

Pull Request: https://projects.blender.org/blender/blender/pulls/117401
2024-01-23 09:37:41 +01:00
Jeroen Bakker
062a9f9540 Fix: Compiling EEVEE test cases
Due to recent changes eevee test cases didn't compile anymore.
The issue was that a header file was migrated from C to CPP.

Pull Request: https://projects.blender.org/blender/blender/pulls/117436
2024-01-23 09:14:10 +01:00
Campbell Barton
5574a2790f Cleanup: rename uuid to uid for local-view functionality
Follow up to 311ca3e6af.
2024-01-23 16:07:39 +11:00
Campbell Barton
9a7b767226 Cleanup: reserve "r_" prefix for return arguments 2024-01-23 13:30:47 +11:00
Campbell Barton
0ce1102147 Cleanup: replace incorrect use of UUID with UID in bmesh_region_match
Follow up to 311ca3e6af.
2024-01-23 13:22:04 +11:00
Harley Acheson
a4a8683788 UI: Increased Overlay Text Contrast
Increased contrast of light text on any background by increasing the
effectiveness of the dark shadow.

Pull Request: https://projects.blender.org/blender/blender/pulls/117351
2024-01-22 21:57:55 +01:00
Hans Goudey
8dd30838e9 Fix #117423: Broken UI button float display after cleanup
Caused by 089c389b5c. Previously the draw string was created
by appending text inside the buffer multiple times. Now it's formatted
in one step. Part of that change was missing for factor display.
2024-01-22 15:46:52 -05:00
Hans Goudey
50ff1e843b Cleanup: Remove unnecessary use of mutable linked list iteration 2024-01-22 15:32:38 -05:00
Jacques Lucke
c7e674d40f Cleanup: extract low level dna array utilities to separate file
This simplifies reusing those functions outside of the context of node sockets.

Pull Request: https://projects.blender.org/blender/blender/pulls/117418
2024-01-22 21:07:28 +01:00
Omar Emara
02fc4d6481 Fix: Tonemap node has a wrong luminance scale
The Tonemap node has a wrong luminance scale. This is because the
parallel reduction shader for logarithmic sum had a wrong identity
value. In particular, its identity was set to 0.0, but since its
initialization macro computed the log, the zero becomes a rather large
negative value.

To fix this, the general structure of the parallel reduction shader was
changed such that the identity is used as is, and not passed to the
INITIALIZE or LOAD macros. This simplifies the implementation and even
avoid the extra texel fetches at the boundary.
2024-01-22 22:03:05 +02:00
Hans Goudey
089c389b5c Cleanup: Store UI button drawstr with std::string
Similar to bff51ae66c
2024-01-22 14:54:44 -05:00
Miguel Pozo
18af495cfc Fix: EEVEE-Next: Alpha Blended material pre-pass
Alpha blended materials were being rendered in the forward opaque
pre-pass, causing them to use dithered transparency as well.
2024-01-22 18:11:49 +01:00
Bastien Montagne
f1d4c35f4d GPV3: Refactor the 'dna processing' code when reading/writing blendfile.
GreasePencil v3 requires some additional processing on its data before
writing to blendfile, and after reading from it.

Extract this from generic `read/write` code, and put it into dedicated
callbacks in Cpp classes that need it (layer groups and leaves
currently).

NOTE: Work done while exploring possibility to use 'memfile' read/write
code for GP editmode undo (!117072), but ended up taking a different
approach for it, so this PR is purely a 'no expected changes in behavior'
refactor at this point.

Pull Request: https://projects.blender.org/blender/blender/pulls/117413
2024-01-22 17:44:44 +01:00
Thomas Barlow
e9ff079131 RNA: Use sdna for ByteIntAttributeValue.value
This enables raw access to the property, which enables raw array access
to the property through ByteIntAttribute.data, speeding up Python API
access through foreach_get/foreach_set (bpy_rna.cc#foreach_getset).

Pull Request: https://projects.blender.org/blender/blender/pulls/117409
2024-01-22 17:39:51 +01:00
Hans Goudey
f2f9bce6c3 Cleanup: Avoid unnecessary .c_str() call 2024-01-22 11:17:56 -05:00
Hans Goudey
0618de49ad Cleanup: Replace MIN/MAX macros with C++ functions
Use `std::min` and `std::max` instead. Though keep MIN2 and MAX2
just for C code that hasn't been moved to C++ yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/117384
2024-01-22 15:58:18 +01:00
Alexander Gavrilov
c478235985 Anim: copy bone collection parenting and visibility in armature join.
When joining armatures, make sure to preserve parenting relations
of bone collections. Also, copy and update the visibility flags.

Pull Request: https://projects.blender.org/blender/blender/pulls/117406
2024-01-22 15:55:39 +01:00
Jeroen Bakker
18b5b0812b Cleanup: OpenGL program creation and linking
This PR improves the place when shader stages are attached to glPrograms.
Previously it was done when shaders stages where created, in the function
create_shader_stage.

This PR will attach the shader stages inside link program.
Ensuring that create_shader_stage doesn't alter the program, which isn't
clear in its name.

Pull Request: https://projects.blender.org/blender/blender/pulls/117407
2024-01-22 14:50:42 +01:00
Iliya Katueshenock
801e24379e Fix: Geometry Nodes: Wrong hash of Shortest Edge Path field
This could cause too many comparisons when deduplicating
field inputs for evaluation.

Pull Request: https://projects.blender.org/blender/blender/pulls/117391
2024-01-22 14:00:03 +01:00
Jacques Lucke
311ca3e6af Core: rename Session UUID to Session UID
`UUID` generally stands for "universally unique identifier". The session identifier that
we use is neither universally unique, nor does it follow the standard. Therefor, the term
"session uuid" is confusing and should be replaced.

In #116888 we briefly talked about a better name and ended up with "session uid".
The reason for "uid" instead of "id" is that the latter is a very overloaded term in Blender
already.

This patch changes all uses of "uuid" to "uid" where it's used in the context of a
"session uid". It's not always trivial to see whether a specific mention of "uuid" refers
to an actual uuid or something else. Therefore, I might have missed some renames.
I can't think of an automated way to differentiate the case.

BMesh also uses the term "uuid" sometimes in a the wrong context (e.g. `UUIDFaceStepItem`)
but there it also does not mean "session uid", so it's *not* changed by this patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/117350
2024-01-22 13:47:13 +01:00
Sybren A. Stüvel
784ff4abc0 Anim: armature edit mode undo now also handles bone collection root count
Armature Edit mode has its own undo handling, which didn't store the
number of root bone collections in the armature. Now it does.

An alternative would be to not store this in the undo step, but rather
loop over all bone collections to find the minimum `child_index`. This
would be linear in the number of bone collections, though, so I chose to
use a few more bytes of memory to make the undo system a little faster.
2024-01-22 13:34:25 +01:00
Sergey Sharybin
29aaa2922d Fix performance issue when tagging relations for update
The relations update code does tagging needed to ensure that the
array of bases is updated when relations are updated. It was done
by tagging the Scene ID node, and potentially recursing into all
dependent depsgraph nodes. If there is a driver on a scene property
it was unnecessarily re-evaluated.

This solves the slow behavior of adding objects in the test file
from #117335.

Pull Request: https://projects.blender.org/blender/blender/pulls/117403
2024-01-22 12:27:55 +01:00
Lukas Tönne
1903f58eac Cleanup: Removed unused variable in grease pencil color modifier. 2024-01-22 11:37:31 +01:00
Omar Emara
0adf01e79e Fix: Compile errors in GPU shader builder stubs
IMB module is now C++, so adjust the linkage of the stubs.
2024-01-22 12:27:19 +02:00
Sergey Sharybin
7a2d04a5c4 Fix #117335: Slow selection in scene with drivers
Change parameters tagging from implicit based on the copy-on-write to
more explicit, allowing to ignore tagging of parameters component for
changes which do not affect drivers.

There is still implicit parameters tagging based on tags for geometry
or transform components to avoid making changes in too many places of
Blender.

Should be no functional changes, only expecting better performance.

Pull Request: https://projects.blender.org/blender/blender/pulls/117336
2024-01-22 11:23:19 +01:00
Sergey Sharybin
b2b6286366 Depsgraph: Avoid implicit tagging on hide_viewport changes
The update callback of this property does proper tagging.

Should be no functional changes, but allows the depsgraph to make
more optimal decision on avoiding unneeded recalculations.

In practice this should avoid unnecessary re-evaluation when
toggling this option on objects on outliner.

Ref #117335
2024-01-22 11:23:14 +01:00
Sergey Sharybin
85ff988f99 Depsgraph: Move scene evaluation node to own component
This node is needed to ensure evaluation order of scene and modifiers
which might access scene for custom data masks, or for the current
frame.

Move it to own component, so that evaluation of scene does not lead
to changes in the parameters component, hence does not trigger
driver evaluation.

Should be no functional changes.

Ref #117335
2024-01-22 11:23:14 +01:00
Sybren A. Stüvel
dfc220622c Anim: bone collection tree, show selected bones as hollow dot
In the Bone Collection tree, mark bone collections that contain any
selected bones with a hollow dot.

As before, collections containing the active bone are still hown with a
filled dot.
2024-01-22 11:13:00 +01:00
Pratik Borhade
a68b0957ed GPv3: Broken color modifier UI
Opacity modifier properties/ui was resued for color modifier

Pull Request: https://projects.blender.org/blender/blender/pulls/117376
2024-01-22 10:47:42 +01:00
Sybren A. Stüvel
6b8c64fc69 Anim: create new bone collections as next sibling of active one
Bone collections created via the `bpy.ops.armature.collection_new`
operator now always become the next sibling of the active bone
collection. If there is no active one, the new one is added at the end
of the list as root.

This removes the `.parent_index` property of the operator, as it is now
always created relative to the active bone collection.
2024-01-22 10:34:30 +01:00