Previously, the node would always evaluate the input field on the
entire geometry domain. This is good when most indices will be
accessed afterwards. However, it is quite a bad when only a single
index is used. Now the field is only evaluated for that one index.
Remove:
- IDPropertyTemplate.matrix_or_vector
Matrix & vector types have been deprecated, this wasn't used.
- IDProperty.saved
This was added preemptively but never used, replace with a pad so as
not to hint at a feature that doesn't exist.
The default curve type when there is no "curve_type" attribute is
Catmull ROM. In order to avoid allocating an entire array of values
just to set this default type, remove the attribute instead. This will
be less important when we can store attributes as single values.
Also fix a curve utility API comment.
Improve safety and correctness of matrix multiplication by using
temporary storage if one of the inputs is also the output.
No functional changes.
Differential Revision: https://developer.blender.org/D16876
Reviewed By: Campbell Barton, Sergey Sharybin
Since a year and a half ago we've been switching to a new way to
represent what sockets a node should have called "declarations"
that's easier to use, clearer, and more flexible for upcoming
features like dynamic socket counts or generic type sockets.
All builtin nodes with a static set of sockets have switched, but one
missing area has been group nodes and group input/output nodes. These
nodes have **dynamic** declarations which change based on their
properties or the group they're inside of. This patch addresses that,
in preparation for using the same dynamic declaration feature for
simulation nodes.
Generally there shouldn't be user-visible differences, but one benefit
is that user-created socket descriptions are now visible directly in
the node editor for group nodes and group input/output nodes.
The commit contains a few changes:
- Add a node type callback for building dynamic declarations with
different arguments
- Add an `Extend` socket declaration for the "virtual" sockets used
for connecting new links
- A similar `Custom` socket declaration is used for addon-defined socket
- Simplify the node update loop to use the declaration to build update
sockets
- Replace the "group update" functions with the declaration building
- Move the node group input/output link creation to link drag operator
- Make the field status part of group node declarations
(not for group input/output nodes though)
- Some fixes for declarations to make them update and build properly
Differential Revision: https://developer.blender.org/D16850
Under some circumstances (loading autosaves), we end up reading from
files that were saved with the new mesh format (after T95965). When
that happens we should skip the conversion from the old format to
avoid data-loss. This will also give forward compatibility when we
stop saving in the old format completely in 4.0.
Here I mostly just check if the attributes in the new format already
exist. Along with checking for the null status of `Mesh::mvert`, that
should cover the majority of cases.
Fixes T103878
Differential Revision: https://developer.blender.org/D17011
This fixes the UI alignment issues that were introduced by {D12815} with the addition of the boolean custom properties.
Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D17012
Previously transforming and translating meshes (used by the object info
and transform geometry nodes) was single threaded. Now use the same
code path as other geometry types which already includes multithreading.
I observed a 5x performance improvement for a 4 million vert mesh on a
Ryzen 7950x.
Trim erronously samples the next to last control point when it should
sample the last control point on the curve. This only happens when
reducing the curve to a single point. These changes should correct
the behavior.
Differential Revision: https://developer.blender.org/D17003
ViewCullingData::corners (vec4) was casted to a BoundingBox (vec3), so the frustum corners were uploaded in the wrong format to the GPU.
Now the ViewCullingData::corners are used directly without casting, since the BoundBox API is not really needed.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D17008
While keeping SSE2, SSE4.1 and AVX2. This does not affect hardware support, it
only slightly reduces performance for some older CPUs.
To reduce maintenance cost and improve compile times.
Differential Revision: https://developer.blender.org/D16978
Separating strokes using "selected points" didn't take into account
that points->time can be 0 and thus created points with negative
values in points->time, which should be an impossibility.
This patch fixes this in BKE_gpencil_stroke_delete_tagged_points.
Also, it makes the build modifier's new drawspeed immune
to (erroneous) negative time values, should they arise in other situations.
Reviewed By: antoniov
Differential Revision: https://developer.blender.org/D17006
Implementation didn't count the string terminator when allocating
memory to store `msl_patch_default`. The string terminator could
be overwritted by other memory adding some undefined behavior.
An alternative fix to [0] which caused an error with ASAN
(freeing an GHOST_ISystem instead of a GHOST_System).
Reported by @Baardaap in chat, I'm unable to reproduce the issue.
Instead of calling the destructor directly, add a private method that
deletes data before raising an exception.
[0]: fd36221930
Use a consistent style for declaring the names of struct members
in their declarations. Note that this convention was already used in
many places but not everywhere.
Remove spaces around the text (matching commented arguments) with
the advantage that the the spell checking utility skips these terms.
Making it possible to extract & validate these comments automatically.
Also use struct names for `bAnimChannelType` & `bConstraintTypeInfo`
which were using brief descriptions.
Meshes spawning particles from faces with with UV's/Vertex-colors but no
faces would crash de-referencing a NULL pointer.
Resolve by adding a check for this case and an assertion if CD_MFACE is
NULL when the mesh has polygons.
Ref D16947
These allow the usage of `atomicMin` and `atomicMax` function with float
values as there is no overload for these types in GLSL.
This also allows signed 0 preservation.
This wasn't really a problem since these are set on first bind or creation.
The test `if (enabled_srgb && srgb_) {` was depending on that variable that
in certain case, might not have been initialized (because of lazy init).
Changes to overlay_shader.cc workaround a bug in GCC-12.2
(likely a duplicate of [0]). As the workaround involved removing
a local variable which most functions already didn't assign,
remove it for all functions.
An alternative is to add (otherwise redundant) parenthesis, e.g.
`&(e_data.sh_data[sh_cfg])`, but this would need to be noted in
code-comments, so opt for removing the intermediate variable.
[0]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106247
As noted in comments, there are a lot of false positives which can't
be conveniently suppressed. Many of these warnings were caused by
`float x, y, z` being passed as `float[3]` using a pointer to `x`.
This makes `GVArrayImpl` and `VArrayImpl` more similar.
Only passing the pointer instead of the span also increases
efficiency a little bit. The downside is that a few asserts had
to be removed as well. However, in practice the same asserts
are in place at a higher level as well (in `VArrayCommon`).
In most cases it is currently not used, so always having it there
causes unnecessary overhead. In my test file that causes
a 2 % performance improvement.
Previously, `ParamsBuilder` lazily allocated an array for an
output when it was unused, but the called multi-function
wanted to access it. Now, whether the multi-function supports
an output to be unused is part of the signature. This way, the
allocation can happen earlier when the parameters are build.
The benefit is that this makes all methods of `MFParams`
thread-safe again, removing the need for a mutex.
`std::get` could not be used due to restrictions on macos.
However, the minimum requirement has been lifted in
{rB597aecc01644f0063fa4545dabadc5f73387e3d3}.
Currently you can retrieve a mutable array from a const CustomData.
That makes code unsafe since the compiler can't check for correctness
itself. Fix that by introducing a separate function to retrieve mutable
arrays from CustomData. The new functions have the `_for_write`
suffix that make the code's intention clearer.
Because it makes retrieving write access an explicit step, this change
also makes proper copy-on-write possible for attributes.
Notes:
- The previous "duplicate referenced layer" functions are redundant
with retrieving layers with write access
- The custom data functions that give a specific index only have
`for_write` to simplify the API
Differential Revision: https://developer.blender.org/D14140
Fixes bugs where UV islands with `mark seam` would tear at boundaries.
Modify seam_connected to search both it's edges instead of only one,
as this could fail if the edge was a seam or did not fan to the other loop.
Also fixes bug in `seam_connected_recursive`:
- `loop->prev == needle` changed to `loop == needle`
Maniphest Tasks: T103787
Reviewed By: Campbell Barton
Differential Revision: https://developer.blender.org/D16992
Test File: F14145477, F14137755, T79304
Avoid using components that can contain null pointer.
Getting attibute should avoid trying to do it for a null mesh.
This fix bypasses working with components.
Differential Revision: https://developer.blender.org/D16997
The crease custom data layer was added to a mutable version of the mesh,
but that wasn't used in the rest of the operation. Also the layer wasn't
retrieved properly with write access from the custom data API (fixed
separately as part of D14140). Also clean up a bit by retrieving
attributes from the mesh directly and by tweaking naming a bit.
Timecodes were generated from read packets, but applied to decoded
frames. This works as long as delay between packet read and decoded
frame is less than GOP size or if packet does not produce multiple
frames. In this case it did not work.
Use `pkt_pos`, `pkt_dts` and `pts` from `AVFrame` instead of `AVPacket`.
This way delay can be eliminated and timecode files are more reliable.
Effectively this disables two volume modifiers for the new curves
object and the point cloud object types. The aim is to simplify the
process of using these object types to prove out a node-group-based
workflow integrated with the asset browser. We're making the assumption
that these two modifiers were used very rarely on the new curves type
since that wasn't its purpose, so this breaks backwards compatibility.
Similar to the corresponding properties on node sockets, only adjust
the soft range. Because group nodes only have soft limits, groups
should generally be able to accept these inputs anyway. The benefit
of only using a soft range is that it allows choosing a more user-
friendly default range while keeping flexibility.
A proper boolean custom property type is commonly requested. This
commit simply adds a new `IDP_BOOLEAN` type that can be used for
boolean and boolean array custom properties. This can also be used
for exposing boolean node sockets in the geometry nodes modifier.
I've just extended the places existing IDProperty types are used, and
tested with the custom property edit operator and the python console.
Adding another IDProperty type is a straightforward extension of the
existing design.
Differential Revision: https://developer.blender.org/D12815
- `Interpolate Domain` -> `Evaluate on Domain`
- `Field at Index` -> `Evaluate at Index`
These names, discussed in recent geometry nodes submodule meetings,
describe actions rather than nouns, which is generally how nodes are
supposed to be named. The names are consistent, which is helpful
because they're similar conceptually. They also don't require knowledge
of the field concept, which we generally try to keep out of the UI in
favor of more beginner-friendly concepts.
We hope to add the ability to search for nodes with multiple
names for 3.5, so the old names can still have search items.
The menus are growing too large. This patches move some categories under
sub-menus, and shuffle some entries around.
We already had sub-categories split by separators. This change now
goes a step further and embrace 3-level menus.
Inspired by the "Simpler Add Menu" add-on by Quackers (waiting to hear
back to know Quackers real name).
Inspired by the "Simpler Add Menu" add-on by Alfonso Martinez II.
Differential Revision: https://developer.blender.org/D16993
Caused by {rBd397ecae325}.
Above commit added a new socket, so
`version_geometry_nodes_primitive_uv_maps` was getting the wrong sockect
with `->next`.
Now get the right one with yet another `->next` (might not be ideal, but
searching the right socket with other methods might be overhead?)
Maniphest Tasks: T103837
Differential Revision: https://developer.blender.org/D16994
When idle, each 3D view made two calls CTX_data_mode_enum(C) from the
WM_main loop. While not causing problems it complicated troubleshooting
high CPU use while idle in other areas.
Access the object via the view layer, giving approx 40x speedup.
Recently the event handling thread for Wayland sometimes used 100% of a
CPU core while idle.
Resolve by waiting for changes to the Wayland file-handle when
there are no events to read.
The previous fix from T100855 [0] no longer works on my system
(3.4.1 release also fails for GNOME/KDE/WLROOTS compositors).
Resolve by removing the loop from the wait-on-file handle check.
Also reduce locking/unlocking calls.
[0]: 37b256e26f
The new C++ OBJ importer was missing "split by objects" / "split by
groups" import settings of the older Python importer.
Implements T103839.
Added test coverage for all 4 possible combinations of these two
options.
This is caused by the partial derivatives not being precise enough to
take the tube shape into account. For now we just disable displacement
bump for this type of geometry to match cycles.
Fixes T101175 Eevee displacement behavior changed
In patch D16759 cleanup a else was removed by error which
deals with situations where current gpf was copied,
so that previous gpf may have MORE strokes than current gpf.
Reviewed By: antoniov
Differential Revision: https://developer.blender.org/D16986
Remove the unused function `pose_propagate_fcurve`
It was missed in D16771
Reviewed By: Jacques Lucke
Differential Revision: https://developer.blender.org/D16937
Ref: D16937
In case there is only 1 key on the FCurve,
the operator can run into a situation where it divides by 0.
It now skips the curve in that case
Reviewed by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D16982
Ref: D16982
For some reason the Armature modifier in the Multi-Modifier mode
interpreted the vertex group in a way essentially opposite to the
regular mode. Moreover, this depended not on the Multi-Modifier
checkbox, but on whether the mode was actually active.
This fixes the flip and adds versioning code to patch old files.
One difficulty is that whether the Multi-Modifier flag is valid
can be different between the viewport and render. The versioning
code assumes any modifier enabled in either to be active.
This change is not forward compatible, so min version is also bumped.
Differential Revision: https://developer.blender.org/D16787
User notifications in Blender were always annoying and therefore by default turned off.
- When tweaking compositor/material tree a notification was shown.
- When rendering an animation for each frame a notification was shown.
The reason for this was that it was automatically shown when a background job was
finished and Blender wasn't the top most application.
In stead of migrating user notification to UserNotification.framework it was decided
to remove it for now. If in the future notifications should be added back we should
start with a design to figure out where notifications makes sense.
Reviewed By: sergey, brecht
Maniphest Tasks: T103757
Differential Revision: https://developer.blender.org/D16955
Replace the pointers in the MeshEdge with indexes, removing MeshPrimitive and MeshVertex.
Code cleanup proposed by the geometry nodes to make the data structures more reusable by
other areas of Blender as well. Old implementation was to focused to the texture painting.
Initial the idea was to do the same with the data structures in UVIslands, but there some
concerns were raised that requires a different design than expected from a clean-up patch.
Concerns raised about converting UVIslands:
* Maps between UVPrimitive, UVEdge and UVVertex will be stored inside the UVIsland.
During UVIsland extraction detected islands can be merged. When they are merged all
Indexes should be updated.
* It is not possible to pre-allocate all buffers as they grow, what will lead to more re-allocations. The current
implementation uses a VectorList to ensure that re-allocations don't require the data to be
moved to the newly allocated memory. We could store some information about last used
sizes in runtime data to reduce the re-allocation overhead.
* Solution would require index based access inside a VectorList, which might increase the
complexity.
* UVIslands during 3d texturing is used as intermediate data, the final data is stored as PackedPixelRows.
We could proceed converting UVIslands as well, but that would lower the performance noticeably.
3D texturing has performance requirements, so when doing so we should make sure that
it matches that as well.
Reviewed By: HooglyBoogly
Maniphest Tasks: T101740
Differential Revision: https://developer.blender.org/D16752
Cycles converts internal links to converter nodes which don't do anything and
later on get collapsed by the graph optimization. However, the previous code
assumed that one Blender input socket maps to one Cycles input socket.
When a node is muted, there might be internal links from one input to multiple
outputs. In Cycles, this meant that one Blender input socket now mapped to
multiple input sockets on all the converter nodes, so only the last one survived.
THe fix is simple, just make the mapping a MultiMap.
The problem here is that whether an object is a shadow catcher or not affects the
visibility flags, but changes to the shadow catcher property did not trigger a
visibility flag update.
Added an extrude mode enum to the trim operators to
control extrusion: "project" and "fixed." "Fixed" just
extrudes along a fixed normal and is the new default.
New code from rBd05909a70c36 last week did not take into account
liboverride templates and `NOOP` operations. So we cannot assume that
there is no valid override property for these which need to be restored.
While we may get rid of templates at some point now, for now they are
still exposed in PY API, and have some basic unittests, so keep them
working as best as possible.
Issue reported on IRC by Martijn Versteegh (@Baardaap), thanks!
It is a part of the Phabricator to Gitea migration.
The issue template is based on the bug submission instructions which
are shown in the Phabricator's bug submission form. Some further tweaks
are likely needed, but the current version of the template simplifies
re-iteration while working on the migration.
The pull request template is needed to override the template in the
.github folder which is otherwise picked up by Gitea.
Tool settings can be accessed from both `tool_settings` &
`scene.tool_settings`.
As of [0] `scene.tool_settings` was used instead of `tool_settings`
causing the snap shortcut not to display.
Resolve by supporting variations of data-paths so both are detected.
[0]: 9a76dd2454
Logic to skip UV layers that are part of the MLoopUV treated all
loop-layers as UV's, causing duplicate and invalid names to be added
to be added to 'uv_sublayers_to_skip', this asserted in debug mode
when saving the `ellie_animation.blend` demo blend file.
Byte colors are generic attributes and are therefore included in
CD_MASK_PROP_ALL. Also clarify the use of vertex groups.
They always have to be propagated since they're displayed in
the spreadsheet, etc.
Move the `ME_SHARP` flag for mesh edges to a generic boolean
attribute. This will help allow changing mesh edges to just a pair
of integers, giving performance improvements. In the future it could
also give benefits for normal calculation, which could more easily
check if all or no edges are marked sharp, which is helpful considering
the plans in T93551.
The attribute is generally only allocated when it's necessary. When
leaving edit mode, it will only be created if an edge is marked sharp.
The data can be edited with geometry nodes just like a regular edge
domain boolean attribute.
The attribute is named `sharp_edge`, aiming to reflect the similar
`select_edge` naming and to allow a future `sharp_face` name in
a separate commit.
Ref T95966
Differential Revision: https://developer.blender.org/D16921
An apostrophe should not be used because it is not a mark of plural,
even for initialisms. This involves mostly comments, but a few UI
messages are affected as well.
Differential Revision: https://developer.blender.org/D16749
This property was intended to keep the snap elements synchronized with the scene.
But another solution exists.
And this property is not even working correctly.
This patch is a response to T101313.
Adds a selection to the Store Named Attribute node.
If the attribute does not exist unselected parts
are filled with zero values. Otherwise, only the
selected parts are filled.
Differential Revision: https://developer.blender.org/D16237
It was introduced in commit https://developer.blender.org/rB0fb12a9c2ebc
The problem was that the tool uses the same values for all modes,
but the new calculation must be only for Draw mode.
Now the mode is checked.
This is a mere "get this to compile in C++", didn't do changes like
using `MEM_cnew()` instead of `MEM_calloc()`.
Needed for the blender-project-basics branch, so I don't have to write C
wrappers for a single call from this file.
With the GPU API the sampler can not be set after texture binding, which caused
a delay of the actual change. Now do both in a single call for correctness and
performance.
Caused by NULL dereference in strip overlap handling (expand to fit),
because `time_dependent_strips` strip collection is not created.
Check if strip collection is provided in `query_right_side_strips()`.
Updates the add and search menu of the node editor to use the new "All"
asset library introduced in the previous commit. This simplifies code by
removing redundant logic to merge contents of multiple asset libraries.
Adds a new built-in asset library that contains all other asset
libraries visible in the asset library selector menu. This also means
all their asset catalogs will be displayed as a single merged tree. The
asset catalogs are not editable, since this would require support for
writing multiple catalog definition files, which isn't there yet.
Often it's not relevant where an asset comes from. Users just want to be
able to get an asset quickly, comparable to how people use a search
engine to browse images or the web itself, instead of first going to a
dedicated platform. They don't want to bother with first choosing where
they want the result to come from.
This especially is needed for the Asset Shelf (T102879) that is being
developed for the brush assets project (T101895). With this, users will
have access to all their brushes efficiently from the 3D view, without
much browsing.
Did an informal review of the asset system bits with Sybren.
This patch uses the recorded drawing speed to rebuild the strokes. This results in a way more
natural feel of the animation.
Here's a short summary of existing data used:
- gps->points->time: This is a timestamp in seconds of when the point was created
since the creation of the stroke. It's quite often 0 (I added a sanitization routine).
- gpf->inittime: This is a timestamp in seconds when a stroke was drawn measured
since some unknown point in time. I only ever use the difference between two strokes,
so the absolute value is not relevant.
Reviewed By: frogstomp, antoniov, mendio
Differential Revision: https://developer.blender.org/D16759
When adding a new layer from the viewport, the newly created layer
is set as active, which is visible in the properties panel,
but the selection in the dopesheet was not updated accordingly,
due to a missing notifier which is added in this patch.
A few weeks ago we enabled the Metal back-end for the viewport.
Due to metal, master is only able to build on MacOS 10.15 and above.
The previous minimum requirement is MacOS 10.13.
It was already planned to bump to a higher version for Blender 3.6. After
a short discussion via bf-committers it was decided that it is fine to bump it for
3.5 release.
This patch cleans up the CMake files and update the minimum requirement.
With this patch the next deprecations will be listsed.
- `NSOpenGLView`, `NSOpenGLContext` is deprecated. (replaced by metal)
- `NSStringPboardType` is replaced by `NSPasteboardTypeString`
- `NSTIFFPboardType` is replaced by `NSPasteboardTypeTIFF`
- `NSFilenamesPboardType` should be replaved by multiple pasteboard items with `NSPasteboardTypeFileURL` instead.
- `NSUserNotification` should be replaced with UserNotifications.frameworks API
Deprecations will be handled in separate tasks and commits. OpenGL won't be
fixed at this moment, as it will be phased out in the future. NSStringPboardType, NSTiffPboardType & NSFilenamesPboardType
will be provided in a single patch. NSUserNotification will also be provided in
its own patch.
Reviewed By: brecht, sergey
Differential Revision: https://developer.blender.org/D16953
OpenGL is deprecated by Apple and triggers a warning when used. The goal
is that OpenGL is replaced by Metal backend, but we are not there yet.
To improve tracability of new warnings we hide deprecation warnings
when the GHOST_ContextCGL.h file is included.
NOTE: This change silences other deprecation warnings as well.
Set origin and convert operator now accepts point cloud and new curve
object. But these operators were not added in context menu.
Support for set origin and convert operator was added in
rBadb4dd911b91, rB933d56d9e98d and rB2752a88478a8
Reviewed by: HooglyBoogly
Differential Revision: https://developer.blender.org/D16939
The T103586 fix effectively ran the wl_surface_listener.leave callback
to as WLROOTS based compositors doesn't run them. Remove the workaround
since it's an error in WLROOTS to be fixed upstream.
Temporarily using the wrong window scale when disconnecting a monitor
on configurations that use different DPI per monitor is a minor enough
issue that I don't think it makes sense to workaround in GHOST.
Using run-time members in the surface modifier complicated code-review
and caused an unnecessary renaming in `dna_rename_defs.h`.
Also rename:
- `x` -> `vert_positions_prev`.
- `v` -> `vert_velocities`.
- `cfra` -> `cfra_prev`.
The mesh positions are now a span, but the convex hull didn't copy
the custom data layout to the new mesh since it assumed it didn't
need to. Moving UV maps to a generic attribute triggers this difference
in the test results.
It doesn't really make sense for the convex hull node to copy the
source mesh custom data layout at all anyway, but do it anyway
to avoid having to change the tests right now.
Currently the `MLoopUV` struct stores UV coordinates and flags related
to editing UV maps in the UV editor. This patch changes the coordinates
to use the generic 2D vector type, and moves the flags into three
separate boolean attributes. This follows the design in T95965, with
the ultimate intention of simplifying code and improving performance.
Importantly, the change allows exporters and renderers to use UVs
"touched" by geometry nodes, which only creates generic attributes.
It also allows geometry nodes to create "proper" UV maps from scratch,
though only with the Store Named Attribute node for now.
The new design considers any 2D vector attribute on the corner domain
to be a UV map. In the future, they might be distinguished from regular
2D vectors with attribute metadata, which may be helpful because they
are often interpolated differently.
Most of the code changes deal with passing around UV BMesh custom data
offsets and tracking the boolean "sublayers". The boolean layers are
use the following prefixes for attribute names: vert selection: `.vs.`,
edge selection: `.es.`, pinning: `.pn.`. Currently these are short to
avoid using up the maximum length of attribute names. To accommodate
for these 4 extra characters, the name length limit is enlarged to 68
bytes, while the maximum user settable name length is still 64 bytes.
Unfortunately Python/RNA API access to the UV flag data becomes slower.
Accessing the boolean layers directly is be better for performance in
general.
Like the other mesh SoA refactors, backward and forward compatibility
aren't affected, and won't be changed until 4.0. We pay for that by
making mesh reading and writing more expensive with conversions.
Resolves T85962
Differential Revision: https://developer.blender.org/D14365
Edit-mesh duplicator logic used a struct member vert_coords which read
as an alternative (and inconsistent) naming to vert_positions.
Rename to `vert_positions_deform` as the purpose of this value is to
assign when modifiers deform an edit-mesh.
Add `_deform` suffix to normals as well.
Use font's OS/2 table code page range bits to help differentiate
between Korean, Japanese, Simplified & Traditional Chinese fonts.
See D16484 for details.
Differential Revision: https://developer.blender.org/D16484
Reviewed by Brecht Van Lommel
Wayland requires the windows surface size is divisible by the surface
scale. This wasn't guaranteed when creating new temporary windows.
This meant opening the preferences could exit Blender with an error
with Hi-DPI configurations.
**Changes**
As described in T93602, this patch removes all use of the `MVert`
struct, replacing it with a generic named attribute with the name
`"position"`, consistent with other geometry types.
Variable names have been changed from `verts` to `positions`, to align
with the attribute name and the more generic design (positions are not
vertices, they are just an attribute stored on the point domain).
This change is made possible by previous commits that moved all other
data out of `MVert` to runtime data or other generic attributes. What
remains is mostly a simple type change. Though, the type still shows up
859 times, so the patch is quite large.
One compromise is that now `CD_MASK_BAREMESH` now contains
`CD_PROP_FLOAT3`. With the general move towards generic attributes
over custom data types, we are removing use of these type masks anyway.
**Benefits**
The most obvious benefit is reduced memory usage and the benefits
that brings in memory-bound situations. `float3` is only 3 bytes, in
comparison to `MVert` which was 4. When there are millions of vertices
this starts to matter more.
The other benefits come from using a more generic type. Instead of
writing algorithms specifically for `MVert`, code can just use arrays
of vectors. This will allow eliminating many temporary arrays or
wrappers used to extract positions.
Many possible improvements aren't implemented in this patch, though
I did switch simplify or remove the process of creating temporary
position arrays in a few places.
The design clarity that "positions are just another attribute" brings
allows removing explicit copying of vertices in some procedural
operations-- they are just processed like most other attributes.
**Performance**
This touches so many areas that it's hard to benchmark exhaustively,
but I observed some areas as examples.
* The mesh line node with 4 million count was 1.5x (8ms to 12ms) faster.
* The Spring splash screen went from ~4.3 to ~4.5 fps.
* The subdivision surface modifier/node was slightly faster
RNA access through Python may be slightly slower, since now we need
a name lookup instead of just a custom data type lookup for each index.
**Future Improvements**
* Remove uses of "vert_coords" functions:
* `BKE_mesh_vert_coords_alloc`
* `BKE_mesh_vert_coords_get`
* `BKE_mesh_vert_coords_apply{_with_mat4}`
* Remove more hidden copying of positions
* General simplification now possible in many areas
* Convert more code to C++ to use `float3` instead of `float[3]`
* Currently `reinterpret_cast` is used for those C-API functions
Differential Revision: https://developer.blender.org/D15982
Since internal links are only runtime data, we have the flexibility to
allocating every link individually. Instead we can store links directly
in the node runtime vector. This allows avoiding many small allocations
when copying and changing node trees.
In the future we could use a smaller type like a pair of sockets
instead of `bNodeLink` to save memory.
Differential Revision: https://developer.blender.org/D16960
activeSnap --> transform_snap_is_active
activeSnap_SnappingIndividual --> transform_snap_project_individual_is_active
activeSnap_SnappingAsGroup --> transform_snap_mixed_is_active
applySnappingIndividual --> transform_snap_project_individual_apply
applySnappingAsGroup --> transform_snap_mixed_apply
Also rearrange functions to be close to where they are used.
And use static when possible.
When rendering in the viewport (or probably on instanced objects, but I didn't
test that), emissive objects whose scale is negative give the wrong value on the
"backfacing" input when multiple sampling is enabled.
The underlying problem was a corner case in how normal transformation is handled,
which is generally a bit messy.
From what I can tell, the pattern appears to be:
- If you first transform vertices to world space and then compute the normal from
them (as triangle light samping, MNEE and light tree do), you need to flip
whenever the transform has negative scale regardless of whether the transform
has been applied
- If you compute the normal in object space and then transform it to world space
(as the regular shader_setup_from_ray path does), you only need to flip if the
transform was already applied and was negative
- If you get the normal from a local intersection result (as bevel and SSS do),
you only need to flip if the transform was already applied and was negative
- If you get the normal from vertex normals, you don't need to do anything since
the host-side code does the flip for you (arguably it'd be more consistent to
do this in the kernel as well, but meh, not worth the potential slowdown)
So, this patch fixes the logic in the triangle emission code.
Also, turns out that the MNEE code had the same problem and was also having
problems in the viewport on negative-scale objects, this is also fixed now.
Differential Revision: https://developer.blender.org/D16952
- Avoid calling node interface items "sockets"
- Use "active" instead of "current" to be more correct
- Avoid using the same word in description and name
- A couple grammar fixes
- Matrix normalize overloads needs to have the vector normalize redefined.
- double underscore (anywhere in symbol name) are reserved.
- Some operation yield different result due to float imprecision. Increasing
epsilon threshold for the failing tests.
Incorrect offset was calculated when strip was implicitly retimed (movie
FPS does not match scene FPS). This is because strip playback rate was
not used for offset calculation at all.
Since hold offset is specifying numbers of frames to skip, but at frame
rate of the source, this could result in gap when splitting the strip.
If that occurs, gap is compensated by moving handle to frame where strip
is split.
Happens, for example, when the object has animation, and disabled for
render, and animation render is performed.
The regression has been uncovered by f12f7800c2 which made it so
the dependency graph relies on runtime visibility tracking and
updates (without updating relations).
The optimization from a while ago in the ff60dd8b18 got in a way
of the visibilit updates because it removed relation between two
no-op nodes which belong to different IDs, which make the visibility
tracking impossible.
This change makes it so only relations which belong to the same
component are removed. This matches the expectations of the visibility
tracking (which, actually, also needed to happen at the moment of the
initial optimization commit). Technically, this change could introduce
some performance regression, but with the current design design of the
graph it is not really avoidable.
The idea to gain the best performance is to separate relations which
actually define the execution flow, and which are only needed to
define things like visibility dependencies.
When drawing using the option `Outline` the result stroke
was not using the Vertex Color option and always was converted
using material.
Now the vertex color option is used.
Crash only occured when textures was stored in a gray scale GPU
texture and was scaled down to fit inside the given limitation.
In this case the original number of pixels were packed into the
GPU buffer, not taken into account the scaled down image. This
resulted in a buffer overflow.
The bug is caused by rBb66b3f547c43e841a7d5da0ecb2c911628339f56.
From what I can see, that fix was intended to enable manual lens shift for
panorama cameras, but it appears that it also unintentionally applies
interocular shift.
This fix disables the multiview shift for panorama cameras, that way manual lens
shift still works but we get the 2.x behavior for stereoscopic renders back.
Differential Revision: https://developer.blender.org/D16950
The code that computes and inverts the shutter CDF had some issues that caused
the result to be asymmetric, this tweaks it to be more robust and produce
symmetric outputs for symmetric inputs.
At the first bounce, the diffuse/glossy/transmission weights are stored so that
contributions along the path can be split into the d/g/t indirect passes.
However, volume bounces always set the weight even at indirect bounces, so
even paths that had their first bounce on a purely glossy object would suddenly
start counting towards the diffuse indirect pass after a secondary volume bounce.
Do not clear all the font's glyph caches with single-step zoom
operators if the area does not change font size when doing so.
See D16785 for more details.
Differential Revision: https://developer.blender.org/D16785
Reviewed by Campbell Barton
During geometry nodes evaluation some sockets can be determined
to be unused, for example based on the condition input in a switch node.
Once a socket is determined to be unused, that information has to be
propagated backwards through the tree to free any memory that may
have been reserved for those sockets already. This is happening before
this commit already, but in a less ideal way.
Determining that sockets are unused early is good because it helps with
memory reuse and avoids copy-on-write copies caused by shared data.
Now, nodes that are scheduled because an output became unused have
priority over nodes scheduled for other reasons.
This allows auto-vectorization to happen when the a multi-function is
evaluated in "materialized" mode, i.e. it is processed in chunks where
all input and outputs values are stored in contiguous arrays.
It also unifies the handling input, mutable and output parameters a bit.
Now they all can use tempory buffers in the same way.
Staging texture update copied over the entire texture, rather than just the region of the texture which had been updated. Also added early-exit for cases where the net texture update extent was zero, as this was causing validation failures.
Authored by Apple: Michael Parkin-White
Ref T103658
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T103658, T96261
Differential Revision: https://developer.blender.org/D16924
First binding of a framebuffer lead to an incorrect SRGB conversion state being applied, as attachments, where presence of SRGB is determined, were processed after the SRGB check rather than before.
This DIFF also cleans up SRGB naming conventions and caching of fallback non-srgb texture view, for use when SRGB mode is disabled.
Authored by Apple: Michael Parkin-White
Ref T103399
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T103399, T96261
Differential Revision: https://developer.blender.org/D16907
This simplifies the code enough so that msvc is able to unroll and
vectorize some multi-functions like simple addition.
The performance improvements are almost as good as the GCC
improvements shown in D16942 (for add and multiply at least).
Required texture bytesize calculation for compacted data types was incorrectly calculated, resulting in an erroneous format conversion taking place instead of direct data upload.
Metal dummy buffer size also temporarily increased to address problematic cases where the bound buffer was too small for missing UBOs.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T96261
Differential Revision: https://developer.blender.org/D16904
This was caused by rB0d73d5c1a2, which releases the scene mutex during kernel
loading. However, the reset mutex was still held, which can cause a deadlock
if another thread tries to reset the session, since it will acquire the
released scene mutex and then wait for the reset mutex.
Turns out there's no point in keeping the reset mutex locked after the delayed
reset section, so now we just release it earlier, which resolves the deadlock.
This mainly helps GCC catch up with Clang in terms of field evaluation
performance in some cases. In some cases this patch can speedup
field evaluation 2-3x (e.g. when there are many float math nodes).
See D16942 for a more detailed benchmark.
This moves all multi-function related code in the `functions` module
into a new `multi_function` namespace. This is similar to how there
is a `lazy_function` namespace.
The main benefit of this is that many types names that were prefixed
with `MF` (for "multi function") can be simplified.
There is also a common shorthand for the `multi_function` namespace: `mf`.
This is also similar to lazy-functions where the shortened namespace
is called `lf`.
* `depends_on_context` was not used for a long time already.
* `param_data_indices` is not used since rB42b88c008861b6.
* The remaining data is moved to a single `Vector` to avoid
having to do two allocations when the size signature becomes
larger than fits into the inline buffer.
This avoids a move of the signature after building it. Tthe value had
to be moved out of `MFSignatureBuilder` in the `build` method.
This also makes the naming a bit less confusing where sometimes
both the `MFSignature` and `MFSignatureBuilder` were referred
to as "signature".
* New `build_mf` namespace for the multi-function builders.
* The type name of the created multi-functions is now "private",
i.e. the caller has to use `auto`. This has the benefit that the
implementation can change more freely without affecting
the caller.
* `CustomMF` does not use `std::function` internally anymore.
This reduces some overhead during code generation and at
run-time.
* `CustomMF` now supports single-mutable parameters.
This refactors how devirtualization is done in general and how
multi-functions use it.
* The old `Devirtualizer` class has been removed in favor of a simpler
solution. It is also more general in the sense that it is not coupled
with `IndexMask` and `VArray`. Instead there is a function that has
inputs which control how different types are devirtualized. The
new implementation is currently less general with regard to the number
of parameters it supports. This can be changed in the future, but
does not seem necessary now and would make the code less obvious.
* Devirtualizers for different types are now defined in their respective
headers.
* The multi-function builder works with the `GVArray` stored in `MFParams`
directly now, instead of first converting it to a `VArray<T>`. This reduces
some constant overhead, which makes the multi-function slightly
faster. This is only noticable when very few elements are processed though.
No functional changes or performance regressions are expected.
This implement most of the functions provided by the BLI math library.
This is part of the effort to unify GLSL and C++ syntax. Ref T103026.
This also adds some infrastructure to make it possible to run GLSL shader unit
test.
Some code already present in other libs is being copied to the new libs.
This patch does not make use of the new libs outside of the tests.
Note that the test is still crashing when using metal.
This was limiting the use of the templates with other non internal types
like Ceres types, xithout defining thing like that:
`template<> inline constexpr bool is_math_float_type<mpq_class> = true;`
This breaks backwards compatibility some in that 3 sides will be mapped
differently now, but difficult to avoid and can be considered a bugfix.
Similar to rBdd8016f7081f.
Maniphest Tasks: T103615
Differential Revision: https://developer.blender.org/D16910
This patch implements the matrix types (i.e:float4x4) by making heavy
usage of templating. All matrix functions are now outside of the vector
classes (inside the blender::math namespace) and are not vector size
dependent for the most part.
###Motivations
The goal/motivations of this rewrite are the same as the Vector C++ API (D13791):
- Template everything for making it work with any types and avoid code duplication.
- Use functional style instead of Object Oriented function call to allow a simple compatibility layer with GLSL syntax (see T103026 for more details).
- Allow most convenient constructor syntax and accessors (array subscript `matrix[c][r]`, or component alias `matrix.y.z`).
- Make it cover all features the current C API supports for adoption.
- Keep compilation time and debug performance somehow acceptable.
###Consideration:
- The new `MatView` class can be generated by `my_float.view<NumCol, NumRow, StartCol, StartRow>()` (with the last 2 being optionnal). This one allows modifying parts of the source matrix in place. It isn't pretty and duplicates a lot of code, but it is needed mainly to replace `normalize_m4`. At least I think it is a good starting point that can refined further.
- An exhaustive list of missing `BLI_math_matrix.h` functions from the new API can be found here P3373.
- This adds new Rotation types in order to have a clean API. This will be extended when we port the full Rotation API. The types are made so that they don't allow implicit down-casting to their vector representation.
- Some functions make direct use of the Eigen library, bypassing the Eigen C API defined in `intern/eigen`. Its use is contained inside `math_matrix.cc`. There is conflicting opinion wether we should use it more so I contained its usage to almost the tasks as in the C API for now.
Reviewed By: sergey, JacquesLucke, HooglyBoogly, Severin, brecht
Differential Revision: https://developer.blender.org/D16625
Profiling shows that this computation consumes a noticeable amount
of time, so it is worth moving it to an earlier part of the code
that is executed less frequently and is multithreaded.
Differential Revision: https://developer.blender.org/D16933
Both cloth object collision and self collision use a BVH tree
representing the current cloth shape. The only difference between
them is the epsilon threshold value.
If these values are the same, it is possible to use the same tree
for both uses, thus easily reducing the overhead in the case when
both collision modes are used by the same cloth object.
Differential Revision: https://developer.blender.org/D16914
Caused by f1c0249f34, which filled the wrong value.
I have noticed several problems:
- Using a full array as single result.
- Checking single material index for 0. If we have a list of all slots,
then we must check this in the list.
- The result was filled false. Simple fix.
- Fixed problem with incorrect recording by mask indices, not polygons.
- Added domain specifics to names to avoid confusion.
Differential Revision: https://developer.blender.org/D16926
Previously you had to use a workaround with the Object info node to get
evaluated data from the new curves object to an original editable mesh.
This commit makes it so that a curves object can be converted directly
to a mesh object if it has evaluated curves or an evaluated mesh.
Differential Revision: https://developer.blender.org/D16930
Socket locations are set while drawing the node tree in the editor.
They can always be recalculated this way based on the node position and
other factors. Storing them in the socket is misleading. Plus, ideally
sockets would be quite small to store, this helps us move in that
direction.
Now the socket locations are stored as runtime data of the node editor,
making use of the new node topology cache's `index_in_tree` function
to make a SoA layout possible.
Differential Revision: https://developer.blender.org/D15874
Improve animation playback performance in EEVEE for materials using Mix
nodes. Socket availability was being set and reset on every evaluation
of Mix nodes, during animation playback, this was causing the graph to
be marked dirty, and the whole graph being re-evaluated on every frame,
causing performance issues during playback.
Additionally, do a bit of cleanup, traversing the node sockets with
the next link to improve clarity and reduce errors. Also refactoring
`nodeSetSocketAvailability` to early out and increase clarity on no-op.
Differential Revision: https://developer.blender.org/D16929
The reported backtrace in T102766 strongly points at some
concurrency issues within exisitng liboverride diffing code that
restores forbidden changes to reference linked data values.
This commit instead add tags to mark liboverrides/properties that need
to be restored, and do so in a separate new step of diffing, from the
main thread only.
This patch moves the realtime compositor out of experimental. See
T99210.
The first milestone is finished with regards to implementing most
essential nodes for single pass compositing. It is also now documented
in the manual and no major issues are known.
Differential Revision: https://developer.blender.org/D16891
Reviewed By: Clement Foucault
This patch allows the realtime compositor to be limited to a specific
compositing region that is a subset of the full render region. In the
context of the viewport compositor, when the viewport is in camera view
and has a completely opaque passepartout, the compositing region will be
limited to the visible camera region.
On the user-level, this gives the user the ability to make the result of
the compositor invariant of the aspect ratio, shift, and zoom of the
viewport, making the result in the viewport identical to the final
render compositor assuming size relative operations.
It should be noted that compositing region is the *visible* camera
region, that is, the result of the intersection of the camera region and
the render region. So the user should be careful not to shift or zoom
the view such that the camera border extends outside of the viewport to
have the aforementioned benefits. While we could implement logic to fill
the areas outside of the render region with zeros in some cases, there
are many other ambiguous cases where such a solution wouldn't work,
including the problematic case where the user zooms in very close,
making the camera region much bigger than that of the render region.
Differential Revision: https://developer.blender.org/D16899
Reviewed By: Clement Foucault
Previously when on frame 2.5 and trying to jump to a
keyframe that was on frame 2, it would instead jump past it.
Now it properly respects the subframes for that.
Reviewed by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D16651
Ref: D16651
The "While Held" option from the Pose Propagate Operator
doesn't do anything meaningful.
After talking with the Animation Module it was decided to remove it.
In code it was called `POSE_PROPAGATE_SMART_HOLDS`
Reviewed by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D16771
Ref: D16771
Ideally, we would also get variance information out of the test, but that
seems a bit more complex to implement. For now just run the test a couple
of times and average the timings.
The test now runs between 5 and 100 times, depending on how long it
to run the test once.
I noticed that sometimes the geometry nodes benchmark would not work
if there were some left-over debug prints in the code. The reason it did
not work was because the prints were mixed with the test output print.
I also tried using explicit flusing and `atexit` for printing the test output,
but that didn't solve it. Just printing additional newlines to better separate
the test output from other printed output helped though.
Using negative blend factors for blending in flipped poses was undesirable.
Instead, the pose blending operator now uses CTRL to flip the pose.
Negative blend values are still allowed, and cause the pose asset to be
subtracted from the current pose. It can quickly break the rig, but for
small adjustments it can be useful.
The slider component can now be told to not use CTRL for toggling stepped
10% increments. This is useful when the operator that uses the slider needs
that modifier key for its own purposes.
Initial error caused by 1efc94bb2f and fixed in 6a7917162c. However
the empty index files (empty as in, they contain the version number but
no assets) will have to be fixed somehow, since otherwise assets don't
show up at all for people who saved asset files in a broken version.
Delete empty index files if the modification timestamp indicates a time
when the bug was present (plus a day before and after, to address
possible time zone differences). This will basically make Blender skip
the optimization for .blend files without assets for one load, but even
then the index should still produce faster results than a completely
non-index read.
This can be removed after a while, it's just a (much needed) fix for
people who were using alpha/beta builds.
Differential Revision: https://developer.blender.org/D16678
Reviewed by: Jeroen Bakker
The use of `std::variant` allows combining the four vectors
into one which more closely matches the intend and avoids
a workaround used before.
Note that this uses `std::get_if` instead of `std::get` because
`std::get` is only available since macOS 10.14.
Issue comes from the fact that some of the image updates are handled
outside of depsgraph context (through the signal system), and therefore
completely ignored by the undo/redo code.
Now that undo/redo tries to update as little data as possible, it needs
to be aware of these changes.
As a temporary workaround, until image update is fully handled through depsgraph,
consider that IDs tagged with `ID_RECALC_SOURCE` should get their caches
cleared on undo/redo, and tag some RNA property updates of
Image/ColorSpace as such.
Reviewed By: sergey
Maniphest Tasks: T103242
Differential Revision: https://developer.blender.org/D16927
This workaround is no longer needed and prevents our OCIO configuration
from being loaded if Blender is unpacked under a Unicode path.
Differential Revision: https://developer.blender.org/D16818
Multiple improvements to UV Cylinder and UV Sphere projection including:
* New option "Pinch" or "Fan" to improve unwrap of faces at the poles.
* Support for "Polar ZY" option on "View On Equator" and "Align To Object"
* Better handling of inputs with round-off error.
* Improved handling of faces touching the unit square border.
* Improved handling of very wide quads spanning the right hand border.
* Improved accuracy near to (0, 0).
* Code cleanup and simplification.
Differential Revision: https://developer.blender.org/D16869
- Add parentheses to suppress an assertion on some compilers.
- It turns out cloth self-collision math is not precisely symmetric,
so sort the triangle index pair to restore behavior exactly identical
to the version before the new traversal.
Follow up to rB0796210c8df32
Previously cloth self-collision and other code that wants self-overlap
data was using an ordinary BVH overlap utility function. This works,
but is suboptimal because it fails to take advantage of the fact that
it is comparing two identical trees.
The standard traversal for self-collision essentially devolves into
enumerating all elements of the tree, and then matching them to the
tree starting at the root. However, the tree itself naturally partitions
the space, so overlapping elements are likely to be mostly placed nearby
in the tree structure as well.
Instead, self-overlap can be computed by recursively computing ordinary
overlap between siblings within each subtree. This only considers each
pair of leaves once, and provides significantly better locality.
It also avoids outputting every overlap pair twice in different order.
Differential Revision: https://developer.blender.org/D16915
To better estimate light contribution. Note that estimating the texture
from the IES file is still missing.
Contributed by Alaska.
Differential Revision: https://developer.blender.org/D16901
This patch adds two new panels in which users can control
offset (position, rotation, scale) by layer and by stroke number.
Use cases:
- if you want to create array of Suzannes and place them one behind
another, in 2d mode, Z depth will be wrong.
In 3d mode there will be Z fighting. With combination of stroke
and layer offset we can fight this issue without touching original drawing.
- even easier way to create 2.5d environments..
simply draw on layers and then displace them in one panel
instead fiddling with every layer individually
Possible improvements:
- add offset by material slot
- add step parameter, to allow displacing groups of N strokes.
{F13129598}
Reviewed By: mendio, antoniov
Differential Revision: https://developer.blender.org/D15106
Due an internal scale of the brush size done by grease pencil
draw tool (this scale factor cannot be removed), the size of the
radial control is not equal to the actual stroke thickness and
this makes the radial size displayed useless.
This patch adds a new property that allows to pass the
path of the tool path and this value is used to apply
the correct scale to the radial size.
Reviewed By: mendio, frogstomp, pepeland, brecht
Differential Revision: https://developer.blender.org/D16866
Use NodeTree.bl_label instead of "NodeTree" for more descriptive name.
Implemented by Iliya Katueshenock.
Differential Revision: https://developer.blender.org/D16856
Since rBcommit 74c4977a the pose library blending operator can extrapolate.
This is now also reflected in the hard min/max value of the blend factor
RNA property. The soft min/max are still -1/1 to indicate normal use.
While blending, press E to enable extrapolation / overshoot of the pose.
It will make it possible to blend in more than 100% of the pose asset.
This has the potential to completely break the rig, but it can be useful
to exaggerate poses when used with caution.
This was the case when an Annotation is also present as in the report.
Since {rB92d7f9ac56e0}, Dopesheet is aware of greaspencil/annotations
(displays its channels/keyframes, can rename their data, layers, fcurve
groupings etc.). However, the Graph Editor does not display these /
should not be aware of them.
Above commit already had issues that were addressed in the following
commits (mostly adding the new `ANIMFILTER_FCURVESONLY` to places that
dont handle greasepencil/annotations)
- {rBfdf34666f00f}
- {rB45f483681fef}
- {rBa26038ff3851}
Now in T103303 it was reported that doublicking a channel would not
select all fcurve`s keyframes anymore and this wasnt actually an issue
with that particular operator, but instead with another operator that is
also mapped to doubleclicking: the channel renaming (I assume the
keyconflict here is actually wanted behavior).
Channel renaming would not return `OPERATOR_PASS_THROUGH` here anymore
in the case nothing cannot be renamed, so we would not actually reach
the 2nd operator at all (the one selecting all keyframes).
Deeper reason for this is that the renaming operator would actually
"see" a channel that could be renamed (in the case of the report: an
annotation layer), but then cannot proceed, because the "real"
underlying data where the doubleclick happens is an fcurve...
So now exclude non-greasepencil channels in filtering as well where
appropriate by also adding `ANIMFILTER_FCURVESONLY` to the filter there.
Fixes T103303.
Maniphest Tasks: T103303
Differential Revision: https://developer.blender.org/D16871
Multiframe copy paste operations were prohibited by a block of code.
While this is understandable as it prevents confusing actions, there is a good use case to allow multiframe copy pasting.
This patch does:
- remove restricting block of code
- adds outer loops for frames both in copy and paste actions.
In copy action it will create an array of selected strokes from all selected frames
In paste action it will create new from previous copy action merged to a single frame. It will paste to all selected frames and create new frame if autokey is on and time cursor is not on any of the keyframes.
The main usecase is for creating motion smears as in examples attached. The user still need to do some actions in order to achieve desired look, such as stroke ordering and deleting excessive strokes.
{F14069747}
{F14069743}
Reviewed By: antoniov, mendio
Differential Revision: https://developer.blender.org/D16805
This issue was introduced in rB78f28b55d39288926634d0cc.
The fix is to use a `std::shared_ptr` to ensure that the `Global` will live
long enough until all `Local` objects are destructed.
This was quite a fight, some resulting notes:
* We cannot use anymore Boost packages because of a weird bug breaking
Blender debug builds and ivolving Boost, TBB and USD (see also
rB019b930d6b9c).
* OCIO, OIIO, OpenVDB and USD build options where updated to match these
from cmake libs building.
** Most notably, USD now has imaging, OIIO, OpenVDB and GL support.
Ref. T99618.
Previously, the lifetimes of anonymous attributes were determined by
reference counts which were non-deterministic when multiple threads
are used. Now the lifetimes of anonymous attributes are handled
more explicitly and deterministically. This is a prerequisite for any kind
of caching, because caching the output of nodes that do things
non-deterministically and have "invisible inputs" (reference counts)
doesn't really work.
For more details for how deterministic lifetimes are achieved, see D16858.
No functional changes are expected. Small performance changes are expected
as well (within few percent, anything larger regressions should be reported as
bugs).
Differential Revision: https://developer.blender.org/D16858
It is a part of old-standing TODO, and code which accesses
the value was commented out for many years.
Remove the field to help with an upcoming const-correctness
improvements.
To aid in debugging the case where your compiler is too old for Blender,
actually log which version CMake found.
Before, CMake would output:
```
CMake Error at CMakeLists.txt:121 (message):
The minimum supported version of GCC is 11.0.0
```
With the patch, it logs:
```
CMake Error at CMakeLists.txt:121 (message):
The minimum supported version of GCC is 11.0.0, found 10.4.0
```
This has been implemented for GCC and Clang. MSVC has been explicitly
excluded, as the version numbers used for this comparison are internal
versions and not directly usable/recognisable.
Reviewed By: LazyDodo, brecht
Differential Revision: https://developer.blender.org/D16849
Change the logic for propagating poses such that it checks keyframes
on all selected bones to determine the frame on which a pose
should be propagated to.
It then adds keyframes if they don't exist on whatever
frame the pose should be propagated to.
Reviewd by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D16654
Ref: D16654
Added a new operator that aligns selected keys on an exponential curve
Revied by Reviewed by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D9479
Ref: D9479
Although viewport compositor isn't supported yet on Apple deviced the
shaderlibs are compiled. The compositor shaders uses mat3 constructor
with a single vec3 and 6 floats. This constructor wasn't defined in
metal so it failed the compilation.
This patch adds the override to mat3.
This patch adds a new "Kernel Optimization Level" dropdown menu to control Metal kernel specialisation. Currently this defaults to "full" optimisation, on the assumption that the changes proposed in D16371 will address usability concerns around app responsiveness and shader cache housekeeping.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D16514
For some reason I don't understand, the dragged link is sorted across
all the node's multi-input sockets. This leads to problems when there
are multiple sockets to sort. With this patch, I'm making the feature
work more directional.
Differential Revision: https://developer.blender.org/D16892
Reading or writing a vertex group is expensive enough that it's worth
parallelizing. On a Ryzen 3700x, in a grid of 250k vertices with
30 randomly assigned vertex groups (each to 10-50% of vertices),
I observed a 4x improvement for writing to a group and a 3x
improvement when reading their data. This significantly speeds
up nodes that create a new mesh from a mesh that had vertex groups.
Previously, this happened when the "node task" first runs, which might
not actually execute the node if there are missing inputs. Deferring the
allocation of storage and default inputs allows for better memory reuse
later (currently the memory is not reused).
Since 78f28b55d3, allocating on multiple threads is much
faster, making it a nice improvement to parallelize vertex group
operations. This patch adds multi-threading when removing a
vertex group from the "Remove Named Attribute" node.
On a Ryzen 3700x:
Before: `(Average: 15.6 ms, Min: 15.0 ms)`
After: `(Average: 8.1 ms, Min: 7.6 ms)`
Differential Revision: https://developer.blender.org/D16916
All kernel specialisation is now performed in the background regardless of kernel type, meaning that the first render will be visible a few seconds sooner. The only exception is during benchmark warm up, in which case we wait for all kernels to be cached. When stopping a render, we call a new `cancel()` method on the device which causes any outstanding compilation work to be cancelled, and we destroy the device in a detached thread so that any stale queued compilations can be safely purged without blocking the UI for longer than necessary.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D16371
If we change the radius of a point or spot lamp, we also change the area lamp size.
As shown in T102853, this is bad for animating the lamp type.
The solution is to make the property point to another member of the DNA
struct `Light`.
Differential Revision: https://developer.blender.org/D16669
The members `soft`, `bleedbias`, `bleedexp` and `contact_spread` were
deprecated in rBd8aaf25c23fa, and are no longer really used.
`soft` is only used by Collada as an extra value for exporting and
importing Blender files in collada.
`bleedexp` and `contact_spread` are only used in versioning to
initialize a default value.
Reviewed By: brecht, fclem
Differential Revision: https://developer.blender.org/D16834
Both, the guarded and lockfree allocator, are keeping track of current
and peak memory usage. Even the lockfree allocator used to use a
global atomic variable for the memory usage. When multiple threads
use the allocator at the same time, this variable is highly contended.
This can result in significant slowdowns as presented in D16862.
While specific cases could always be optimized by reducing the number
of allocations, having this synchronization point in functions used by
almost every part of Blender is not great.
The solution is use thread-local memory counters which are only added
together when the memory usage is actually requested. For more details
see in-code comments and D16862.
Differential Revision: https://developer.blender.org/D16862
This is now only an indirect dependency on shared libraries, which means
this combination is valid.
Also remove mechanism that automatically disabled WITH_BOOST if no libraries
are using it, this is no longer really helpful with shared boost libraries.
"show_expanded" did not dirty the keymap diff cache, leading to old flags
being written to the item when another item was edited.
Differential Revision: https://developer.blender.org/D13418
There are dependencies between shared libraries, and Python modules which are
always installed on Linux and macOS can use these also.
Instead of adding logic for dealing with dependencies and conditional Python
module installs, just always install everything when using precompiled
libraries. This does not affect compile time which would be the main reason to
turn off build options, and it does not affect the case where system libraries
are used.
More automatic and convenient to update existing configurations this way.
Also move into platform_old_libs_update.cmake where similar logic was put
already.
WLROOTS compositors don't run surface leave callbacks,
while this may be considered a bug in WLROOTS, neither GTK/SDL crash
so workaround the crash too.
This also fixes a minor glitch where the cursor scale wasn't updated
when changing monitor scale at run-time.
Use the same `".selection"` attribute for both curve and point domains,
instead of a different name for each. The attribute can now have
either boolean or float type. Some tools create boolean selections.
Other tools create float selections. Some tools "upgrade" the attribute
from boolean to float.
Edit mode tools that create selections from scratch can create boolean
selections, but edit mode should generally be able to handle both
selection types. Sculpt mode should be able to read boolean selections,
but can also and write float values between zero and one.
Theoretically we could just always use floats to store selections,
but the type-agnosticism doesn't cost too much complexity given the
existing APIs for dealing with it, and being able to use booleans is
clearer in edit mode, and may allow future optimizations like more
efficient ways to store boolean attributes.
The attribute API is usually used directly for accessing the selection
attribute. We rely on implicit type conversion and domain interpolation
to simplify the rest of the code.
Differential Revision: https://developer.blender.org/D16057
Finding the active view item button should only happen when it's actually
necessary, since looping through all buttons and blocks is an expensive
operation. This patch limits the search a bit more, to left clicks (the only
case that is actually handled).
This improves drawing performance in the node editor slightly,
where this was a bottleneck.
Differential Revision: https://developer.blender.org/D16882
This functionality is related only to debugging of SYCL implementation
via single-threaded CPU execution and is disabled by default.
Host device has been deprecated in SYCL 2020 spec and we removed it
in 305b92e05f.
Since this is still very useful for debugging, we're restoring a
similar functionality here through SYCL 2020 Host Task.
When pasting nodes with the shortcut or the context menu, place the
center of the selected nodes at the same position as the mouse cursor.
This should save time, and is more intuitive because the new nodes are
actually visible.
Based on a patch by Juanfran Matheu (@jfmatheu).
Differential Revision: https://developer.blender.org/D10787
The main change is returning a socket pointer instead of using two
return arguments. Also use the topology cache instead of linked lists,
references over pointers, and slightly adjust whitespace.
* Add missing constructor for squared matrix types.
* Use using instead of define for typenames.
* Add `==, !=, unary-` operators
* Catch all functional style constructors inside the regex
Always hide the area header contents when the slider UI component is used.
This prevents the slider from being drawn semi-transparently on top of
other UI elements.
Avoid saving the 'flipped' operator property of the "apply pose asset"
(`POSELIB_OT_apply_pose_asset`) operator. This caused problems: when
choosing "Apply Pose Flipped" in the asset browser, double-clicking a pose
would cause it to always be flipped.
Interactive blending of poses can now use negative factors (i.e. drag to
the left) to blend in the flipped pose.
This reverts rB6eb1c98b15bb7ea6cf184b08617f24c7afb91b6c where the F key
was used to flip the pose. That was already described as stop-gap
measure, and the new behaviour is more intuitive & direct.
Functionality over-the-shoulder reviewed by @hjalti.
Add a field `is_bidirectional` to sliders (`tSlider`). By defafult this
is `false`; when set to `true` the slider allows negative values.
The allowed ranges are now:
- No overshoot, no bidirectional: `[0, 1]`
- No overshoot, bidirectional: `[-1, 1]`
- Overshoot, no bidirectional: `[0, infinity)`
- Overshoot, bidirectional: `(-infinity, infinity)`
This will be used for the pose library blending operator, where sliding
to the right (postitive) blends as normal, and sliding to the left
(negative) flips the pose before blending.
This is part of D16858. Iterating over all field inputs allows us to extract
all anonymous attributes used by a field relatively easily which is necessary
for D16858.
This could potentially be used for better field tooltips for nested fields,
but that needs further investigation.
This is part of D16858 but is also useful for other purposes.
The changes to the node declaration in this commit allow us to figure
out which fields might be evaluated on which geometries statically (without
executing the node tree). This allows for deterministic anonymous attribute
handling, which will be committed separately. Furthermore, this is necessary
for usability features that help the user to avoid creating links that don't
make sense (e.g. because a field can't be evaluated on a certain geometry).
This also allows us to better separate fields which depend or don't depend
on anonymous attributes.
The main idea is that each node defines some relations between its sockets.
There are four relations:
* Propagate relation: Indicates that attributes on a geometry input can be
propagated to a geometry output.
* Reference relation: Indicates that an output field references an inputs field.
So if the input field depends on an anonymous attribute, the output field
does as well.
* Eval relation: Indicates that an input field is evaluated on an input geometry.
* Available relation: Indicates that an output field has anonymous attributes
that are available on an output geometry.
These relations can also be computed for node groups automatically, but that
is not part of this commit.
This was the case when done via the py-API.
Now also set active_color_attribute / default_color_attribute on newly
created attributes (in case none exist yet).
Maniphest Tasks: T103564
Differential Revision: https://developer.blender.org/D16898
Python API for moving strips to and from meta strips did not invalidate
strip lookup cache. Because of that, `SEQ_get_seqbase_by_seq()` failed
to lookup origin of strip, which resulted in crash on NULL dereference.
Invalidateion was added to functions `SEQ_edit_move_strip_to_meta()` and
`SEQ_add_meta_strip()`.
Partly a cleanup, but also iterating over spans can be faster than
linked lists. Also rewrite the multi-input socket link counting
to avoid the need for a temporary map. Overall, on my setup the changes
save about 5% (3ms) when drawing a large node tree (the mouse house file).
Small memory allocations are a bottleneck when drawing large node trees.
Avoid them by passing the socket index in the whole tree and getting the
tree from the context rather than allocating structs for the tree, node,
and socket. The performance improvement will be a few percent at most.
This was an oversight in rBdba2d828462ae22de5.
The evaluator uses multiple threads to initialize node states
but it is still in single threaded mode.
`get_main_or_local_allocator` did not return the right allocator
in this case.
During pose blending, when flipping the pose with {key F}, the pose
backup needs to be recreated. Without this, the blending wouldn't be
done properly.
F-for-flipping was introduced in rB6eb1c98b15bb7ea6cf184b08617f24
While blending poses from the pose library, press {key F} to flip the
pose.
Since rBc164c5d86655 removed the "Flip Pose" checkbox, there was no more
way to blend poses flipped.
Note that this is a bit of a stop-gap measure. The goal is to have a
bidirectional blend slider, where dragging to the left flips the pose,
and dragging to the right blends it normally.
As an optimization, dependency graph evaluation skips through
no-op nodes at the scheduling stage. However, that leaves update
flags enabled on the node, and the most problematic one is the
USER_MODIFIED flag, which get flushed to children every time
the no-op node is tagged.
This in turn can cause simulation caches downstream to be
permanently stuck in an outdated state until the depsgraph
is rebuilt and the stuck flag cleared out.
Differential Revision: https://developer.blender.org/D16868
The BONE_SEGMENTS operation node is only created if the bone is
actually a B-Bone. One location in the code wasn't checking that
before trying to create a relation.
Move some functions for transforming a span of vectors to a header
and call them from these functions, just like was done for curves
objects recently.
Resolves T102027, T102026
Differential Revision: https://developer.blender.org/D16883
Expose `BKE_pose_apply_action_blend` and a simplified pose backup system
to RNA. This will make it possible to easily create some interactive
tools in Python for pose blending.
When creating a backup via this API, it is stored on the
`Object::runtime` struct. Any backup that was there before is freed
first. This way the Python code doesn't need access to the actual
`PoseBackup *`, simplifying memory management.
The limitation of having only a single backup shouldn't be too
problematic, as it is meant for things like interactive manipulation of
the current pose. Typical use looks like:
- Interactive operator starts, and creates a backup of the current pose.
- While the operator is running:
- The pose backup is restored, so that the next steps always use the
same reference pose.
- Depending on user input, determine a blend factor.
- Blend some pose from the pose library into the current pose.
- On confirmation, leave the pose as-is.
- On cancellation, restore the backup.
- Free the backup.
`BKE_pose_apply_action_blend` is exposed to RNA to make the above
possible.
An alternative approach would be to rely on the operator redo system.
However, since for poses this would use the global undo, it can get
prohibitively slow. This change is to make it easier to prototype
things; further into the future the undo system for poses should be
improved, but that's an entire project on its own.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D16900
While the cost of creating AttributeAccessor and finding the "material_index"
attribute is not large, there's really no need to do that for each
polygon. Move the access outside of the per-polygon loop.
Move `pose_backup.cc` from `editors/armature` to `blenkernel`. This is
in preparation of an upcoming change where the pose backup is going to be
owned by the `Object`. This will need to be automatically cleared when the
object is freed, which means that `blenkernel` needs the corresponding
logic.
Technically only the freeing code could be moved, but I felt it made more
sense to keep the related code together.
No functional changes.
The "osl_texture" intrinsic was not implemented correctly. It should handle alpha
separately from color, the number of channels input parameter only counts color
channels.
There are two underlying issues which got uncovered by the report:
First, is that the poll() function for the operator was using legacy
API which is on its way of removal in the next major version release.
This part is fixed in this patch based on a patch provided by Philipp
Oeser (P3389) with the modification that the `clip` is not accessed
prior to None check. Ended up in a bit annoying one-liner, the entire
function could be refactored to use early returns.
The second issue is that the Python access to the legacy property
was wrong: need to access camera reconstruction instead of accessing
deprecated DNA field.
Some files out there (e.g. in T103441) contain face definitions with
four indices, which the importer code was not expecting. The OBJ
standard spells out up to three indices per face corner; the file in
there must be using some sort of non-standard OBJ syntax extension.
Now the code simply ignores any trailing per-face-corner data.
Similar to T98782 that was about normal indices: some files out there
are technically "wrong" since they refer to UV indices, without ever
defining any UVs. If the file does not have any UVs, simply ignore UV
indices in the OBJ face definitions. Fixes T103212.
It's confusing for users when the Dopesheet's Editor Buttons for Grease Pencil are greyed out.
{F14099985}
[[ https://blenderartists.org/t/cant-create-new-layers-in-grease-pencil-dopesheet/1353882 | Can’t create new layers in grease pencil dopesheet ]]
This is often because the 'Only Show Selected' filter is disabled. This 'requirement' does not seem to be necessary since the Dopesheet is already in Grease Pencil mode and there is an active Grease Pencil Object. It is also not apparent as to why so many Operators depend on it and unintuitive that it controls their function. The 'Only Show Selected' filter button is far away from the Operator buttons in the User Interface Header, so it's difficult to make the association.
If the 'Only Show Selected' IS absolutely required, I believe it should be closer to the DOPESHEET_HT_editor_buttons. Otherwise, I think the requirement should be removed.
Reviewed By: antoniov
Differential Revision: https://developer.blender.org/D16885
Based on suggestion from Ray molenkamp (@LazyDodo), thanks.
Also fix patching of OSL code, would not work properly when using repo
checkout instead of archive download.
Re. T99618.
- Move from blenkernel to the node editor, the only place it was used
- Use two vectors instead of ListBase
- Remove define for validating the clipboard, which shouldn't be skipped
- Comment formatting, other small cleanups to whitespace
Differential Revision: https://developer.blender.org/D16880
The geometry nodes evaluator supports "lazy threading", i.e. it starts out
single-threaded. But when it determines that multi-threading can be
benefitial, it switches to multi-threaded mode.
Now it only creates an enumerable-thread-specific if it is actually using
multiple threads. This results in a 6% speedup in my test file with many
node groups and math nodes.
When these declarations are built without the help of the special
builder class, it's much more convenient to set them directly rather
than with a constructor, etc. In most other situations the declarations
should be const anyway, so theoretically this doesn't affect safety too
much. Most construction of declarations should still use the builder.
Whenever a node group is entered during evaluation, a new compute
context is entered which has a corresponding hash. When node groups
are entered and exited a lot, this can have some overhead. In my test
file with ~100.000 node group invocations, this patch improves performance
by about 7%.
The speedup is achieved in two ways:
* Avoid computing the same hash twice by caching it.
* Invoke the hashing algorithm (md5 currently) only once instead of twice.
Geometry nodes used to log all socket values during evaluation.
This allowed the user to hover over any socket (that was evaluated)
to see its last value. The problem is that in large (nested) node trees,
the number of sockets becomes huge, causing a lot of performance
and memory overhead (in extreme cases, more than 70% of the
total execution time).
This patch changes it so, that only socket values are logged that the
user is likely to investigate. The simple heuristic is that socket values
of the currently visible node tree are logged.
The downside is that when the user changes the visible node tree, it
won't have any logged values until it is reevaluated. I updated the
tooltip message for that case to be a bit more precise.
If user feedback suggests that this new behavior is too annoying, we
can always add a UI option to log all socket values again. That shouldn't
be done without an actual need though because it takes up UI space.
Differential Revision: https://developer.blender.org/D16884
Read the selection attribute on the proper domain using implicit
interpolation rather than just using its oiginal domain that might
not match the domain of the color attribute.
Lazy-function graphs are now evaluated properly even if they contain
cycles. Note that cycles are only ok if there is no data dependency cycle.
For example, a node might output something that is fed back into itself.
As long as the output can be computed without the input that it feeds into,
everything is ok.
The code that builds the graph is responsible for making sure that there
are no actual data dependencies.
This patch adds rename popup when using Y key to switch
active layer and choosing New layer in Draw mode.
It follows https://developer.blender.org/D15092, which introduced this
for moving selected strokes to layers in Edit mode.
Reviewed By: antoniov
Differential Revision: https://developer.blender.org/D16877
OIIO: 2.4.6.0
OpenVDB: 10.0.0
OSD: 3.5.0
OCIO: 2.2.0
NOTE: Had to fight OpenVDB to force it to use 'deprecated' TBB 2020, it
really wants to use oneTBB when it can find it.
Re. T99618.
Use socket indices to keep track of logged values instead of their
identifiers. This decreases memory pressure when there are many
sockets. In cases with many cheap nodes, this can give a relatively
large improvement to overall performance. We observed a 15% increase
in a case with many math nodes and a larger increase in an experimental
softbody node setup. The log is invalidated when we add/remove/move
sockets anyway.
This is the best way I found to make building socket declarations without
the builder helper class work. Besides a vague hope for non-leaky
abstractions, I don't think there's any reason for these fields not to be
accessible directly.
Ref D16850
Fix warning generated due to the full-stop in the description message of
the property `use_auto_mask`
Property added in: rBa9cb66b856e80d0542a9ad3fec0b0fb47d28f805
Remove the option to display the real size of the cursor
and set as default. Now the cursor is displayed or not using
show_cursor option, but if it's displayed always use the real size.
This patch makes sure that each of the expand keymap entries will use consistent "invert" and "use_mask_preserve" properties.
Based on previous discussions we decided to flip the default Mask Expand behavior.
This has multiple benefited:
- The mask creation is more consistent with other masking tools (Always add to existing mask. Mask selected areas)
- It's easier to use expanding for masking face sets (Snapping with `Ctrl`) or building a mask from repeated operations
- It's less likely to mask certain areas unintentionally (Loose mesh islands)
- If the current behavior is desired for an expand operation the user can use `E` & `F` in the modal keymap (Which is less often the case).
If we want to revisit the original design of inverted masking again in the future we should do this via {T97903}.
Reviewed By: Joseph Eagar
Differential Revision https://developer.blender.org/D16434
Ref D16434
Scale texture coordiantes for square brushes by sqrt2,
proportionally to how square they are (how close
tip_roundness is to zero).
Note: this is done in `calc_brush_local_mat()`, the
result of which appears to be used exclusively for
texture mapping.
Don't allow calling Attribute Convert operator in edit mode.
Right now BMesh does not support attribute operations.
Differential Revision: https://developer.blender.org/D16864
The node doesn't support blurring boolean attributes, so avoid
compiling an implementation for boolean data.
Differential Revision: https://developer.blender.org/D16867
When converting from imesh to mesh for the final result, custom
data should be copied from ALL operands including the main mesh.
Differential Revision: https://developer.blender.org/D16854
I missed adding the "convert type/domain to mask" macros.
Also refactor slightly to split the matching attribute test to a
separate function to ease debugging and reduce duplication.
The effect of CANCELLED on the undo stack is quite obscure, and
mistakenly using it after doing some changes causes confusing
behavior. It's better to describe it explicitly in the docs.
This commit addresses that specific case related to Collection ID type,
using a band-aid fix which is hopefully safe enough.
T103062 will remain open as a TODO task for a proper fix later.
This is an obvious editing mistake introduced in 05952aa94d,
resulting in incorrect vertex coordinates used when raycasting
for internal springs with a rest shape key.
In rBfcddb7cda766 I forgot to update part of the whole diffing chain,
effectively breaking the report flags propagation from any sub-structs
of RNA IDs structs.
Remove the redundant option to disable selection in order to simplify
the tools and UI, both conceptually and internally.
It was possible to disable curves selection completely by clicking on
the active selection domain. However, that was redundant compared to
just selecting everything by pressing "A". The remaining potential use
could have been saving a selection for later, but that can be done with
more complete attribute editing tools in the future.
The color of the brush cursor is changed depending
of the mode selected.
If the mode is stroke vertex color, use vertex color, otherwise
it uses material stroke color.
On gcc 11.3, Ubuntu 22.04 the default constructor for
ColorSceneLinear4f did not zero the r,g,b,a member variables. Replacing
the empty constructor with a default constructor circumvents this
problem (compiler bug? ) even though it *should* be more or less
equivalent.
This panel showed a duplication of options that were in the main light panel and only mistakenly shows up in the workbench engine where lights should have no options.
This panel was also used by the POV-Ray add-on but that was removed recently.
This panel showed a duplication of options that were in the main light panel and only mistakenly shows up in the workbench engine where lights should have no options.
This panel was also used by the POV-Ray add-on but that was removed recently.
When drawing strokes in Grease Pencil, it was always a bit hard
to predict how thick the strokes would be, because there was
no visual reference of the thickness in the cursor.
This patch adds that visual reference. It shows the brush size
as a circle in the draw cursor.
Showing the brush size can be toggled in the Cursor menu
of the Grease Pencil draw tool.
Request in RCS with 26 upvotes for this option:
https://blender.community/c/rightclickselect/0zfbbc
On the technical side: the brush size is calculated
in 3D space and takes zoom level into account, as well as
object/layer transfrom, layer thickness change (gpl->line_change)
and thickness scale (gpd->pixfactor).
Reviewed By: mendio, antoniov
Differential Revision: https://developer.blender.org/D16851
Add required additional_info to shader using gpu_shader_point_uniform_color_aa_frag.glsl. This is the only other reference to the shader which requires the additional_info to be added.
{F14085803}
Reviewed By: #eevee_viewport, fclem
Maniphest Tasks: T103426
Differential Revision: https://developer.blender.org/D16853
This replaces the old Edit menu, creating a menu only for catalog
operators. The Undo/Redo were already working only for catalogs, so now
this is more clear.
The menu also contains the Save and New catalog operators.
Differential Revision: https://developer.blender.org/D16820
Caused by rB6514bb05ea5a.
For the remeshing, we have to make sure these names are brought over
each time a mesh is made from another in the process.
This happens when reprojecting the colors in
`BKE_remesh_reproject_vertex_paint` and also again in
`BKE_mesh_nomain_to_mesh`. A bit unsure if this should happen as deep as
in `BKE_mesh_nomain_to_mesh` (if not, this can be isolated to
`voxel_remesh_exec`), but I would assume other callers of
`BKE_mesh_nomain_to_mesh` would actually benefit from it, too?
Maniphest Tasks: T103394
Differential Revision: https://developer.blender.org/D16847
Caused by 7d7e90ca68.
When accessing context members from the windowmanager context
(`C->wm.store` which is mainly used for UI related stuff) the above
commit broke behavior in `CTX_store_ptr_lookup` in that it changed and
would **always** return NULL if no type is passed in. The call to
`CTX_store_ptr_lookup` from `ctx_data_get` **always** passes in NULL
though.
Accessing other context members survived since they take a different
code path in `ctx_data_get` and dont use `CTX_store_ptr_lookup`.
Now also return the entry if a NULL type was passed as it was before.
Fixes T103370, T103405, T103417
Differential Revision: https://developer.blender.org/D16840
Until now the owner spaces in the object constraint properties used the
same descriptions as the target spaces, unlike bone constraints.
For instance, if you chose World Space as owner space, you'd get the
description: "The transformation of the target is evaluated relative to
the world coordinate system".
Reuse the existing descriptions from the bone constraints instead, so
now you get: "The constraint is applied relative to the world coordinate
system".
Reviewed By: sybren
Maniphest Tasks: T43295
Differential Revision: https://developer.blender.org/D16747
Convert 3D point shader fragment color from sRGB space to framebuffer space to match 3D line shader.
Reviewed By: fclem
Maniphest Tasks: T97394
Differential Revision: https://developer.blender.org/D16831
Make the "Clear Motion Paths" operators more intuitive. Previously, the
only way to clear the motion path of the selected object/bone would be
to shift-click the "Clear ALL Motion Paths" button. Now there are two
"X" buttons, one for "selected" and one for "all".
The "Clear Selected" and "Clear All" buttons align with the
corresponding "Update Selected" and "Update All" buttons.
When building without WITH_WINDOWS_BUNDLE_CRT the manifest
did not contain the blender.shared dependentAssembly leading
to missing dll errors at blender startup.
(MacOS) only: In the System tab of the user preferences the user has the
ability to select a GPU backend that Blender will use. After changing
the GPU backend setting, the user has to restart Blender before the
setting is used.
It was added to start collecting feedback on the Metal backend without
using the command lines.
By default Blender will select OpenGL as backend. When Metal is selected
(via `--gpu-backend metal` or via user preferences) OpenGL will be used as
fallback when the platform isn't capable of running Metal.
Separate the "insert nodes into group" operation into more distinct
phases. This helps to clarify what is actually happening, to avoid
redundant updates to group nodes every time a new socket is discovered,
and to make use of the topology cache to avoid the "accidentally
quadratic" alrogithms that we have slowly been removing from node
editing.
The change is motivated by the desire to use dynamic node declarations
for group nodes and group input/output nodes, where it is helpful to
avoid updating the declaration and sockets multiple times.
Use the map created for copying nodes more instead of iterating over all
nodes unnecessarily a few times. Use the map empty check instead of
a separate boolean variable. Use a utility function to retrieve a
separate buffer of selected nodes in case the nodes by id Vector
is reallocated (that part is technically a fix).
This enable building the metal backend by default on Apple hardware.
This is needed for further testing and the new backend selector D16774.
Ref T96261
Global scope arrays can incur suboptimal per-shader-thread memory allocations, resulting in excessive usage of limited local memory resources. These changes ensure that any arrays are limited to the closest scope in which they are required and thus will get correctly optimized by the compiler.
A number of constants have also been replaced with Macro's as these can result in better runtime performance for complex shader code.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T96261
Differential Revision: https://developer.blender.org/D16825
Propagate `eRNAOverrideMatchResult` 'return' flags at higher level into
BKE API, instead of just returning a boolean true when new override
rules have been created.
NOTE: This is an intermediary step towards fixing T102766.
Differential Revision: https://developer.blender.org/D16761
This was harmless because the function would just return null in release
builds, which was checked. Theoretically this vertex group mapping
shouldn't depend on the object type, but the vertex group API would
have to move away from the object-level first.
These are meant to be regression tests, not fuzz tests. The "random"
shuffling made debugging quite annoying, even though the random order
was the same every time. Instead, hard-code the two lists to make
things more obvious. The resulting list doesn't make much sense
(for example, the multires modifier has to be first in the stack),
but for now avoid changing things further.
Also remove some comments that weren't helpful.
Previously, the same `FieldInferencingInterface` was build for every node
multiple times. Now only once during the inferencing. Going forward,
it would be even better to store the inferencing interface as part of the
node declaration to avoid building it during inferencing at all.
A number of paths resulted in compilation errors after porting EEVEE to use Create-Info. Namely the fallback path for cubemap support. A number of other strict compilation failures regarding format comparison also required fixing when this mode is enabled.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T96261, T103313
Differential Revision: https://developer.blender.org/D16819
Add documentation for `BKE_id_defgroup_list_get()` and document that
`CD_MDEFORMVERT` mesh layers contain `MDeformVert` structs.
No functional changes.
The Metal backend already supports output for the 6 clipping planes via gl_ClipDistances equivalent, however, functionality to toggle clipping plane enablement was missing.
Authored by Apple: Michael Parkin-White
Ref T96261
Depends on D16777
Reviewed By: fclem
Maniphest Tasks: T96261
Differential Revision: https://developer.blender.org/D16813
Line Loop topology support for cutting tool and add support for packing several vertex attributes across individual pixels within a texture buffer.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T96261
Differential Revision: https://developer.blender.org/D16783
- Support for non-contiguous shader resource bindings for all cases required by create-info
- Implement missing geometry shader alternative path for edit curve handle.
- Add support for non-float dummy textures to address all cases where default bindings may be required.
Authored by Apple: Michael Parkin-White
Ref T96261
Depends on D16721
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D16777
The Realtime Compositor crashes on undo after an operation like Dissolve
node.
The compositor evaluator stored a reference to the compositor node tree
assuming that it will always be valid. This is not guaranteed, however,
and changes to the node tree can invalidate that reference. So we get
the node tree from the context directly every time to fix the crash.
Such IDs are tagged with the new `LIB_TAG_RUNTIME`. They are essentially
like any other regular ID, except that they do not get written in .blend
files. They also do not make their linked data usages directly linked.
They do be written in undo steps however.
This tag should be ignored in any non-Main IDs (e.g. evaluated data,
`NO_MAIN`, etc.).
This commit also adds a new RNA ID property, `is_runtime`. This is not a
direct mapping to the DNA tag, as a non-main ID will also return True,
and the property is only editable for Main IDs.
Some basic testing for expected behavior of that new tag was also added
to `blendfile_io` py unittest.
Required for brush asset project, see T101908.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D16675
ID tags were fully cleared on file write, however some should be written
so that they are preserved accross undo steps.
Currently this likely did not cause any serious issue, as the missing
ones were not that critical.
When creating a new mesh to change it in some way, the active and
default color attribute names should be copied to the new mesh.
Doing that in the generic "copy parameters for eval" function should
cover the vast majority of cases.
Accessing a mesh with write access can be costly if it is used
elsewhere at the same time because of copy-on-write. When always did
that at the end of the modifier calculation, but it's trivial to only
do that when we might need actually use the mesh to add original
index layers.
Caused by b08301c865. This also contains an optimization
compared to the previous version to avoid recalculating normals when
the entire mesh has moved by the same offset.
Reported by Demeter in chat.
This reverts commit a3a9459050.
And fixes T103337.
a3a9459050 has some flaws and it needs to go through review (See D16803).
Conflicts:
intern/ghost/intern/GHOST_SystemWin32.cpp
This was due to a missing endpoint case that wasn't handled in the port.
The last point still have to be discarded manually because of the
dot/stroke setting of the material.
The first test `ma1.x == -1` is not necessary anymore since the index
buffer do not contain this point (which was rendered using instance
rendering before.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D16812
Unlike other (closed) hierarchies, view layers dont show their contents
next to their names.
Code would still find the item via outliner_find_item_at_x_in_row though,
this is now prevented (same as if the viewlayer was open [instead of
collapsed]).
Fixes T102357.
Maniphest Tasks: T102357
Differential Revision: https://developer.blender.org/D16662
This patch implements the Streaks Glare node. Which is an approximation
to the existing implementation in the CPU compositor. The difference due
to the approximation is bearily visible in artificial test cases, but is
less visible in actual use cases. Since the difference is rather similar
to that we discussed in the Simple Star mode, the decision to allow that
difference would probably hold here.
For the future, we can look into approximating this further using a
closed form IIR recursive filter with parallel interconnection and
block-based parallelism. That's because the streak filter is already
very similar to the causal pass of a fourth order recursive filter,
just with exponential steps.
Differential Revision: https://developer.blender.org/D16789
Reviewed By: Clement Foucault
This patch implements the variable size mode of the blur node. This is
not identical to the CPU implementation, but is visually very close.
That's because of two things. First, the Extend Bounds option introduces
a 2px offset that doesn't make sense, which is likely a bug in the CPU
implementation. Second, the CPU implementation approximate the result
using three passes, the first two of which are separable morphological
operators applied on the size input. But this approximation does not
provide an advantage because the last pass is non-separable anyways. So
the GPU implementation does not attempt this approximation for more
accurate and faster results.
Differential Revision: https://developer.blender.org/D16762
Reviews By: Clement Foucault
This simplifies some memory management, ammortizes some of the many
small allocations when building UI layouts, and simplifies the code
that deals with the groups. `uiBlock` is no longer a trivial type.
In my testing this saved a few ms when drawing a large node tree.
Duplicating context lists took a measurable amount of time when drawing
large node trees in the node editor. Instead of using a linked list of
entries, which results in many small allocations, use a vector. Also,
use std::string and StringRefNull instead of char buffers and pointers.
I had forgotten about curves sculpt mode when I wrote
this function. It just initializes the viewport
pivot point to the evaluated object bounding box.
Should be used inside the mode entry function.
Texpaint now bounds checks material indices when looking up
materials, in case the user has corrupted the material_index
attribute somehow. We may wish to report this to the user
somehow on entering texture paint mode.
Partially addresses T72011.
The problem here is that the previous barycentric clamping did not deal well
with skinny triangles and would end up generating "sub-pixel jittering"
locations that were actually >20 pixels away.
Differential Revision: https://developer.blender.org/D16727
Previously, the code tried to keep node groups working even if some of
their input/output sockets had undefined type. This caused some
complexity with no benefit because not all places outside of this file
would handle the case correctly. Now node groups with undefined
interface sockets are disabled and have to be fixed manually before
they work again.
Undefined interface sockets are mostly caused by invalid Python
API usage and incomplete forward compatibility (e.g. when newer
versions introduce new socket types that the older version does
not know).
Avoid utility function call that would query the file system, this was a
bottleneck. The path joining was also problematic. See patch for more
details.
Differential Revision: https://developer.blender.org/D16768
Reviewed by: Jacques Lucke
Expands Color Mix nodes with new Exclusion mode.
Similar to Difference but produces less contrast.
Requested by Pierre Schiller @3D_director and
@OmarSquircleArt on twitter.
Differential Revision: https://developer.blender.org/D16543
Materials without connections to the output node would crash with OSL
in OptiX, since the Cycles `OSLCompiler` generates an empty shader
group reference for them, which resulted in the OptiX device
implementation setting an empty SBT entry for the corresponding direct
callables, which then crashed when calling those direct callables was
attempted in `osl_eval_nodes`. This fixes that by setting the SBT entries
for empty shader groups to a dummy direct callable that does nothing.
Switching viewport denoising causes kernels to be reloaded with a new
feature mask, which would destroy the existing OptiX pipelines. But OSL
kernels were not reloaded as well, leaving the shading pipeline
uninitialized and therefore causing an error when it is later attempted to
execute it. This fixes that by ensuring OSL kernels are always reloaded
when the normal kernels are too.
Restrict the condition under which paint cursors read use the cursor
location from the the operating-system.
This caused a glitch when dragging UI elements in painting context
popup. Since the paint cursor would display using mouse motion
which was clamped to the window center - an internal detail of hidden
cursor grabbing.
Now only read the cursor coordinates when clamped to a region which
is used for the transform cursor to stay visible even when the cursor
wraps around.
Recent reverting of changes to cursor grabbing intended to match
Blender 3.3 release. This is the case for 3.4x branch, however there is
an additional change to grabbing on WIN32 by Germano [0] which is a
significant improvement on old grabbing logic for Windows.
So instead of matching 3.3x behavior, restore logic that keeps
the cursor centered while grabbing & hidden.
This re-introduces T102792 issue displaying the paint-brush while
dragging buttons, this will have to be solved separately.
Re-apply [1] & [2], revert [3] & [4].
[4]: a3a9459050
[0]: 9fd6dae793
[1]: 4cac8025f0
[2]: 230744d6fd
[3]: 0240b89599
The paint cursor was continuously set which meant hiding the cursor
while interacting with buttons would immediately show it again.
This exposed cursor warping.
Small roundoff errors during UV editing can sometimes occur, most likely
due to so-called "catastrophic cancellation".
Here we set a tolerance around zero when using Constrain-To-Bounds and UV Scaling.
The tolerance is set at one quarter of a texel, on a 65536 x 65536 texture.
TODO: If this fix holds, we should formalize the tolerance into the UV editing
subsystem, perhaps as a helper function, and investigate where else it needs
to be applied.
Differential Revision: https://developer.blender.org/D16702
When migrating to the new packing API, pin_unselected was not
implemented correctly.
Regression from rB143e74c0b8eb, rBe3075f3cf7ce, rB0ce18561bc82.
Differential Revision: https://developer.blender.org/D16788
Reviewed By: Campbell Barton
Duplicated in blender-v3.4-release as rB3dcd9992676a
Upon conversion, the newly-created UV map with default name "UVMap"
should be translated.
Reviewed By: mont29
Maniphest Tasks: T103183
Differential Revision: https://developer.blender.org/D16775
Replace ../lib/linux_centos7_x86_64 with ../lib/linux_x86_64_glibc_228,
built with Rocky8 Linux, compatible with the VFX platform CY2023,
see: T99618.
- Update build-bot configuration.
- Remove unnecessary check for Blosc, this is part of OpenVDB lib now.
- Remove WITH_CXX11_ABI, always use new C++11 ABI now
- Replace centos7 by glibc_228 everywhere
Note that existing builds with cached paths pointing to
"../lib/linux_centos7_x86_64" will need to be updated.
Includes contributions by Brecht.
Attributes are unifying around a name-based API, and we would like to
be able to move away from CustomData in the future. This patch moves
the identification of active and fallback (render) color attributes
to strings on the mesh from flags on CustomDataLayer. This also
removes some ugliness used to retrieve these attributes and maintain
the active status.
The design is described more here: T98366
The patch keeps forward compatibility working until 4.0 with
the same method as the mesh struct of array refactors (T95965).
The strings are allowed to not correspond to an attribute, to allow
setting the active/default attribute independently of actually filling
its data. When applying a modifier, if the strings don't match an
attribute, they will be removed.
The realize instances / join node and join operator take the names from
the first / active input mesh. While other heuristics may be helpful
(and could be a future improvement), just using the first is simple
and predictable.
Differential Revision: https://developer.blender.org/D15169
If the resulting geometry from applying a geometry nodes modifier
contains no mesh, give an error message. This gives people something to
search and makes the behavior more purposeful.
Also remove the `modifyMesh` implementation from the geometry nodes
modifier, since it isn't necessary anymore. And remove the existing
"Modifier returned error, skipping apply" message which was cryptic
and redundant if applying returns an actual error message.
Resolves T103229
Differential Revision: https://developer.blender.org/D16782
This patch allows skipping the automatic insertion of nodes on top of
links when the transform operator ends. When putting nodes into small
spaces this often gets in the way and wastes time. Now, when holding
`alt`, this is turned off.
The header text is also improved to add this shortcut and to remove
the Dx and Dy values and improve the formatting a bit.
Making this functionality optional might allow us to use it in more
places in the future, like for the nodes added by link-drag-search.
Differential Revision: https://developer.blender.org/D16230
The function was highly related to the apply modifier operator,
and only used once. This was too specific to be in the blenkernel,
especially in a mesh conversion file.
This was missing some paths setup in the environment, ctest
normally sets this up before running the tests from the CLI
but that does not help the IDE all that much.
After switching over to using start_frame / end_frame, scaling an NLA strip didn't scale the strip, it just repeated the action.
Now withing the NLA transform code, we look for TFM_TIME_EXTEND / TFM_TIME_SCALE transform mode, and handle the update to strip scale accordingly
Since rB8014180720d8, all paint modes support orbiting around last
stroke, so [a] the comment there is out of date and [b] the fallback
case of orbiting around the center will never be used (unless there is
no stroke information - but BKE_paint_stroke_get_average handles that
anyways).
Spotted while looking into T101766.
Maniphest Tasks: T101766
Differential Revision: https://developer.blender.org/D16779
The problem was the bake function was using the evaluated
data and must use the original data.
The problem was caused by commit: rBcff6eb65804d: Cleanup: Remove duplicate Bake modifier code.
Fix by Philipp Oeser
Editmode should display the original (non-evaluated) points unless there
is something like an "On Cage" option of a modifier [which none of the
curves modifiers have].
This was not the case since the introduction in rBe15320568a29.
So we now draw the editpoints from the original curves. This also means
that original and evaluated curves might not have the same number of
points, so we have to get independent of `proc_point_buf` since that
would possibly create vertexbuffers of different sizes (compared to the
original curves) which is not allowed for a single batch.
- remove the "pos" alias from the vertex buffer format of proc_point_buf
- instead, create a new "edit_points_pos" vertex buffer
- fill that with the original (un-evaluated) curves positions
- dont request `proc_point_buf` anymore
- rename the editpoints flags buffer to be more consistent
And since original and evaluated points might also be in completely
different positions, we also need to draw connecting lines between those
editpoints to not have them float in thin air. For drawing these in
editmode, a simple polyline was chosen (instead of drawing lines in a
resolution that is take from the old particle system -- which is not
depending on points even but has a hardcoded resolution that can only be
upped by the hair_subdiv scene render setting)
- create appropriate batch and indexbuffer for this
- positions vertex buffer can be reused
- reuse particle edit shader (instead of curve edi shader) to get
segment highlighting
{F14055436}
NOTE: this also removes the broken depth handling and instead makes it
work (also XRay is properly taken into account) by binding the correct
overlay framebuffer.
NOTE: to further clarify the distinction between curves drawing (that is
based on the old partice system drawing) and drawing in editmode, the
corresponding vertexbuffers have been moved out of CurvesEvalCache into
CurvesBatchCache directly.
NOTE: drawing the lines in editmode could be improved (taking the "real"
resolution of splines into account, but since this should happen on the
GPU in a compute shader, this is for later)
Potentionally fixes T101889.
Maniphest Tasks: T101889
Differential Revision: https://developer.blender.org/D16281
Under Wayland the transform cursor wasn't displaying the warped cursor.
This worked on other platforms because cursor motion is warped where as
Wayland simulates cursor warping, so it's necessary to apply warping
when requesting the cursor location too.
- Use typed enum for the wrap axis.
- Rename `bounds` to `wrap_region`.
- Take a `rcti` argument instead of an `int[4]`.
- Pair wrap & wrap_region arguments together.
This is an alternative fix to [0] which kept the cursor centrally
located as part of GHOST cursor grabbing which caused T102792.
Now this is done as part of walk mode as it's the operator that most
often ran into this problem although ideally this would be handled by
GHOST - but that's a much bigger project.
[0]: 9fd6dae793
Historically checks for windowing capabilities used platform
pre-processor checks however that doesn't work when Blender is built
with both X11 & Wayland.
Add a capabilities flag which can be used to check which functionality
is supported. This has the advantage of being more descriptive/readable.
This reverts commits
9fd6dae793,
4cac8025f0 (minor cleanup).
Re-introducing T102346, which will be fixed in isolation.
Unfortunately even when the cursor is hidden & grabbed,
the underlying cursor coordinates are still shown in some cases.
This caused bug where dragging a button in the sculpt-context popup
would draw the brush at unexpected locations because internally
the cursor was warping in the middle of the window, reported as T102792.
Resolving this issue with the paint cursor is possible but tend towards
over-complicated solutions.
Revert this change in favor of a more localized workaround for walk-mode
(as was done prior [0] to fix T99021).
[0]: 4c4e8cc926
This was only called once in a situation where such functions
are typically used as a dynamic enum callbacks.
Prefer keeping the items close to the EnumProperty definition &
avoid the need to note why this is a special case that doesn't follow
the common pattern for enum callbacks.
- Follow sphinx conventions for doc-strings.
- Use __slots__ for KeyframesCo as dynamically assigning new members
isn't needed.
- Import from bpy.types instead of assigning.
- Split typing imports across multiple lines as they tend to become
quite large.
This is a solution in response to the issues mentioned in comments on
rBe4f1d719080a and T103088.
Apparently the workaround of checking if the mouse is already inside
the area on the next event doesn't work for some tablets.
Perhaps the order of events or some very small jitter is causing this
issue on tablets. (Couldn't confirm).
Whatever the cause, the solution of checking the timestamp of the event
and thus ignoring the outdated ones is theoretically safer.
It is the same solution seen in MacOS.
Also calling `SendInput` 3 times every warp ensures that at least one
event is dispatched.
This adds a new mirror image extension type for shaders and
geometry nodes (next to the existing repeat, extend and clip
options).
See D16432 for a more detailed explanation of `wrap_mirror`.
This also adds a new sampler flag `GPU_SAMPLER_MIRROR_REPEAT`.
It acts as a modifier to `GPU_SAMPLER_REPEAT`, so any `REPEAT`
flag must be set for the `MIRROR` flag to have an effect.
Differential Revision: https://developer.blender.org/D16432
The `render_color_index` skips attributes with different types
and domains in order to give the proper order for the UI list.
That is a different than an index in the group of all attributes.
The most solid solution I could think of is exposing the name of
the default color attribute. It's "solid" because we always address
attributes by name internally. Doing something different is bound
to create problems. It's also aligned with the design in T98366 and
D15169.
Another option would be to change the way the "attribute index"
is incremented in Cycles. That would be a valid solution, but would
be more complex and annoying.
For consistency, I also exposed the name of the active color attribute
the same way, though it isn't necessary to fix this particular bug.
The properties aren't editable, that can come in 3.5 as part of D15169.
Differential Revision: https://developer.blender.org/D16769
This is essentially a left-over from the initial transition to fields where this was
forgotten. The mesh primitive nodes used to create a named uv map attribute
with a hard-coded name. The standard way to deal with that in geometry nodes
now is to output the attribute as a socket instead. The user can then decide
to store it as a named attribute or not.
The benefits of not always storing the named attribute in the node are:
* Improved performance and lower memory usage when the uv map is not
used.
* It's more obvious that there actually is a uv map.
* The hard-coded name was inconsistent.
The versioning code inserts a new Store Named Attribute node that
stores the uv map immediatly. In many cases, users can probably just
remove this node without affecting their final result, but we can't
detect that.
There is one behavior change which is that the stored uv map will be
a 3d vector instead of a 2d vector which is what the nodes originally created.
We could store the uv map as 2d vector inthe Store Named Attribute node,
but that has the problem that older Blender versions don't support this
and would crash immediately. Users can just change this to 2d vector
manually if they don't care about forward compatibility.
There is a plan to support 2d vectors more natively in geometry nodes: T92765.
This change breaks forward compatibility in the case when the uv map
was used.
Differential Revision: https://developer.blender.org/D16637
This is done based on the render sample count so that it doesn't impact
sampling quality. It's similar in spirit to the adaptive table size in D16561,
but in this case for performance rather than memory usage.
Differential Revision: https://developer.blender.org/D16726
The first two dimensions of scrambled, shuffled Sobol and shuffled PMJ02 are
equivalent, so this makes no real difference for the first two dimensions.
But Sobol allows us to naturally extend to more dimensions.
Pretabulated Sobol is now always used, and the sampling pattern settings is now
only available as a debug option.
This in turn allows the following two things (also implemented):
* Use proper 3D samples for combined lens + motion blur sampling. This
notably reduces the noise on objects that are simultaneously out-of-focus
and motion blurred.
* Use proper 3D samples for combined light selection + light sampling.
Cycles was already doing something clever here with 2D samples, but using
3D samples is more straightforward and avoids overloading one of the
dimensions.
In the future this will also allow for proper sampling of e.g. volumetric
light sources and other things that may need three or four dimensions.
Differential Revision: https://developer.blender.org/D16443
While it helps on many scenes, it can be disruptive for existing scenes and
for benchmarks the differences in timing can be confusing. So be a bit more
conservative and only it enable it for new scenes.
This allows choosing the 2d vector type in the Store Named Attribute
node. Similar to byte-colors, there is not a special socket type for this
(currently). In geometry nodes itself, vectors are all still 3d.
The "Loading Asset Libraries" label in the menu would already disappear
before the asset libraries are done loading. It only queried if the
loading was started, not if it was finished. Especially notable when the
asset library was slow to load, e.g. because it is not yet in the asset
index.
The use of a struct for device strings caused the CUDA compiler to
generate byte arrays as the argument type, whereas OSL generated
primitive integer types (for the hash). Fix that by using a typedef
instead so that the CUDA compiler too will use an integer type in the
PTX it generates.
Maniphest Tasks: T101222
This is because OB_MODE_SCULPT_CURVES is not part of OB_MODE_ALL_PAINT
(yet). While there is some chance it ends up there, there are a lot of
more places that need checking and so patch only fixes the report very
isolated.
NOTE: T93501 is related (since the option to show these should also be
hidden in sculptmode)
Maniphest Tasks: T101765
Differential Revision: https://developer.blender.org/D16764
Allow keyboard layouts which include "dead keys" to enter diacritics
by calling MapVirtualKeyW even when not key_down.
See D16770 for more details.
Differential Revision: https://developer.blender.org/D16770
Reviewed by Campbell Barton
Recently a new geometry node for splitting edges was added in D16399.
However, there was already a similar implementation in mesh.cc that was
mainly used to fake auto smooth support in Cycles by splitting sharp
edges and edges around sharp faces.
While there are still possibilities for optimization in the new code,
the implementation is safer and simpler, multi-threaded, and aligns
better with development plans for caching topology on Mesh and other
recent developments with attributes.
This patch removes the old code and moves the node implementation to
the geometry module so it can be used in editors and RNA. The "free
loop normals" argument is deprecated now, since it was only an internal
optimization exposed for Cycles.
The new mesh `editors` function creates an `IndexMask` of edges to
split by reusing some of the code from the corner normal calculation.
This change will help to simplify the changes in D16530 and T102858.
Differential Revision: https://developer.blender.org/D16732
Fixed more cases where attributes weren't being reinitialized
on switching PBVH mode:
* When PBVH_GRIDS and PBVH_BMESH force attributes into simple
array mode they no longer override simple_array in the
SculptAttributeParams parameters, instead they set a field
in SculptAttribute itself. Thus if the attribute is
reinitialized in another mode it won't retain the simple_array
parameter.
* sculpt_attribute_ensure_ex now calls sculpt_attr_update if
the attribute already exists.
* Fixed a bug from a couple commits ago that set
SculptAttribute.data_for_bmesh wrong.
PBVH draw code now builds coarse triangle index buffers
for multires. Note that the coarse grids can be at any
multires depth but is currently hardcoded to 1.
Previously the sculpt box trim operator always created face sets,
but after face sets became optional it only modified them if they
already existed. Absent a better way to turn the behavior on and off,
the fix is to just always create face sets.
Before f1c0249f34 the material was assigned to the previous
slot rather than the next. Though the behavior is arbitrary, there
is no reason to change it.
The `transform_convert_clip_mirror_modifier_apply` code is made more readable by:
- decreasing indentation;
- removing `axis` and `tolerance` variables;
- renaming `int clip` to `bool is_clipping`;
The comment of `solve_cubic()` put the coefficients of the to-be-solved
cubic equation in the wrong order. This is now fixed.
No functional change, just a comment fix.
When the line was very thin the precision of the thickness
calculation was not precise enough.
The algorithm has been improved. This affects SVG and PDF.
* Make it clearer that contrib isn't shipped with releases, by already excluding it in beta.
* Improve the UI by hiding the "Testing" enum item in these case.
Differential Revision: https://developer.blender.org/D16729
In preparation to sanatize the mask texture and color texture in sculpt code. In sculpt
mode the mask texture is read from mtex, leaving the mask_mtex when we want to use color
textures in sculpt mode.
Having all packages on one line made reviewing changes difficult.
Also note why Python modules are needed (with some TODO's where I wasn't
able to find any reason given for their inclusion).
The PKGCONFIG file exposes the OPUS include: requiring <opus/opus.h>
to be replaced with <opus.h>. Manipulate the PKGCONFIG file instead of
patching the source since the small change is only needed in one place.
Meson is built as part of external_python_site_packages,
without this dependency it would be called before being built.
Also remove Meson as a build requirement since the version is used.
Adds an early return if Position/Offset inputs won't lead
to any changes in the Geometry.
It now also compares with the read-only Position attribute instead of
getting it for write only, to work correctly with Copy-on-Write.
Before, the `is_same`-check only worked for geometry created
in the node tree.
Differential Revision: https://developer.blender.org/D16738
There has been an attempt to reorganize this part, however, it seems that didn't compile on HIP, and is reverted in
rBc2dc65dfa4ae60fa5d2c3b0cfe86f99dcb5bf16f. This is another attempt of refactoring. as I have no idea why some things don't work on HIP, it's
best to check whether this compiles on other platforms.
The main changes are creating a new struct named `MeshLight` that is shared between `KernelLightDistribution` and `KernelLightTreeEmitter`,
and a bit of renaming, so that light sampling with or without light tree could call the same function.
Also, I noticed a patch D16714 referring to HIP compilation error. Not sure if it's related, but browsing
https://builder.blender.org/admin/#/builders/30/builds/7826/steps/7/logs/stdio, it didn't work on gfx1102, not gfx9*.
Differential Revision: https://developer.blender.org/D16722
The OpenVDB delay loading of voxel leaf data using mmap works poorly on network
drives. It has a mechanism to make a temporary local file copy to avoid this,
but we disabled that as it leads to other problems.
Now disable delay loading entirely. It's not clear that this has much benefit
in Blender. For rendering we need to load the entire grid to convert to NanoVDB,
and for geometry nodes there also are no cases where we only need part of grids.
To avoid issues with lights being either skipped or sampled unnecessarily
when the exposure is set low or high.
Contributed by Alaska.
Differential Revision: https://developer.blender.org/D16703
* preempt_attr was copied from CUDA, but not used in HIP.
* Remove shadowed variable before conditional in EnvironmentTextureNode code.
Differential Revision: https://developer.blender.org/D16741
Expand the motion path frame range options with an extra option "Manual
Range". When chosen, Blender will not automatically update the path
range any more.
Additionally, the start/end frame fields are greyed out in the UI when
one of the automatic range options is selected (i.e. all but the new
"Manual Range" one). It is still possible to set the start/end frame
temporarily, but the original behaviour (of recomputing those on update)
remains.
Manifest Task: T101522
The catalog tree is a unit on its own, and should be tested separately.
This makes the testing files smaller and more focused, which can help
maintaining them.
This manages setting up asset library directories for testing, which is
useful for testing multiple asset library related compontents. So move
it to a common header. No reason to squeeze everything into one file
then.
Compile each static shader using shaderc to Spir-V binaries.
The main goal is to make sure that the GLSL created using ShaderCreateInfo and able to compile to Spir-V.
For the second stage a correct pipeline needs to be created and some shader would need more
adjustments (push constants size).
With this patch future changes to GLSL sources can already be checked against vulkan, without the
backend finished.
Mechanism has been tested using MacOS and MoltenVK. For other OS, we should finetune CMake
files to find the right location to shaderc.
```
************************************************************
*** Build Mon 12 Dec 2022 11:08:07 CET
************************************************************
Shader Test compilation result: 463 / 463 passed (skipped 118 for compatibility reasons)
OpenGL backend shader compilation succeeded.
Shader Test compilation result: 529 / 529 passed (skipped 52 for compatibility reasons)
Vulkan backend shader compilation succeeded.
```
Reviewed By: fclem
Maniphest Tasks: T102760
Differential Revision: https://developer.blender.org/D16610
Previously, it wouldn't detect the case when one mesh had an attribute
that the other one did not. Not sure if this always was the case or whether
this less strict test was implemented accidentally at some point.
But it below the `else` case to make the control flow clearer, since
in the end that is more important. Also clarify the wording and fix
grammar slightly.
Similar to previous commits, avoid using pointers that are redundant
to their corresponding index. Also avoid storing the edge vectors stack
in the data-per-loop when it can just be a function argument.
Face corner normals are calculated when auto smooth or custom
per-corner normals are used.
This brings the per-face-corner data from 64 to 24 bytes, as measured by
`sizeof`. In a large test file I observed a 20% performance improvement,
from 285 to 239 ms.
The loop was also retrievable with the index. This needed some care
though, because previously the index became "detached" from the
corresponding MLoop pointer for a short time.
Since face corner indices are available, using pointers to MLoop and
other data is redundant. Using fewer local variables means there is less
state to keep track of when reading the algorithm, even if it requires
more characters in some cases.
The `lnor` pointer was only used for fans containing a single face,
and can be retrieved for a specific loop from the common data anyway.
Also saves 8 bytes per corner during the calculation
Add `bNode::index()` to allow accessing node indices directly without
manually de-referencing the runtime struct. Also adds some asserts to
make sure the access is valid and to check the nodes runtime vector.
Eagerly maintain the node's index in the tree so it can be accessed
without relying on the topology cache.
Differential Revision: https://developer.blender.org/D16683
This adds an explicit post processing step to node declarations.
The purpose of this is to keep the actual node declaration functions
concise by avoiding to specify redundant information. Also it improves
the separation of the creation of the declaration from using it.
This made it harder to change these functions in the future.
No functional changes are expected and the versioning worked correctly
in my test with a files created in Blender 2.69.
Adding the sockets in the function was not necessary in my test, because
those were already added before as part of `node_verify_sockets` in
`ntreeBlendReadLib`. I kept it in just to be on the safe side.
The problem was the bounding box was calculated using
all strokes, but if a filter is added, the bounding box must
include only selected strokes.
Fix by @frogstomp
Improve a few messages, but mostly fix typos in many areas of the UI.
See inline comments in the differential revisiion for the rationale
behind the various changes.
Differential Revision: https://developer.blender.org/D16716
Using a cache greatly simplifies access to the output node.
I touched on the most common and understandable cases for me.
The texture nodes were touched because it looked pretty generic.
Differential Revision: https://developer.blender.org/D16699
Add preferred domain based on the "Value" input field. Most often,
the domain must match the original domain for the value.
Differential Revision: https://developer.blender.org/D16730
Apple notarization rejects packages containing them.
Similar to rpaths we handle generically this as part of the harvest step rather
than patches individual library builds systems.
Ref T99618
This allows using the "On Cage" feature in edit mode to interact with
original mesh elements via the newly created geometry. The original
indices are only set for new elements that copy attribute values
from original elements directly, so it can also be a helpful way
to visualize attribute propagation.
The change was simplified by refactoring the individual mode slightly
to create separate index maps for the new edges and vertices. That
simplified attribute copying a bit too.
This is partially a bug fix, since the original index layer wasn't
handled at all before, and could be left initialized. That was caused
by my recent change to modify a mesh in place rather than create a
new one. Also copy over any orco data, which was another unhandled
layer type.
It's also a new feature though, since it allows using the "On Cage"
feature of edit mode to adjust original mesh elements by selecting
the new ones. This brings the functionality inline with the Edge Split
modifier.
- Added comment for additional tasks to do when bumping python
- updated sqlite to 3.39.4
- downgrade setuptools to 63.2.0 to avoid numpy build issues
- numpy 1.23.5
Don't use the same "context" struct for tagging sharp edges from auto-
smooth / poly flags and actually calculating face corner normals. That
required more arguments, and it required breaking const slightly to
reuse the code. Also split apart pre-populating corner normals
with vertex normals, since it isn't related at all and is only used
in one code path.
Image engine uses 4 gpu textures that are as large as the area being
drawn. The amount of needed GPU memory can be reduced by dividing the
region in smaller parts. Reducing the GPU memory also reduces the stalls
when updating the textures, improving the performance as well.
This optimization works, but is disabled for now due to some rounding
errors that drawn lines on the screen where the screen is divided.
It used to be a number of fixed full screen images where the
responsibility was at image engine. Now moved the responsibility to the
drawing mode to make sure we can allocate non-full region-size textures
in a future refactoring.
`get_gpu_textures` was created when the image engine didn't support
texture streaming and used the gpu textures that were stored in the
image buffer itself.
This patch implements the Simple Star Glare node. This is only an approximation
of the existing implementation in the CPU compositor, an approximation that
removes the row-column dependency in the original algorithm, yielding an order
of magnitude faster computations. The difference due to the approximation is
readily visible in artificial test cases, but is less visible in actual use
cases, so it was agreed that this approximation is worthwhile.
For the future, we can look into approximating this further using a closed form
IIR recursive filter with parallel interconnection and block-based parallelism.
Which is expected to yield another order of magnitude faster computations.
The different passes can potentially be combined into a single shader with some
preprocessor tricks, but doing that complicated that code in a way that makes
it difficult to experiment with future optimizations, so I decided to leave it
as is for now.
Differential Revision: https://developer.blender.org/D16724
Reviewed By: Clement Foucault
This patch implements the Ghost Glare node. It is implemented using
direct convolution as opposed to a recursive one, which produces
slightly different results---more accurate ones, however, since the
ghosts are attenuated where it matters, the difference is barely
visible and is acceptable as far as I can tell.
A possible performance improvement is to implement all passes in a
single shader dispatch, where an array of all scales and color
modulators is computed recursively on the host then used in the shader
to add all ghosts, avoiding usage of global memory and unnecessary
copies. This optimization will be implemented separately.
Differential Revision: https://developer.blender.org/D16641
Reviewed By: Clement Foucault
These functions were originally implemented because:
- Not all of them existed pre C++17, but now we are using C++17.
- The call stack depth is quite a bit deeper with the std functions, making
debugging slower and more annoying. I didn't find this to be a problem
anymore recently.
No functional changes are expected.
Nodes which are common in multiple editors (RGB, Value, Switch, RGB to BW)
has less width in compositor editor. Patch changes compositor node width to
140 for consistency.
Reviewed by: HooglyBoogly
Differential Revision: https://developer.blender.org/D16719
OpenVDB likes to crash even in release builds when volumes become too small.
To fix this I used the same function that we use in other places already to
determine if the resulting volume will be too small.
Float images loaded in Blender are converted to scene linear and don't
require additional conversion. Image engine can reuse the rect_float of
those images. An assert statement is added tp make this more clear and
to test on missing code paths or future developments.
This splits the logic to detect if the MeshSequenceCache modifier
evaluation is for the ORCO mesh into its own function. This will allow
reusing the logic for when GeometrySet support is added to the modifier
(D11592).
No functionnal changes.
Differential Revision: https://developer.blender.org/D16611
Texture usage flags can now be provided during texture creation specifying
the ways in which a texture can be used. This allows the GPU backends to
perform contextual optimizations which were not previously possible. This
includes enablement of hardware lossless compression which can result in
a 15%+ performance uplift for bandwidth-limited scenes on hardware such
as Apple-Silicon using Metal.
GPU_TEXTURE_USAGE_GENERAL can be used by default if usage is not known
ahead of time. Patch will also be relevant for the Vulkan backend.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D15967
Fix a number of small memory leaks in the Metal backend. Unreleased blit
shader objects and temporary textures addressed. Static memory manager
modified to defer creation until use. Added reference count tracker to
shared memory manager across contexts, such that cached memory allocations
will be released if all contexts are destroyed and re-initialized.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D16415
Implementing non-geometry-shader path for rendering stencil shadows,
used by the workbench engine.
Patch also contains a few small modifications to Create-info to ensure
usage of gl_FragDepth is explicitly specified.
This is required for testing of the patch.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D16436
Implemented geometry shader alternative for rendering of UV edges in Metal, as geometry shaders are unsupported.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D16452
There is a more recent implementation as a geometry node, but this code
is used by RNA and Cycles still. In order to help understand the code
to tell if it can be replaced this makes some small changes:
- Use indexing instead of pointer incrementing
- Add const to unchanged arguments
- Avoid unnecessary indentation
- Use references for expected non-null arguments
On linux a man page is generated before the
scripts are installed, this lead to USD getting
a null pointer for it's pluging path and crashing
the process.
Porting conservative depth rendering to use non-geometry shader path for
Metal.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D16424
Additional mat3 constructors added, global variable namespace collisions
for uniform and object color avoided via re-name.
Metal vertex format compatibility added for shaders wherein vertex data
goes through a double-conversion and cannot be implicitly converted during
Metal vertex assembly e.g. bitmasks passed directly as unsigned type in
shader interface for certain shader interfaces.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D16433
Required by Metal backend for efficient shader compilation. EEVEE material
resource binding permutations now controlled via CreateInfo and selected
based on material options. Other existing CreateInfo's also modified to
ensure explicitness for depth-writing mode. Other missing bindings also
addressed to ensure full compliance with the Metal backend.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D16243
I organized the fields so that similar variables were closer together and
more "important" fields were closer to the beginning. I also added
comments to help describe the purpose of most fields.
Differential Revision: https://developer.blender.org/D16710
Based on feedback from Simon Thommes, for link-drag-serach it's most
useful to have the A and B sockets connected, first, then the factor
sockets, then the special color mix operations. This addresses that by
adding the search items in order and decrementing a weight manually
as items are added.
The PDF of mesh lights were not being scaled by `pdf_selection` when
the light tree was disable. This resulted in the mesh lights having
the wrong PDF and thus the wrong brightness.
Differential Revision: https://developer.blender.org/D16717
Make the `Object *` and `Mesh *` parameter of `USD_mesh_topology_changed()`
`const`. This function only inspects them, and doesn't need to modify
them.
No functional changes.
Since moving to float scaling, the method of accessing the text
width with the aspect applied wasn't working properly.
Based on contributions by @lone_noel & @harley, see D15043.
The optimization is done by removing the `len` member from the groups
and using fewer `for` loops.
But it's not a really impactful optimization.
Only 1.9% in the weld operation of a high poly mesh.
(disregarding getting the vertex map and all other operations on a
Blender frame).
The readability improvement comes from using more familiar types like
`int` and `int2` instead of `WeldGroup` and `WeldGroupEdge` structs.
In the merge_by_distance code, `vert_dest_map` is modified to become a
vertex group map. But this is not clear from the code.
Also use the `_map` suffix on `vert_final` and `edge_final`.
And remove some unnecessary variables.
The wrap function was a feature of the old compositor
but was never ported to the new CPP compositor node.
This simply removes the unused property, the function could alternatively be
restored but in has been missing for a decade so it does not seem missed.
Differential Revision: https://developer.blender.org/D16712
Fixes T102796
This diff improves the docs for bmesh by adding the default values to all methods. This is motivated by this issue https://github.com/nutti/fake-bpy-module/issues/118 in fake-bpy-module which generates a typed API for authoring Blender scripts and addons from the docs.
After this diff gets merged, the Blender docs get updated, and `fake-bpy-module` gets regenerated, the type signatures in `fake-bpy-module` will match the reality of Blender's API.
Here's a diff for the docs using the modified script:
https://gist.github.com/xixixao/1c83153adbcefbe0859f9cc9ba757d46
I "hardcoded" the defaults based on the types of the arguments, after some testing and consulting the Blender .c source for these APIs.
Here's a test script that verifies that the arguments with defaults added in this diff are indeed not required by Blender 3.3: https://gist.github.com/xixixao/adc4e5a076e80a63735bd60c7c9e7a0d
I made the minimum changes required to get this doc generation script fixed, but let me know if I should restructure this script more.
I also amended the comments of three args, 2 to align them with Python (NULL -> None) and one to mark it as optional (CurveProfile).
Reviewed By: Blendify
Differential Revision: https://developer.blender.org/D16400
The executable would get boost python linking in when not needed, and even when
linking to Python libraries there were still unresolved symbols. Instead split
off boost python libraries and link them only where needed.
Compiling Cycles in Visual Studio 2022 yields the error:
C4146: unary minus operator applied to unsigned type, result still unsigned
Replacing it with explicit two's complement achieves the same result as signed
negation but avoids the error.
Differential Revision: https://developer.blender.org/D16616
For file formats like PNG, JPEG and TIFF. Eventually this should use
the OpenColorIO view transform, but this at least makes the image
closer to what it should be in most cases.
Differential Revision: https://developer.blender.org/D16482
The Blur Attribute node mixes values of neighboring elements in meshes and curves.
Currently it supports points, edges and faces on meshes and points on curves.
In theory, support for face corners could be added, but useful semantics are not
obvious yet.
The node calculates a weighted average of each element with its neighbors (based
on curve/mesh topology). The weight of the element itself is always 1, and the weight
of the neighbor elements is controlled by the weight input socket. In the future,
more options for how different elements are weight can be added (e.g. smoothing
groups and selection).
The node can perform multiple blurring iterations to achieve a blurrier result.
Generally, it is better to do multiple iterations in one node instead of using
multiple blur nodes because it has better performance in the current implementation.
We use the term "Blur" (instead of "Smooth") because smoothing is generally more
related to removing roughness from surfaces. When viewing the result of the
Blur Attribute node in the viewport, it looks like an image is blurred. While the
node can also be used to smooth surfaces, other/better algorithms exists for that
purpose (which e.g. don't reduce the volume of the mesh to zero with too many
iterations).
Differential Revision: https://developer.blender.org/D13952
**Problem**:
Area lights in Cycles have spread angle, in which case some part of the area light might be invisible to a shading point. The current implementation samples the whole area light, resulting some samples invisible and thus simply discarded. A technique is applied on rectangular light to sample a subset of the area light that is potentially visible (rB3f24cfb9582e1c826406301d37808df7ca6aa64c), however, ellipse (including disk) area lights remained untreated. The purpose of this patch is to apply a techniques to ellipse area light.
**Related Task**:
T87053
**Results**:
These are renderings before and after the patch:
|16spp|Disk light|Ellipse light|Square light (for reference, no changes)
|Before|{F13996789}|{F13996788}|{F13996822}
|After|{F13996759}|{F13996787}|{F13996852}
**Explanation**:
The visible region on an area light is found by drawing a cone from the shading point to the plane where the area light lies, with the aperture of the cone being the light spread.
{F13990078,height=200}
Ideally, we would like to draw samples only from the intersection of the area light and the projection of the cone onto the plane (forming a circle). However, the shape of the intersection is often irregular and thus hard to sample from directly.
{F13990104,height=200}
Instead, the current implementation draws samples from the bounding rectangle of the intersection. In this case, we still end up with some invalid samples outside of the circle, but already much less than sampling the original area light, and the bounding rectangle is easy to sample from.
{F13990125}
The above technique is only applied to rectangle area lights, ellipse area light still suffers from poor sampling. We could apply a similar technique to ellipse area lights, that is, find the
smallest regular shape (rectangle, circle, or ellipse) that covers the intersection (or maybe not the smallest but easy to compute).
For disk area light, we consider the relative position of both circles. Denoting `dist` as the distance between the centre of two circles, and `r1`, `r2` their radii. If `dist > r1 + r2`, the area light is completely invisible, we directly return `false`. If `dist < abs(r1 - r2)`, the smaller circle lies inside the larger one, and we sample whichever circle is smaller. Otherwise, the two circles intersect, we compute the bounding rectangle of the intersection, in which case `axis_u`, `len_u`, `axis_v`, `len_v` needs to be computed anew. Depending on the distance between the two circles, `len_v` is either the diameter of the smaller circle or the length of the common chord.
|{F13990211,height=195}|{F13990225,height=195}|{F13990274,height=195}|{F13990210,height=195}
|`dist > r1 + r2`|`dist < abs(r1 - r2)`|`dist^2 < abs(r1^2 - r2^2)`|`dist^2 > abs(r1^2 - r2^2)`
For ellipse area light, it's hard to find the smallest bounding shape of the intersection, therefore, we compute the bounding rectangle of the ellipse itself, then treat it as a rectangle light.
|{F13990386,height=195}|{F13990385,height=195}|{F13990387,height=195}
We also check the areas of the bounding rectangle of the intersection, the ellipse (disk) light, and the spread circle, then draw samples from the smallest shape of the three. For ellipse light, this also detects where one shape lies inside the other. I am not sure if we should add this measure to rectangle area light and sample from the spread circle when it has smaller area, as we seem to have a better sampling technique for rectangular (uniformly sample the solid angle). Maybe we could add [area-preserving parameterization for spherical
ellipse](https://arxiv.org/pdf/1805.09048.pdf) in the future.
**Limitation**:
At some point we switch from sampling the ellipse to sampling the rectangle, depending on the area of the both, and there seems to be a visible line (with |slope| =1) on the final rendering
which demonstrate at which point we switch between the two methods. We could see that the new sampling method clearly has lower variance near the boundaries, but close to that visible line,
the rectangle sampling method seems to have larger variance. I could not spot any bug in the implementation, and I am not sure if this happens because different sampling patterns for ellipse and rectangle are used.
|Before (256spp)|After (256spp)
|{F13996995}|{F13996998}
Differential Revision: https://developer.blender.org/D16694
Part of the workaround for NVIDIA driver issue got lost in the changes to
switch to the GPU module.
Differential Revision: https://developer.blender.org/D16709
If there is a layer that hasn't frames but is not the active layer
the pointer to frames can be NULL and crash.
Now, the empty layers are skipped.
Reported to me by Samuel Bernou.
Image engine is used to draw the image inside the image editor, uv editor and node editor. The
performance during scrolling wasn't smooth when using larger textures on a dedicated GPU. Main
reason was the data transfers that happens when panning the image.
The original idea of the image engine was to have 4 textures that are as large as the editor.
Those textures would be used to simulate a larger canvas where if the texture is out of the
visible area the texture would be reused to contain the data of a new visible area. This would
reduce the data transfers to only on certain x/y coordinates. Between those coordinates no
data transfers would be needed.
This patch implements the mechanism described above. During development other areas to
improve have been detected (incorrect color management for float textures, using different
image formats to reduce data transfer bandwidths, using different render techniques for
images upto 8k). More improvements will follow.
This updates the libraries dependencies for VFX platform 2023, and adds various
new libraries. It also enables Python bindings and switches from static to
shared for various libraries.
The precompiled libraries for all platforms will be updated to these new
versions in the coming weeks.
New:
Fribidi 1.0.12
Harfbuzz 5.1.0
MaterialX 1.38.6 (shared lib with python bindings)
Minizipng 3.0.7
Pybind11 2.10.1
Shaderc 2022.3
Vulkan 1.2.198
Updated:
Boost 1.8.0 (shared lib)
Cython 0.29.30
Numpy 1.23.2
OpenColorIO 2.2.0 (shared lib with python bindings)
OpenImageIO 2.4.6.0 (shared lib with python bindings)
OpenSubdiv 3.5.0
OpenVDB 10.0.0 (shared lib with python bindings)
OSL 1.12.7.1 (enable nvptx backend)
TBB (shared lib)
USD 22.11 (shared lib with python bindings, enable hydra)
yaml-cpp 0.8.0
Includes contributions by Ray Molenkamp, Brecht Van Lommel, Georgiy Markelov
and Campbell Barton.
Ref T99618
Instead of the the same folder as the Blender executable, generate a manifest
that lets us move the libraries out of the way of users and into a separate
folder.
Ref T99618
This is not compatible with upcoming shared libraries usage, where we can't
let each library have their own libstdc++ and safely exchange memory.
Hopefully it is no longer required either. This is from before Blender builds
were even made on CentOS 7, and there is no obvious reason it is still needed.
Ref T99618
Shared libraries and USD plugins will be placed in the same folder, where USD
already looks for plugins.
This means that specifying the path to the plugins will no longer be needed
once the new libraries are available for all platforms. For now the code was
refactored to support both cases.
Ref T99618
Ensure the environment is set up for blender_test, idiff and oslc so that they
can find the required shared libraries.
Also deduplicate add_bundled_libraries() between Linux and macOS.
Includes contributions by Ray Molenkamp and Brecht Van Lommel.
Ref T99618
This patch adds a new `max_working_set_exceeded()` check on Metal so that we can display a "System is out of GPU memory" message to the user. Without this, we get obtuse "CommandBuffer failed" errors at render time due to exceeding the size limit of resident resources.
Likely fix for T101787 & T102786.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D16713
Issue was the lifetime of GPUVertFormat & GPUVertAttr.
Both need to be static in the function to be persistent here (and
handled appropriately).
Was an error in rB319ee296fd0c.
Maniphest Tasks: T102966
Differential Revision: https://developer.blender.org/D16704
Support Esc / RMB to cancel dolly, move, rotate & zoom.
Previously only roll could be canceled.
This can be useful to temporary orbit away from the camera or an
orthographic view without having to manually set it back.
- Add VIEW_CANCEL event_code.
- De-duplicate operator freeing logic for the roll operator.
- Structure checks so adding cancel is is simplified.
- Split event checks into two blocks, one for model events, another
for all other events.
Migrate (some) of the UDIM offset calculation from inside one
of the packing engines (where it's consumed) to the packing
operator (where it's produced).
This change (and others) will help simplify the future migration
of the packing engine inside editors/uvedit/uvedit_islands.cc
to the Geometry module, so it can eventually replace the other
packing engine in geometry/intern/uv_parametrizer.cc
Store the potentially owned mesh separately from the original/evaluated
mesh which is now stored with a const pointer. Also store mesh spans
separately in the class so they don't have to be retrieved for every
index.
Avoid using an incremented "loop index" variable which makes the whole
data-filling necessarily sequential. No functional changes expected,
this just simplifies some refactors to face corner storage.
Translation from python enum values were incorrect and textures created
in python using those types would result in faulty textures. In
renderdoc those textures would not bind.
Remove most of the old (pre-3.0) pose library:
- Remove The entire `editors/armature/pose_lib.c` file
- Deprecate `Object::poselib` in DNA
- Remove Operators marked as deprecated in T93405
- Remove RNA property `Object.pose_library`
- Add comment to clarify that the call `BLO_read_id_address(reader,
ob->id.lib, &ob->poselib);` handles deprecated data.
Note that this functionality has been documented as deprecated since
Blender 3.2.
What remains of the old pose library: The DNA for action markers
(`bAction::markers`) and the corresponding Python API. This will allow
future versions of Blender to still convert old pose libraries to new
ones (via the Pose Library panel in the Action editor).
Manifest task: T93406
Bugs that caused wrong renders should be fixed now, and tests that showed minor
floating point differences on platforms were tweaked to sidestep the problem.
Ref T77889
Ensure that thumbnails of images with aspect greater than 256:1 have
dimensions of at least one pixel.
See D16707 for more details
Differential Revision: https://developer.blender.org/D16707
Reviewed by Brecht Van Lommel
We need to ensure the mask layer exists before running the operator.
I made the order of function calls here the same as in newer code later
on in this file for consistency.
Differential Revision: https://developer.blender.org/D16696
Ensure that thumbnails of images with aspect greater than 256:1 have
dimensions of at least one pixel.
See D16707 for more details
Differential Revision: https://developer.blender.org/D16707
Reviewed by Brecht Van Lommel
We need to ensure the mask layer exists before running the operator.
I made the order of function calls here the same as in newer code later
on in this file for consistency.
Differential Revision: https://developer.blender.org/D16696
Simplify checks so that one check doesn't influence the following one.
Checks no longer pass the last-visited frame number into the "start frame"
parameter of the next check. This way all test values are hard-coded and
easy to read, without having to understand how all the checks fit together.
No functional changes.
Replace `EXPECT_NE(column, nullptr)` with `ASSERT_NE(column, nullptr)` to
abort the test on failure. With `EXPECT_NE`, the test would continue onto
the next like, which accesses `column->cfra` and would segfault.
No functional changes to the tests. Just better reporting of failures.
rB8b7cd1ed2a17 broke this for the paint slots
rB4669178fc378 broke this for regular attributes
Name filtering in UI Lists works when:
- [one] the items to be filtered have a name property
-- see how `uilist_filter_items_default` gets the `namebuf`
- [two] custom python filter functions (`filter_items`) implement it
themselves
-- if you use `filter_items` and dont do name filtering there, the default
name filtering wont be used
So, two problems with rB8b7cd1ed2a17:
- [1] items to be listed changed from `texture_paint_images` to
`texture_paint_slots`
-- the former has name_property defined, the later lacks this
- [2] the new `ColorAttributesListBase` defined a `filter_items` function,
but did not implement name filtering
And the problem with rB4669178fc378:
- it added `filter_items` functions, but did not implement name filtering.
These are all corrected now.
Fixes T102878
Maniphest Tasks: T102878
Differential Revision: https://developer.blender.org/D16676
This unassign the Alt+D shortcut from the detach operator. Right now the
operator has to be accessed via the menu.
Alt+D is left for duplicate link, following the other editors.
Cursor motion events on windows read the position from GetCursorPos()
which wasn't always the same location stored in `lParam`.
In situations where events were handled immediately this wasn't often a
problem, for heavier scenes or when updates between event handling was
slow - many in-between cursor events would be incorrect.
This behavior dates back to the initial commit, there doesn't seem to be
a good reason not to use the cursor coordinates from the event.
Noticed when investigating T102346.
Make OpenGL errors match formatting used by GCC & clang
(as well as Blender's logging), so utilities that recognize this
convention can be used to quickly access this location.
Detect when the operator adds its own undo step and clear the panel.
An alternative fix for [0] which caused T101743.
Needed to prevent changing values in the last operator panel from
destructively undoing brush steps.
[0]: 11bdc321a2.
Reviewed By: mont29, joeedh
Ref D16523
This reverts commit 11bdc321a2.
This change caused T101743, in general OPTYPE_UNDO should not be used
to control the UI.
This also caused 2x undo pushes to be performed when sculpting,
although sculpt mode doesn't add a step for the second undo push
so it wasn't visible to the user.
An alternative fix will be applied separately as it's too risky this
close to a release.
The following functions only supported back slashes on WIN32,
which can use both forward and back slashes.
- BLI_path_append
- BLI_path_append_dir
- BLI_path_slash_ensure
- BLI_path_slash_rstrip
Follow up to [0] which is a more limited bug-fix.
[0]: a16ef95ff6
Support both forward and back slashes on WIN32.
Forward slashes for paths in WIN32 was removed in [0] (for BLI_path_join)
& [1] (for BLI_path_name_at_index), this is correct on UNIX as back
slashes can be used in paths but not on WIN32 which can use both.
Note that other path functions such as BLI_path_append &
BLI_path_slash_ensure should be updated too, but this is out of scope
for a bug-fix.
Documenting and ensuring Windows path handling functions all handle
forward slashes can be done separately.
[0]: 8f7ab1bf46
[1]: 511ae22264
Reviewed By: harley
Ref D16700
When triangulating meshes, the UV unwrapper was previously using a
heuristic to split quads into triangles. If one of the internal angles
is greater than 180degrees, a so-called "reflex angle", the heuristic
was giving a poor choice of split.
Instead of using a special case for quads, this change routes everything
through the generic n-gon `BLI_polyfill_beautify` method instead.
Reviewed By: Brecht Van Lommel
Differential Revision: https://developer.blender.org/D16505
When n-gons share vertices, their triangulation can be non-manifold,
even if the original mesh is manifold.
The UV Unwrapper does not currently work with non-manifold meshes.
This workaround attempts to modify the triangulation of n-gons in
the UV unwrapper to preserve the manifold property.
This change replaces the previous fix for quads, and extends it
to all n-gons.
See T84078 as motivation for this change.
Differential Revision: https://developer.blender.org/D16521
Make "Convert Attribute" and "Convert Color Attribute" operators
auto-fill their initial settings with active attribute's domain
and data type if it wasn't already set explicitly.
Differential Revision: https://developer.blender.org/D16550
You shouldn't be able to retrieve a mutable node from a const node tree
or a mutable socket from a const node. Use const_cast in one place in
order to correct this without duplicating the function, which is still
awkward in the C-API.
Uses a light tree to more effectively sample scenes with many lights. This can
significantly reduce noise, at the cost of a somewhat longer render time per
sample.
Light tree sampling is enabled by default. It can be disabled in the Sampling >
Lights panel. Scenes using light clamping or ray visibility tricks may render
different as these are biased techniques that depend on the sampling strategy.
The implementation is currently disabled on AMD HIP. This is planned to be fixed
before the release.
Implementation by Jeffrey Liu, Weizhen Huang, Alaska and Brecht Van Lommel.
Ref T77889
This was not working well in non-trivial scenes before the light tree, and now
it is even harder to make it work well with the light tree. It would average the
with equal weight for every light object regardless of intensity or distance, and
be quite noisy due to not working with multiple importance sampling.
We may restore this if were enough good use cases for the previous implementation,
but let's wait and see what the feedback is.
Some uses cases for this have been replaced by the shadow catcher passes, which
did not exist when this was added.
Ref T77889
Traverse all scene dependency graphs and stop audio playback for each
scene.
Also fixes T71233
Reviewed By: sergey, mont29
Differential Revision: https://developer.blender.org/D16646
The attribute smoothing node asks for the ability to have a factor
outside the range of 0 and 1. The problem with this is that there is a
negative weight assertion for some of the mixers. If mixing between 0
and 1, then at a factor of 2, one of the elements will be negative.
Differential Revision: https://developer.blender.org/D16351
In a few places, nodes were added without updating the Identifiers and
vector. In other places nodes we removed without removing from and
rebuilding the vector. This is solved in a few ways. First I exposed
a function to rebuild the vector from scratch, and added unique ID
finding to a few places.
The changes to node group building and separating are more involved,
mostly because it was hard to see the correct behavior without some
refactoring. Now `VectorSet` is used to store nodes involved in the
operation. Some things are handled more simply with the topology
cache and by passing a span of nodes.
The new atomic disjoint set uses additional atomics which are not supported
as intrinsics on all architectures and require linking to libatomic.
Now always link to libatomic on Linux when it is available, instead of only
checking if atomic add for int64_t requires linking to this library.
Thanks to Sergey for the help fixing this.
`is_internal` is supposed to mean that the attribute shouldn't be
visible in lists or the spreadsheet by default, and that it can't be
accessed in geometry nodes. But the value was reversed, which
just happened to work because the list filtering was swapped.
Differential Revision: https://developer.blender.org/D16680
It is not really used from any of the sources, including the
standalone app. Since we are moving to a more backend-independent
drawing it makes sense to remove header which was specific to
how Blender integrates Cycles into viewport.
There is probably some cleanup in CMake files is possible, but
there is some inter-dependency with USD.
Differential Revision: https://developer.blender.org/D16681
This change fixes issues with viewport rendering when Metal
GPU backend is used for drawing. This is not a default build
configuration and requires the following tweaks:
- Enable WITH_METAL_BACKEND CMake option (set it to on)
- Use `--gpu-backend metal` command line arguments
It also helps using the `--factory-startup` command line
argument to ensure Eevee is not used (it is not ported and
will crash).
The root of the problem was in the use of glViewport().
It is replaced with the GPU_viewport_size_get_i() which
is supposed to be portable equivalent form the GPU module.
Without this change the viewport size is detected to be 0
which backfired in few places.
The rest of the changes were to make the code more robust
in the extreme conditions instead of asserting or crashing.
Simplified and streamlined GPU resources creation in the
display driver. It was a bit convoluted mix of creation of
the GPU resources and resizing them to the proper size. It
even seemed to be done in the reverse order. Now it is as
simple as "just ensure GPU resources are there for the
given texture or buffer size".
Also avoid division by zero in the tile manager.
Differential Revision: https://developer.blender.org/D16679
Steps to reproduce were:
- Open a .blend file that is located inside of an asset library and
contains assets.
- Save and close the file.
- Open a new file (Ctrl+N -> General).
- Open asset browser and load the asset library from above.
- If the assets from the file above still show up, press refresh button.
- -> Assets from the file above don't appear.
Likely fixes the underlying issue for T102610. A followup will be needed
to correct the empty asset index files written because of this bug.
We're in the process of moving responsibilities from the file/asset
browser backend to the asset system. 1efc94bb2f introduces a new
representation for asset, which would own the asset metadata now instead
of the file data.
Since the file-list code still does the loading of asset libraries,
ownership of the asset metadata has to be transferred to the asset
system. However, the asset indexing still requires it to be available,
so it can update the index with latest data. So transfer the ownership,
but still keep a non-owning pointer set.
Differential Revision: https://developer.blender.org/D16665
Reviewed by: Bastien Montagne
This is a workaround required to get BAT reliably working again after
recent rB133dde41bb5b, which fixed many indirectly linked IDs being
tagged as directly linked, and therefore having their reference written
in .blend file.
It seems that BAT is still missing proper handling of some ID pointers.
Required for the end of the Heist production here at Blender Studio.
rB9fa4ceb340951 caused a forward compatibility issue.
Going forward, when changing socket names, only the name should be
changed and not the identifier if possible.
The existing `DisjointSet` data structure only supports single
threaded access, which limits performance severely in some cases.
This patch implements `AtomicDisjointSet` based on
"Wait-free Parallel Algorithms for the Union-Find Problem"
by Richard J. Anderson and Heather Woll.
The Mesh Island node also got updated to make use of the new data
structure. In my tests it got 2-5 times faster. More details are in 16653.
Differential Revision: https://developer.blender.org/D16653
When entering paint modes the paint pivot was cleared,
which broken rotate around pivot. Fixed for all paint modes.
PBVH modes set the pivot to the PBVH bounding box
while texture paint uses the evaluated mesh bounding box.
90ea1b7643 broke the sorting that happens as nodes are selected.
The compare function for stable sort had different requirements than
the previous implementation.
This patch adds an integer identifier to nodes that doesn't change when
the node name changes. This identifier can be used by different systems
to reference a node. This may be important to store caches and simulation
states per node, because otherwise those would always be invalidated
when a node name changes.
Additionally, this kind of identifier could make some things more efficient,
because with it an integer is enough to identify a node and one does not
have to store the node name.
I observed a 10% improvement in evaluation time in a file with an extreme
number of simple math nodes, due to reduced logging overhead-- from
0.226s to 0.205s.
Differential Revision: https://developer.blender.org/D15775
Fix debug assert opening File Browser on Windows platform.
See D16672 for more details.
Differential Revision: https://developer.blender.org/D16672
Reviewed by Julian Eisel
To make GPU backends other than OpenGL work. Adds required pixel buffer and
fence objects to GPU module.
Authored by Apple: Michael Parkin-White
Ref T96261
Ref T92212
Reviewed By: fclem, brecht
Differential Revision: https://developer.blender.org/D16042
Use recently introduced BKE_fcurve_merge_duplicate_keys (that was moved
from the transform system to BKE) to merge keyframes on the same frame
after snapping (same as what would happen with the transform system).
This makes behavior consistent and prevents a state after snapping that
cannot be reproduced in any other way.
NOTE: same probably has to be done for greasepencil, but that is for
another commit.
This exposes the fcurve cleanup from transform system to other callers
in anticipation to use it in the snapping operators.
It has been renamed from `posttrans_fcurve_clean` to
`BKE_fcurve_merge_duplicate_keys` to better describe what it does.
No functional change expected.
Ref. T101996
NOTE: same probably has to be done for greasepencil, but that is for
another commit.
Maniphest Tasks: T101996
Differential Revision: https://developer.blender.org/D16663
This just replaces the combined usage of OB_MODE_PAINT_GPENCIL
OB_MODE_SCULPT_GPENCIL
OB_MODE_WEIGHT_GPENCIL
OB_MODE_VERTEX_GPENCIL.
Differential Revision: https://developer.blender.org/D16652
Introduced in fc7beac8d6, but I think this never worked because the
`asset_library_ref` of the temporary file-list used for reading in a
background thread is nulled. Now there's a different pointer that we can
use that works properly.
Two things here:
- fix ghash lookup from rB4d497721ecd1
-- this was looking in the wrong map (causing an assert on file load)
- set MovieTrackingObject active_plane_track to NULL upon deletion (same
as for regular tracks)
-- rBfe38715600c introduced a crash because `draw_tracking_tracks` would
still get an active plane track (logic for getting these changed)
Maniphest Tasks: T102887
Differential Revision: https://developer.blender.org/D16660
a5e7657cee missed this call where clamped slicing is necessary.
The subdivision of a segment purposefully modifies the handle types of
the other side of the following control point, but that didn't work for
the final cyclic segment.
The code I wrote to group triangles or multires quads that
belonging to single faces into single PBVH nodes had edge
cases that failed. The code is now much simpler and simply
assigns groups of primitives to nodes.
When entering paint modes the paint pivot was cleared,
which broken rotate around pivot. Fixed for all paint modes.
PBVH modes set the pivot to the PBVH bounding box
while texture paint uses the evaluated mesh bounding box.
If no brush exists the stroke operator
falls through to the grab transform
op in the global view3d keymap.
This now works. It would be nice if
we could get rid of that keymap entry
though and add it manually to the edit/paint
modes that need it.
The code I wrote to group triangles or multires quads that
belonging to single faces into single PBVH nodes had edge
cases that failed. The code is now much simpler and simply
assigns groups of primitives to nodes.
When entering paint modes the paint pivot was cleared,
which broken rotate around pivot. Fixed for all paint modes.
PBVH modes set the pivot to the PBVH bounding box
while texture paint uses the evaluated mesh bounding box.
If no brush exists the stroke operator
falls through to the grab transform
op in the global view3d keymap.
This now works. It would be nice if
we could get rid of that keymap entry
though and add it manually to the edit/paint
modes that need it.
In this case the blocksize may not the one we requested, which was assumed to be
the case. Instead get the effective block size from the compiler as was already
done for Metal and OneAPI.
Unless using WITH_CYCLES_DEBUG.
This is convenient for investigating kernel performance, but too verbose to
always have in the buildbot logs especially now that we are also compiling HIP
and OneAPI kernels.
Materials now have an enum to set the emission sampling method, to be
either None, Auto, Front, Back or Front & Back. This replace the
previous "Multiple Importance Sample" option.
Auto is the new default, and uses a heuristic to estimate the emitted
light intensity to determine of the mesh should be considered as a light
for sampling. Shaders sometimes have a bit of emission but treating them
as a light source is not worth the memory/performance overhead.
The Front/Back settings are not important yet, but will help when a
light tree is added. In that case setting emission to Front only on
closed meshes can help ignore emission from inside the mesh interior that
does not contribute anything.
Includes contributions by Brecht Van Lommel and Alaska.
Ref T77889
* Split light types into own files, move light type specific code from
light tree and MNEE.
* Move flat light distribution code into own kernel file and host side
building function, in preparation of light tree addition. Add light/sample.h
as main entry point to kernel light sampling.
* Better separate calculation of pdf for selecting a light, and pdf for
sampling a point on the light. The selection pdf is now also stored in
LightSampling for MNEE to correctly recalculate the full pdf when the
shading position changes but the point on the light remains fixed.
* Improvement to kernel light storage, using packed_float3, better variable
names, etc.
Includes contributions by Brecht Van Lommel and Weizhen Huang.
Ref T77889
This cache was never written to, only "copied" between sockets in one
case, it dates back at least a decade. It doesn't make sense to store
caches on node trees directly anyway, since they can be used in
multiple places.
No user visible changes expected.
Add a function to query the full path for a file, so that asset files
can get the path via the asset representation and its new asset
identifier. This is designed to be a reliable way to locate an asset,
and using it is yet another step to rely less on the problematic file
browser code.
Also, previous code would build the full path manually in a few places,
which is good to deduplicate anyway.
With the asset identifier introduced in the previous commit, we can now
locate an asset just from its `AssetRepresentation`, without requiring
information from the asset library and the file browser storage. With
this we can remove some hacks and function parameters. A RNA/BPY
function is also affected, but I didn't remove the paramter to keep
compatibility. It's simply ignored and not required anymore, noted this
in the parameter description (noted for T102877).
No user visible changes expected.
`AssetIdentifier` holds information to uniquely identify and locate an
asset. More information:
https://wiki.blender.org/wiki/Source/Architecture/Asset_System/Back_End#Asset_Identifier
For the start this is tied quite a bit to file paths, so that external
assets are assumed to be in the file system.
This is needed to support an "All" asset library (see T102879), which
would contain assets from different locations. Currently the location of
an asset is queried via the file browser backend, which however requires
a common root location. It also moves us further away from the file
browser towards the asset system (see T87235) and allows us to remove
some hacks (see following commit).
No user visible changes expected.
If an asset library is located on disk, store the path to it in the
asset library data. This is called the "root path" now.
With this we can construct an asset identifier, which is introduced in
the following commit.
When reading directories recursively, the code would first only set the
file name as the relative path and then later iterate over the read files
and prepend the recursed into path, to get the complete path relative to
the recursed into directory. This isn't clear and confused me quite a
bit. And it is not compatible with what we need for creating asset
identifiers, which are introduced in the 2nd following commit.
Instead properly determine the complete relative path when initially
adding the file, and don't change it after. The asset identifier can the
be constructed properly at the time needed.
`done` was only used in one place, and `is_updating` was never read.
Generally we should avoid adding this sort of temporary data to longer
lived structs.
When applying the "Bake Action" operator in pose mode
it could throw an error saying "Nothing to Bake"
even though bones are selected
That is because the code was looking for a selected armature
But in Pose Mode, clicking into empty space to de-select would also
deselect the armature.
Then box selecting would not make the armature selected again
Reviewed by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D16593
When applying the "Bake Action" operator in pose mode
it could throw an error saying "Nothing to Bake"
even though bones are selected
That is because the code was looking for a selected armature
But in Pose Mode, clicking into empty space to de-select would also
deselect the armature.
Then box selecting would not make the armature selected again
Reviewed by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D16593
rB133dde41bb5b changed handling of (in)directly linked status handling
for IDs, now IDs that are not directly linked get proper status and
handling on file save. this broke parts of the `pyapi_idprop_datablock`
tests.
This commit essentially ensures before writing .blend file that only
actualy locally used linked IDs are tagged as `LIB_TAG_EXTERN` (and
therefore get a reference stored in the .blend file).
Previously, a linked ID tagged as directly linked would never get back
to the indirectly linked status. Consequence was a lot of 'needless'
references to linked data in .blend files.
This commit also introduces a new flag for lib_query ID usage types,
`IDWALK_CB_DIRECT_WEAK_LINK`, used currently for base's Object
pointer, and for LayerCollection's Collection pointer.
NOTE: A side-effect of this patch is that even IDs explicitely linked by
the user won't be kept anymore when writing files, i.e. they will not be
there anymore after a file reload, if they are not actually used.
Overhead of new process is below 0.1% in whole file saving process in
a Heist production file e.g.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D16605
Retrieve and load the vertices selected/hidden state in pos_nor extraction.
Reviewed By: fclem
Maniphest Tasks: T102519
Differential Revision: https://developer.blender.org/D16594
This is usability improvement, rather than bugfix. By default, height of
VSE timeline is clamped to 7 channels, unless more are added. But adding
new strip is not intuitive, since user can't scroll up due to clamping.
Clamp timeline height to n+1 used channels, so there is always 1 free
channel visible.
`BPYGPU_IS_INIT_OR_ERROR_OBJ` is not implemented in all pygpu functions.
Instead of copying and pasting that call across the API when it has no
gpu context, override the methods with one that always reports error.
Using 32 does not make much sense, because there will be 4 remaining
padding bytes in the struct anyway. Using 64 instead does not actually
increase the size of the struct, but makes allocations less likely.
With stereoscopy enabled, sseq->multiview_eye is set to left and
right eye during drawing, but this value is not reset, even if
stereoscopy is disabled.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D16639
`OldNewMap` used to have its own map implementation. Given that
the file uses C++ now, it is easy to use a C++ map implementation
instead. This simplifies the code a lot.
Going forward it might make sense to remove the `OldNewMap`
abstraction or to split it up in two (currently, `NewAddress.nr` has
two different meanings in different contexts which is confusing).
No functional changes are expected.
Differential Revision: https://developer.blender.org/D16546
Before, the frame was not created, but now if there is
a previous stroke and teh frame changed, the new keyframe
is created.
This is related to T102623
In `Orphan Data` (or `Blender File`) view, the ID pointer of the
actions's parent tree-element wasn't actually pointing to an ID, but to
the list-base containing the IDs.
Early out (with a warning) if the object or object-data to unlink the
action from is not clear.
Caused by rBb4a2096415d9.
Similar to rBe772087ed664.
Maniphest Tasks: T102797
Differential Revision: https://developer.blender.org/D16635
Before rBa8a454287a27, edge creases were copied to the result mesh as
part of `MEdge`. Now they are stored in a separate `CD_CREASE` layer,
which I mistakenly disabled for interpolation. However, to maintain
the geometry node uses a field input, remove the interpolated attribute
there.
Caused by a8a454287a which assumed it was possible
to access the raw data of the edge creases layer. Also allow
processing vertex creases even if there aren't any edge creases.
**Empty Slot Fix**
Currently the boolean modifier transfers the default material from
meshes with no materials and empty material slots to the faces on the
base mesh. I added this in a2d59b2dac for the sake of consistency,
but the behavior is actually not useful at all. The default empty
material isn't chosen by users, it just signifies "nothing," so when
it replaces a material chosen by users, it feels like a bug.
This commit corrects that behavior by only transferring materials from
non-empty material slots. The implementation is now consistent between
exact mode of the boolean modifier and the geometry node.
**Index-Based Option**
"Index-based" is the new default material method for the boolean
modifier, to access the old behavior from before the breaking commit.
a2d59b2dac actually broke some Boolean workflows fundamentally, since
it was important to set up matching slot indices on each operand. That
isn't the cleanest workflow, and it breaks when materials change
procedurally, but historically that hasn't been a problem. The
"transfer" behavior transfers all materials except for empty slots,
but the fundamental problem is that there isn't a good way to specify
the result materials besides using the slot indices.
Even then, the transfer option is a bit more intuitive and useful for
some simpler situations, and it allows accessing the behavior that has
been in 3.2 and 3.3 for a long time, so it's also left in as an option.
The geometry node doesn't get this new option, in the hope that we'll
find a better solution in the future.
Differential Revision: https://developer.blender.org/D16187
**Empty Slot Fix**
Currently the boolean modifier transfers the default material from
meshes with no materials and empty material slots to the faces on the
base mesh. I added this in a2d59b2dac for the sake of consistency,
but the behavior is actually not useful at all. The default empty
material isn't chosen by users, it just signifies "nothing," so when
it replaces a material chosen by users, it feels like a bug.
This commit corrects that behavior by only transferring materials from
non-empty material slots. The implementation is now consistent between
exact mode of the boolean modifier and the geometry node.
**Index-Based Option**
"Index-based" is the new default material method for the boolean
modifier, to access the old behavior from before the breaking commit.
a2d59b2dac actually broke some Boolean workflows fundamentally, since
it was important to set up matching slot indices on each operand. That
isn't the cleanest workflow, and it breaks when materials change
procedurally, but historically that hasn't been a problem. The
"transfer" behavior transfers all materials except for empty slots,
but the fundamental problem is that there isn't a good way to specify
the result materials besides using the slot indices.
Even then, the transfer option is a bit more intuitive and useful for
some simpler situations, and it allows accessing the behavior that has
been in 3.2 and 3.3 for a long time, so it's also left in as an option.
The geometry node doesn't get this new option, in the hope that we'll
find a better solution in the future.
Differential Revision: https://developer.blender.org/D16187
Actually, the interpolation can be done only between keyframes different of breakdown type,
but in some cases, this is not convenient.
Now, a new option is displayed to allow the interpolation using breakdown keyframes
as interpolation extremes.
Reviewed By: mendio, pepeland
Differential Revision: https://developer.blender.org/D16515
Makes code safer, easier to understand, and less verbose. I detected
negligible performance differences, only a slight improvement for the
normalize step where the function call overhead was probably more
of a bottleneck.
I kept `memset` instead of `.fill(float3(0))` because that gave
better performance in my tests. In the future that stage could be
parallelized, or we could make sure new arrays are allocated with
`calloc`.
Meta strip position relies on strips within. When meta strip is empty,
update function, that would normally update it's position returns early
and this causes translaton to behave erratically.
When strip is empty, treat it as normal strip and move its start frame
as with other strip types.
This patch makes the Bake Actions operator fills the Start Frame & End From with that of the Preview Range if "Use Preview Range" is enabled.
{F13973619}
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D16630
Use `ED_view3d_win_to_3d` to unproject the first click coords.
This is the same function used in other tools like Draw Curve.
Differential revision: https://developer.blender.org/D16617
The node transferred position once as a generic attribute, and then set
the values again manually. This wastes processing during the attribute
transfer step. On a 1 million face grid, I observed roughly an 8%
improvement, from 231.5 to 217.1 ms average and 225.4 to 209.6 ms min.
It's helpful to have these topology maps standardized and organized
a bit better so they can be optimized and considered for future caching
together. Also use a more standard name for the map for that purpose.
Fix a performance regression from 05952aa94d by storing pointers
to mesh arrays locally in the subdiv foreach context. In a simple test
of a 1 million face grid, this improved performance by 5% (from 0.31
to 0.295 seconds).
A utility function retrieved mesh arrays for every element after
05952aa94d which can be easily avoided. This was used when
building the GPU indices for sculpt mode drawing. In my tests this
saves 0.1ms per PBVH node. There may be very slight improvements
in line art and shrinkwrap as well.
The issue was that geometry nodes was not reevaluated after changing the
content of the collection. That resulted in the other object still having a
reference to the deleted object, which resulted in a crash when it tried to
access it.
Adding the `ID_RECALC_GEOMETRY` tag indicates that the content of the
collection has changed and will trigger geometry nodes setups that depend
on the collection to update.
{F13294314}
# Process
In the pixel extraction process a larger domain will be extracted then the input mesh.
The borders of uv islands are extended with connected geometry of the input mesh.
The extended mesh is then fed into the pixel extraction process.
A mask is used to limit the extraction so UV islands will not overlap.
Input UV islands.
{F13206401}
Extended UV Island (only one showing).
{F13288764}
This patch doesn't include fixing uv seams at non-manifold edges (like suzannes eyes) as that
would require a different approach (edge extending or pixel copy-ing). The later has already been
implemented in D14702, but should be revisited to only use do the non-manifold edge fixing.
This patch supports fixing UV seams across UDIM textures.
There might be an issue when using a single texture on multiple uv maps.
Reviewed By: brecht, joeedh, JulienKaspar
Maniphest Tasks: T97352
Differential Revision: https://developer.blender.org/D14970
Add support for `pin_unselected` in new UV Packing API.
Regression introduced by API change in rBe3075f3cf7ce.
Duplicate change to rB0ce18561bc82 in master.
This new inheritance behavior is more beneficial for the metal Backend.
Also change the default depth write behavior of shaders to be unchanged.
This makes fragment shader depth amendment more explicit.
This also add the missing depth_write for metal kernels.
When accessing certain structure fields from Python, they return
mathutils types instead of generic arrays (this is based on subtype).
This exposes this information in the Python API documentation.
Differential Revision: https://developer.blender.org/D16626
Issue was caused by imprecise math due to using float numbers.
Use double instead.
No negative performance impact was observed.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D16517
Meta strip range was adjusted in versioning because of previous issues
by function `version_fix_seq_meta_range`. After `speed_factor` property
was added, this changed how function works and result was incorrect
function due to uninitialized property value.
Running `version_fix_seq_meta_range` after `seq_speed_factor_set` fixes
this issue.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D16606
Overlay relationship lines were missing between the object having the
modifier and the target object.
To make this consistent with other objects types, now draw relationship
lines for greasepencil and hooks now, too.
Spotted while looking into T102741.
Maniphest Tasks: T102741
Differential Revision: https://developer.blender.org/D16609
Brush cursors were missing when opening a file saved in sculpt/vertex-/
weightpaint mode.
Since we dont do a full modeswitch on file load in `ED_editors_init` for
grease pencil since rBde994d6b7b1c, we were missing the brush cursor
toggling [`ED_gpencil_toggle_brush_cursor`] normally done in
`ED_gpencil_setup_modes`.
This is now explicitly added for any greasepencil paintmode (in case
object is active).
Maniphest Tasks: T102685
Differential Revision: https://developer.blender.org/D16603
These comments were from rBcc7460eaa491 / rBde994d6b7b1c /
rB7037ff920447 but ended up in a confusing state.
Moved into the right places and reworded appropriately.
Spotted while looking into T102685.
Maniphest Tasks: T102685
Differential Revision: https://developer.blender.org/D16601
Caused by {rBbf8507414889}
Above comit set the wrong cursors (WM_CURSOR_DEFAULT).
When releasing MMB, we need to return to WM_CURSOR_PAINT_BRUSH.
When exiting, we need to return to WM_CURSOR_DOT (since this is the
default cursor for the tool, see `_defs_gpencil_paint` >
`generate_from_brushes`)
Maniphest Tasks: T102650
Differential Revision: https://developer.blender.org/D16591
When in greasepencil sculpt-/vertexpaint mode and using selection
masking, picking points wasnt working correctly.
So regular gpencil.select (without modifier keys) was not enabled for the
keymap. This only really makes sense for RCS (right click select) atm
(and not using RC fallback tools - which I dont think are present in
these modes anyways). With RCS, this can be supported and afaict, this
does not cause conflicts.
NOTE: prior to D16576, one could use the ALT modifier key (this
combination was actually in the keymap) -- but it should select the
entire stroke, which is handled in D16576.
Differential Revision: https://developer.blender.org/D16577
Caused by rB85f90ed6fd88.
Above commit made sure whole strokes are selected when the
GP_SELECTMODE_STROKE is used in different modes, but ignored the fact
that this can also already be set by the entire_strokes select operator
property.
This is now corrected.
Differential Revision: https://developer.blender.org/D16576
As described in T101948, this commit changes socket name to be more
consistent with other nodes that generate instances output.
Differential Revision: https://developer.blender.org/D16394
Change name to make navigation easier for beginner users. This should
more clearly hint at the use of this node to change the full geometry,
and not work with fields, and makes the name more consistent.
Differential Revision: https://developer.blender.org/D16396
While implementing T102289, I noticed that this node has
several solutions that are different from other, newer nodes.
- Explicitly set default values
- Use references
- Reduce the size of the node settings structure
Differential Revision: https://developer.blender.org/D16548
Instead of creating a new mesh from scratch, modify an existing mesh.
This allows us to keep derived caches for triangulation and bounds
alive more easily, and allows keeping materials and non-generic
attributes like vertex groups alive on the mesh.
It also has other performance benefits, since face and face corner
attributes aren't affected at all, and because of reduced overhead
from not allocating a new mesh.
Updating edge attributes is a bit more complicated now, since we
have to completely replace the arrays but keep the existing attribute
IDs around. The new mesh update tag is also slightly too specific IMO.
But I think both of those things will improve in the future because
of existing plans for further refactoring these areas:
- New attribute storage that gives pointer stability
- Further use and granularity of mesh update tagging that will
make the correct API more clear
Fixes T102711
Differential Revision: https://developer.blender.org/D16615
Add a script for a very simple object evaluation benchmark.
There could be more advanced ways of measuring the time
per-node or per modifier, but this just loads the file, tags
the active object for a reevaluation, and times how long
that takes.
Differential Revision: https://developer.blender.org/D16604
The main goal here is to move towards more self contained node
definitions. Previously, one would have to change `blenkernel` to
add a new node which is not necessary anymore. There is no need
for all these register functions to "leak out" of the nodes module.
Differential Revision: https://developer.blender.org/D16612
Point clouds are meant to use a default radius of 0.01 when there is no
radius attribute. The curve to points node can create curves without a
radius attribute. This affects joining and the realize instances node.
Similar to 30f244d96f.
Based on discussion in D10891, this node isn't meant to be exposed and
may be removed in the future. The fact that it was exposed in search
menus was a mistake from the implementation of link-drag-search
and bdb5754147.
I explicitly removed the link drag search implementation, and added
(Legacy) to the node name which hides it from the add node search.
The issue is caused by the combination of the following factors:
- There is a driver from custom property to the subdivision surface
modifier.
- Active material index tags the ID for the copy-on-write update.
Dependency graph currently does not fully distinguish between
copy-on-write tag and properties-update tag, so the copy-on-write tag
makes the dependency graph believe that it is property which actually
affects evaluation has been changed.
The simple solution is to treat the active material slot index as an
interface data which does not need to trigger copy-on-write tag.
The possible downside of this solution is that if someone has a driver
from this property the driver will stop working. Whether there is such
a real-life setup or not is not clear. Is not something advisable to do
anyway.
Possible alternative would be to introduce more granularity into the
way how property tagging is done. This is something that would be nice
to implement eventually, but it is a much bigger refactor.
Differential Revision: https://developer.blender.org/D16613
Basically copy the information from the commit message of the
03e2f11d48 directly to the code.
This makes the information easier to find when working on the
code.
The copy-on-write is really an implementation detail of the
dependency graph. While there are still cases where there is
no better tag to be used, the ID_RECALC_COPY_ON_WRITE should
not be used in combination with a dedicated tag.
For example if location of object changes the proper tag is
`ID_RECALC_TRANSFORM`. Tagging with `ID_RECALC_TRANSFORM |
ID_RECALC_COPY_ON_WRITE` will seemingly work, but this is
not an intended usage.
Ensure VolumeUniformPool uses is always incremented when retrieving a buffer in alloc().
Otherwise the same buffer will be retrieved for more than one object when incrementing the pool size.
Reviewed By: fclem
Maniphest Tasks: T101402
Differential Revision: https://developer.blender.org/D16607
If the compositor is enabled or disabled, the node warnings for
unsupported nodes is not updated because of a missing redraw. This patch
adds that missing redraw in order to make the change immediate.
Missed in the first commit[1].
Initially it was reported that the `flags` parameter was unused on
`imb_cache_filename` but it turns out another swath of code was unused
related to that same function. Clean this up now too.
[1] 38573d515e
The wrong guiding distribution was used when direct and indirect light
scattering happened at different locations. Now use a different distribution
for each location.
Recording is not quite correct since OpenPGL does not support spliting the
path like this, instead recording at the start of the volume ray. In practice
this seems to make little difference.
Differential Revision: https://developer.blender.org/D16448
Swapping some ID lists between Mains must invalidate the name_map cache.
Note that in theory, at least WM type could be ignored by name_map
cache, since it is a singleton. However, don't think it's worth adding
extra complication here, for really marginal benefits. The overhead of
rebuilding the name cache here is extremly small.
For some reason, this issue did not show so far in master, only appeared
in some branch work on improving (in)direct status of linked IDs... Go
figure.
With this change Blender, delivered via the Microsoft store, will launch without the console window flashing.
Ref T88613
Differential Revision: https://developer.blender.org/D16589
Previously when using the "Jump To Keyframe" operator
in conjunction with subframes, the decimal part would be kept.
Meaning that it wouldn't jump exactly to the frame.
This fix also makes it so it is possible to jump to keyframes
that are on subframes.
Reviewed by: Sybren
Differential Revision: https://developer.blender.org/D16595
Add int attributes interpolation support for GPU subdivision.
Ensure cached shaders match their intended defines.
(The defines parameter was ignored when requesting a second time the same shader with different defines)
De-duplicate the extract_attr_init code for subdiv/non-subdiv.
Reviewed By: jbakker, fclem
Maniphest Tasks: T102076
Differential Revision: https://developer.blender.org/D16420
This removes the unused code for the IBM tile cache APIs. These have
been unused for as far back as I could manage to search.
Since TIFF was used for the cached images, this removal will allow for
an easier review when it comes time to move TIFF to OIIO as part of
T101413.
Differential Revision: https://developer.blender.org/D16587
When either initializing with a non-constant value, or using the standard
[[ string widget = "null" ]] metadata. This can be used for inputs like
normals and texture coordinates, where you don't want to default to a
constant value.
In previous OSL versions the input value was automatically ignore when it
was left unchanged for such inputs. However that's no longer the case in
the latest version, breaking existing nodes. There is no good entirely
backwards compatible fix, but I believe the new behavior is better and will
keep most existing cases working.
Fix T102450: OSL node with normal input not working
a5e7657cee didn't account for slices of zero sizes, and the asserts
were slightly incorrect otherwise. Also, the change didn't apply to
`Span`, only `MutableSpan`, which was a mistake. This also adds "safe"
methods to `IndexMask`, and switches function calls where necessary.
These editors have their own "Auto-Snap" activation option.
So ignore the option in the 3D View in these cases.
The generic incremental snap function doesn't seem really useful in these cases.
If an incremental snap needs to be implemented, this should be a new option of `eAnimEdit_AutoSnap`.
After a recent refactor in b247588dc0, object mode would not show wireframe
edges that do not exist in the original mesh. Now only hide such edges while in
edit mode, where they would otherwise look as if they can be selected.
Before the refactor, edit and paint modes would sometimes show wireframes and
sometimes not, depending on the modifier stack in unpredictable ways.
This wasn't used for backwards compatibility, because Blender does not
read from the `nodetype` anywhere. It also wasn't used for forward
compatibility, because it was not initialized for new node groups.
With this change Blender, delivered via the Microsoft store, will launch without the console window flashing.
Ref T88613
Differential Revision: https://developer.blender.org/D16589
Vulkan doesn't have a memory allocator builtin. The application should
provide the memory allocator at runtime. Vulkan Memory Allocator is a
widely used implementation.
Vulkan Memory Allocator is a header only implementation, but the using
application should compile a part in a CPP compile unit. The file
`vk_mem_alloc_impl.cc` and `extern_vulkan_memory_allocator` library
is therefore introduced.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D16572
This is not used for anything in practice currently. The original intention
was probably to generate different socket subtypes, but that is solved
differently now (e.g. using `NodeSocketFloatDistance`). It's possible
that an addon tried to use this but it's rather unlikely.
Differential Revision: https://developer.blender.org/D13188
This patch warns the user that the compositor setup is not fully
supported when an unsupported node is used. The warning is displayed as
an engine warning overlay and in the node header itself.
See T102353.
Differential Revision: https://developer.blender.org/D16508
Reviewed By: Clement Foucault
(Probably requires ASan for a reliable crash.)
Steps to reproduce were:
* Enter Geometry Nodes Workspace
* Press "New" button in the geometry nodes editor header
* Right-click the data-block selector -> "Mark as Asset"
* Change 3D View to Asset Browser
* Create a catalog
* Drag new Geometry Nodes asset into the catalog
* Save the file
* Press Shift+A in the geometry nodes editor
There was a general issue here with keeping catalog pointers around
during the add menu building. The way it does things, catalogs may be
reloaded in between.
Since the Current File asset library isn't loaded in a separate thread,
the use-after-free would always happen in between. For other libraries
it could still happen, but apparently didn't by chance.
This patch disables the realtime compositor on MacOS until Metal is
supported. This is because MacOS doesn't support the necessary GPU
features to make it work.
An engine error overlay is displayed if it is enabled and the option
itself is greyed out.
See T102353.
Differential Revision: https://developer.blender.org/D16510
Reviewed By: Clement Foucault
This patch turns the checkbox option to enable the viewport compositor
into a 3-option enum that allows:
- Disabled.
- Enabled.
- Enabled only in camera view.
See T102353.
Differential Revision: https://developer.blender.org/D16509
Reviewed By: Clement Foucault
The active catalog ID (UUID) was a read only property. From a studio I
got the request to make this editable, so their pipeline tooling can
make certain assets visible.
Differential Revision: https://developer.blender.org/D16356
Reviewed by: Sybren Stüvel
This patch implements the Track Position node for the realtime
compositor.
Differential Revision: https://developer.blender.org/D16387
Reviewed By: Clement Foucault
Opening the material selector after reloading files could cause long UI
freezes, because some linked in materials don't have the preview stored
in the source file. So Blender would keep rerendering it after every
file load, which may involve compiling OpenGL shaders, which again
freezes the UI typically. This was reported as quite an issue for the
Heist Production by the Blender Studio.
Don't render these missing material previews from linked data-blocks
anymore.
Differential Revision: https://developer.blender.org/D16538
Reviewed by: Brecht Van Lommel, Jeroen Bakker
The old hard limit was 5, but now it's possible set to a max
value of 16. UI limit remains to 5.
This extreme value is only used in some corner case, but it
was a request by some artists.
Warning: Using very high values could produce a long calculation time, especially in strokes with a high density of points.
It is possible that the image editor redraw happens prior to the
"Loading render kernels" status is reported from status but after
the display driver is created. This will make the image editor to
wait on the scene mutex to update the display pass in the film.
If it happens to be that the kernels are actually to be compiled
then the Blender interface appears to be completely frozen, without
any information line in the image editor.
This change makes it so the amount of time the scene mutex is held
during the kernel compilation is minimal.
It is a bit unideal to unlock and re-lock the scene mutex in the
middle of update, while nested reset mutex is held, but this is
already what is needed for the OptiX denoiser optimization some
lines below. We can probably reduce the lifetime of some locks,
avoiding such potential out-of-order re-locking. Doing so is
outside of the scope of this patch.
The scene update only happens from the single place in the session,
which makes it easy to ensure the kernels are loaded prior the rest
of the scene update.
Not only this change makes it so that the "Loading render kernels"
status appears in the image editor, but also allows to pan and zoom
in the image editor, potentially allowing artists to re-adjust their
point of interest.
Differential Revision: https://developer.blender.org/D16581
This prevents Blender from crashing with an access violation when
stopping a VR session using the DirectX backend. The issue occurred for
any headset on Windows+Nvidia when using the SteamVR runtime and thus
affected a large number of users.
The workaround presented here is to simply skip unregistering the
shared resources on exit, as either of the calls to
`wglDXUnregisterObjectNV()` or `wglDXCloseDeviceNV()` will result in an
access violation. While not ideal, this avoids the crash and doesn't
present any issues when starting a new VR session.
Reviewed By: Severin
Differential Revision: https://developer.blender.org/D16569
Before this, if there were no missing files, the operator would run
successfully but there would be no user feedback at all, making the
user wonder if the operator was even run.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D16585
`GeometrySet::has()` can return an empty component. It's more convenient
if it doesn't, since other code rarely wants to access an empty component.
The alternative would be adding an `is_empty()` check in the lazy function
for the viewer node, that would work fine too, for this case.
Differential Revision: https://developer.blender.org/D16584
When combining the internal geometry component instancing (used when
the original object type doesn't match the evaluated data type) with
the "vertex dupli" instancing could cause the fix from e508de0417
to fail, because the subsequent fix from 864af51d6a popped from the
"instance generator type" stack even when there was nothing added to it
(for geometry instancing).
Currently the face set of every single face is saved for every sculpt undo step.
When only changing the face sets of a small section of the mesh, this can be quite
wasteful. It also makes face sets a special case compare to all other sculpt undo step
types, which makes the whole system more complex and harder to improve.
Fixes T101203.
Reviewed By: Hans Goudey
Differential Revision: https://developer.blender.org/D16224
Ref D16224
Currently the face set of every single face is saved for every sculpt undo step.
When only changing the face sets of a small section of the mesh, this can be quite
wasteful. It also makes face sets a special case compare to all other sculpt undo step
types, which makes the whole system more complex and harder to improve.
Fixes T101203.
Reviewed By: Hans Goudey
Differential Revision: https://developer.blender.org/D16224
Ref D16224
We currently check multiple dynamic attribute providers for the
attribute ID, even after it has been removed (which can free the name).
This was used as a simple way to remove multiple attributes with the
same name (dealing with name collisions). However, that doesn't happen
in practice at this point, since so much code has moved to the
attribute API which checks for it.
Since we free BMesh attributes by attempting on every domain,
sometimes the attribute wouldn't be found for a CustomData.
We avoid reallocating custom data blocks in that case, so we
need to pass the ownership of the "pool" back to the BMesh.
Wrote a new API method, BKE_pbvh_sync_visibility_from_verts
that flushes vertex hidden flags to edges & faces.
Fixes not being able to sculpt outside a face set after
undoing the fkey hide-all-but-this operator.
Wrote a new API method, BKE_pbvh_sync_visibility_from_verts
that flushes vertex hidden flags to edges & faces.
Fixes not being able to sculpt outside a face set after
undoing the fkey hide-all-but-this operator.
Currently slicing a span clamped the final size so that it would be
within bounds of the input. However, in the vast majority of cases
that is already the case anyway, and we can use asserts to detect
when that assumption fails.
The clamping had a performance cost. On a test interpolating a boolean
attribute from 1 million curves to 4 million points, removing the
clamping saved about 10% of the time. That's an extreme case but
this probably slightly improves performance in other cases too.
Slicing is used a lot in the new curve code.
This commit introduces `slice_safe` which still does the clamping,
and uses it in the few places that needed it or where I wasn't
sure.
MoltenVK is part of the vulkan SDK. Blender requires the vulkan SDK
to compile. This patch adds the MoltenVK includes and libraries to
the Vulkan includes and libraries.
This avoids need to do special trickery detecting whether the principal
point is to be changed when reloading movie clip. This also allows to
transfer the optical center from high-res footage to possibly its lower
resolution proxy without manual adjustment.
On a user level the difference is that the principal point is exposed in
the normalized coordinates: frame center has coordinate of (0, 0), left
bottom corner of a frame has coordinate of (-1, -1) and the right top
corner has coordinate of (1, 1).
Another user-visible change is that there is no more operator for setting
the principal point to center: use backspace on the center sliders will
reset values to 0 which corresponds to the center.
The code implements versioning in both directions, so it should be
possible to open file in older Blender versions without loosing
configuration.
For the Python API there are two ways to access the property:
- `tracking.camera.principal_point` which is measured in the normalized
space.
- `tracking.camera.principal_point_pixels` to access the pixel-space
principal point.
Both properties are not animatable, so there will by no conflict coming.
Differential Revision: https://developer.blender.org/D16573
Before this an attempt to assign track from another object wos
silently assigning active object to null. Such silencing of
errors is not really a good way.
De-duplicate selection logic and threshold between various
operators (selection and sliding).
The user measurable difference is that regular selection
threshold now matches sliding threshold: it is more strict
now. The possible downside of this is that it might be more
tricky to select tracks, but this is what needs to happen
for tools support. Also, this matches object selection in
viewport.
Use active object accessor, and then access data from the
object. There is no need to have an API call for shortcut
of all object fields.
Should be no functional change.
Make it more obvious in the name that an operation is not
cheap, and that the function operates on a tracks from
object and does not need a global tracking structure.
Historically tracks and reconstruction for motion tracking camera
object were stored in the motion tracking structure. This is because
the data structures pre-dates object tracking support, and it was
never changed to preserve compatibility.
Now the compatibility code supports more tricks and allows to change
the ownership without breaking any compatibility. This is what this
change does: it moves tracks from motion tracking structure to the
motion tracking camera object, and does it in a way that no
compatibility is broken.
One of the side-effects of this change is that the active track is
now stored on motion tracking object level, which allows to change
active motion tracking object without loosing active track. Other
than that there are no expected user-level changes.
The function is already doing a lot of memory indirections and
sub-optimal lookups, so for the simplicity and robustness of the
system might as well just do copy-on-write update.
This adds a vulkan backend to GHOST. The code was extracted from the
tmp-vulkan branch. The main difference with the original code is that
GHOST isn't responsible for fallback. For Metal backend there is already
an idea that the GPU module is responsible for the fallback, not the system.
For Blender we target Vulkan 1.2 at the time of this patch.
MoltenVK (needed to convert Vulkan calls to Metal) has been added as
a separate package.
This patch isn't useful for end-users, currently when starting blender with
`--gpu-backend vulkan` it would crash as the `VBBackend` doesn't initialize
the expected global structs in the GPU module.
Validated to be working on Windows and Apple. Linux still needs to be tested.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D13155
Adds support for Material, Random, Single and Object color modes.
Adds flat shading support.
Adds backaface culling support.
prepass_shader_cache_ is actually used now.
This adds a new experimental option for testing the new rewrite.
This is a full rewrite using C++ and using the new DRW API.
This tries to simplify each aspect of the engine:
- Materials are put in SSBOs.
- Only one shader per pass.
The goal is to leverage the new DRW capabilities in term of GPU culling
and drawcall batching.
2022-10-03 13:33:20 +02:00
2342 changed files with 107642 additions and 51013 deletions
Read [these tips](https://wiki.blender.org/wiki/Process/Bug_Reports) and watch this **[How to Report a Bug](https://www.youtube.com/watch?v=JTD0OJq_rF4)** video to make a complete, valid bug report. Remember to write your bug report in **English**.
### What not to report here
For feature requests, feedback, questions or issues building Blender, see [communication channels](https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests).
### Please verify
* Always test with the latest official release from [blender.org](https://www.blender.org/) and daily build from [builder.blender.org](https://builder.blender.org/).
* Please use `Help > Report a Bug` in Blender to automatically fill system information and exact Blender version.
* Test [previous Blender versions](https://download.blender.org/release/) to find the latest version that was working as expected.
* Find steps to redo the bug consistently without any non-official add-ons, and include a **small and simple .blend file** to demonstrate the bug.
* If there are multiple bugs, make multiple bug reports.
* Sometimes, driver or software upgrades cause problems. On Windows, try a clean install of the graphics drivers.
### Help the developers
Bug fixing is important, the developers will handle a report swiftly. For that reason, we need your help to carefully provide instructions that others can follow quickly. You do your half of the work, then we do our half!
If a report is tagged with Needs Information from User and it has no reply after a week, we will assume the issue is gone and close the report.
- type:textarea
attributes:
label:"Description"
value:|
**System Information**
Operating system:
Graphics card:
**Blender Version**
Broken: (example: 2.80, edbf15d3c044, master, 2018-11-28, as found on the splash screen)
Worked: (newest version of Blender that worked as expected)
**Short description of error**
**Exact steps for others to reproduce the error**
Based on the default startup or an attached .blend file (as simple as possible).
option(WITH_CYCLES_ONEAPI_BINARIES"Enable Ahead-Of-Time compilation for Cycles oneAPI device"OFF)
option(WITH_CYCLES_ONEAPI_HOST_TASK_EXECUTION"Switch target of oneAPI implementation from SYCL devices to Host Task (single thread on CPU). This option is only for debugging purposes."OFF)
[Blender](https://www.blender.org) is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline—modeling, rigging, animation, simulation, rendering, compositing and motion tracking, even video editing.
This package provides Blender as a Python module for use in studio pipelines, web services, scientific research, and more.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.