The socket indices in `bNode` and their corresponding `lf::Node`
don't match exactly, because `lf::Node` does not contain the
unavailable sockets. A simple mapping from `bNodeSocket` index
to `lf::Socket` index is required for future work. For now it
only removes the need for various tempory vectors.
This adds baking support to simulation nodes.
The following features are supported:
* Bake simulation nodes of selected objects from the new "Baking" panel in the
object properties.
* Free baked/cached simulation data.
* The bake is stored on disk in a folder next to the .blend file (so it's necessary
to save before baking works).
* Baked data is detected automatically when reloading the file.
* The data stored on disk is partially deduplicated. Only duplicates that can be
detected using implicit-sharing are taken into account.
* The baked data can contain meshes, curves, pointclouds and instances.
* The simulation state is written using a combination raw binary files for the
data arrays and `.json` for meta data. Other formats besides `.json` could be
used (most code is agnostic to that), but json is the easiest to use right now and
seems to be good enough the common use cases (note that the size of the `.json`
files do not depend on how large e.g. the baked mesh is).
* During baking, there is a progress bar and it can be interrupted using escape.
Limitations:
* Volumes are not written to disk yet.
* Currently it always bakes the entire scene frame range.
* Baking subframes is supported internally, but is not exposed in the UI.
* Currently, all attributes are written, but that is likely not necessary in most
cases (e.g. selection attributes are written as well).
Pull Request: blender/blender#106937
Similar to the cache of loose edges added in 1ea169d90e,
cache the number of loose vertices and which are loose in a bit map.
This can save significant time when drawing large meshes in the
viewport, because recalculations can be avoided when the data doesn't
change, and because many geometry nodes set the loose geometry
caches eagerly when the meshes contain no loose elements.
There are two types of loose vertices:
1. Vertices not used by any edges or faces
`Mesh.loose_verts()`
2. Vertices not used by any faces (may be used by loose edges)
`Mesh.verts_no_face()`
Because both are used by Blender in various places, because the cost
is only a bit per vertex (or constant at best) and for design consistency,
we cache both types of loose elements. The bit maps will only be
allocated when they're actually used, but they are already accessed
in a few important places:
- Attribute domain interpolation
- Subdivision surface modifier
- Viewport drawing
Just skipping viewport drawing calculation after certain geometry
nodes setups can have a large impact. Here is the time taken by
viewport loose geometry extraction before and after the change:
- 4 million vertex grid node: 28 ms to 0 ms
- Large molecular nodes setup (curve to mesh node): 104 ms to 0 ms
- Realize instances with 1 million cubes: 131 ms to 0 ms
Pull Request: blender/blender#105567
The node outputs the index of the closest element to itself. See #102387
for the original design.
This is different from the Sample Nearest node in two important ways:
* It does not have a geometry input, instead the geometry is taken from the
field evaluation context.
* The node can exclude the "current" element from the search.
* The group id input can be used to build subsets of elements that only
consider each other as neighbors and ignore elements with other ids.
Pull Request: blender/blender#104619
The issue happens because the algorithm used to calculate the center of
the selection first needs to create a TransData array. In this array,
the code calculates the "mirrored" elements which can be quite slow in
dense meshes.
The solution is replace this slow algorithm used for calculating the pivot
point with the fast algorithm used to calculate the position of transform
gizmos.
Pull Request: blender/blender#107203
An operator to allow interactive text selection for 3D Text Objects.
This is from the code of Yash Dabhade (yashdabhade) for GSoC 2022
with corrections and simplifications. Also includes double-click for
word selection.
Pull Request: blender/blender#106915
When EEVEE is rendering multiple samples via
eevee_draw_scene, the command submission and in-flight
memory pressure would grow until all samples completed,
due to lack of intermediate flushing of GPU work and memory.
This patch adds a command flush and memory clear for this case
which occurs with high TAA sample counts during saving, similar
to the process in EEVEE_render_draw.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#107221
Function `WM_keymap_guess_opname()` skipped `UI_OT` operator types. In
some cases this is detremental to workflow, see #105371.
To exclude operators from getting keyboard shortcut it was suggested by
Campbell to use flag `OPTYPE_INTERNAL` or make new one.
Pull Request: blender/blender#105383
This patch contains changes needed for retiming sound strips.
`BKE_sound_set_scene_sound_pitch()` is replaced by
`BKE_sound_set_scene_sound_pitch_constant_range()` which uses new
Audaspace interface to set pitch in bulk.
This is done in `SEQ_retiming_sound_animation_data_set()` where retimed
sections are created for each strip. When strip is inside of meta
strip(s), the retimed sections of meta and actual strip are split where
they intersect and pitch is multiplied where they overlap. Each section
will have pitch value that is provided to audaspace.
Waveform overlay now represents retimed audio accurately.
Ref: #100337
Pull Request: blender/blender#105072
Whether the outputs are fields only depends on whether at least one of the
last three inputs is a field. It does not matter whether the `Value` input is
a field.
Pull Request: blender/blender#106007
Patch prefers usage of Transform Feedback for hair refinement
as opposed to compute, as vertex work can be pipelined with
existing rendering work which is in-flight.
This approach is ~20% faster depending on the scene. Note that
the current implementation only uses TF, as storage buffer support
is disabled. Though once storage buffer support is added, we should
still use the TF path.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#107166
This PR uses the VK_EXT_debug_utils extension, but it's only for labeling, so it doesn't rely on the VK_LAYER_KHRONOS_validation functionality.
The functions that do these things are loaded into the runtime as vulkan extensions.
Declare the function pointers in a struct and make them members of vk_context.
Pull Request: blender/blender#106098
This speeds up saving `070_0100.anim.blend` from the Heist project
from ~3s to ~300ms by adding PROPOVERRIDE_IGNORE in a few
places. It's not completely obvious to me when `PROPOVERRIDE_IGNORE`
should be used and when it shouldn't. Given that the same is done for
meshes already, it seems correct.
Pull Request: blender/blender#107196
Add texture usage flags for textures which are used as texture views
or require texture views for backing implementation.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#107163
Apply compilation fixes for Metal compatibility.
This includes explicit type casts, packed data types
where vec3 alignment is inconsistent, constructor replacement
with factory function.
The Metal shader generator also needs knowledge of when bound
resources are fundamental data types, so
SHADOWS_TILE_DATA_PACKED must be described as uint in
ShaderCreateInfo.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#107178
Caused by 6b8cdd5979.
Above commit introduced element tagging for boundary calculations but
only cleared them properly on all faces if the new `Preserve Seams`
option was chosen. We cannot be sure about the state of element tags
from prior operators though, so correct the culprit check to also only
be in effect if the new `Preserve Seams` option was chosen.
Pull Request: blender/blender#107161
Leverage new API call in Metal to increase the number of threads
dedicated to concurrent shader compilation. First step to improve
parallel compilation times when multiple engines are active.
Would also enable an increase in worker threads for shader
compilation jobs within the DRWManager.
Note that this is only available in the latest
version of macOS Ventura (13.3).
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#106625
The result of detecting if a quad should flip the default 0-2 split
when tessellated only used a pre-calculated normal when available,
since the method of detecting the flip was different, the check for a
concave face could change depending on the existence of polygon-normals.
In practice this meant cycles render preview could use a different
tessellation than the GPU display.
While [0] exposed the bug, it's an inherent problem with having 2
methods of detecting concave quads.
Remove is_quad_flip_v3_first_third_fast_with_normal(..) and always
use is_quad_flip_v3_first_third_fast(..), because having to calculate
the normal inline has significant overhead.
Note that "bow-tie" quads may now render with a subdivision in a
different direction although they must be very distorted with both
triangles along the 0-2 split pointing away from each other.
Thanks to @HooglyBoogly for investigating the issue.
[0]: 16fbadde36.
While this didn't cause bugs, initialize members to avoid problems
in the future.
GHOST::SystemX11
- m_keyboard_vector
- m_keycode_last_repeat_key
GHOST::Window
- m_cursorGrabInitPos
- m_userData
Generally, one does not know if the sharing info is currently shared
and should therefore be const. Better keep it const almost all the
time and only remove the constness when absolutely necessary
and the code has checked that it is valid.
The main challenge is to avoid dangling pointers. Currently, the lifetime of socket
declarations is somewhat unbounded (at least we didn't restrict it explicitly yet).
Therefore, storing non-owning pointers in it tricky. For ID pointers one could
potentially use the foreach-id iterator to update pointers in declarations as well,
but that's a bit out of scope and might not be the right solution anyway, since it's
not obvious that all node declarations are reachable from IDs stored in `bmain`.
The solution now is to use a callback that retrieves the right ID pointer when it
is used. The important thing is that the callback does not capture any potentially
dangling pointer either.
Pull Request: blender/blender#107179
When running oneAPI with AoT binaries, on hardware that's not compatible with
these, recompilation could have been missing from the kernels loading phase and
happen during execution instead.
These changes fixes it, any kernel compilation will now happen during the
kernels loading phase.
It was broken in two ways:
- bpy_bmlayercollection_iter passed PY_SSIZE_T_MIN, while
PY_SSIZE_T_MAX was needed.
- bpy_bmlayercollection_subscript_slice() contained an
off-by-one error.
Pull Request: blender/blender#107165
Completes the TODO in GHOST_SystemPathsCocoa::addToSystemRecentFiles
Also renames the filename parameter to the more appropriate filepath.
The recently opened/saved file will now also show up in:
- Blender Dock icon > Right click.
- Three finger swipe down in Open Blender i.e., App Expose
Based on a earlier contribution by @jenkm.
Pull Request: blender/blender#107174
After e45ed69349 we need to remove the existing attribute
when adding the rest position before evaluating modifiers. Also, adding
the rest position attribute was completely skipped in edit mode.
Pull Request: blender/blender#107190
The crash can occur in the following situations:
- Attempt to open a corrupted EXR file
- Attempt to save an EXR file under a non-existing directory.
The root cause is not really clear: for some reason the OpenEXE API on
the Blender side can not catch OpenEXE exceptions by a constant
reference to a std::exception, although it can by a constant reference
to an Iex::BaseExc.
This does not seem to be an issue with the OpenEXR library itself as
the idiff tool from our SVN folder catches the exceptions correctly.
It is also not caused by the symbols_apple.map as erasing it does not
make the problem go away.
It could still be some compiler/visibility flag which we were unable
to nail down yet.
The proposed solution is to add catch-all cases, mimicking the OIIO
tools. This solves the problem with the downside is that there are
no friendly error messages in the terminal. Those messages could be
brought as part of the workaround by additionally catching the
Iex::BaseExc exception. But probably nobody relies on those error
prints anyway, so added complexity in the code is likely does not
worth it.
Pull Request: blender/blender#107184
Animation: Adds a new "Parent Space" Orientation option for the Transformation Gizmo.
---
For child targets (objects, bones, etc) being able to transform in parent space is a desired feature (especially when it comes to rigging / animation).
For objects:
* with a parent, the gizmo orients to it's parents orientation
* without a parent, the gizmo orients to Global space
For Armatures:
* Child bone shows parent's space regardless if "Local Location" is set for parent bone
* For root bone **without** "Local Location" set, use the armature objects space.
* For root bone **with** "Local Location" set, use local bone space.
---
No new transformation orientation code needs to be written, we can achieve the desired results be using the existing `transform_orientations_create_from_axis`, `ED_getTransformOrientationMatrix`, and `unit_m3` methods. To do this, we check to see if the bone has a parent, if so, we use the bones pose matrix (`pose_mat`). This is done similarly for objects using the parent's object matrix (`object_to_world`).
Pull Request: blender/blender#104724
Scene.cpp and Geometry.cpp are large file it can be broken up into smaller easier to handle files. This change has been broken out from #105403 to make understanding the changes easier.
geometry.cpp is broken up into:
1. geometry.cpp
2. geometry_attributes.cpp
3. geometry_bvh.cpp
4. geometry_mesh.cpp
scene.h & scene.cpp is broken into:
1. scene.h
2. scene.cpp
3. devicescene.h
4. devicescene.cpp
Pull Request: blender/blender#107079
When a parent item was renamed, the `TreeView` was doing everything as
expected, however `AssetCatalogService::update_catalog_path` is supposed
to also update the catalog paths of all sub-catalogs [which it does --
but it does not tag sub-catalogs as having unsaved changes, resulting in
wrong saving of catalogs afterwards, meaning the parent item was saved
with the old name and a new item with the new name was created].
Now also tag sub-catalogs for having unsaved changes.
This should also go into 3.3 LTS
Pull Request: blender/blender#107121
The selection (box select, click select...) had an offset when selecting keys in the timeline.
That was because the function to get the NLA mapping ignored the timeline.
Pull Request: blender/blender#106904
The following properties were not library overrideable, but now are
* Line Thickness
* Color
* Custom Color Checkbox
Pull Request: blender/blender#106959
Currently when a baked curve is in the Graph Editor and normalization is enabled, it doesn't work.
It even throws a warning.
This patch adds the missing logic to normalize baked FCurves within a preview range.
Pull Request: blender/blender#106890
When using Xcode version 14.3 on Apple Silicon hardware a number of
regression tests fails. This change fixes this problem.
The root cause comes to the floating point contraction. It was already
disabled for GCC on Linux, but not for Clang on neither of Linux or
macOS.
Also corrected the comment about Clang default, as it as set to on
somewhere in 2021.
Pull Request: blender/blender#107136
Occlusion query buffers not being cleared to zero resulted in
erroneoues selection in certain situations.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#107135
Shader source requires explicit conversions and shader address
space qualifers in certain places in order to compile for Metal.
We also require constructors for a number of default struct types.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#106219
This patch adds several tools and options to the weight paint mode of Grease Pencil.
* Blur tool: smooths out vertex weights, by calculating a gaussian blur of adjacent vertices.
* Average tool: painting the average weight from all weights under the brush.
* Smear tool: smudges weights by grabbing the weights under the brush and 'dragging' them.
* With the + and - icons in the toolbar, the user can easily switch between adding and subtracting weight while drawing weights.
* With shortcut `D` you can toggle between these two.
* The auto-normalize options ensures that all bone-deforming vertex groups add up to 1.0 while weight painting.
* With `Ctrl-F` a radial control for weight is invoked (in addition to the radial controls for brush size and strength).
* With `Ctrl-RMB` the user can sample the weight. This sets the brush Weight from the weight under the cursor.
* When painting weights in vertex groups for bones, the user can quickly switch to another vertex group by clicking on a bone with `Ctrl-LMB`.
For this to work, follow these steps:
* Select the armature and switch to Pose Mode.
* Select your Grease Pencil object and switch immediately to Weight Paint Mode.
* Select a bone in the armature with `Ctrl-LMB`. The corresponding vertex group is automatically activated.
Pull Request: blender/blender#106663
This patch implements the ID Mask node for the realtime compositor.
The node can be implemented as a GPU shader operation when the
anti-aliasing option is disabled, which is something we should do when
the evaluator allows nodes be executed as both standard and GPU shader
operations.
Pull Request: blender/blender#106593
`make format` uses autopep8 to format Python, using a list of paths
specified in `tools/utils_maintenance/autopep8_format_paths.py`. The
scripts folder used to be a submodule inside release, but it is now at
the root of the blender repo.
This commit adds `scripts` to the list of paths to format.
Ref !107143
The comment didn't really make sense, since the removed code did the
same thing as the CustomData function anyway, and that's already done
in `mesh_init_data`.
Some callers that access the extension operated on the end of the path
even when there was no extension. Using this avoids having to assign
the end of the string using a separate check.
The file extension was copied into a buffer without checking it's size.
While large extensions aren't typical, some callers used small fixed
size buffers so an unusually named file could crash.
Runtime this information is stored in the active_color_attribute and
default_color_attribute strings on the mesh, however when saving it
is still saved in the old format with flags on the CustomData layers.
When converting from the strings to the layers not all flags were
properly cleared from the CustomData layers, leading to multiple
layers having the CD_FLAG_COLOR_ACTIVE/RENDER flag.
Implicit sharing means attribute ownership is shared between geometry
data-blocks, and the sharing happens automatically. So it's unnecessary
to choose whether to enable it when copying a mesh.
The typical order is vertex, edge, face(polygon), corner(loop), but in
these three functions polys and loops were reversed. Also use more
typical "num" variable names rather than "len"
Create a "nomain" mesh when converting intermediate representations
to a Mesh, meaning those areas don't have to know about data-block
names or the main database, and also that the boilerplate of adding
attributes individually can be avoided. The attribute arrays aren't
copied here, so the performance should be unaffected.
The nodes for inverting a color are named simply Invert, which begs the question: invert what?
This patch changes the naming for the node in Shading, Texture and Compositing nodes to *Invert Color*
This matches the naming of other color dedicated nodes like Separate Color or Combine Color
Pull Request: blender/blender#106750
Do not show asset metadata "description", "license", "copyright", or
"author" if they are empty AND read-only, since they can't be edited
and contain no useful information to show.
Pull Request: blender/blender#105812
Small fixes to recent file operations changes. FileOperations enum
starting with zero results in bad behavior with EnumPropertyItem. Typo
fix.
Pull Request: blender/blender#107138
Avoid copying the selected edges if all edges are selected, and
parallelize gathering the selection otherwise. Also use `int2` instead
of `std::pair`.
In simple test file I observed an approximate 10% FPS improvement,
though in real world cases the impact is probably much smaller.
Using the new HIP SDK 5.5 that includes a fix for the compiler bug.
This also enables the light tree.
For Linux the binaries are still disabled. ROCm 5.5 is planned to
include the same fix but not released yet. When that happens we
should be able to enable Linux as well.
Ref #104786Fix#104085
Pull Request: blender/blender#107098
Caused by uninitialized `ToolSettings` `GpPaint` [which was later
accessed in `BKE_gpencil_palette_ensure`].
Not 100% sure why `ToolSettings` `GpPaint` is properly initialized in a
default startup fille, but for some files, this was not the case (as in
the report)
See 22462fed00 for a similar commit.
Now initialize `ToolSettings` `GpPaint` (alongside `GpVertexPaint`) when
entering grease pencil vertex paint mode.
Should probably go into LTS releases as well.
Pull Request: blender/blender#107131
Muting a VSE channel does not mute the sound, this is caused by lack
of depsgraph updates for sound when mute state changed for the channel.
Now fixed.
Caused by ad146bd17a
Pull Request: blender/blender#107116
The dpcpp folder grew from 200M to 500M with the last update
due to lld being enabled and having 5 different copies in the bin
folder. We do not need to ship lld so it can be safely removed.
However previous harvest cleaned up the build folder before copying
the libs to their final destination in output, this will no longer
work, since we actually do need lld to build embree.
So copy to the full build folder to output first, then remove the
binaries we do not need. Embree will use the binaries in the build
folder so it will be unaffected by this.
Before the add node search refactor and link-drag-search, nodes were
filtered out based on whether they worked with the active render
engine. For example, the Principled Hair BSDF node doesn't work with
EEVEE, so it isn't displayed in the UI. While we might want to relax
this in the future, we have no better way to show that they don't work
right now, so it's best to keep that behavior.
The filtering is implemented with a new node type callback, mainly
to reduce the boilerplate of implementing many node search callbacks
otherwise. It's also relatively clear this way I think. The only
downside is that now there are three poll functions.
I didn't port the "eevee_cycles_shader_nodes_poll" to the new
searches, since I don't understand the purpose of it.
Pull Request: blender/blender#106829
The resolution of the driver value RNA path was using the wrong
property (it was forced to be referenced relative to the ID).
Pull Request: blender/blender#107129
Change the "displist to mesh" conversion to use the edge calculation
function used everywhere else, to allow removing the old code. This
changes edge vertex and corner edge indices, requiring a test update,
but the visual result should be the same.
Add the ability to retrieve implicit sharing info directly from the
C++ attribute API, which simplifies memory usage and performance
optimizations making use of it. This commit uses the additions to
the API to avoid copies in a few places:
- The "rest_position" attribute in the mesh modifier stack
- Instance on Points node
- Instances to points node
- Mesh to points node
- Points to vertices node
Many files are affected because in order to include the new information
in the API's returned data, I had to switch a bunch of types from
`VArray` to `AttributeReader`. This generally makes sense anyway, since
it allows retrieving the domain, which wasn't possible before in some
cases. I overloaded the `*` deference operator for some syntactic sugar
to avoid the (very ugly) `.varray` that would be necessary otherwise.
Pull Request: blender/blender#107059
Caused by 2eeec49640.
Above commit would early out when falling through the specialized
greasepencil selection operator to view3d_select_exec. But in order to
select posebones in grease pencil weightpaint mode, we still have to
continue with view3d_select_exec.
Now check this special case [with convenient
`BKE_object_pose_armature_get_with_wpaint_check`] and DONT early out in
that case.
Should go into 3.3 LTS as well.
Pull Request: blender/blender#107076
When a node input is connected to a group node input that is unlinked
and is of a different type, no implicit conversion takes place, so the
value is unexpected.
This patch fixes that by considering the types of both sockets and do
implicit conversion if necessary.
Reverts dcb2821292 but handles
the linker error by relying on target_link_libraries deduplication.
Reverts 18a15bafe8 but handles
blender_test linking after dependency change by passing
lib to target_link_libraries itself.
Closes#107033
While replacing the extension with an empty string works,
it required a redundant string-size argument which took a dummy
value in some cases. Avoid having to pass in a redundant string size by
adding a function that strips the extension.
The internal utility get_sequence_len would make it's filename
argument absolute so as to scan it's directory for files.
Perform this on the directory instead so the filename can be const.
Finding the extension included hidden files (starting with a '.'),
now finding the extension matches Python's `os.path.splitext` behavior
which has the advantate a hidden file is not considered one long
extension - with an empty name part.
Also update code to use BLI_path_extension in cases which previously
in-lined this logic.
BLI_path_frame_get path argument is now const,
it was being manipulated unnecessarily.
This adds new movement types TEXT_BEGIN and TEXT_END to allow
FONT_OT_move and FONT_OT_move_select operators move the text
cursor (caret) to the top and bottom of the text.
Pull Request: blender/blender#106196
During createOffscreenContext with VK backend enabled wl_surface
was not stored in the context's user data. This resulted in nullptr
dereference later on during disposeContext. Added a line that sets
user data and additionally added nullptr checks in disposeContext.
Ref !107057.
Updated Embree 4 library with GPU support is required for it to be
compiled - compatiblity with Embree 3 and Embree 4 without GPU support
is maintained.
Enabling hardware raytracing is an opt-in user setting for now.
Pull Request: blender/blender#106266
This allows toggling of text styles of selected text and at the current
mouse cursor position if nothing is selected.
Pull Request: blender/blender#107048
Use the attribute API for domain and type interpolation instead of doing
it manually. I observed a 3.8x improvement in curve selection mode and
an 18x improvement in point selection mode.
Adds a submenu to the File Browser selected item context menu that
allows opening the item or viewing the location in an OS browsing
window. On Win32 also allows other actions like editing, searching,
opening command prompt, etc.
Pull Request: blender/blender#104531
This reverts commit df096eab77.
There is a corner case for when WITH_CYCLES_ONEAPI_BINARIES is set to on
and later turned off during config, in case there is no ocloc.
This happens when the collection's item type doesn't have a
'nameproperty' to index with. For debug builds we error out with an
assert, since in general this shouldn't happen. For release builds
Python will report item not found.
Pull Request: blender/blender#107086
We don't use the callbacks that create virtual arrays from the custom data
anymore, they just add extra indirection. The only non-obvious case was
the crease attribute which had a setter function. Replace that with an
attribute validator like the other similar attributes.
Pull Request: blender/blender#107088
A solution for an older bug was causing it.
Added a special case to avoid an extra relation for context
variables as they do not change during the dependency graph
evaluation,
Pull Request: blender/blender#107082
Make the `remove_if` function for `Vector`, `VectorSet`, `Set`, and `Map` return the number of elements it removed.
Pull Request: blender/blender#107069
- Avoid unnecessary topology tag
- Copy from offsets in one line
- Comment formatting
- Avoid describing future changes in comment, let the code stand on its own
* Make the drawing smoother/anti-aliased.
* We use the alpha to blend between the background and the zone color.
* If alpha is 100% we then get to see the dotted background again
* Change zone corner radius to match nodes/layout.
If we want to set the background transparent again we need to do:
```
- immUniformThemeColorBlend(TH_BACK, TH_NODE_ZONE_SIMULATION, zone_color[3]);
+ immUniformThemeColor(TH_NODE_ZONE_SIMULATION);
```
For the design behind some of those change see #106810
Pull Request: #107043
Update the RNA and DNA documentation for two bone matrices:
- `PoseBone.matrix_channel` (`bPoseChannel::chan_mat` in DNA) contains
the evaluated loc/rot/scale channels, including constraints and drivers.
- `PoseBone.matrix` (`bPoseChannel::pose_mat` in DNA) contains the same
transform, but then expressed in the armature object space.
No functional changes, just clarifications in comments / tooltips.
While embedded IDs are usually considered as private local data of their
owner ID, some areas of code, like the depsgraph, can consider them as
regular IDs in some aspects.
So when swapping IDs, also properly 'counter-swap' their potential
embedded IDs, such that the pointers to the embedded IDs remain as before
swapping, even though the data of the embedded IDs is swapped.
The main target of this change is memfile undo code. There, newly read
IDs are swapped with their oldder version, so that the old address
contains the new data. This allows to avoid rebuilding some of the
depsgraph. Doing the same thing for embedded IDs should reduce even
further the needs for depsgrah rebuilds on undo steps.
This commit also gives more control over the remapping of 'self' ID
pointers inside themselves.
Pull Request: blender/blender#107044
- Split out WM_init_splash_on_startup(..) which performs startup checks.
- WM_init_splash(..) now shows the splash (ignoring preferences).
- Avoid calling BLI_exists on an empty string (in some cases).
Recent failures requiring investigation have exposed some shortcomings
that this addresses:
- When creating the diff image for offline comparison, use a higher
threshold to prevent idiff from printing more output which will often
contradict the primary failure output just above it (very confusing)
- For metadata failures, make sure these get printed so it's obvious
what kind of failure we're dealing with
Pull Request: blender/blender#107058
After 17800e0c03, the oneAPI kernels library was still able to find sycl6.dll but that wasn't reliable.
We fix this by moving the oneAPI kernels library also into blender.shared.
Pull Request: blender/blender#106894
Due to floating point differences between importance sampling and
texture evaluation, disagreeing on whether or not a ray lies within
the sun disc.
* Use the same input values for geographical_to_direction() in
sky_radiance_nishita() and kernel_data.background.sun.
* The mathematical operations in pdf_uniform_cone() were adjusted to
match sky_radiance_nishita().
Pull Request: blender/blender#106764
This is the first step for refactoring the lightcache system.
Each probe instance (as in `Object`) will now store its own baked data.
The data is currently stored in uncompressed readable format.
This introduces two new operators for baking to avoid confusion with
the previous light baking pipeline. These do nothing other than
creating empty caches that will be populated by EEVEE later on.
The DNA storage is made to be able to include multiple caches
in case of baked simulation over time but it isn't yet supported.
I prefer to keep the implementation simple for now as the long term
goals for this feature are uncertain.
There is still a type flag (`LightProbeObjectCache.cache_type`) that
will be used for versioning.
The naming convention of structs is a bit weird but that's all I
found in order to avoid interfering with the old scene light cache
that is still used by (old) EEVEE.
Related task #106449.
Pull Request: blender/blender#106808
For non-object parents (so bones & vertices), the parent is now also
explicitly checked for animation. In other words: having an animated
parent will cause the transform of the child to be written to Alembic/USD
on every frame (as if it is animated itself).
Copying a simulation zone should keep the 1:1 pairing intact (see `remap_pairing` functions)
- When copying a simulation input node on its own, unpair it to avoid ambiguity. Only the old simulation input node is paired to the output.
- When copying a simulation output node on its own, no special action is needed - the node gets a new ID and nothing is paired with it.
- When copying both input and output, remap the `output_node_id` property of the simulation input node, so that it is paired with the output copy.
There are a couple of places where copies happen:
* Node tree copy
* Duplicate nodes
* Group Separate (copies nodes from the group tree into another tree)
* Clipboard (both copy to clipboard and paste into node tree)
* Shader node tree branch copy for execution
These copy operators do mostly the same thing, but in slightly different ways, which makes the code incompatible (e.g. using a `Map<const bNode *, bNode *> node_map` vs. `Map<bNode *, bNode *> node_map`). That's why there are 3 `remap_pairing` implementations.
Dynamic node declarations are problematic:
Copying nodes invokes `nodeDeclarationEnsure` to generate declarations for new nodes. It does not, however, change the socket lists. If a dynamic declaration for a node copy alters the sockets (in this case: remove all because the node is unpaired), the subsequent `update_socket_declarations` will crash because it expects sockets to match the declaration.
At the end of operators there is usually a `BKE_ntree_update_main` or similar, which invokes `update_node_declaration_and_sockets`. This method _does_ update the socket lists as well (see #106732), but only if a node is tagged for a respective update.
The solution here is to use `update_node_declaration_and_sockets` for dynamic declarations instead of just `build_node_declaration_dynamic`.
Pull Request: blender/blender#106812
Do not read IDs from types flagged as 'no undo', whether they are local
or linked.
This should have no effect currently, since all 'no undo' ID types
currently are supposedly only local data anyways (Screen, WindowManager
and WorkSpace).
These IDs kept their address, but their content has been replaced
(re-read from the memfile undo step). Add an ID tag to identify them.
As a further cleanup, systematically tag these IDs for despgraph COW,
since their data is effectively modified (though in practice all of
these IDs are expected to already have other update tags anyway).
No change in behavior is expected from this commit.
This should not have much effective consequences with current code, but
fixes potential missed remappings for e.g. some nodetree pointers in the
node editor, or the `parent` pointer of collections to a scene's master
collection.
Implements #95966, as the final step of #95965.
This commit changes the storage of mesh edge vertex indices from the
`MEdge` type to the generic `int2` attribute type. This follows the
general design for geometry and the attribute system, where the data
storage type and the usage semantics are separated.
The main benefit of the change is reduced memory usage-- the
requirements of storing mesh edges is reduced by 1/3. For example,
this saves 8MB on a 1 million vertex grid. This also gives performance
benefits to any memory-bound mesh processing algorithm that uses edges.
Another benefit is that all of the edge's vertex indices are
contiguous. In a few cases, it's helpful to process all of them as
`Span<int>` rather than `Span<int2>`. Similarly, the type is more
likely to match a generic format used by a library, or code that
shouldn't know about specific Blender `Mesh` types.
Various Notes:
- The `.edge_verts` name is used to reflect a mapping between domains,
similar to `.corner_verts`, etc. The period means that it the data
shouldn't change arbitrarily by the user or procedural operations.
- `edge[0]` is now used instead of `edge.v1`
- Signed integers are used instead of unsigned to reduce the mixing
of signed-ness, which can be error prone.
- All of the previously used core mesh data types (`MVert`, `MEdge`,
`MLoop`, `MPoly` are now deprecated. Only generic types are used).
- The `vec2i` DNA type is used in the few C files where necessary.
Pull Request: blender/blender#106638
Animation data (including drivers) on inactive view layers now work. The
removal of such view layers was too optimistic; they are now kept
around. The bases are still removed, mostly for safety sake and to keep
the changes to a minimum.
`scene_remove_unused_view_layers()` has been renamed to
`scene_minimize_unused_view_layers()` to reflect its new functionality.
For compatibility with assumptions in other areas of the code, the
function still ensures the input view layer is at index 0.
This also introduces a new function
`BKE_view_layer_free_object_content(view_layer)`, which is a subset of
the functionality of `BKE_view_layer_free()`.
Having a type defined allows the compiler to help with type safety. For
example we can use it in switches to trigger a warning when a new object
type is added but not covered by the switch yet (but probably should).
Currently, when using the python api for offscreen drawing, the
default background will always be rendered into the GPUOffScreen's
framebuffer, rendering the alpha channel essentially useless and
making it difficult to separate objects from the background.
This patch allows offscreen drawing of a 3d view with transparent
background by exposing an optional parameter to the python api,
enabling, for example, compositing the result over another image.
The new parameter to draw_view3d() is optional, with the default
value matching the previous behavior, so this change is fully
Pull Request: blender/blender#105748
Previously, there was a "main" and "tmp" buffer and the final
result was expected to be in the "main" buffer. Now the two buffers
are called a and b and the final result can be in either of those.
This can improve performance especially if the number of iterations is low.
Pull Request: blender/blender#106860
`PyObject_GetBuffer` was used without checking that it was successful.
This could cause the code to access an incompatible or uninitialized
`Py_buffer`.
Add the missing checks, and clears the raised `PyExc_BufferError`
to silently fall back to accessing the PyObject as a sequence.
Using a "//" prefix resolves to the root directory which isn't a good
default as it typically doesn't have write permissions.
Only set the name and let the file selector pick a directory to use
(matches how saving from the text editor works).
Add WM_window_pixels_read & WM_window_pixels_read_sample that
use front-buffer pixel reading when supported.
Note that direct access to reading from the front-buffer is still needed
for writing thumbnails - where redrawing can cause problems
(see code-comments).
Expand on why front-buffer support is always disabled on Wayland &
why viewport orbit around selection offset correction isn't used for
perspective views.
Bezier curve position evaluation expects the handle position attributes
to exist and doesn't handle the case where they don't. Swith to using
a utility function to evaluate each curve type so Bezier evaluation can
stop early in that case.
Fixes a bug introduced in b0b9e746fa.
The volume transformation matrix is multiplied in the wrong order
which means the grid scale is applied on the translation.
Default settings changed for Sculpt mode's
Paint Brush, Smear Brush, and Smear Brush.
~~This includes updates of PR review #105691.~~
Updated to only include commits relevant to this PR.
Reviewed by: Joseph Eagar & Julian Kaspar
Pull Request: #105759
commit 7aa5e65dcbda862dcb17ecfc6727eb241a12c316
Merge: c08a9ec19f 7c9e493da55
Author: Joseph Eagar <joeedh@gmail.com>
Date: Sun Apr 16 15:11:53 2023 -0700
Merge branch 'main' of https://projects.blender.org/ChengduLittleA/blender into ChengduLittleA-main
commit 7c9e493da55a4adbfa2415b711e6d0daa2720ad9
Author: YimingWu <xp8110@outlook.com>
Date: Fri Mar 31 17:46:32 2023 +0800
Fix#106358: Handles null evaluated object when entering sculpting workspace.
The setup where everything in the scene is invisible/not enabled could
trigger a crash when switched to sculpting workspace, triggered when
opening the file.
This patch handles such situation.
Changed the menu operators:
Expand Mask by Topology (hotkey Shift A)
Expand Mask by Normals (hotkey Shift Alt A)
Expand Face Set by Topology (hotkey Shift W)
Expand Active Face Set (hotkey Shift Alt W)
so that their hotkeys would appear in their menu entries.
Resolves#104023
Co-authored-by: DisquietingFridge <30654622+DisquietingFridge@users.noreply.github.com>
Pull Request: #104568
Rebased for main instead of sculpt-dev
Decompose most of the nesting in the code to make the code
more consistent along the line of program execution.
Mainly achieved through:
- Remove redundant else
- Invert condition
- Add temporary variable to redistribute and name conditions
Pull Request: blender/blender#105509
This adds an WM_capabilities_flag to indicate that a platform
implements support for copying and pasting images using a shared
clipboard.
Pull Request: blender/blender#106990
A few fixes included here:
- Use `reserve` properly to add space after the first mesh
- Add to the end of the UVs array instead of replacing it for every mesh
Also, a cleanup/simplification:
- Split face size and face vertex loops, they are independent
Pull Request: blender/blender#106967
- Use off-screen drawing when reading from the front-buffer isn't
supported.
- Add a capabilities flag for reading the front-buffer which is always
disabled on WAYLAND.
- Add GPU_offscreen_read_pixels_region, used for reading a sub-region of
an off-screen buffer - use for color-picking a single pixel.
Orbit around selection didn't work well in orthographic views,
potentially causing viewport offset to drift during navigation
to the point content would be outside the far clipping range.
Resolve by aligning the view offset depth with the dynamic offset
being orbited around.
Currently the Textures used for offscreen rendering don't have
the `GPU_TEXTURE_USAGE_HOST_READ` flag. But some cases it is
needed. This PR adds a parameter when creating an offscreen
buffer.
Other solution could be to add this flag to all textures, but
we chose not to do this as that reduces the amount of fine-tuning
options for Metal/Vulkan backends. GPU can store textures
differently based on its actual usage.
This option isn't available in the python API as we don't expect
add-on developers to fine-tune texture usages to this extent.
For convenience `GPU_TEXTURE_USAGE_ATTACHMENT` is by default
always added.
Pull Request: blender/blender#106899
Cleaned up sculpt code to store lists of `PBVHNodes` with
`blender::Vector` instead of simple pointer arrays. This is much
simpler and eliminates memory leaks caused by forgetting to free
the result of `BKE_pbvh_search_gather`.
Notes:
* `BKE_pbvh_search_gather` is now `blender::pbvh::search_gather`.
* `FilterCache` and `ExpandCache` have ownership over their .nodes
members; as a result they're no longer pure C structs and
are allocated with `MEM_new`/`MEM_delete`.
* The word 'totnode' no longer occurs anywhere in
`source/blender/editors/sculpt_paint`
Todo (not for this PR): create a new properly C++ task API for sculpt
(with lambdas) and use it for brushes.
Pull Request: blender/blender#106884
Re-organize ID tags in a more logical way, and keep their values
strictly increasing, splitting the free available ones in-between the
main groups (to avoid having to edit all tags values when adding a new
one).
Note that shuffling around these ID tags values should not be an issue
anymore, all of these are strictly run-time, and fully cleared in write
code when writing into a .blend file.
This also lead to the second cleanup, which is removing some asserts on
ID tag values in readcode, these are useless since the tag is cleared on
write.
Embedded IDs did not benefit from any of the recent optimizations
(especially for undo case) when writing regular IDs (cleaning up of some
pure runtime data that would generate a lot of fake 'changed on undo'
status).
Now factor out of `write_file_handle` this part of the code generating
temp ID copy with cleaned-up data for writing, and expose it in BLO API
such that IDs owning embedded ones can also use it.
Code there was fairly naive and simple, missing some ID pointers,
sometimes improperly accessing non-ID data as IDs (usual dear Outliner
tree element usages of its 'ID' pointer...).
And code was especially quite severely broken in case these UI ID
usages were processed in a non-readonly context (i.e. if some of these
ID pointers were expected to be modified).
Code has been updated following existing very similar code in
`lib_link_workspace_layout_restore` from `readfile.cc`.
Code re-reading new ID pointers addresses inside readfile process would
not ensure that the 'ID' pointer of the outliner's treestore element is
actually a real ID pointer, and not a 'fake' one.
Probably harmless in practice, though this could have potentially been
the cause of extremely random rare crashes or corruption...
The build seems to complain without this, though theoretically it isn't
meant to be necessary. Though keeping them defined can potentially
avoid quadratic lookups too.
Similar to 7eee378ecc, this change decreases memory usage and
improves performance when copying curves and meshes without changing
their topology. The same change used for custom data layers is applied
to face and curve offset indices, which aren't stored as a custom data
layer.
The implicit sharing info for the offsets is stored in the mesh and
curve runtime structs, since it doesn't need to be written to files
directly. When changing the offsets pointer directly, the sharing info
must be updated accordingly. To make that easier, a few utility
functions take care of common operations like making an array mutable,
resizing an array, and creating sharing info for allocated data.
This commit also clarifies the intention to not allocate the offsets
at all when there are no curves/faces. That slightly complicates some
of the logic, but there's no reason for the single `0` integer to be
allocated.
Pull Request: blender/blender#106907
This commits adds some new, specific flags to further control ID
remapping process (like and option to skip user refcounting completely).
It also adds a new function to do 'raw' remapping, without any extra
post-processing, depsgraph tagging, etc. This is not used currently, but
will soon be needed by readfile post-processing code changes.
There is also some small cleanups and reorganization in that area of code,
the main noticeable change being the switch from a short to an int for
the flags controlling remapping code (using short here does not give
any benefit, and makes it harder to switch to integers when it becomes
necessary).
No change in behaviors are expected from this commit.
This type will be used to store mesh edges in #106638, but it could
be used for anything else too. This commit adds support for:
- The new type in the Python API
- Editing the type in the edit mode "Attribute Set" operator
- Rendering the type in EEVEE and Cycles for all geometry types
- Geometry nodes attribute interpolation and mixing
- Viewing the type in the spreadsheet and using row filters
The attribute uses the `blender::int2` type in most code, and
the `vec2i` DNA type in C code when necessary. The enum names
are based on `INT32_2D` for consistency with `INT8` and `INT32`.
Pull Request: blender/blender#106677
The extrude node resizes an existing mesh, but doesn't initialize new
data for most non-generic data types like shape keys or freestyle tags,
or custom normals. The split edges node doesn't process some
similar vertex data too.
In the future this data can become generic attributes, or it can be
supported in the nodes anyway. But now the new data is un-initialized
after being allocated.
Fixes#106926
When hitting normalize in the Graph Editor, it would frame the y-extents of the visible part of the FCurves.
Now, when a preview range is set, it frames the part of the FCurves in the preview range.
Pull Request: blender/blender#106888
Note, at the moment it is using the last login as a criteria to
whether the person should be listed (comparing it to 2 years past).
However anyone who hasn't logged in in gitea yet shows as last login 1970.
To run this you need to install all the required python packages and
generate a token with scope "read:org" or "admin:org".
See:
infrastructure/blender-projects-platform#55
`BKE_mesh_nomain_to_mesh` expects the object's data to be the mesh.
Also, the curve to mesh conversion can return a null pointer, so use
an empty mesh in that case. Thanks to Falk David for finding these.
This is the case e.g. of the `parent` collection pointer of collections
children of a scene's master collection, or some nodetree pointers in
the UI data (node editor).
Right now handling of this new flag is exactly the same as in owning
embedded case, the distiction between both usages will happen in future
commits.
This commit is expected to have no behavioral change at all.
The built-in brush identifier didn't match the enum name causing
brush assignment not to update the tool-system (clearing the tool).
Resolve by using generate_from_enum_ex(..) to avoid each brush
definition having to manually duplicate enum definitions.
Expose the full enum including separators and section titles,
useful for the tool system so it's possible to read separators
from brush enums (not part of this commit).
Also avoid using a dict as a default argument. While it didn't cause
problems - in general it's bad practice and worth avoiding as any
modifications produce strange behavior.
A buffer is a technical term most often referred to using the metaphor
of a "clipboard" in applications. However, the "clipboard" is usually
the system clipboard, used to carry data accross applications. To
avoid confusion, this replaces "clipboard" by "internal clipboard"
when not dealing with the system clipboard.
In addition, a few places still used the "[copy/paste] buffer"
terminology, so they are replaced with "internal clipboard as well.
The replacement from "[copy/paste] buffer" to "clipboard" was
undertaken in previous commits da6d6f99a8, 14b60c3a1c. This
commit should tackle the remaining occurrences.
Pull Request: blender/blender#106060
Adds "quick tooltips" to quickly see the name of a tab in the Properties
editor. (See patch for visuals.)
From own experience users are often confused about the name of the different
tabs, and I always found the delay to see it in the tooltip annoying. These
quick tooltips have been introduced for the toolshelf and solve this issue
nicely here. There is still a delay so that simple mouse movements won't
trigger the tooltips, but they show up a lot faster than normal tooltips now.
This may have the side-effect that icon only enum-item buttons will show the
enum name when there is no RNA property description. Previously we wouldn't
show this, even if available.
Pull Request: blender/blender#106906
This revision moves the vertex color reading and writing in the USD import and export functions over to the new Mesh Attributes API. I have removed anything else (new features or unnecessary changes) that was present in the prior patches to focus only on this task.
On the import side, I've introduced a class method named read_custom_data. In this function is the call-out for reading mesh colors. As requested, this function is intended to be the starting point for future Attribute reads, with methods like the new read_color_data* methods being called when a USD primvar matches a specific heuristic. UVs will (in the future, not in this revision) also need to be processed here. In a later patch, any primvars that do not match a heuristic can be imported as generic Attributes. There is a matching function on the export side, write_custom_data.
Attached is a .blend file for testing. The plane has five Color Attributes. The colors should be visibly the same when exported and re-imported.
I have also enabled color attribute imports by default. I believe it would be counter intuitive for most users for this feature to be off-- it means that at some point, a person round-tripping with default settings will lose data.
Pull Request: blender/blender#105347
Vulkan uses IMath. IMath on windows requires an option to indicate
it is used as dll file. This option wasn't set for the GPU module.
Thanks to Kazashi Yoshioka for mentioning this.
Pull Request: blender/blender#106932
Previous fix to resolve GPU hang which could occur in the
Metal backend caused additional flickering to occur as
as side effect, due to removal of required execution
dependencies in certain places.
This patch resolves both problems by only removing the
GPU hang dependency stall when additional synchronization
primitives are used along-side the global sync primitive.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#106914
Changes to [0] which worked as intended but used confusing naming.
- The note on using -1 for the active layer causes an assertion.
- The doc-string was above the wrong function.
- The meaning of the `_n()` suffix was flipped,
where the `layer_index_n` refers to an absolute index across all
layer types which is done internally for an index calculated from the
`layer` argument, not the argument it's self which is a UV index.
Rename BM_uv_map_get_offsets_n to BM_uv_map_get_offsets_from_layer.
[0]: 412b6a8f65
Apply the changes suggested at #103782
It includes:
- Draw dot at the origin the active gizmo
- Hide other gizmos while dragging (except the move arrows)
Other changes:
- Draw shadow for the move and scale circle gizmos (while transforming)
Pull Request: blender/blender#104624
Some properties may have the pointer stored in the gizmo structure
itself.
Reading from the struct directly is useful for cases where the value is
accessed frequently but not often required by the caller.
A disadvantage is that the property may not be saved in the file.
If there is not enough space for the Color Picker either above or below
the launching button, adjust the position to fit instead of clipping.
Pull Request: blender/blender#106122
Similar to e35f971da1. We aren't meant to rely on the
zero-initiatialization on creation anyway. I observed a small (a few
percent) decrease in minimum runtime in the geometry nodes points node.
The position attribute has special meaning for point clouds, and
meshes and curves have access methods for the attribute as well.
This saves boilerplate and gives more consistency between types.
The OSL GPU services implementation of noise intrinsics was missing the
overloads for derivatives and therefore OptiX pipeline creation would fail if
those were referenced.
This integrates the new implicit-sharing system (from fbcddfcd68)
with `CustomData`. Now the potentially long arrays referenced by custom
data layers can be shared between different systems but most importantly
between different geometries. This makes e.g. copying a mesh much cheaper
because none of the attributes has to be copied. Only when an attribute
is modified does it have to be copied.
Also see the original design task: #95845.
This reduces memory and improves performance by avoiding unnecessary
data copies. For example, the used memory after loading a highly
subdivided mesh is reduced from 2.4GB to 1.79GB. This is about 25%
less which is the expected amount because in `main` there are 4 copies
of the data:
1. The original data which is allocated when the file is loaded.
2. The copy for the depsgraph allocated during depsgraph evaluation.
3. The copy for the undo system allocated when the first undo step is
created right after loading the file.
4. GPU buffers allocated for drawing.
This patch only gets rid of copy number 2 for the depsgraph. In theory
the other copies can be removed as part of follow up PRs as well though.
-----
The patch has three main components:
* Slightly modified `CustomData` API to make it work better with implicit
sharing:
* `CD_REFERENCE` and `CD_DUPLICATE` have been removed because they are
meaningless when implicit-sharing is used.
* `CD_ASSIGN` has been removed as well because it's not an allocation
type anyway. The functionality of using existing arrays as custom
data layers has not been removed though.
* This can still be done with `CustomData_add_layer_with_data` which
also has a new argument that allows passing in information about
whether the array is shared.
* `CD_FLAG_NOFREE` has been removed because it's no longer necessary. It
only existed because of `CD_REFERENCE`.
* `CustomData_copy` and `CustomData_merge` have been split up into a
functions that do copy the actual attribute values and those that do
not. The latter functions now have the `_layout` suffix
(e.g. `CustomData_copy_layout`).
* Changes in `customdata.cc` to make it actually use implicit-sharing.
* Changes in various other files to adapt to the changes in `BKE_customdata.h`.
Pull Request: blender/blender#106228
This function was not exposed outside of internal GPU module.
Renaming `draw::Texture::depth()` to `is_depth` for consistency
and removing the ambiguity.
Some functions changed slightly for this non beta release.
No functional changes though as we didn't use what was removed.
Pull Request: blender/blender#106861
The fast_float is an external library, so move it to the
system includes which has less strict compiler flags applied.
This matches how other IO module use this library as well.
Pull Request: blender/blender#106892
When WITH_CYCLES_DEBUG is set to ON the following errors are
printed to the console:
E0412 15:51:22.588564 7996345 sync.cpp:737] Unknown pass Guiding Color
E0412 15:51:22.588605 7996345 sync.cpp:737] Unknown pass Guiding Probability
E0412 15:51:22.588613 7996345 sync.cpp:737] Unknown pass Guiding Average Roughness
This change fixes this by treating the guiding passes the same
way as all other passes, solving the errors and making it possible
to visualize guiding passes in the viewport later on.
Pull Request: blender/blender#106863
This PR reverts the breaking part of the #106535. This part doesn't seem
to be required to fix the HD4400-HD5500 issue.
Might also fix#106844.
Pull Request: blender/blender#106887
Changes to viewport state to resolve texture paint color
selection introduced a side effect wherein the correct
attachment size of a framebuffer was reset. This size is
needed when scissor regions are disabled to return the
state to its correct default. When this default was wrong,
certain operators would have incorrect offsets.
To maintain consistency with the OpenGL backend, the
Metal backend independently tracks the raw attachment
size using default_width/height. This will also reset to zero
when attachments are all removed, unlike other state which
may be retained.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#106857
After double clicking a file, user can click on a different app and
Blender will lose focus. Then it stays on splash screen. So fetch any
window instead of relying on active one to open the file.
pull request #106769
This reverts commit 4fe2685615.
Always use the preferred_scale requested by the compositor as this
did not work so well in the intended use case (where the low resolution
monitor text was scaled down and difficult to see).
After discussion with @ZedDB, revert this change since there are cases
where either functionality might be preferred - to ensure Blender's UI
is visible on a low resolution mirrored projector for e.g.
Changing the behavior of the preferred scale makes most sense in the
compositor, instead of controlling it on a per-application basis.
GCC did not support mold when support was initially added,
since then GCC has been updated to add support, removing the need
to point to a binary directory containing an alternative `ld` command.
Support for MOLD_BIN CMake option has been kept as mold may be installed
to standard location.
Use names:
- `tool_settings` instead of `ts`.
- `props` instead of `op` / `prop` / `op_props`
As Python may reference operators, don't confuse the operator
properties with an instance of the operator.
In both cases these names were already used for most scripts.
I cleaned up the cube brush tip code quite a bit; more remains
to be done. There is a new function to initialize cube
tip matrices, SCULPT_cube_tip_init. It's currently only
used by the paint brush, I'll need to do a bit of testing
before using it for clay strips and multiplane scrape.
Note: SCULPT_cube_tip_init uses the brush local matrix code
to avoid code duplication (and to take advantage of the debouncing
that is done there).
Nodes with names separated by a slash / can
not be searched by their initials.
This commit adds the slash character to
the list of separators for this type of
fuzzy search.
Pull Request: blender/blender#106838
This data should be initialized when building the mesh. If the arrays
aren't already initialized, there is already a bug. Theoretically this
could improve performance, since we can use `malloc` instead of
`calloc`. In practice I observed less than a 1% difference though.
These aren't used much in current code, but currently they created
offsets on the result curves, then just freed them again when copying
from the source data. In the future it might be better to completely
avoid using the base constructor in the first place.
Swap is commonly used to implement move assignment since it's short
and the logic is relatively simple. Use is here to avoid the need to
spell out the copying and freeing manually. The `BKE_id_free` call
at the end of the function will free whatever data was swapped.
The curve types and the runtime always have to be created when reading
the file from disk, so we might as well do that in `blend_read`, which
will help in the future when the offsets use implicit sharing.
Return null instead of an empty curves data-block, which amounts to
the same thing in geometry nodes, with less potential for error in
the rest of the function.
Change Text Object character `kern` member to float from int, and allow
fractional changes to kerning with Shift-Alt-arrows.
Pull Request: blender/blender#105181
The existing utility cleared vertex group names and active attribute
names, which doesn't always make sense when the geometry is
replaced but the custom data layout remains mainly unchanged.
This code (looking for matching new IDs to restore by name) is called
from `set_app_data` after a .blend file has been read (also in memfile
undo case).
The part handling VSE clipboard to restore ID pointers is not really
needed, since pasting VSE strips already ensures stored ID pointers are
still valid, and tries to find a new matching one otherwise.
The contexts appear twice, in the list of #defines and in the
BLT_I18NCONTEXTS_DESC. Both had gotten out of alphabetical order, and
out of sync.
Pull Request: blender/blender#106718
- "Lens" can be a transparent object used in cameras, or specifically
its property of focal length
- "Empty" can be an adjective meaning void, or an object type. The
latter is already disambiguated using `ID_ID`
- "New" and "Old" are adjectives that can have agreements in some
languages
- "Modified" is an adjective that can have agreement in some languages
- "Clipping" can be a property of a camera, or a behavior of the
mirror modifier
- "Value" in HSV nodes, see #105113
- "Area" in the Face Area geometry node, can mean a measurement or a
window type
- "New" is an adjective that can have agreement
- "Tab" can be a UI element or a whitespace character
- "Volume" can mean a measurement or an object type. The latter is
already disambiguated using `ID_ID`
These changes introduce the new `BLT_I18NCONTEXT_TIME` translation
context.
They also remove `BLT_I18NCONTEXT_VIRTUAL_REALITY`, which I added at
one point but then couldn't find which messages I wanted to fix with
it.
Ref #43295
Pull Request: #106718
This property is not editable after 7966cd16d6,
though doing so didn't seem to give an error. It doesn't have
to be set anymore, since the data is redundant with the
"loop_start" anyway.
Existing code was intrisically wrong, and also potentially very
innefficient.
Now tagging objects for deletion and removal is separated from actual
collection removal and object deletion. This makes the code safer,
simpler and more efficient.
NOTE: There is still an unsolved (already existing in original code)
issue with checks on objects that should not be deleted, noted in code.
Pull Request: blender/blender#106821
Links created through the normal Python API are invalid since
7026096099. Before then, one could create links to or from virtual
sockets from Python (grayed out sockets in Group Input and Group
Output nodes), as is still possible in the GUI.
This is documented as an API change, and it broke at least Node
Wrangler, see blender/blender-addons#104470. Instead of just fixing
that, let's introduce an API to make this operation simpler.
Pull Request: blender/blender#105975
Mistake in ba25023d22, updated the drawing code with the wrong function
call. So when setting the add-ons category to "User", add-ons installed
in the user paths (custom paths configured in Preferences) wouldn't show
up.
`script_paths()` wasn't updated correctly, but that was hidden by some
compabtibility logic that was in the patch earlier. Only with my last
change to the PR before merging it that was removed and the error became
quite visible.
When loading an external file in the text editor, the footer text
stating "File: <file>" or "File: <file> (unsaved)" was not translated,
because the translation happened after string formatting, and the
message was thus not found in the po files.
Pull Request: blender/blender#106716
When trying to search for the Vector Math node with a translated
interface, the node did not come up because it did not use the proper
translation context.
The Vector Math node's RNA had a translation context added in
db87e2a638, in order for the Floor operation to be disambiguated. I
made a mistake and added the context to the entire node struct instead
of just the Operation prop. This had the result that the Vector Math
was searched with an empty context in the search menu, but could not
be found.
Replacing the translation context from the struct to the property
fixes the issue, and actually allows disambiguating operations such as
Floor, which wasn't achieved previously.
Pull Request: blender/blender#106579
The call to `channel_sum` requires that the `weights` array is at least
as large as the number of channels in the originating buffer.
Switch to use the span overload as well since the method that takes a
raw weights array is deprecated.
Thanks to @aras_p for debugging the issue.
Pull Request: blender/blender#106847
f36543c5f5 took care of syncing multiple viewport`s cameras, but wasnt
fully meeting intentions [which was to only do this if both viewports
are locked to the scene camera].
Check was only done for the viewport this was executed in (if this was
locked to the scene camera, it would change all other viewports as
well), now also check if the target viewport prefers to use its own
local camera instead and skip it in that case.
Pull Request: blender/blender#106799
Defer acting on the tag to update scale as it caused the window
to use the wrong scale on startup & exit.
GTK/KDE applications seem to postpone updating scale so use this by
default as glitches with scale tend to be caused by updating the scale
too frequently instead of not quickly enough.
There is no need to postpone these operations when configuring the frame
only postpone committing the surface change.
Deferring these operations caused flickering when moving windows
between monitors of different scale on both GNOME & KDE.
This checkin will use OIIO to replace the image save/load code for BMP,
DDS, DPX, HDR, PNG, TGA, and TIFF.
This simplifies our build environment, reduces binary duplication,
removes large amounts of hard to maintain code, and fixes some bugs
along the way.
It should also help reduce rare differences between Blender and Cycles
which already uses OIIO for most situations. Or potentially makes them
easier to solve once discovered.
This is a continuation of the work for #101413
Pull Request: blender/blender#105785
Freeing ContextEGL would attempt to free the context's EGLSurface,
which was already freed by the native-window, causing 2x bad-surface
errors on exit.
Suppress the warning by clearing the surface from releaseNativeHandles
when the surface was created by a native window.
It was that names of related "combo" operations
like Hue/Saturation/Value, *Dilate/Erode*
and Brightness/Contrast should be separated
by slashes in their names.
This patch changes this for the multiple nodes
and operators concerning Hue/Saturation/Value
across Blender.
Note1: This patch should only touch UI names
which do not need versioning and should not
break scripts.
Note2: This breaks first letter fuzzy search
for "hsv". It was noted by @HooglyBoogly that
the "/" character needs to be added to the
fuzzy search split list. Note however that such
search is already broken in Main for nodes like
Brightness/Contrast and Dilate/Erode which
already use slash separators
Pull Request: blender/blender#106721
Rename *Bright/Contrast* to *Brightness/Contrast* in order to avoid the use of shortened names and improve consistency within Blender and with industry conventions.
Reasoning:
The modified color characteristic is called *brightness*, not *bright*. You don't modify the *bright* of an image.
This also interferes with search in case someone searches for brightness, producing no results.
*Note: This patch should only touch UI names which do not need versioning. It leaves the actual property name in nodes for a future breaking release.*
Pull Request: blender/blender#104998
Before 6c774feba2, the maximum number of UV maps was
enforced throughout Blender. Now it has to be enforced in the few places
that actually have the limit. In the future the limit of the subsurf
could be lifted, but that isn't done now to keep the crash fix simple.
Since the positions of the final mesh are modified rather than a
separate array after d20f992322, the final mesh has
to become the deformed mesh after the deform modifiers, rather
than the input mesh. The arrays can't be shared anymore, but that
performance loss will be solved by implicit sharing shortly.
Give errors in a few cases:
- The mesh has no UV map
- The faces have no area
- The applied modifier has no curve data (it may have been modified)
Use errors instead of cancelling the operator completely so the
operator can still do something useful when many meshes are
selected and only some fail.
Pull Request: blender/blender#106823
The new poly offsets were needed to interpolate attribute to a different
domain, but they were cleared when the legacy MPoly array was built.
Instead just clear the offsets a bit later after the other conversions.
Do not include Fake Draggable button in file lists if the space is so
constrained that they have negative widths. Avoids debug assert.
Pull Request: blender/blender#106777
Blender 3.5 has a performance regression in the image engine
that made the image engine 3-4x slower then 3.4. The cause of
this was the new way how panning was implemented.
This PR disables the new panning for now as a short term fix.
In the future the panning and improvements we did ensured
better performance when dealing with higher resolution images.
But the regression for regular images weren't acceptable.
This fix might introduce other performance regressions on
lower end systems.
In the future we still want to improve the performance to
get back to Blender 3.0 performance, but that requires more
work and has a different priority.
Pull Request: blender/blender#106803
This is mistake in the refactor of the DNA storage which unified
the camera and object storage. The bit which was missed from the
initial logic is that the autosave does not use regular file
write.
Detect this in the do-versioning code and rely on the new data
format when it exists.
A candidate for 3.5.1 release.
Pull Request: blender/blender#106811
Makes it possible to select multiple custom script directories in Preferences >
File Paths, replacing the single Scripts path option. Each of these directories
supports the regular script directory layout with a startup file (or files?),
add-ons, modules and presets.
When installing an add-on, the script directory can be chosen.
NOTE: Deprecates the `bpy.types.PreferencesFilePaths.script_directory`
property, and replaces `bpy.utils.script_path_pref` with
`bpy.utils.script_paths_pref`.
Pull Request: blender/blender#104876
When using ASAN on Clang / Linux, the call to `find_library(... asan ...)`
works against us, as it finds GCC's `libasan.so`. To work with Clang,
we should simply not pass any explicit library, as Clang will figure things
out by itself with the `-fsanitize=xxx` options.
Furthermore, Clang is incompatible with `-fsanitize=object-size`, so that's
now also no longer passed on Linux (mimicking the Apple) configuration.
For the long run, it would be better to rewrite this entire section to
select behaviour on a per-compiler basis, rather than per platform. That's
tracked in #105956
Pull Request: blender/blender#106675
Legacy drivers don't support auto type casting in comparisons.
This PR fixes some comparisons cast.
Thanks to Johannes J. for working/thinking along with the PR.
Pull Request: blender/blender#106789
The shader was compiled without the right define, disabling the world
volume lighting.
This had nothing to do with the light path node as the lighting
was totally disabled.
Pull Request: blender/blender#106787
This came up in #106591 which reported that changing a Light Group would
not work when alt-clicking the property field (which is the usual method
to edit a property for multiple objects at once).
This is because string properties were not supported in
`ui_selectcontext_apply` which is now done.
Similar to 1318660b04 [which added support for pointer properties].
Adding general support for string properties means this method can now
be used for many more things:
- changing all sorts of ID names (objects, meshes, ...)
- many settings in modifiers (e.g. vertexgroups)
- geometry nodes modifier properties (e.g. attribute names)
- ...
Fixes#106591
Pull Request: blender/blender#106599
Updating the buffer scale increased the window size based on the
previous window scale. Since the previous scale (DPI) newly created
windows restored from a `.blend` file isn't known, don't scale the
window size when updating the window's scale for the first time.
When a window overlaps multiple outputs, always use the resolution
on the output with the highest resolution. This means Blender never
shows low resolution content up-scaled.
Share logic between fractional & non-fractional window scaling.
This also enables fractional-scaling without scaling fixed sized buffers
for compositors without support for fractional_scale_manager_v1.
There is a `KeyError` exception when the `install_linux_packages.py` build script is ran with `--distro-id`:
```console
$ ./build_files/build_environment/install_linux_packages.py --distro-id arch
INFO: Distribution identifier forced by user to arch.
Traceback (most recent call last):
File "file:///blender/./build_files/build_environment/install_linux_packages.py", line 1656, in <module>
main()
File "file:///blender/./build_files/build_environment/install_linux_packages.py", line 1646, in main
distro_package_installer = PackageInstaller(settings) if settings.show_deps else get_distro_package_installer(settings)
File "file:///blender/./build_files/build_environment/install_linux_packages.py", line 1570, in get_distro_package_installer
return DISTRO_IDS_INSTALLERS[get_distro(settings)](settings)
KeyError: None
```
This happens because the `get_distro` function returns `None` if the distribution ID is forced with the `--distro-id` option, when it should return the provided value.
Pull Request: blender/blender#106461
This patch implements the Map UV node for the realtime compositor. This
is different from the CPU implementation in that it relies on the
approximate EWA filtering provided by the driver's implementation of
anisotropic filtering to displace the texture. This is easier and faster
than implementing EWA manually in the shader and has identical quality
where it matters.
Pull Request: blender/blender#106765
This patch implements the Fog Glow option in the Glare node. The
implementation does not match the existing implementation in the CPU
compositor, because it is computationally infeasible for the realtime
compositor. Instead, this implementation is similar to how Bloom is
implemented in EEVEE, based on the talk:
"Next Generation Post Processing in Call of Duty: Advanced Warfare".
This is just a temporary solution as requested by users until we either
implement an accurate implementation using FFT, provide a separate
option for EEVEE bloom, or roll out a different solution altogether.
Pull Request: blender/blender#106042
This patch implements the Displace node for the realtime compositor.
This is different from the CPU implementation in that it relies on the
approximate EWA filtering provided by the driver's implementation of
anisotropic filtering to displace the texture. This is easier and faster
than implementing EWA manually in the shader and has identical quality
where it matters.
Pull Request: blender/blender#106681
This patch implements the Z Combine node for the realtime compositor.
The patch also extends the SMAA implementation to work with float
textures as a prerequisite to the Z Combine implementation. Moreover, a
mechanism for computing multi-output operations was implemented, in
which unneeded outputs will allocate a dummy 1x1 texture for a correct
shader invocation, then those dummy textures will be cleaned up by
calling a routine right after evaluation.
This is different from the CPU implementation in that the while combine
mask is anti-aliased, including the alpha mask, which is not considered
in the CPU case.
The node can be implemented as a GPU shader operation when the
anti-aliasing option is disabled, which is something we should do when
the evaluator allows nodes be executed as both standard and GPU shader
operations.
Pull Request: blender/blender#106637
#### Summary
Occlude edit mode selection behind objects in object mode.
#### Problem
When doing retopology, you want to be able to select your edit mesh,
but only when you can see it.
Being able to select geometry behind reference objects is not
desirable.
#### Solution
Make it so reference objects occlude selection, while the edit mesh is
pushed towards the view using retopology offset.
#### Limitations
Poly Build is not supported, because it doesn't use the depth buffer.
It behaves the same as normal, unoccluded by reference meshes.
#### Notes
Selection occlusion is not used when xray is enabled. This is
intentional.
Pull Request: blender/blender#105498
This is necessary for #106228. Without this, `PBVH` might contain pointers to
data that either does not exist anymore or that must not be edited because
it is shared.
Pull Request: blender/blender#106271
There is no point in checking if the allocation of this relatively
small array was successful. We only do that in very few places,
but here it just adds unnecessary complexity.
Allow Text Object operator FONT_OT_case_set to correctly transform the case
of strings written in almost all scripts that differentiate letter case.
Pull Request: blender/blender#106581
Similar to 8d0920ec6d and aef0e72e5a.
In a test case with 2 million curves and 15 million points
I observed a 10x performance improvement, from 2.2s to 0.2s
to copy the data from Blender to Cycles.
Similar to 8d0920ec6d.
In a test case with 8 million points and 3 attributes, I observed
around a 9x performance improvement, from 1.8s to 0.2s to copy
the data from Blender to Cycles. For some attribute types, using
implicit sharing could remove the need to copy entirely, but removing
the overhead from the RNA API makes sense anyway.
Only use the denoised buffer for access of denoised passes, and
access the rest of the passes from the original render buffer.
This allows in-place modification of the guiding passes needed
by the denoiser without affecting the final render result pixels.
Pull Request: blender/blender#106668
Stored `ComponentIDKey` and `OperationIDKey` would still use string
references (char pointers) to data in related IDs, instead of using the
already locally stored std::string name of their matching `ComponentNode`
or `OperationNode` for that.
During undo, to reduce updates and speedup undo steps, a lot of IDs get
'replaced in place', i.e. new data read from the undo memfile is moved
into the existing 'old' ID memory address. And the depsgraph is also
re-used from the old BMain.
Calling `DEG_id_tag_update` and similar on the ID could then cause
depsgraph code to access freed memory from the 'old' data.
Joint effort with @sergey and the rest of the depsgraph team, thanks!
The Exit Group menu entry was mistakenly only whown for nodes who are
themselves also group nodes. It should be show for any node inside a
group.
Pull Request: blender/blender#106643
Issue caused by inconsistency in GPUFramebuffer viewport state
between Metal and OpenGL. The MTLFramebuffer code has been
modified such that framebuffer viewport/scissor state is retained
and only updated if attachments are modified during bind.
This is consistent with OpenGL. Previously, other updates to the
framebuffer in Metal would reset the viewport region, especially
if attachments were temporarily removed. This caused the color
picker selection to be misaligned.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#106619
Introduce a context manager that temporarily overrides a UILayout's
operator context.
Instead of writing this:
```py
default_op_context = layout.context
layout.context = 'OTHER_VALUE'
layout.do_stuff()
layout.context = default_op_context
```
you can now write this:
```py
from bl_ui_utils.layout import operator_context
with operator_context(layout, 'OTHER_VALUE'):
layout.do_stuff()
```
This is also exception-safe; it will always ensure the layout's operator
context is restored when the `with` body is exited, regardless of
whether that's done with an exception or regularly.
Idea in-the-hallway approved by @Sergey.
Autosave files are created from memfile undo, which
doesn't save legacy mesh data. This leads to a crash
on file load.
In addition the mesh code can now add CustomData
layers when saving files, which did not work if
the original domain had no layers. In that case
CustomData.layers is NULL and DNA has nothing to
key off of when loading the file later.
Pull Request: blender/blender#106648
CustomData_get_active_layer_index() was used by accident. But that
returns the CustomData layer index (in all layers) as opposed to
CustomData_get_active_layer(), which returns the active UV layer.
Pull Request: blender/blender#106644
Barycentric coordinate convention was changed at some point, which is
reflected in `motion_triangle_shader.h` (1c2c468abc) but not in
`motion_triangle.h`, this is also fixed by sharing functions between the
two header files.
Pull Request: blender/blender#106629
Check the specific case of `OP_IS_REPEAT_LAST` and recalculate
the orientation.
To that, pass the `OP_IS_REPEAT` and `OP_IS_REPEAT_LAST` flags as
inheritance to macro operators.
Force field absorption allows dampening of force fields by colliders, but it does not currently work when the scene only contains a rigid body simulation. It requires a particle simulation, cloth, dynamic paint, fluid sim, or softbodies for the feature to work correctly.
The reasons is that the effector function computing force field strength uses depsgraph relations to determine which colliders "absorb" the force field. If there are no dependencies between colliders and effectors registered in the depsgraph, the visibility function `eff_calc_visibility` does not add any absorption.
There is a function build_collision_relations which adds a dependency between the absorption object (the one with a collision modifier) and the forcefield object. It's currently only called by
1. Particle systems (DepsgraphRelationBuilder::add_particle_collision_relations)
2. Cloth, DynPaint, Fluid, and Softbody (DEG_add_collision_relations and indirectly through DEG_add_forcefield_relations).
The `DepsgraphRelationsBuilder` now adds the effector relations also when building rigid body relations.
Pull Request: blender/blender#106503
Since e3801a2bd4, we would always respect
hiding for vertex paint and weight paint (drawing code and stroke based
painting), leaving an inconsistency between the different paintmodes.
To rectify this, now also always respect edit mode hiding for projection
painting as well.
Some feedback was gathered in #sculpt-paint-texture-module to ensure
this is desired behavior.
Note: this does not change the (experimental) texture painting in
sculptmode [this already respects hiding via PBVH, albeit in a manner
that bleeds into hidden faces if the brush center is over visible faces]
ref #106354
Pull Request: blender/blender#106544
After investigating the crash logs it looked like the macro
unrolling wasn't working on Windows systems with these GPUs.
Macro unrolling was changed in order to cross compile to Metal and
in the future to Vulkan. The macro unrolling in OpenGL can be removed
by using a different naming scema.
This PR removes the macro unrolling by changing the generated GLSL
code:
**Before**
```
layout(std140) uniform _probe_block
{
ProbeBlock probe_block;
};
```
**After**
```
layout(std140) uniform probe_block
{
ProbeBlock _probe_block;
};
```
Some tweaks had to be done to the Eevee-shaders to make sure that
the macro unrolling is done correctly and could be compiled using
legacy opengl drivers.
Fix: #106278Fix: #106555
(and others)
Pull Request: blender/blender#106535
Python has several different string types [0], each using a prefix to
indicate the type. Presently Blender's Text Editor / syntax highlighting
does not include the prefix as part of the string, which makes the
prefix appear as a syntax error. This patch looks for these prefixes,
and includes them with the string highlighting.
Note: prefixes can appear in either case (ex: f and F mean the same
thing), and some prefixes can be combined (ex: fr is a raw f-string).
[0]: https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
Ref D14739
Show Splash screen if there are no Preferences found even if we are
launched with a filename, so that users can migrate old settings.
Pull Request: blender/blender#105863
Resolve small indexing issue in Metal implementation
of motion path line rendering.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#106595
To avoid unpaired simulation inputs or outputs, whenever deleting such
nodes the respective paired node should be deleted as well. A simple
utility function selects paired nodes before the delete operator removes
them.
This does not affect API methods, which still remove only individual
nodes. The feature is primarily a workflow improvement.
Resolves#105728
Pull Request: blender/blender#106597
The legacy conversion from MLoopUV to generic attributes used the
active and default layer names to copy the active/render status to the
new layers. But sometimes the names can change, and they weren't
updated in that case. Instead, store the active status with an index
into the names array (use an array instead of Vector for clarity).
fa0f295b53 exposed that there was a region missing because of some
faulty versioning.
The `fluid_motion_blur.blend` Cycles test file was crashing. Seems like
this is a pre 2.5 file that was resaved in newer versions, but the
preview region for the Sequencer was missing. Before mentioned commit,
the region would be broken when activating the preview view mode in the
Sequencer, now it would crash even on startup.
Ensure the region exists, as expected.
Simulation input and output nodes are currently added individually, but they always need to exist as pair. This PR modifies the _Add Node_ menu so that a single menu entry adds and input and output node together.
The `NODE_OT_add_node` operator currently adds just a single node type. A new variant of this operator is added which adds a _simulation zone_ with origin + target node instead. This requires some modification of the `NodeAddOperator` base class, moving the `node_type` property into the final implementation. Unlike the `NODE_OT_add_node` operator, the `NODE_OT_add_simulation_zone` adds 2 different node types.
After adding the two nodes, a reference needs to be added to "pair" them: Input node ("origin") stores the UID of the output node ("target") in its `output_node_id` property. So far this was detected automatically when adding an input, but this method is not very robust (e.g. it depends on order of adding nodes and adding multiple pairs can be tricky).
Now the pairing is done explicitly through an API function `node_geo_simulation_input_pair_with_output`. The `NODE_OT_add_simulation_zone` operator performs pairing of the input/output nodes after adding them. The function is accessible through RNA, so an operator may be added if necessary to allow users to fix unpaired nodes.
In addition to pairing the two nodes, the operator also positions them at a comfortable distance, as well as adding a default link between the two Geometry sockets for convenience.
Resolves#105727
Pull Request: blender/blender#106557
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.
Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.
We plan to use this in #102879.
This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences
Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.
Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
This patch makes it disappear entirely.
## Implementation
- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.
Pull Request: blender/blender#105088
Avoid creating a lazy function for the `Simulation Input` node if the `output_node_id` is invalid. This can happen when e.g. the output node is deleted without also deleting the input node. The lazy function assumes a valid output ID and will crash if the output node does not exist.
Pull Request: blender/blender#106585
To prepare for OIDN2 with GPU support, some of the code that was exclusive to the OptiXDenoiser is being moved to the DenoiserGPU superclass.
Co-authored-by: Stefan Werner <stefan.werner@intel.com>
Pull Request: blender/blender#106496
Any errors from calling `bpy.ops.render.render(write_still=True)` would
be suppressed, making it impossible to know what went wrong.
Now the operator now reports errors when run via `exec` which mainly
occurs when the operator is called from scripts.
Interactively rendering via `invoke` is left as-is since users can see
the error in the UI and showing a popup error is disruptive.
The assets are required to build proper Blender release, so they can not be
skipped from packing.
The packing ignores the `working` directory as it seems to be big and sounds
that it is not needed for the release.
The assets are bundled under the `release/datafiles/assets` folder in the
blender sources. This is where they will reside after switch to the Git LFS.
Pull Request: blender/blender#106536
Use the latest Wayland version, resolves inverted track-pad scroll
direction #104272 by adding support for physical scroll direction.
Updates to GHOST/Wayland have already been made.
The "reverse map" of corners to faces and points to curves is the same
for meshes and curves now. Move it to the offset indices header to
reflect this.
This unification can go further in the future, but I'd rather wait
until the design is clearer for now.
Pull Request: blender/blender#106570
Similar to 4bcd59d644. This probably got worse recently with
the generic attribute refactors for `Mesh`, but the final performance is
probably much better than older versions too.
Timings extracting attributes from a 16 million vertex grid (seconds):
- Corner float attribute: 0.72 -> 0.19
- Face float attribute: 0.60 -> 0.07
- UV map: 3.18 -> 0.05
Implements #95967.
Currently the `MPoly` struct is 12 bytes, and stores the index of a
face's first corner and the number of corners/verts/edges. Polygons
and corners are always created in order by Blender, meaning each
face's corners will be after the previous face's corners. We can take
advantage of this fact and eliminate the redundancy in mesh face
storage by only storing a single integer corner offset for each face.
The size of the face is then encoded by the offset of the next face.
The size of a single integer is 4 bytes, so this reduces memory
usage by 3 times.
The same method is used for `CurvesGeometry`, so Blender already has
an abstraction to simplify using these offsets called `OffsetIndices`.
This class is used to easily retrieve a range of corner indices for
each face. This also gives the opportunity for sharing some logic with
curves.
Another benefit of the change is that the offsets and sizes stored in
`MPoly` can no longer disagree with each other. Storing faces in the
order of their corners can simplify some code too.
Face/polygon variables now use the `IndexRange` type, which comes with
quite a few utilities that can simplify code.
Some:
- The offset integer array has to be one longer than the face count to
avoid a branch for every face, which means the data is no longer part
of the mesh's `CustomData`.
- We lose the ability to "reference" an original mesh's offset array
until more reusable CoW from #104478 is committed. That will be added
in a separate commit.
- Since they aren't part of `CustomData`, poly offsets often have to be
copied manually.
- To simplify using `OffsetIndices` in many places, some functions and
structs in headers were moved to only compile in C++.
- All meshes created by Blender use the same order for faces and face
corners, but just in case, meshes with mismatched order are fixed by
versioning code.
- `MeshPolygon.totloop` is no longer editable in RNA. This API break is
necessary here unfortunately. It should be worth it in 3.6, since
that's the best way to allow loading meshes from 4.0, which is
important for an LTS version.
Pull Request: blender/blender#105938
`PLATFORM_BUNDLED_LIBRARIES` was installing right next to the blender
executable rather than the `blender.shared` folder,
`PLATFORM_BUNDLED_LIBRARIES` wasn't used very much on windows, just
by the ONEAPI code which likely wasn't aware this plumbing was
still missing.
This diff adds support for using `PLATFORM_BUNDLED_LIBRARIES` on
windows in both debug and release configurations.
You can differentiate between a .dll being installed for debug/release
or all configurations, by prefixing the library with either `DEBUG`,
`RELEASE` or `All`, if no prefix is given `ALL` is assumed.
Pull Request: blender/blender#106348
When accessing UVmaps from python in BMesh, the UVmap name/index was ignored
and the active UVmap always used. This fixes this by passing the layer index
to the underlying CustomData function.
Pull Request: blender/blender#106537
This was only used in a single place, multires baking, where it's simple
to just retrieve the looptris from the temporary `Mesh` that we already
create to simplify accessing normals. This allows removing a bunch of
complexity from `DerivedMesh`, to help progress towards its complete
removal at some point in the future.
Also use `Span` more instead of raw pointers in multires baking,
and pass around the spans instead of the low-resolution DerivedMesh.
Caused by 16fbadde36. The first mistake was passing a pointer
to a poly to what was meant to be the pointer to the start of the array.
Use Span instead to avoid that confusion. The second was a logic error
in CCGDerivedMesh's lazy initialization of corner data. The data was
copied when the mesh is created so it wasn't initialized.
This PR adds debug information inside the spir-v assembly to enable
step-by-step debugging of Shaders using renderdoc. The debugging
information can be fairly large so are only generated when used
with the `--debug-gpu-renderdoc` feature.
During debugging shader optimizations are turned off.
Pull Request: blender/blender#106546
Regression caused by 98bfa8d458
The `XRAY_ENABLED(v3d)` check was lost during a modification to
`transform_snap_context_project_view3d_mixed_impl` function.
This caused vertex snapping in solid shading to jump between visible
and occluded faces.
Pull Request: blender/blender#106495
This patch refactors the texture samples code by mainly splitting the
eGPUSamplerState enum into multiple smaller enums and packing them
inside a GPUSamplerState struct. This was done because many members of
the enum were mutually exclusive, which was worked around during setting
up the samplers in the various backends, and additionally made the API
confusing, like the GPU_texture_wrap_mode function, which had two
mutually exclusive parameters.
The new structure also improved and clarified the backend sampler cache,
reducing the cache size from 514 samplers to just 130 samplers, which
also slightly improved the initialization time. Further, the
GPU_SAMPLER_MAX signal value was naturally incorporated into the
structure using the GPU_SAMPLER_STATE_TYPE_INTERNAL type.
The only expected functional change is in the realtime compositor, which
now supports per-axis repetition control, utilizing new API functions
for that purpose.
This patch is loosely based on an older patch D14366 by Ethan Hall.
Pull Request: blender/blender#105642
Related to #106535 where a similar fix was done for OpenGL. A small
cleanup that might reduce the complexity during GLSL shader compilation.
Pull Request: blender/blender#106538
Renderdoc requires all calls/updates to originate from the same
context. It also doesn't support multithreading. For now we
enable main context workaround.
The renderdoc integration used to be behind the `--debug-gpu`
command line option. When using `--debug-gpu` outside renderdoc
error messages where displayed that aren't relevant.
This PR adds a specific command line option for the renderdoc
integration. This option will also enable `--debug-gpu`.
Pull Request: blender/blender#106541
This was the case with hidden faces and `Sync Selection` turned ON.
Caused by 8f543a73ab.
Since 8f543a73ab, the UV element map
respects the hidden state of geometry, but stitching [which also
respected this on its own even prior to the culprit commit in its
calculation of connectivity] did this differently [it only skipped
hidden geo when UV_SYNC_SELECTION was OFF -- even though UVs would not
be visible which is probably the real error here, I believe there is
this principle that we "dont act on stuff we dont see"].
To fix this, also skip hidden geo (even with UV_SYNC_SELECTION = ON) in
the stitch calculation of connectivity, just as
`BM_uv_element_map_create` does it.
Should go into 3.3 LTS as well.
Pull Request: blender/blender#106493
Depending on newer API's could cause build failure for existing
builds using wayland-protocols outside of Blender's 'lib' directory.
Now the existence of the most recent XML file is checked on each CMake
execution, resetting the cache when not found so the protocols in
`../lib/linux_x86_64_glibc_228/` will be used instead.
The function which collects files to process in add-on extraction
returned only files that did not start with '_', in the case where the
add-on was a module in a directory. This excluded __init__.py, which
may very well contain UI code, so an exception is added for this case.
This change currently allows the extraction of 42 new messages.
Logic for the recently included fractional scaling support [0] was
difficult to reason about as it depended on two different callbacks
one that listened to a preferred scale, another that tracked which
physical displays the window overlapped.
Checking if fractional scaling was in used depended on the order
the callbacks ran - which is undefined.
In practice - mixing non-fractional and fractional displays would
flicker when the window was moved between monitors.
Resolve this problem with the following changes:
- When the fractional-scale manager is supported,
only respond to the scale from it's preferred_scale callback.
- When no fractional-scale manager is available,
set the scale based on the scale of overlapping outputs.
- Add support for postponing the buffers commit call to prevent
flickering when changing the windows scale.
Other changes:
- Use a lock before setting the pending frame state from
wp_fractional_scale_handle_preferred_scale.
- Ensure pending actions that themselves trigger pending actions
run in the time gwl_window_pending_actions_handle is called.
- Rename GWL_Window::scale -> GWL_WindowFrame::buffer_scale.
[0]: cde99075e8
Depend on fractional-scale when searching for wayland-protocols
This will impact builders that don't use Blender's `../lib/` and
have wayland-protocols older than v1.31.
For some reason, lattice modifier always depend on self object transform.
This fix just move extra dependencies in to if case statement, also some
cleaning of this code area.
Pull Request: blender/blender#105293
Caused by the changes in the submodules configuration.
Can no longer rely on the `git submodule` command to
show list of external references to be packed.
Needs to be backported to 3.5.1.
Pull Request: blender/blender#106502
This happens even though there is only one user.
The Outliner only implements this `Make Single User` for worlds
(`singleuser_world_fn`) and actions (`singleuser_action_fn`) [it is
questionable if the whole functionality could be removed really, but
this is for another report] and it uses `id_single_user` to do so --
this function does not check if we even have more than one user though,
so data gets duplicated resulting in duplicate worlds or actions even if
they only have one user and shouldnt be touched.
Now let `id_single_user` check usercount and only act if we have more
than one real users.
Pull Request: blender/blender#105991
pgettext_tip incorrectly imported as iface_ instead of importing
pgettext_iface. These leads to incorrectly translated attribute text
shown when the user elects to translate only tooltips.
Pull Request: blender/blender#106507
Caused by filebrowser calling space `refresh` function. The intention of
refresh function was mainly to hide channels when view type is changed.
Unhiding channels when view is changed back seems logical, but this
causes issues when region is too thin, which results in hiding side
panel, which is more important.
When creating nodes by dragging a link, it can be convenient to
transfer values from input socket. For reference values, like images,
this may be necessary to avoid unnecessary data-block users. This
patch starts adding such a system. At this moment this only makes sense
for one node (Image Input), but this can be extended to work with other
reference types, different non-reference types and support auto-casting
(if a float is transferred to the Integer Input node).
See task: blender/blender#102854
Original patch: https://archive.blender.org/developer/D16735
Pull Request: blender/blender#105972
Previously the only way to control the subtype was to remove the group
input or output and create it again. This commit adds a dropdown to
change an existing socket, for supported socket types.
Based on a patch by Angus Stanton: https://developer.blender.org/D15715
It was necessary to fix the UI code slightly; the layout's context
wasn't being used in calls to an operator's enum items callback.
Pull Request: blender/blender#105614
The potential optimization in the normal edit modifier when flipping
faces isn't worth the "API impurity" and complexity introduced by
adding poly normal editing as part of the API. This change simplifies
future changes to the ownership of poly normals with a shared cache,
which can prevent recomputing poly normals completely.
Vertex positions and faces aren't changed, so most caches shouldn't
need to be tagged. This removes unnecessary re-computation of bounds,
triangulation, loose edges, etc.
Pull Request: blender/blender#106250
Make it a native Cycles light option instead of counter-acting the inverse
area calculation in Hydra.
Differential Revision: https://developer.blender.org/D16838
HdRenderDelegate got a change with the interface, adding gpuSupported. It
currently is just a dummy implementation without checking for anything
GPU-related.
Differential Revision: https://developer.blender.org/D17207
The problem is that `set_geometry()` otherwise ends up implicitly
casting `Geometry*` to bool. In Blender this worked because the
geometry header was always included before the object header.
Differential Revision: https://developer.blender.org/D16737
Allows NLA strips to horizontally translated over each other. If a strip is dropped when translating, it'll cause the strip to shuffle into place.
---
Abstracted large conditional branch in `recalcData_nla` into it's own `nlastrip_fix_overlapping` method for increased readability. No logical changes were made.
---
[Archived Phabricator Patch](https://archive.blender.org/developer/D10102)
Pull Request: blender/blender#105532
Use raw Blender structs and mesh data rather than using the RNA API.
There isn't any benefit from using the RNA when Cycles is compiled
with Blender anyway, and a profile showed that the majority of time
was spent in Blender RNA API functions.
This gives a significant improvement in performance when ingesting
meshes. Here are some tests of the runtime of the `create_mesh`
function (in seconds):
| | Before | After |
| ------------------------- | ------ | ----- |
| Grid | 0.66 | 0.11 |
| Many realized cubes | 2.60 | 0.48 |
| Large curve to mesh setup | 4.18 | 1.14 |
Also change to resizing the arrays and filling them by index rather
than appending. This makes the parallel aspect of the logic clearer,
and makes the loops easier to parallelize in the future, and makes
it easier to have a performance benefit when an attribute like
`sharp_face` doesn't exist.
Pull Request: blender/blender#106275
Use the dot product of the normal of the two polygons connected to the
edge to calculate the edge factor.
This fixes#90641 and #102545 and ensures more predictable results for
boundary and non-manifold edges.
Co-authored-by: Germano Cavalcante <mano-wii>
Pull Request: blender/blender#105352
No functional changes.
Edges hidden by Optimal Display are hidden by edge factor Shader.
But there is not much advantage in doing this, as the number of edges
hidden by the Optimal Display is usually much higher than the number of
visible edges.
And the lines extractor does not include invisible edges due to other
factors.
So this change makes:
- Visibility test more consistent with what is actually seen.
- Smaller buffer for IBO sent to GPU
- consistency with GPU Subdivision that already considers Optimal Display
- Allows possible improvement in the "Edge Factor" extraction by making
it unnecessary to check the Optimal Display (except for optimization).
Co-authored-by: Germano Cavalcante <mano-wii>
Pull Request: blender/blender#106402
Popover menu buttons had their labels translated but not their
descriptions, although they were properly extracted.
This commit fixes that using the `TIP_()` macro.
This information is displayed in the top left of the 3D Viewport with
other text info. The units of the grid are already extracted, but they
were not translated in the drawing code.
Remove comments from `eBConstraint_Types` that
- were used long ago during a big refactor effort, but are no longer
necessary, or
- just repeated the name of the enum constant.
No functional changes.
OpenEXR has some dependecies that other other modules in Blender
requires. When disabling OpenEXR these dependecies could not match
and building blender would fail.
This PR disables the next options when `WITH_IMAGE_OPENEXR=Off`
- `WITH_OPENVDB`
- `WITH_ALEMBIC`
- `WITH_VULKAN_BACKEND`
- `WITH_CYCLES_OSL`
Additionally windows stores the IMath libraries in `IMATH_LIBRARIES`
Linux and Mac stored the IMath libraries in `IMATH_LIBRARY`. This
change will also adds `IMATH_LIBRARIES` variable to all platforms.
Pull Request: blender/blender#106209
Splitting workload dependency chains such that they
only exist within the context of a single frame.
Dependencies are required to ensure sequential
command buffer submissions execute in order,
but the additional dependencies between frames
could incur GPU timeouts, if a signal was delayed.
This could be triggered by both CPU/GPU cycles
texture updates and Viewport Compositor operations.
Should also resolve#106401
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#106443
Reduce register spill to global memory in raytrace_resolve
function. Results in a 20% uplift for this particular shader on
Apple Silicon GPUs. Contributing to 3-5% uplift for scenes
which have SSR enabled. This is achieved via reducing
memory pressure using a packed data type for the sampling
kernel.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#106231
Very sadge to see this kind of mistakes still exist in 2023 code...
While in theory this commit could be backported to (LTS) releases, would
rather only do it if/when proven it actually fixes user-facing issues.
Fixing such issues so deep in ID management code can have completely
unexpected side effects.
The framebuffer default size was only set during the first bind. This
is because the `dirty_attachments_ tag` wasn't set and thus the
framebuffer size was never passed down to the GL.
Split to `default_size_set()` to not affect other code paths that use
`size_set()`.
Adds the ability to pack UVs back into the original bounding box.
Choose UV Editor > Menu > UV > Pack Islands
Then change "Pack To" to "Original bounding box"
Face Nearest only works with individual projection, so always set the
`SCE_SNAP_PROJECT` flag in this case.
Also gray out the `Project Individual Elements` option in the UI if
`Face Nearest` is enabled.
And change the description to indicate that `Project Individual Elements`
is always enabled with the `Face Nearest` option.
(I feel a better design for this option needs to be considered).
Avoid introducing another `::modifiers` namespace for now, since it's
not clear if we'll want that long term. This just avoids a bunch of
boilerplate and makes things easier to read.
Use the node group and the properties as arguments instead of
the modifier. This may help to allow reusing the functions outside
of the modifier execution context.
This adds the select more/less operators to the weight paint mode face selection.
Just like in edit mode, press `CTRL`+`Numpad Plus/Minus` to use them.
They have also been added to the `Select` menu.
Pull Request: blender/blender#105607
This adds the select more/less operators to the weight paint mode vertex selection.
Just like in edit mode, press CTRL+Numpad Plus/Minus to use them.
They have also been added to the Select menu.
Pull Request: blender/blender#105633
When retrieving the evaluated mesh to paint on, it can be reevalauted,
where a smaller set of attributes are requested than for regular
evaluated meshes. That reevaluation should be completely removed
(see #106186), but a simple fix in the meantime is to manually
request that data.
When normalization is enabled in the Graph Editor,
the area outside the -1/1 range on the y axis isn't meaningful.
To visually represent that this patch greys out that area
just as it does with anything outside the current frame range.
Pull Request: blender/blender#106302
fast_float.h currently is only used by OBJ, STL and PLY I/O importers.
Update it to the latest release from upstream (from 3.4.0 2020 Nov to
4.0.0 2023 Mar).
No behavior changes, but they have optimized the performance a bit.
Importing a 6-level subdivided Suzanne OBJ file (330MB) goes from 3.5sec
down to 3.2sec on Win10, Ryzen 5950X, VS2022 build.
Previously, fractional scaling was detected but set an integer buffer
scale which the compositor would down-scale causing blurry output.
Now the fractional scaling interface is used when available to set the
DPI and set the internal buffers size & viewport transformation to
ensure 1:1 pixels from Blender to the Wayland output.
Tested to work with multiple monitors with mixed
fractional/non-fractional scale.
Note that this change causes a regression for when fractional scaling
is set on a compositor without support for fractional-scale-v1.
Supporting fractional scaling in both cases is possible but overly
complicated. This case already wasn't working so well - with blurry
output due to image scaling, now the DPI wont be accurate in this case
although Blender is still usable.
It's a bit easier to follow this way, and we can make better use of
const. It's also more reusable in case we have to use it elsewhere
too (for node group operators?).
Use checks for certain node types with better algorithmic complexity.
They should perform better in some edge case with a lot of nodes or
node group nesting. They're now a bit more similar to each other too.
This is the only package that warns about this type of thing, and gets in the
way of actual warnigns on build logs. This requires CMake 3.19+ to take effect,
older versions still show the warnings.
Ensure compression is enabled by using shader_read
flag only. Also ensure that MTLTexture contents
remain in optimal layout for reading after any
data modifications.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#106234
The command buffer fails to execute, the cause is unknown. It does not
appear to be related to the binary archive cache as disabling that does
not prevent the issue.
Pull Request: blender/blender#106328
The issue was caused by uninitialized offset used for the scale
variable.
Follow the rest of the usages of the operation which initialize
it explicitly. This makes it very safe and easy fix to backport
to any LTS or corrective release.
Ideally should probably initialize all members in the class
itself, to avoid such situations in the future.
Pull Request: blender/blender#106325
The cycling method for the viewer connection starts searching from the next socket
after the last current connection. If a geometry socket is is the last connected
output this caused the method to jump to the next socket after the geometry,
potentially skipping over valid data sockets that are not viewed yet.
The solution is to ignore the geometry sockets in the cycling entirely and only
consider data sockets (i.e. non-geometry sockets).
Pull Request: blender/blender#106318
This tool now only supports installing packages, it won't build any
dependency anymore. This implies that on most distributions, it wont
make a complete Blender build possible, some features will likely be
misisng.
By default, it only install basic dev environment to enable building
Blender with the precompiled libraries (which is the recommended way).
Passing the `--all` option will make it try to install all known
dependencies from distro packages. This is a development option,
regular Blender build should be done with the precompiled libraries.
Tested on Debian Testing, Arch, Fedora and Suse Tumbleweed.
With the new design, it should be fairly trivial to add more
distributions if desired, and maintenance should also be way simpler.
NOTE: side effect is that a working python3 interpreter is expected on
system running this script. In practice this should not be an issue,
since Python3 is installed by default in almost all regular desktop
linux installations.
The insert key operator allowed to insert a keyframe on all selected FCurves
and on the Active FCurve at cursor value.
But it didn't allow to insert a keyframe only on the active FCurve.
This patch adds that. It is available in the redo panel and under Key->Insert Keyframes (which can also be called with the I hotkey)
Pull Request: blender/blender#106307
This change aimed to solve the following issues:
- Possible threading issue of two tests writing to the same
file, depending on how the ctest is invoked
- Test using the release directory, and potentially leaving
temp file behind on test failure, breaking code sign on
macOS.
Pull Request: blender/blender#106311
Found together with a fix for #106043.
Edge panning (in Node Editors, Outliner and VSE) does unnecessary
updates when the view has not changed at all. This includes adding
`MOUSEMOVE` events (even if you dont move the mouse at all).
Adding `MOUSEMOVE` events results in the transform system constantly running (even if you dont move the mouse) which we certainly want to avoid.
Rectify this by only calling these updates when the view changes.
Pull Request: blender/blender#106301
The fix for #105363 (6d3ce8273a) made the transform system respect
(Frame) nodes `offsetx`/`offsety`.
Now Node Editors run the transform system even if the mouse is still (due to edge panning -- unnecessarily, see PR #106301 for fixing this). And due to the way `frame_node_prepare_for_draw` recalculates these offsets (based on
on updated positions and `node.runtime->totr` [which in turn gets rounded in `node_update_basis` -- so subpixel precision is lost there, see [1]]), this can lead to slight imprecisions/noise/jitter during transform (if we use float offsets, see the PR for more info).
So to counter this, use rounded offsets now [which will keep the whole circle stable].
NOTE: PR #106301 would fix this already for having the cursor still, but this patch still improves slight jitter when moving, so will commit separately.
[1] comment from `node_update_basis`
> /* Round the node origin because text contents are always pixel-aligned. */
Pull Request: blender/blender#106096
No user visible changes expected.
For brush assets, we need a way to store a reference to a brush in .blend files, so that the last active brush can be restored from the file. See #101908. It seems like a generally useful thing to have.
Adds a new DNA struct to store a "weak" asset reference, that is, a reference that can break under a number of circumstances, but should work reliably enough under normal usage. There's no way to reliably reference an asset currently, so this works on a "best effort" basis. It can break when assets are moved inside the asset library, asset libraries are unregistered from the Preferences, or a file is opened on a different machine with different Preferences, for example. It can also break currently if an asset library is renamed.
It contains:
- Information to identify the asset library the asset can be found in.
- A relative "identifier" (currently a relative path) for the asset within the asset library.
There's further code to resolve a weak reference to file paths and Blender library paths.
Part of #101908.
Co-authored-by: Bastien Montagne <bastien@blender.org>
Pull Request: blender/blender#105603
The goal is to solve confusion of the "All rights reserved" for licensing
code under an open-source license.
The phrase "All rights reserved" comes from a historical convention that
required this phrase for the copyright protection to apply. This convention
is no longer relevant.
However, even though the phrase has no meaning in establishing the copyright
it has not lost meaning in terms of licensing.
This change makes it so code under the Blender Foundation copyright does
not use "all rights reserved". This is also how the GPL license itself
states how to apply it to the source code:
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software ...
This change does not change copyright notice in cases when the copyright
is dual (BF and an author), or just an author of the code. It also does
mot change copyright which is inherited from NaN Holding BV as it needs
some further investigation about what is the proper way to handle it.
When hitting the "normalize" button in the graph editor, set the y extents of the view to the extents of the `FCurves`.
Previously you had to search for your curves after pressing that button.
Pull Request: blender/blender#105857
Similar to recent OBJ UV values merging commit (05a63e3705) - build
mapping of (vertex, UV) by going over the face loops directly, instead
of using BKE_mesh_uv_vert_map_get_vert and then having an additional
map on top. Provide the mapping into ready to use flat arrays, instead
of building a map and then building arrays out of that in a separate
pass.
While at it, avoid the extra cost of building all this complicated
mapping when we don't have or are not exporting UVs.
Timing tests on exporting several models into binary PLY file
(Win10, Ryzen 5950X):
- Suzanne subdivided to level 6 (2.1M verts): 0.93s -> 0.68s
- Rungholt Minecraft level (9.7M verts): 3.3s -> 2.3s
- Stanford Lucy 3D scan (14.0M verts, no UVs): 5.2s -> 1.5s
This patch replaces `dispatchThreadgroups` with `dispatchThreads` which takes care of non-uniform threadgroup bounds. This allows us to remove the bounds guards in the integrator kernel entry points.
Pull Request: blender/blender#106217
The system wayland-protocols version is too old, and xdg-activation-v1.xml
is a more recent addition than xdg-decoration-unstable-v1.xml so check for
that.
This patch fixes a MetalRT issue where viable shadow hits are discounted based on the false assumption that hits are ordered by distance. With this patch, the following unit tests now pass:
- openvdb smoke
- shadow catcher pt transparent lamp only 0.8
- shadow catcher pt transparent lamp only 1.0
Pull Request: blender/blender#106276
This is preparation for #106228, the crash does not happen in `main` currently.
The issue was `positions_for_write` might make a copy of the data if it was
shared. This operation is not thread safe on a single mesh. The solution is to
get write-access to the positions only once before threading starts.
This makes the APIs more correct and simplifies debugging, because
some debuggers can now show the enum name instead of the integer.
Pull Request: blender/blender#106268
For example
```
OIIOOutputDriver::~OIIOOutputDriver()
{
}
```
becomes
```
OIIOOutputDriver::~OIIOOutputDriver() {}
```
Saves quite some vertical space, which is especially handy for
constructors.
Pull Request: blender/blender#105594
The DPI returned by the GHOST/Wayland didn't account the buffer being
rendered at a higher (non-fractional) resolution, then scaled down.
This caused the software cursor and UI to rendered very small.
A fractional scale of 101% would show the UI just over 50% of the size
(making the UI to be close to half the scale it should have been).
Resolve by accounting for down-scaling of the buffer to it's
fractional size.
The UI needs persistent pointers to catalog paths that it can pass
around via context. It was trying to manage this in own storage, but
this didn't work. Not entirely sure why - the menus get redrawn
continuously while assets load, and the root menu rebuilds the mentioned
storage every time. Maybe the submenus redraw a bit later, or the
keyboard navigation handling still accessed data from a previous redraw
somehow.
Either way, instead of managing own catalog path storage, point into the
asset system, which already has persistent storage for the catalog
paths.
Pull Request: blender/blender#106237
Don't install libraries in blender.shared and don't generate manifest
as it's not working and not important to have a clean directory here.
Always detect MSVC_REDIST_DIR as it is used by oneAPI. The way
InstallRequiredSystemLibraries is called it already only sets some
variables and doesn't install anything by itself.
Pull Request: blender/blender#105999
This is a workaround fix for Open PGL 0.4.1 when the first volume
samples are collected in a later training iteration.
The problem is fixed in Open PGL > 0.5.0 and the workaround
can be removed after upgrading Open PGL.
The bug was found by ASAN when running the file from #105953. It's not
entirely clear what the root issue for the division by zero is, but
at least now the result is more predictable.
Pull Request: blender/blender#106165
The overall goal is to use implicit-sharing in many places in Blender
that currently do unnecessary copies. See #95845 for more details.
This commit only adds the base data structures in blenlib and uses those
in `GeometrySet` and `AnonymousAttributeID`, which used a more ad-hoc
version of implicit sharing already. #105994 lists some more places where
support for implicit sharing can be added (most notably: custom data layers).
Pull Request: blender/blender#105994
The most important part of this change is that the simulation
state at a specific point in time is more self contained now.
This way, only the modifier has to deal with finding the old/new
simulation states and not every simulation individually.
Furthermore, this also includes some simple cache invalidation
when the user changes something that might affect the result.
Previous fix/hack a60f651502 made it so that all 'Fake User' linked
IDs are considered as directly linked, so that some IDs (like linked
Text) references are not lost on file save becaus they are not
effectively used.
However, this created unwanted references to all linked assets data,
because an asset always has its fake user set. This ended up keeping
lots of references to sub-assets when appending from the new Essentials
node groups.
NOTE: This is adding another hack to the collection, the whole handling
of 'which unused linked data reference to keep on file save' needs to be
reworked for Blender 3.6.
This was an issue with the `operator_context`. It's a bit confusing because it
looks like every `uiLayout` has its own, but in `uiLayoutSetOperatorContext`
you can see that the `operator_context` is always set on the root layout for
some reason.
The fix is to set `INVOKE_REGION_WIN` as the operator context after it has been
set to something else (I found this to be the default by printing the operator
context before it was changed).
Pull Request: blender/blender#106213
No user visible changes expected.
With this, empty rows will be added to the tree view so that the
background box is at least a few lines high (like with UI lists). If the
view is used as a drop target, data can be dropped on these empty rows
too then.
This was requested for the Cycles light linking project.
This PR adds support for anamorphic aspect rations when using
masks. As viewport compositor doesn't support masks yet, this
has not been added yet.
Pull Request: blender/blender#106121
This PR adds support for clearing framebuffers and scissor testing.
Tweaks had to be made to VKTexture to keep track of its layout
on the device. Based on the actual call the layout can switch
to a more optimum layout.
For example during upload of a texture the texture will be converted
to a transfer destination optimized layout. When reading from the
texture it will be converted to a transfer source optimized layout.
The order of the attachments in the framebuffer follows the next rules
- When only color attachments are there the color attachments will
be placed in the slot they are defined. This way it will match
the ShaderCreateInfo binding location.
- When a stencil/depth attachment is added it will be placed
right after the color attachments. When there isn't a color
attachment it will be the first attachment.
Pull Request: blender/blender#106044
A few small refactors of the `draw_setting_widget()` function for drawing
animation channel widgets (like 'modifier mute', etc.)
- Use `const` where appropriate.
- Move some variable declarations to their actual use, to clarify their
scope and make it possible to use `const`.
- Return earlier where possible, which should improve performance as some
unnecessary code gets skipped.
No functional changes.
This PR adds pre-checks when enabling validation layers.
For validation layers to work some platforms require that
the Vulkan SDK is installed. Validation layers are activated
when running blender with `--debug-gpu`.
Sometimes we expect users to run with `--debug-gpu` for
narrowing down an issue and we cannot expect them to have
the Vulkan SDK installed.
This patch will check if the `VK_LAYER_PATH` is available
and that the configuration file of the validation layer is
present. If this isn't the case we don't activate the
requested validation layer.
Pull Request: blender/blender#105922
Calling render (for example) with an existing window open now activates
the window on Wayland. Tested to work on GNOME & KDE.
Use the xdg-activation protocol which typically brings the
window to the foreground.
Partially resolves#102985.
Clang would warn about failure to use 'override' when a single
method was added that used 'override' when none of the other methods
did.
This meant a single correct use of override caused noisy compiler
warnings (for CLANG but not GCC).
Avoid this by using 'override' where appropriate.
Improvements to packing efficiency and updating UV packing API.
* Add #pack_islands_alpaca_rotate, the fast alpaca-style packer with rotation.
* Update heuristic for sorting islands based on longest edge.
(Improves pack efficiency when rotation is enabled.)
* Add `aspect_y` to UV Packing API, to support non-square materials in the future.
Pull Request: blender/blender#105977
When all of the input meshes have no loose edges, the output won't have
any either, but finding that out for the output is much more expensive.
Copy this tag to the output mesh to save processing time when drawing.
In my test creating 1 million instances of a 16 face mesh, this changed
the time for the draw cache loose geometry extraction from 220 ms to
131 ms.
For now, only do this when the loose edges of the inputs are already
cached (primitive nodes, for example). This avoids paying the cost of
calculation when we don't know it will be necessary.
It doesn't take much time to know whether all of the curves have more
than a single point, and if that's the case, we know for sure there are
no loose edges in the mesh. This can save time when creating the mesh
draw cache. The time for finding loose geometry goes from 180 ms to
104 ms for a large molecular nodes test file.
For the single-threaded part of the curve to mesh conversion, avoid
writing to two logically separate arrays in the same loop. Instead
run the calculation on two separate threads if the output is large.
Timing for `calculate_result_offsets` when processing 1 million curves:
Before: Average: 10.4 ms, Min: 9.4 ms
After: Average: 9.2 ms, Min: 7.7 ms
Currently assigning values to IDProperties clears their UI data.
That is fixed by #106161, but that is too risky for 3.5. Instead,
work around the issue by triggering `MOD_nodes_update_interface`
function which recreates the UI data of the modifier properties.
Pull Request: blender/blender#106190
Now that mesh primitive nodes calculate their bounds in constant time,
it's worth updating the bounds eagerly when translating a geometry
since doing so should be very cheap and might save a more significant
amount of time if they're needed later.
Also slightly unify the translation functions for the different types.
Pull Request: blender/blender#106159
Previous code was using BKE_mesh_uv_vert_map_get_vert to somewhat
detect identical UV values on mesh vertices. But this was not
handling the case when separate mesh vertices still use the same UV
values (e.g. cube with all six faces mapped to whole image).
Replace usage of BKE_mesh_uv_vert_map_get_vert with a simple "unique UV
value" map, very similar to how OBJ normals are calculated for export.
Measurements on a somewhat extreme case: exporting "Rungholt" Minecraft
level from https://casual-effects.com/data time (Win10, Ryzen 5950X)
goes 2.9sec -> 2.2sec, and resulting file size 486MB -> 231MB. This
particular model has a lot of mesh faces mapping to the same places
in UV map.
On less extreme cases the timings are similar between old and new
code, with a tiny speedup in most tests I've tried.
Allow clicking the "up" and "down" arrows to increment/decrement by a
frame for Video Sequencer strip Frame Start, Strip Offset Start, and
Strip Offset End.
Pull Request: blender/blender#106117
Updated version of our monochrome Noto Emoji (variable) font with 31
new emojis that were released as part of Unicode 15.0
Pull Request: blender/blender#106142
"Rotate Normals" is a changeable operation like any other and does not
need to be hardcoded.
An advantage of exposing this modal is that the shortcut key now
appears in the header when rotating an edited mesh.
Avoid calling `restoreTransObjects`, `resetTransModal`,
`resetTransRestrictions` and `initSnapping` for each change.
Also bring `applyMouseInput` close to the rest of the code.
No functional changes.
The lack of organization in the values of the constants that indicate
the properties was prone to errors.
One error that can be noticed is that the values of
`P_ORIENT_AXIS_ORTHO` and `P_VIEW2D_EDGE_PAN` were the same.
(not really a problem though)
UV attribute refactor in 6c774feb has changed the logic from "UV data does not exist" to "there's no active UV layer". The repro mesh has a UV layer, but not UV data due to the mesh being only a point cloud.
Pull Request: blender/blender#106185
The tooltip of the map range node in the compositing section was displaying that the output value was between 0.0 and 1.0 whereas it is between To Min and To Max value so I just changed the string.
Pull Request: blender/blender#105924
IMath is required for building with vulkan. This patch adds
dependencies to shader_builder for now.
Currently there is a difference between windows and other OS's in
which variable the library is stored. Might be because imath isn't
a direct dependecy. As this is a compilation error I did the quickest
solution and check with platform module what would be the best solution.
Pull Request: blender/blender#106180
Regression introduced at 19b63b932d
The crash happened in `gizmogroup_xform_find` because
`t->region->gizmo_map` was `nullptr`.
The `T_NO_GIZMO` flag was supposed to prevent the
`gizmogroup_xform_find` function from being called, but it was being
removed with `t->flag = t->flag & ~T_PROP_EDIT_ALL;`.
This is because 19b63b932d missed updating the maximum enum value in
`ENUM_OPERATORS`.
The fix is simply to set the correct maximum value in `ENUM_OPERATORS`.
But for more safety, `gizmogroup_xform_find` now returns early when the
region does not have `gizmo_map`.
Co-authored-by: Germano Cavalcante <germano.costa@ig.com.br>
Pull Request: blender/blender#106174
Before this, when the animation is playing and the set of cached frames
changes the timeline is out-of-date which can be confusing.
Now the cached frames are redrawn whenever the current-frame indicator is
redrawn. This fixes the issue but also causes redraws when they are not necessary.
Currently, that does not seem to be an issue,
Pull Request: blender/blender#105986
When using the Low or Medium settings on the Glare node, the generated
glare has an offset toward the lower left corner of the image. That's
because the shader erroneously has logic that assumes non-normalized
coordinates, so its offsets are in the pixel space of the original
image. To fix this, we just use a fixed 0.5 offset in the output pixel
space to evaluate at the center of pixels.
In the future, we might look into using a more advanced downsampling
scheme to avoid temporal instability, which is a new requirement due to
the viewport compositor.
Adding checks for platform capabilities involved adding functions
to multiple classes and was too involved.
Replace this with a single GHOST_System::getCapabilities() function.
This patch implements the Anti-Aliasing node by porting SMAA from
Workbench into a generic library that can be used by the realtime
compositor and potentially other users. SMAA was encapsulated in an
algorithm to prepare it for use by other nodes that require SMAA
support.
Pull Request: blender/blender#106114
Vertex paint's filter operators were not properly going through the SculptSession API.
Undo didn't work; sometimes the operators would do nothing or produce corrupted colors.
The `transform_active_color` helper function now handles all of this. It ensures a valid
SculptSession exists and executes an undo push.
Reviewed By: Hans Goudey
Pull Request: blender/blender#106136
If the variable size option of the Blur node was previously set to true
and the type of blur was later set to Fast Gaussian, variable size blur
will take effect, even though the option is not visible to the user.
This patch fixes the issue by disabling variable size blur when the blur
type is set to Fast Gaussian.
It worked until now because `<iostream>` was included by other headers
before the rotation ones. But this didn't work in all cases. This commit
make sure all rotation type headers include it.
Effectively replicate the behavior of the function in the manner
which is used for autosave file.
There might be better a solution which is cross-platform and does
not suffer from the time of check, time of use (TOCTOU) vector of
attack. This seems to be a bigger project to figure out, so until
then silence the warning: it is fine since the directory is only
used to chdir to, so worst case an external attacker can introduce
is a test failure.
It provides path to a directory suitable for storing temporary files
which satisfies the following conditions:
- The directory exists.
- The return path has trailing directory separator.
It is based on the code used in the appdir.c to get the temporary
directory.
For the C++ people: this is similar to the temp_directory_path()
from the std::filesystem.
No functional changes expected as it is a new code which is planned
to be used on other places as a followup development.
Bug introduced by c2c6707919
Fixing it by undoing the changes to the if statements
at the start of the FCurve drawing functions.
This keeps the intended behavior of the previous path, while fixing the drawing
Pull Request: blender/blender#106100
The Linux worked due to the libraries provided as a dependency
via `EXTRA_LIBS "${TEST_LIBS}"` with extra whole archive.
While on Windows and macOS the whole-archive is not needed the
dependency from the library to the blender_test is still needed.
Solves the issue when modifying asset_catalog_test.cc on macOS
does not make blender_test to be relinked.
Pull Request: blender/blender#106051
When using the slider operators in the Graph Editor
the code would try to access `FCurve.bezt` without checking that exists.
When the curve is baked that is a null pointer.
Pull Request: blender/blender#106102
Nodes inside of frames where pasted with an offset from the cursor.
Since the location of nodes is in parent space, child nodes don't need
to be offset separately.
Pull Request: blender/blender#106099
Workaround gnome-shell including uninitialized memory when pasting
from the clipboard. Where `read` would not write data into the range
return by the length.
Reading from the pipe into a power-of-two buffer
works around the problem.
It's not clear why this only impacts gnome-shell - as there is no
significant down-side to changing the buffer size, apply a workaround.
Ref !106091.
Add a Gaussian smoothing operator to supersede the current
smoothing operator in the graph editor.
Advantage over the current implementation:
* Supports modal operations
* Is independent of key density
* More options in the redo panel
* More predictable Impulse Response
Option in the redo panel to change
Filter Width: How far out on each side of a key the code checks
to average key values
Sigma: The shape of the bell curve, lower values make a sharper bell curve
reducing the smoothing effect.
Too High values will make the code behave like an average filter as the
curve in the -1/1 range will almost be flat.
On a technical note, the operator needs to store additional data when running in modal
to avoid allocating/deallocating data on every modal run.
For that reason the `tGraphSliderOp` struct has been extended with
`void *operator_data` and `void (*free_operator_data)(void *operator_data)`.
The former is the data and the latter is a function responsible for freeing that data.
Pull Request: blender/blender#105635
These often want to store a non-const reference to its owner, i.e. the
object that created them. I don't really like removing const here, but
it makes sense to enable this use case.
Initial idea was to calculate the view boundaries when finishing the
`uiBlock`, after layout code and such ran. But the panel code applies an
offset later, which breaks this. The view boundaries would be off by
something like 100px.
`.asset_generate_preview()` internally calls `UI_icon_render_id` as a
job -- as opposed to `.preview_ensure()` [which internally also calls
`UI_icon_render_id`, but not as a job] leading to crashes in background
mode.
This might be due to the fact that OpenGL context is not set up
correctly (so there might be other ways to fix this), but there seems to
be other places/comments indicating that icon handling is only for main
thread (see e.g. 13beeb5892).
And while this does not fully explain why doing this with jobs works fine
from the UI, the patch certainly fixes the crashes in background mode for
now (by not using jobs).
Pull Request: blender/blender#106046
This PR adds basic support for texture update, read back and clearing
for Vulkan. In Vulkan we need to convert each data type ourselves as
vulkan buffers are untyped. Therefore this change mostly is about data
conversions.
Considerations:
- Use a compute shader to do the conversions:
- Leads to performance regression as compute pipeline can stall
graphics pipeline
- Lead to additional memory usage as two staging buffers are needed
one to hold the CPU data, and one to hold the converted data.
- Do inline conversion when sending the data to Vulkan using `eGPUDataFormat`
- Additional CPU cycles required and not easy to optimize as it the
implementation requires many branches.
- Do inline conversion when sending the data to Vulkan (optimized for CPU)
For this solution it was chosen to implement the 3rd option as it is fast
and doesn't require additional memory what the other options do.
**Use Imath/half.h**
This patch uses `Imath/half.h` (dependency of OpenEXR) similar to
alembic. But this makes vulkan dependent of the availability of
OpenEXR. For now this isn't checked, but when we are closer to
a working Vulkan backend we have to make a decision how to cope with
this dependency.
**Missing Features**
*Framebuffer textures*
This doesn't include all possible data transformations. Some of those
transformation can only be tested after the VKFramebuffer has been
implemented. Some texture types are only available when created for a
framebuffer. These include the depth and stencil variations.
*Component format*
Is more relevant when implementing VKVertexBuffer.
*SRGB textures*
SRGB encoded textures aren't natively supported on all platforms, in
all usages and might require workarounds. This should be done in a
separate PR in a later stage when we are required to use SRGB textures.
**Test cases**
The added test cases gives an overview of the missing bits and pieces of
the patch. When the implementation/direction is accepted more test cases
can be enabled/implemented.
Some of these test cases will skip depending on the actual support of
platform the tests are running on. For example OpenGL/NVidia will skip
the next test as it doesn't support the texture format on OpenGL, although
it does support it on Vulkan.
```
[ RUN ] GPUOpenGLTest.texture_roundtrip__GPU_DATA_2_10_10_10_REV__GPU_RGB10_A2UI
[ SKIPPED ] GPUOpenGLTest.texture_roundtrip__GPU_DATA_2_10_10_10_REV__GPU_RGB10_A2UI [ RUN ] GPUVulkanTest.texture_roundtrip__GPU_DATA_2_10_10_10_REV__GPU_RGB10_A2UI
[ OK ] GPUVulkanTest.texture_roundtrip__GPU_DATA_2_10_10_10_REV__GPU_RGB10_A2UI
```
Pull Request: blender/blender#105762
In Vulkan multiple commands can be in flight simultaneously.
These commands can share resources like descriptor sets or push
constants. When between commands these resources are updated
a new version of the resources should be created.
When a resource is updated it should check the submission id of the
command buffer. If this is different than last known by the resources,
the previous resources should be freed.
If the submission id is the same than previously it has to create a
new version of the resource to not intervene with other commands that
uses the resource before the update.
When the resource wasn't updated between multiple usages in the same
submission id it could reuse the previous resource.
This PR introduces a `ResourceTracker` and a `SubmissionTracker`.
A submission tracker can check if the command buffer is submitted.
In this case all resources of the resource tracker should be freed.
Unmodified resources in the same submission can be shared.
A resource tracker will keep track of all resources that are in
flight. After the resources are used (submission + execution) have
finished the resources can be cleared.
Pull Request: blender/blender#105183
Viewport assumes that when the number of planes of the image
buffer is less or equal to 8 it is a gray scale image. In that
case it will optimize the texture to be stored as a grayscale
image on the GPU.
When using a targa file with a palette, the bitplanes were not
extracted from the actual colors, but from the number of colors
that were present in the palette.
Image buffers don't support palettes so that doesn't make sense.
This PR uses the bitdepth of the actual colors inside the palette
to identify the number of planes to use in the image buffer.
Pull Request: blender/blender#106047
Workaround gnome-shell including uninitialized memory when pasting
from the clipboard. Where `read` woud
Reading from the pipe into a power-of-two buffer
works around the problem.
It's not clear why this only impacts gnome-shell - as there is no
significant down-side to changing the buffer size, apply a workaround.
Only the text editor supported the primary clipboard & only for modal
selection. Now selecting text in the console & 3D text editing also
sets the primary clipboard under X11 & Wayland.
Notes:
- Pasting from the primary clipboard isn't yet exposed in the key-map
so in practice it's only useful for pasting text outside of Blender.
- Use skip-save option when pasting from the primary selection
so this is never used by the regular paste shortcut.
- This commit adds a primary-clipboard flag to WM_capabilities_flag() so
creating the the copy-buffer is only performed when necessary.
Node names should be properly separated for easy searching and reading
and for consistency with other (color) nodes.
This commit should only touch UI names which do not need versioning and does not break node setups or py scripts.
AABB aligned quads would defeat the "witness" accelerator when
using the xatlas packing strategy.
This change reorders the search to allow use of the "witness" technique.
This PR uses renderdoc for frame capturing when enabled.
It enabled an easier workflow for frame capturing.
- Capture GPU API calls from test cases
- Capture GPU API calls from background threads
- Capture GPU API calls from background rendering.
Renderdoc is an important GPU debugger used by the Eevee/
Viewport module. Previously we needed to change code in
order to record background rendering, that could on its own
lead to other side-effects.
The integration with renderdoc can be enabled using
`WITH_RENDERDOC=On` compiler option. `GPU_debug_capture_begin`
and `GPU_debug_capture_end` can be added to the section
of the code you want to debug. When running Blender inside
renderdoc this part will automatically be captured.
All GPU test cases are now guarded by these calls. In order
to capture the test cases you need to start the test cases
from renderdoc and the captured GPU API calls will appear
where each capture is a single test case.
Pull Request: blender/blender#105921
Happens if a scene has a PointerProperty of type collection which
is set to a collection containing rigid bodies.
The error is printed by the builder of the render pipeline graph,
which contains very minimal subset of the view layer: it includes
custom properties (which gets recursed into), but not the rigid
body simulation.
This fix is mainly suppressing the error print, without changing
the apparent behavior of the graph.
Pull Request: blender/blender#106045
Remove `enum eAnimFilterFlags` from `ED_keyframing.h`, the function
parameters that pass them around, and the code that uses them to filter
things.
Only one of the enum values was actually used, `ANIMFILTER_KEYS_LOCAL`.
It indicates whether to only consider keys on the datablock itself (when
set), or in the case of objects, also consider keys on its materials or
shapekeys (when cleared). However, this flag was *always* set, making it
possible to remove the code that handled it.
Finally there was only one function that received a `filters` parameter
that could be different across calls: it would either have value
`ANIMFILTER_KEYS_LOCAL` or `0`. However, the only flag it actually tested
for was `ANIMFILTER_KEYS_MUTED`, which was never actually set. So all of
that could be removed as well.
Just for grepping-through-history sake, these are the flags that were
removed:
- `ANIMFILTER_KEYS_LOCAL`
- `ANIMFILTER_KEYS_MUTED`
- `ANIMFILTER_KEYS_ACTIVE`
- `ANIMFILTER_KEYS_NOMAT`
- `ANIMFILTER_KEYS_NOSKEY`
Note: this is NOT about the flags defined in `ED_anim_api.h`, in `enum
eAnimFilter_Flags`. Note the different names, the one that's removed
doesn't have an `_`.
No functional changes.
Pull Request: blender/blender#106028
was assuming such cases are already handled before this function is
called, but seems to be broken on windows and linux. Do
`safe_normalize()` so the tests pass, will check the problem afterwards.
No functional changes.
A set of functions to get the bounds of a channel was created
for the `ANIM_OT_channels_view_selected` operator.
Theses functions will be used by other functions in this file,
so they need to move to the top.
This patch adds an option to the Status Bar: `Scene Duration`
This shows the duration of the current scene in frames and timecode
`Duration: <timecode> (Frame <current frame>/<total frames>)`
The timecode follows the formatting defined in the user preferences.
Pull Request: blender/blender#104882
Setting a negative active layer index was possible, causing a crash
when adding new layers (for example).
Clamp the active index when assigning from RNA.
Memory chunks that were in the same hashed bucket but had different keys
were comparing memory unnecessary.
In practice this didn't happen all that often in my tests so the
performance improvement isn't significant.
Follow up to 4f10800094.
These `ME_POLY_LOOP_PREV` are redundant, since they're similar to
the `poly_corner_prev` inline functions. They were also confusing,
since they took an index into the poly and returned an index into
the entire corner range. Instead structure code to use the function
version, and simplify some loops in the process.
Standardize naming, use spans and references for input parameters,
and improve documentation. Now the functions expect the lookups to
succeed as well, they will fail and assert otherwise.
The functions are also simple enough that it likely makes sense to keep
them all inlined
This allows adding spans, arrays, etc. directly to SculptSession, which
simplifies accessing mesh data, especially in #105938. A few files
aren't moved to C++ yes, so I had to add three C accessor functions.
Previously UI view items would support custom drop controllers (so they
could react to data being dragged over them and dropped). This is now
more generalized so the views themselves can do this as well.
Main changes:
- Support calculating a bounding box for the view, so this can be used
for recognizing mouse hovering.
- Rename "drop controller" to "drop target", this is more clear, less
abstract naming.
- Generalize drop controllers/targets. There is a new
`ui::DropTargetInterface` now.
- Add support for drop targets in the `ui::AbstractView` base class, so
custom views can use this.
Pull Request: blender/blender#105963
BLI_array_store still performed poorly for boolean arrays or any arrays
where many memory chunks had identical contents since the temporary hash
had many collisions, making lookups slow.
Resolve by ensuring duplicate chunks aren't added to the hash table.
Also increase the memory chunk size for edit-mesh undo to 64kb
which performs well with high poly meshes as it reduces the overhead of
having to manage many small memory chunks.
Notes:
- Before this change performance was quite bad (10-20x worse than v3.3).
- Performance from the test in #105046 is roughly the same as before.
- Performance of #105205 compared with v3.3 is close, even faster at
times but varies much more (likely caused by threading).
* Fix SDL not finding Xlib.h
* Link to clangSupport library for newer LLVM versions
* Add FreeBSD essential symbols to symbols_unix.map
Pull Request: blender/blender#105892
Strict compiler was generating possible-uninitialized warning.
Added an explicit initialization and asserts to solve the noisy
output and catch possible errors early on.
Pull Request: blender/blender#105990
* With the move to gitea, .gitea doesn't need to be copied into installs.
* Add .github and .gitignore in more places for future proofing.
* Deduplicate ìnstall_dir macro.
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: blender/blender#105980
Fix#105955: Cycles crash loading multiple PNG, TIFF and other image textures
concurrently. This OpenImageIO version includes a fix for this problem.
Ref #99618
Pull Request: blender/blender#105958
Workaround for compiler issue on AMD
platforms resulting in the erroneous
discarding of valid rays in fragment
raytracing.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#105967
Eager bounds calculation for cylindrical and spherical primitive nodes,
implemented in constant time rather than as a loop over all positions.
Takes into account the segments count of the circle from which they
are constructed. Solution of the task #105551.
Pull Request: blender/blender#105743
Use XCURSOR_THEME & XCURSOR_SIZE environment variables for Wayland.
While this isn't an official part of the spec, many Wayland compositors
& applications use these variables.
These are meant to be like other low-level attributes--
hidden from the UI, at least by default. This was just
missing from the initial commit that added these
because seeing them was useful for debugging.
After remapping there is no guarantee that collections' parent pointers
are still valid, so using these to free the object cache of all the
collections' ancestors is potentially accessing invalid memory.
Further more, it is noticiably inefficient, as a same collection may be
processed many times.
So instead, introduce (and use in resync case) a new
`BKE_main_collections_object_cache_free`, which iterates over all
collections of given Main and only free their own cache.
I'm doing this because I want to work on the timeline integration for
simulation nodes caching. Also see #103343 for more info regarding moving
files to C++.
Pull Request: blender/blender#105962
Add control over how bone relation lines are drawn. Instead of always
drawing from the head of the child to the tail of the parent, give users
a choice for the parent side of the line. This can now be toggled
between the head and the tail of the bone, where the tail is Blender's
original behaviour and is retained as default value.
Pull request: blender/blender#105427
The Image node in the realtime compositor will output wrong passes if multiple passes are used at the same time. This is because images can only store a single layer, pass, and view at a time. Furthermore, they rely on operators and RNA callbacks to invalidate the cache when a different layer, pass, or view is requested. In effect, when the image node requests multiple passes at the same time without any kind of cache invalidation, wrong passes are output.
While a proper fix is to allow caching of multiple layers, passes, and views at the same time. This patch implements a temporary workaround by explicitly ensuring an up-to-date cache through a call to BKE_image_ensure_gpu_texture() when before requesting a GPU texture.
Pull Request: blender/blender#105547
The asset catalogs are used in Geometry nodes Add Node menu to
generate the hierarchy of submenus.
The assets themselves are used to generate the operator names in the
same menu, and their descriptions.
This commits enables extraction of this data by parsing the catalog
sidecar file, as well as opening each asset blend file to search for
assets.
The Node Add menu can have special submenus containing node assets.
These submenus are generated by parsing the asset blend files from
release/datafiles/assets, and the interface drawing is specific to
these menus.
This commit enables the translation of these dynamic menus, including
their names and the description of the operators.
An error message in paint mode is built out of several possible
components, depending on what is missing in the context for the
painting operation to work.
The main message was properly extracted, but not its individual
possible components.
Although such composite messages should generally not be used, in this
case I'm not sure it's worth it writing 15 different messages with all
possible combinations.
* Group bounding box, bounding cone and energy to a struct called `LightTreePrimitivesMeasure`
* Add utility functions to add primitives to nodes or buckets
* Precompute the split bucket cost to improve efficiency (about 1.4x expected)
Pull Request: blender/blender#105931
Translating an image in fullframe compositor now also translates
the backdrop image for the viewer node.
Attached gif shows the behavior. Notice how gizmo moves with correct
values with the image but the frame stays to indicate what will get
rendered.
Note: This patch is a continuation of [D12750]
(https://archive.blender.org/developer/D12750). In a previous patch,
display offset on screen was not computed correctly. This has now
been fixed.
Pull Request: blender/blender#105677
When converting a BMesh to a Mesh, the attribute would be removed if
all values were true, since BMesh stores the data in a reversed flag.
The check worked the same way for the sharp face attribute already.
No functional changes.
The code previously contained redundant and complex checks for
different snapping scenarios, which involved combinations of multiple
snapping flags and modes on each mouse interaction. This resulted in
unnecessary code duplication and overhead.
To address this issue, the code has been simplified and micro-optimized
by moving these checks to the initialization of the snapping parameters.
This results in a more streamlined and efficient codebase.
The members `align`, `project`, `peel` and `use_backface_culling`
already have a corresponding value in `TransSnap::flag`.
Keeping values that represent the same thing is error prone.
Use C++ types for more automatic memory management, simpler code,
and easier potential performance improvements. Also document each
item in the cache and access a named struct by pointer for the "poly
sorted" instead of using an identical unnamed struct.
As part of #105779, the active status of UV maps won't be stored in
CustomData anymore, so it has to be retrieved from a higher level.
The best way to do that is to retrieve it once and pass around the BMesh
custom data offset as a "key" to the data. This should also decrease
function call overhead in this code (not that it was a bottleneck).
Pull Request: blender/blender#105904
Add `index_range()` and `is_empty()` functions, rename `ranges_num()`
to `size()` (clarifying the final extra integer as an implementation
detail). Also remove the `size(index)` function which gave almost the
same assembly as `[index].size()` (https://godbolt.org/z/PYzqYs3Kr).
Push a task to `TaskPool` when more than `MIN_PRIMS_PER_THREAD` primitives are to be processed. The nodes are rearranged in a depth-first order when copied to the device.
Tested with the scene in #105550 on an Apple M1 Ultra (20 cores), about 11x speedup.
Pull Request: blender/blender#105862
Many error messages were translated when using `BKE_report()` or
`BKE_reportf()`, directly, but others were missing because they used
`WM_report()` or `WM_reportf()`.
This commit adds these two functions to the list of functions used in
the message extraction regex.
In addition, `WM_reportf()` is modified so that the format string is
translated before formatting actually occurs.
Fixed a bug where the active color wasn't being set
on imported meshes, resulting in no colors displaying
in the viewport.
This bug has been in the code for a long time. However,
the colors have been displaying correctly until recently,
so this issue wasn't previously apparent.
Also, changed custom color data name from "displayColors"
to "displayColor", to match the actual USD primvar name.
(This was a typo in the original code.)
Note that pull request
blender/blender#104542
addresses other issues in the color import code (e.g.,
converting all color primvars and not just "displayColor",
avoiding hard-coding of attribute names, handling all
iterpolation types, etc.).
However, the current commit is meant as a short term fix
to a regression, where the "displayColor" attribute does
not render in the viewport at all, until the above pull
can be merged.
Implements #102359.
Split the `MLoop` struct into two separate integer arrays called
`corner_verts` and `corner_edges`, referring to the vertex each corner
is attached to and the next edge around the face at each corner. These
arrays can be sliced to give access to the edges or vertices in a face.
Then they are often referred to as "poly_verts" or "poly_edges".
The main benefits are halving the necessary memory bandwidth when only
one array is used and simplifications from using regular integer indices
instead of a special-purpose struct.
The commit also starts a renaming from "loop" to "corner" in mesh code.
Like the other mesh struct of array refactors, forward compatibility is
kept by writing files with the older format. This will be done until 4.0
to ease the transition process.
Looking at a small portion of the patch should give a good impression
for the rest of the changes. I tried to make the changes as small as
possible so it's easy to tell the correctness from the diff. Though I
found Blender developers have been very inventive over the last decade
when finding different ways to loop over the corners in a face.
For performance, nearly every piece of code that deals with `Mesh` is
slightly impacted. Any algorithm that is memory bottle-necked should
see an improvement. For example, here is a comparison of interpolating
a vertex float attribute to face corners (Ryzen 3700x):
**Before** (Average: 3.7 ms, Min: 3.4 ms)
```
threading::parallel_for(loops.index_range(), 4096, [&](IndexRange range) {
for (const int64_t i : range) {
dst[i] = src[loops[i].v];
}
});
```
**After** (Average: 2.9 ms, Min: 2.6 ms)
```
array_utils::gather(src, corner_verts, dst);
```
That's an improvement of 28% to the average timings, and it's also a
simplification, since an index-based routine can be used instead.
For more examples using the new arrays, see the design task.
Pull Request: blender/blender#104424
133dde41bb changed how 'fake user' flag is handled with linked data.
Previous behavior was a bug/inconsistency, in that the 'directly linked'
tag would be 'over-set' and never cleared, forcing saving references to
a lot of unused linked data.
Note that ideally, 'Fake user' flag should be ignored, and the only way
to decide whether to keep or not a linked ID should be whether it's
actually used by some local data.
However, #103867 and #105687 show that this is causing issues in some cases,
where users wrongly relied on the linked data's pre-defined 'Fake user' flag
to keep their linked data in their production files, even if said data had no
real user.
While not ideal, for now we should consider 'fake user' flag for linked data
as a real usage case. A better handling of this edge-case is related to
wider designs aboud handling of 'non used' data on file save, whether
linked IDs should keep track of being explicitly or implicitly linked by
the user, etc.
Align the labels on the tabs so that when you read them, your head is tilted
towards the content, instead of away.
When tabs are drawn to the right of panels in the sidebar, the labels are read
from bottom to top, which may suggest that this tab does not belong to the area.
This change does it like this:
* Sidebar on the right: the text is read from top to bottom.
* Sidebar on the left: the text keeps reading from bottom to top.
Pull Request: blender/blender#105835
The NLA's behaviour of always forcing a full set of keys (XYZW) is now
done in both 'Combine' and 'Replace' mode (previously only the former).
This fixes the bug where quaternions could not be properly keyed in 'full
stack tweak mode' under certain conditions.
Pull Request: blender/blender#105604
The name #ensure_valid_reflection seems to indicate that the resulted
reflection must be valid, whereas in the reality it only ensure validity
for specular reflections. The new name matches the behavior better.
This function checks if the shading normal would result in an invalid reflection into the lower hemisphere; if it is the case, the function raises the shading normal just enough so that the specular reflection lies above the surface. This is a trick to prevent dark regions at grazing angles caused by normal/bump maps. However, the specular direction is not a good representation for a diffuse material, applying this function sometimes brightens the result too much and causes unexpected results. This patch applies the function to only glossy materials instead.
Pull Request: #105776
Actually both potential roots lie in the interval [0, 1], so the
function ended up checking both roots all the time.
The new implementation explains why only one of the roots is valid; it
saves two square roots and a bunch of other computations.
The `NODE_OT_link_viewer` operator has some complicated logic that was
intended to stop cycling through geometry nodes to make it work better
with nodes that have multiple geometry and data outputs (group nodes).
This logic failed when geometry was not the first socket and it would
just stop connecting data sockets altogether after the geometry socket.
The reason is that the `determine_socket_to_view` function stops looking
for already-viewed outputs after the first geometry, and then simply
reconnects that geometry.
This patch changes the behavior slightly so that, if a geometry output
is found, the node skips over all subsequent geometry outputs, but still
considers data sockets for viewing. Viewing a node with multiple geometry
outputs will connect the first geometry output it encounters and then
keep cycling through data outputs on repeated execution.
Pull Request: #105836
The Cycles light linking branch is using the tree view UI but it seemed
to use the "wrong" layout. It wasn't clear that the layout has to be
reactivated before building the view.
Make it harder to use the API wrong now by requiring the layout as
argument, so the building can ensure it's active.
The input file contains a partial cube, with two regular faces, two
loose edges and one loose vertex. This checks whether the loose vertex
for example is included into the output when exporting with UVs
(loose verts do not have UVs in Blender, so they should get (0,0) UV
in PLY).
In a previous step of the mesh writing process, the loop `totlayer` was
replaced and a temporary vector is used for layer data instead. Use this
temporary vector to find the UV sub-layers, since the vector and the
CustomData struct in the mesh don't necessarily match. Also use a
local variable for mesh loop count to make it clearer that the mesh
isn't used except at the end.
Thanks to Campbell for finding the source of this error.
Since UVs are now stored as 2D vectors in meshes, they can be copied
directly to the vertex buffers. Somewhat surprisingly, multithreading
the copying into the vertex buffer provides a good speedup-- on a CPU
with many cores at least.
Here is a test uploading two UV maps created in geometry
nodes with a 1 million quad mesh, with a Ryzen 7950x:
| | Before | After | Speedup |
| ------- | ------- | ------ | ------- |
| Average | 24.3 ms | 7.5 ms | 3.2x |
| Min | 17.6 ms | 7.0 ms | 2.5x |
I added the copying utilities to the array utils header, since the
need for them has come up in a few different places already, and the
existing function with a selection argument didn't make sense here.
Pull Request: blender/blender#105793
When deleting UV UI attributes it isn't necessary to use the higher
level C attribute API, since we already know we aren't working with
the edit mesh here.
There were logic errors and use-after-free errors with the attribute
removal function. Because the custom data layers are reallocated,
we can't reuse the name pointer after removing an attribute. And
we can't return early on the first domain to fail for the edit mode
implementation, because another domain might have the attribute.
Also reorganize some of the code to make the logic clearer: only remove
sub-attribuutes and change attribute names after actually removing the
attribute,and assert if the attribute isn't removed after it is found.
Geometry Nodes: SDF Volume nodes milestone 1
Adds initial support for SDF volume creation and manipulation.
`SDF volume` is Blender's name of an OpenVDB grid of type Level Set.
See the discussion about naming in #91668.
The new nodes are:
- Mesh to SDF Volume: Converts a mesh to an SDF Volume
- Points to SDF Volume: Converts points to an SDF Volume
- Mean Filter SDF Volume: Applies a Mean Filter to an SDF
- Offset SDF Volume: Applies an offset to an SDF
- SDF Volume Sphere: Creates an SDF Volume in the shape of a sphere
For now an experimental option `New Volume Nodes` needs to be
enabled in Blender preferences for the nodes to be visible.
See the current work plan for Volume Nodes in #103248.
Pull Request: blender/blender#105090
The crash is fixed by reverting 87fd798ae3 and
some follow up commits. While it would generally be nice to move to a more
SoA format for these things, we are not there yet and this is causing more
trouble than it's worth currently. The main difficulty is that the socket
indices are changed by many different operations which invalidates the array
too often and led to many follow up bugs.
Pull Request: blender/blender#105877
Change code fragments where `BKE_mesh_vert_coords_alloc` had been used
to temporarily copy vertex coordinates of a mesh (see #103789) and
providd pointers to the mesh's stored vertex positions instead.
This reduces memory usage and improves performance.
Pull Request: blender/blender#105756
Implement GBuffer prepass and deferred lighting (lights only).
This decouple lighting from the material shaders making them lighter,
less expensive and faster to compile.
Trying to keep a nice data flow so we could potentially use the
subpass programable blending feature on tiled GPU arch.
Not everything is covered yet and #105880 is making the GBuffer layout
a bit awkward and not easily extendable.
Pull Request: blender/blender#105868
Changed `edge->v2` to `endVert` to make it consistent with surrounding code.
Removed the unused `totedges` variable.
Currently `totpoly` is also unused, but is fixed in a separate PR.
Pull Request: blender/blender#105870
Follow connections when reading the varname attribute of a primvar
reader, and support both string and TfToken types for the varname.
A unit test is also provided.
Authored by Apple: Matt McLin
Pull Request: blender/blender#105508
This was lost in the refactor to store material indices in a generic attribute.
The attribute API still allows this, but that will be handled separately
since it's a more complex task. The existing API that already clamped
input values should still do that.
Other areas like blenkernel and Cycles clamp the material indices to be
positive so this should be consistent with them. There is still discussion
if material indices should be made impossible, but this at least avoids
crashing for the 3.5 release.
There was also an inconsistency in how sculpt mode handles material index
higher than the number of slots.
Ref #105577
Simple logic: when the repository is not found under the relative
path to the main repository's origin, enforce clone of the upstream
repository instead.
Pull Request: blender/blender#105858
This flag is moved to a different variable but the default value is still placed on the wrong variable.
This fixes the default value assignment but due to the old flag bits are in conflict with used bits in the new flag variables, versioning changes are not included.
Pull Request: blender/blender#105852
1) There was a logic error in FileBuffer where when it was trying to
add a new 64kb chunk to hold output, it was adding an empty chunk,
but making sure we have space capacity to hold 64 thousand chunks.
So that was a bit of pointless juggling to get nothing good.
2) In UV_vertex_key, instead of trying to combine three members into
a hash value, badly, by doing some ad-hoc shifts and xors, use
get_default_hash_3 instead, which combines them way more properly.
Also avoid copying the whole hash map object.
On my windows box (Ryzen 5950X, VS2022), exporting Stanford Lucy 3D
scan:
- Binary: 13.4 -> 5.4 sec
- ASCII: 29.3 -> 14.6 sec
So basically 2x faster for two tiny changes.
This PR adds support for `GPU_storagebuf_clear` and
`GPU_storagebuf_clear_zero` to the Vulkan backend. It also adds test
cases for all backends.
Pull Request: blender/blender#105487
When multiple nodes (Frame nodes included in the selection) are scaled/
rotated, the TransData location and center can get "wrong" due to the
fact that Frame nodes dont only use `locx`/`locy` for their
representation while drawing, but also `offsetx`/`offsety`.
So in order to use the "real" top-left corner in the transform system,
we have to respect `offsetx`/`offsety` when creating/flushing transform
data.
In addition to the file in the report, this patch was also tested to work
well with nested Frame nodes.
Pull Request: blender/blender#105400
Fixes:
* General:
- Was assuming that positions/normals/UVs are always `float`, and colors
are always `uchar`. But e.g. positions are sometimes doubles, or colors
are floats etc.
- Was assuming that `face` element is always just a single vertex indices
property. But some files have more arbitrary properties per-face.
* ASCII importer:
- Was assuming that file elements are always in this order: `vertex`,
`face`, `edge`. That is not necessarily the case.
- Was only handling space character as separator, but not other
whitespace e.g. tab.
- Was not checking for partially present properties (e.g. if just `nx` is
present but not `ny` and `nz`, it was still assuming whole normal is there).
* Binary importer:
- Was assuming that faces are always 1-byte list size and 4-byte indices.
- Was assuming that edge vertex indices are always 4-byte.
For the assumptions above, it often lead to either crashes, garbage data
or not detecting presence of a vertex component. E.g. binary importer was
just always reading 4 bytes for vertex indices, but if a file has 2 byte
indices then that would read too much, and then later on would start reading
garbage. ASCII importer was doing out-of-bounds reads into properties array
if some assumptions were not correct, etc.
Improvements:
- Some ply files use different property type names, e.g. `float32`,
`uint16` or `int8` instead of `float`, `ushort`, `char`; now that is
supported too.
- Handles `tristrips` element. Some files out there do not have `face` but
rather has a triangle strip, internally using -1 indices for strip restarts.
Performance:
While doing the above fixes/improvements, in order to fix some things it was
more convenient to also make them more performant :) Now it avoids splitting
each ASCII line into a vector of `std::string` objects, for example, or
reading a binary file in tiny chunks.
Generally this is now 2x-4x faster than the previous state of C++ importer.
The code has changed quite a bit to achieve both the fixes and performance:
- Instead of separate files for ASCII and Binary reading, they are now both
in `ply_import_data.cc/hh`. Reason is that all of the "find correct property
indices" logic is the same between both (and that bit was mostly missing
previously).
- Instead of using raw C++ `fstream` object and reading line by line (which
in turn reads one byte at a time) or reading field by field, now there's a
`ply_import_buffer.cc/hh` that reads in 64KB chunks and does any needed
logic for the ASCII/header part to properly split into lines. This avoids
all the mutex locking, locale lookups, C++ abstraction layers overhead
that C++ iostreams have when doing a ton of tiny reads.
Tests:
Extended test coverage with new files (comitted in svn revision 63274).
11 new "situations", in both ascii and binary forms. Additionally, now also
has a Big Endian binary file to test; BE codepath was completely untested
before.
Overall reworked the tests so that they don't do the whole "load dummy
blend file, import ply file on top, go over meshes, check them", but rather
do a simpler "run ply importer logic that fills in PlyData structure, check
that". The followup conversion to blender meshes is fairly trivial and the
tests were not really covering that in a useful way.
Pull Request: blender/blender#105842
Viewer node paths usually start with the modifier, but in pinned
node editors the tree may not be used by the object in context.
In that case the modifier part of the path should be ignored.
The viewer node is always disabled in that case.
Pull Request: blender/blender#105826
Resizing an image via the operator did not mark it dirty
(`IB_BITMAPDIRTY` is needed to pick this up as being modified, if this is
not set, no warning/option is shown on file close).
Note that using RNA would already do this correctly (since it uses
`BKE_image_scale` -- which already calls `BKE_image_mark_dirty`
internally).
Pull Request: blender/blender#105851
While **marking** an asset would update the Outliner immediately (this
due to the fact that `ED_asset_generate_preview` indirectly took care of
a refresh), **clearing** an asset would not do this.
Now be explicit about this in the Outliner listener and consider asset
notifiers there.
Pull Request: blender/blender#105287
Preview render depsgraphs are put in the depsgraph registry
concurrently with other threads. This was lacking a mutex lock
and a map value that remains unchanged when other elements of
the map are updated.
Pull Request: blender/blender#105839
This changes the maximum viewport resolution divider for Cycles to
help users get a more responsive viewport.
This is done by changing the maximum viewport resolution divider
to a divider that aims to have the largest axis of the viewport
roughly equal to 128 pixels.
Depending on the circumstances, this change can result in a few
noticeable differences:
- Users with slow hardware and a large pixel_size, or slow hardware
and a low resolution screen, may observe a higher resolution viewport
during navigation, making the scene more readable. However this comes
at the cost of reduced responsiveness.
- Users with slow hardware and a low pixel_size and high
resolution screen may observe a lower resolution viewport during
navigation, providing a more responsive viewport during navigation.
Along with that, how Cycles iterates through resolution dividers
is changed to promote quick transitions between resolution dividers.
Meaning users don't need to wait through as many iterations to get
from a low navigation resolution to a 1:1 viewport resolution.
Pull Request: blender/blender#105581
This makes it so access to macOS SDK from newer versions than our
deployment target can be detected on a buildbot via failed build.
Pull Request: blender/blender#105595
When an object has no UV layers and an anonymous UV layer is created,
the anonymous layer gets set as the default (render) layer. This is
very confusing because it then uses a hidden anonmous layer. This patch
suppresses the usage of anonymous layers for rendering.
Pull Request: blender/blender#105192
`scissor_test_set` wasn't able to parse the arguments that were
passed correctly, due to incorrect control data during functino
registration.
This patch uses the correct control data during registration and
is able to parse arguments.
Ref: #104911
Pull Request: blender/blender#105850
Auto-depth is no longer reset during consecutive touch-pad motion.
Details:
- Add wmEvent::flag, WM_EVENT_IS_CONSECUTIVE to detect consecutive
track-pad & NDOF motion events. Expose via RNA as Event.is_consecutive.
- Consecutive events are broken by button/key presses and mouse motion.
- Add `WM_event_consecutive_data_*` functions, so operators can store
data between consecutive events.
- Add `ED_view3d_autodist_last_*` functions to access the last autodist
pivot point for view operators to use.
A renaming of UI scale factors from names that imply a relationship to
monitor DPI to names that imply that they simply change "scale"
Pull Request: blender/blender#105750
the path for clang_format_paths.py changed when the submodules
moved but format.cmd was never updated for that.
the work previously done by check_submodules.cmd is now done by
make_update.py so this file can be removed.
This is an issue revealed by the recent optimization in 4d3bfb3f41 to have
CPU and GPU subdivision topology both cached.
BKE_subsurf_modifier_subdiv_descriptor_ensure is what (re)creates the
topology refiner when needed. Invalidating the topology refiner on changes
must be done before it, otherwise we end up with an incomplete Subdiv that
either does not draw or draws incorrectly.
Pull Request: blender/blender#105844
This makes it possible to use `Vector` recursively if the inline buffer
has 0 size. Any other inline buffer size does not work, because then
the type would be embedded in itself which does not make sense.
Pull Request: blender/blender#105832
Various UI code would store the `AssetHandle` in a way that turns out to
be unsafe. The file-data is part of the file browser caching system that
releases file-data when a certain maximum of items is in the cache. So
even while just iterating over the assets, earlier iterated asset
handles may become invalid. Now asset handles are really treated as
volatile, short lived objects.
For the asset-view, the fix was more involved. There we need an RNA
collection of asset-handles, because the UI list code requires that. So
we create a dummy collection and get the asset handles as needed by
index. This again meant that I had to keep the index of the collection
and the asset-list in sync, so all filtering had to be moved to the UI
list.
I tried duplicating the file-data out of the cache instead, but that
caused problems with managing the memory/ownership of the preview
images.
`AssetHandle` should be removed and replaced by `AssetRepresentation`,
but this would be an even more disruptive change (breaking API
compatibility too).
Fixes#104305, #105535.
Pull Request: #105773
These are not really about reading or writing .blend files, they are
general utilities for file-names/paths. Having to link to the
blendloader library just for these utilities is annoying.
Moved them to `BKE_blendfile.h` now, in agreement with Bastien.
Pull Request: #105825
When linking a texture directly to the material output, it's likely being
done for the purpose of previewing. In that case, bias the heuristic towards
not building a light tree, as it's likely not needed and slow on dense meshes.
While this was just a single pixel off, it was a bit notable since the
highlight wasn't centered correctly. Now retina and non-retina screens match
visually.
Adds two modes of GPU frame capture support for
enhanced debugging. GPU frame capture begin/end
allow instantaneous frame capture of all GPU commands
within the capture boundary.
GPU frame capture scopes allow several user-defined capture
regions which can wrap key parts of code. These scopes are
exposed to connected GPU tools allowing the user to manually
trigger a capture of a known scope at the desired time.
This is currently integrated with the Metal backend for
support with Xcode.
Related to #105591
Pull Request: blender/blender#105717
Fix race condition if several competing threads are inserting Metal
buffers into the MTLSafeFreeList simultaneously while a new list
chunk is being created.
Also raise the limit for an MTLSafeFreeListChunk size to optimize
for interactivity when releasing lots of memory simultaneously.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#105254
Optimized node graphs do not get cached and were
not correctly freed once their reference count reached
zero, due to being excluded from the GPUPass garbage
collection.
Also suppress Metal shader warnings, which are prevalent
during material optimization.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#105795
Metal buffer binding validation would trigger an error
when a given shader had an empty PushConstantBlock.
This patch removes the default uniform code gen if
no uniforms are present, to avoid any possible issues
with buffers being bound to a shader where the destination
data block is size zero.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#105796
Crash when selecting objects on AMD platforms running
Metal. This was caused by shader compilation warnings
being treated as errors in macOS 10.15. Wrapping
compilation failure with success check resolves error.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#105739
immDrawPixels performs significantly slower in Metal
than OpenGL. This was caused by two main factors. Firstly,
the additional overhead of tiled texture update, where all
memory needed to be kept in flight for each update, but
caused update to take a slow path. Avoiding tile update
with Metal is more efficient for both memory pressure
and GPU pipelining.
Secondly, on AMD platforms, the staging buffer used
for temporary texture data was page-faulting when
several texture updates would occur within one frame.
This is due to limitations of allocating one large contiguous
memory chunk. Using the Metal buffer pool for staging
data is more efficient.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#105794
Maximum distance of lines in screen space is limited. This limit seems
reasonable for FPS higher than 1, but UI allows to set 0.01 FPS with
soft. even lower values are possible.
This patch allows for normal operation within soft limits and labels are
still visible and quite usable within hard limits.
Pull Request: blender/blender#104849
Without assumptions of a mesh's direct ownership of its normals,
this was error prone, since normals could potentially be reallocated
when they are tagged dirty or retrieved with write access.
- Show/hide mask layers: the tooltip was confusing from a user's
perspective, because they should not be expected to know what a hide
flag is.
- Active Spline -> Active Point: likely a copy and paste error.
- Geo Nodes face is planar node: forgotten article.
- Axes, plural instead of axis for the viewport preferences. Here
there are several usages of axis or axes. Since they refer to
coordinate axes I believe they should be plural, even though the
property `mini_axis_type` is still wrong.
-----



Pull Request: blender/blender#105814
No functional changes.
This is just a micro-optimization to avoid updating `prev_point` and
calling `ED_gizmotypes_snap_3d_data_get` when snapping is not enabled.
The bug only happened in wireframe mode.
Originally the `const bool use_depth` indicated when projection should
be done on invoke.
Later it started to indicate when to snap on invoke.
But with keymap snap detection, using this `use_depth` is no longer
correct.
Implement the two cached normal accessors with C++ methods
directly. This avoids dealing with raw pointers and reduces the
amount of casting necessary.
Since normals are derived data, it's always a change to something
else that will cause them to change, like the winding order of a face
or vertex positions. So it's clearer to use tags for those things
directly. It's correct to remove the tag in one place since dirty is
the default state of a new mesh.
This validation dates back to when vertex normals were stored in
the `MVert` type (before cfa53e0fbe). Since normals
are all calculated in the same place, and aren't saved in files, this
isn't relevant anymore-- they can just be recalculated.
When creating the bounding box mesh for the viewport replacement,
copy the material from the original mesh. I'm not sure if Cycles is
meant to load materials from the original mesh or the Alembic file
itself, but either way, this should be a harmless change and fixes the
issue in the report.
Pull Request: blender/blender#105798
Create GPUNodeLinks for tiled_image and tiled_image_mapping together, to ensure they are the same texture.
See blender/blender#105661 (comment) for context and a more in-depth explanation.
Pull Request: blender/blender#105772
... or carnidal interpolation with only 2 color stops.
This was triggering an incorrect path due to missing optimisation cases.
Just fall back to the unoptimized case fixes the assert.
This was likely caused by a bad merge when doing the uniform name
patching for Metal.
This also fix the same issue for active UDIM tile overlay which wasn't
reported.
eaa87101cd made evaluated metaballs become meshes
for render engines. This exposed the normals calculated by the metaball
tessellation directly, whereas before they were recalculated later.
There are two fixes: not using the metaball tessellation normals at
all and calculating them with the standard Mesh code path instead,
or switching a define in the metaball code to use a more mesh-like
vertex normal accumulation. Since the results are very similar
(see attached renders), use the second solution, which should
be less expensive.
Pull Request: blender/blender#105799
Increase the default value for the maximum number of recently-opened
files from 10 to 20. Also change the user's preference on version bump
to this new value if their current value is exactly the old default.
Pull Request: blender/blender#105703
Move the deform curves with surface node group to last so it affects the
final generated curves consistently (though this will have a negative
performance impact), and make the generate and interpolate modifiers use
the surface mesh's rest positions.
When the height of the editor couldn't fit the sidebar tabs, they would shrink
to a size too small to read the tab label.
This change matches the behaviour with the Properties Editor navigation bar,
by introducing the following improvements:
* Avoid truncating tab labels.
* Allow scrolling when tabs don't fit.
Behaviour is similar to how scrolling works in the Properties Editor navigation
bar, supporting mouse wheel up/down and MMB, and switching tabs with
`Ctrl+Wheel Up/Down`.
Pull Request: blender/blender#105355
My PR blender/blender#104535
was committed as 88f9c55f7f and the logic was changed
while adding support for face sets, making the logic incorrect and
the warning system disfunctional.
Restore the logic from the original PR with added support for face sets,
fix const correctness issues, improve variable naming, and remove a
check for empty names, since all attribute-type layers should have
names in a valid mesh.
Fixes#105780
Previously only the icon of a file could be dragged in the list display
modes, the name label would invoke box select. This made dragging quite
finicky. I've seen this cause quite some frustration, especially when
the file browser is used as a regular editor to drag data from into
other editors.
Instead follow the Outliner (and some other file browsers like the macOS
one): Dragging on empty space invokes box select, dragging on the name
or icon invokes drag & drop of the item.
The hitbox for the dragging is the width of the string, and the full row
height. So there's no space between rows to do box-select from, it
always triggers dragging. This is based on feedback during testing.
Note that 1e9564864c and 6da512f0bc were needed to prepare this change.
Pull Request: #104830
The switch from `stroke_start` to `vertex_start` in 8c6d4aa103 forgot
to also update `iter->stroke_index_last` which also needs to use
`vertex_start`.
Pull Request: blender/blender#105797
Skip explicit binding location for samplers in OpenGL when not needed, since drivers can usually handle more sampler declarations this way (as long as they're not actually used by the shader).
Pull Request: blender/blender#105770
Skip explicit binding location for samplers in OpenGL when not needed, since drivers can usually handle more sampler declarations this way (as long as they're not actually used by the shader).
Pull Request: blender/blender#105770
The loading for the "All" asset library would include the "Current File"
library as if it were a regular asset libray on disk. Instead make sure
the latter is loaded properly first and is skipped when recursively
reading on disk libraries.
This PR fixes an error that is given when Metal API validation is enabled. The compute grid can exceed 65536 threads so `ushort` is not sufficient for `metal_grid_id [[threadgroup_position_in_grid]]`.
This PR also fixes OS version warnings ([Cycles Metal: Unguarded access to newer macOS features #105630](blender/blender#105630))
Pull Request: blender/blender#105763
The operator went through quite a bit of trouble to pass a color
attribute index to the operator, but then it always used the offset
from the first layer of the active color attribute's type.
Also remove the "copy domains temp" API function, which
generalized this more than necessary, and exposed the internals
of the custom data system a bit more than we would like.
The transformations were applied two times and the old fix was wrong because it needs to use the evaluated point, not the original one. Also I did a small code cleanup.
Pull Request: blender/blender#105202
The two removed BKE functions were at a mid-level of abstraction
that doesn't make total sense in this API. Removing them is also
helpful in the general effort to have the attribute system rely less
on `CustomData` internally.
Allow specifying a specific region to check for active button. This is
required in some circumstances, like Driver Popover.
Pull Request: blender/blender#105746
This simplifies the usage of the API and is preparation for #104478.
The `CustomData_add_layer` and `CustomData_add_layer_named` now have corresponding
`*_with_data` functions that should be used when creating the layer from existing data.
Pull Request: blender/blender#105708
This changes the Switch node so that it is implemented directly as a lazy-function,
instead of as a normal geometry node which uses `GeoNodeExecParams`. This improves
the design of the layered execution api, where different nodes can be implemented
at a proper different abstraction level. The simplest kinds of nodes are implemented
as multi-function, then there is `GeoNodeExecParams` and more specialized nodes are
implemented as lazy-function. The switch node is special in the sense that it currently
needs extra behavior in the lazy-function graph generation anyway.
`GeoNodeExecParams` can be simplified as well, because the Switch node was the only
one that used the `lazy_` methods.
We could consider adding back lazy-input functionality to normal geometry nodes
as it becomes necessary. Ideally, that could be integrated with the node declaration.
Pull Request: blender/blender#105696
Fix support for Wireframe and parametric nodes by resolving
compilation failures surrounding barycentric coordinates.
A final missing part of the Metal implementation for barycentric
coordinates was missing.
Feedback also addressed to move barycentric calculation out
of code-gen and into surface_lib.
Authored by Apple: Michael Parkin-White
This also resolves#103606.
Ref #96261
Pull Request: blender/blender#105740
Now only dynamic function parameters that use ParameterDynAlloc support
dynamically sized parameters arrays.
Add tests for both dynamic arrays that don't support resizing
(Image.pixels) and dynamic sized arguments using
(VertexGroup.add(index=[..])).
Regression in [0] which extended support for dynamic sized function
arguments.
[0]: dfb8c5974e
This adds a new set of APIs supporting the loading and saving of image
formats through OIIO. It makes use of the recent IOProxy work in OIIO
to align with the existing Blender image loading/saving machinery.
The support code here has been prototyped to work with ~7 of our image
formats so far. It includes centralized handling of `IB_test`,
`IB_mem`, and `IB_metadata` flags, which the existing code did not
handle consistently or at all depending on the format.
The PSD format (`format_psd.cc`) is included since the prior location
of the code has been restructured away. It serves as an example of how
the loading code typically flows for all the other formats.
Pull Request: blender/blender#105519
- DriverVariable.name update function passed DriverVar to
BKE_driver_invalidate_expression as a ChannelDriver.
- DriverTarget.name update function passed DriverTarget to
BKE_driver_invalidate_expression as a ChannelDriver.
- DriverVariable.type update function DriverVar accessed ChannelDriver,
clearing a flag.
This was exposed by [0] however this issue existed beforehand.
[0]: c26566ad27
In practice this probably didn't cause bugs, but it would have
caused extra copies of the UV helper layers. The layers are only
needed if we find true values. Mistake in 0fe0db63d7.
This is a non-recent regression that strangely went unreported.
It is expected that when snapping, only visible elements are considered
which does not include faces in wireframe mode.
This works like this before, and this change doesn't appear to have
been intentional.
Ref #105664
One of the advantages of separating this enum member from the others is
because mixing several members in a single one hinders debugging since
in this case the IDE does not define which enums were set.
Also separating this item makes it more readable as `SCE_SNAP_MODE_GEOM`
is not a snap mode but a combination of modes.
VKPixelBuffer is used by external render engines to allocate buffers
using the same GPU backend that Blender runs in.
In a later stage we should test what exact binding flags are needed. I
expect that it should be able to use as a transfer buffer to copy the
pixels over to a texture using transfer commands.
Pull Request: blender/blender#105741
This add the`CurvesGeometry::blend_read` and `CurvesGeometry::blend_write` methods
and uses them in the `curves_blend_read_data` and `curves_blend_write` functions.
No functional changes.
Pull Request: blender/blender#105737
The active frame is pasted always, so if multiframe is
copying the strokes don't need copy the active frame again.
Pull Request: blender/blender#105605
Implement ViewLayer.aovs.remove by adding a new RNA function to call
the internal BKE_view_layer_remove_aov.
Resolves#99259
Pull Request: blender/blender#105646
Issue was that the clamping parameters were not in
the correct order. This leads to undefined behavior
and also lead to small artifacts on other platforms.
Pull Request: blender/blender#105735
In most places where it appears in a menu, the operator would already
apply to all selected F-Curves. Now it is done consistently and explicitly
from all menu items. The default of the operator is now also set to 'all
selected', so that it also behaves like that when called from the operator
search menu.
The BMesh to Mesh conversion does some checks to the UV helper
attributes like selection to avoid copying them to the mesh if they
don't contain any meaningful data. However, it does this by looping
over all faces for every UV map, not in parallel, so it takes up a large
portion of the total time in the conversion. This commit moves that
to the existing similar checks.
On a 1 million face mesh with 3 UV maps, for me this improved the
conversion runtime by 75%, from 174ms to 99ms. Before the serial
loops took 88ms out of the total. Combining them with the existing
loop over faces only increased its runtime from 29 to 40ms.
Some add-ons choose to use the `warning` field in the `bl_info`
dictionary. This is potentially useful info, which should be shown to
the user translated.
This commit extends `dump_addon_bl_info()` from the i18n utils add-on,
to add this field to the message extraction.
The _gpu_ prefix is redundant as they are inside a namespace
and run as part of a test suite that already contain the name
gpu. (GPUOpenGLTest)
This patch also moved the texture test cases to its own
compile module.
This renames the `BKE_gpencil_*` as well as the `DNA_gpencil_types.h`
files to indicate that it's the legacy grease pencil.
Pull Request: blender/blender#105597
When a shader is bound it should outlife the pipeline. In one
test case where only the shader data was accessed it also bound
the shader. This isn't needed as the shader data should be
retrieved without binding the shader.
This change fixes the issue by not binding the GPU shader.
Patch version was increased, but the file subversion should have
been increased.
Also fixes previous incorrect patch versioning code as it didn't
add all 'version code until next subversion bump goes here.' after
version bump.
The function set bits in a bitmap for all the edge indices in a face.
With future changes to mesh topology storage though, this level
of abstraction won't be as helpful anyway.
Refactoring mesh code, it has become clear that local cleanups and
simplifications are limited by the need to keep a C public API for
mesh functions. This change makes code more obvious and makes further
refactoring much easier.
- Add a new `BKE_mesh.hh` header for a C++ only mesh API
- Introduce a new `blender::bke::mesh` namespace, documented here:
https://wiki.blender.org/wiki/Source/Objects/Mesh#Namespaces
- Move some functions to the new namespace, cleaning up their arguments
- Move code to `Array` and `float3` where necessary to use the new API
- Define existing inline mesh data access functions to the new header
- Keep some C API functions where necessary because of RNA
- Move all C++ files to use the new header, which includes the old one
In the future it may make sense to split up `BKE_mesh.hh` more, but for
now keeping the same name as the existing header keeps things simple.
Pull Request: blender/blender#105416
This is very similar to ebe8f8ce71, but applies the same
changes to conversions to non-evaluated meshes meant for original
data. The function also handles shape keys, UVs, selection history,
"scan the database" object vertex index remapping, and multires fixes.
Those operations are handled in parallel with the other conversions now.
Similar to before, the improvement is better the more attributes/data
contained in the BMesh. This time I observed an improvement of 50%
(182ms to 123ms) for a large grid mesh with many attributes, and 20%
for a large grid mesh with less data. Shape keys, selection, hiding, and
multires data should have less of a detriment to performance now too.
One remaining thing to improve is the recently added UV selection/pin
handling. This should be moved into the first single-threaded loop over
faces, or changed further.
Pull Request: blender/blender#105602
- The Math node lost the headers of its operation type menu in
ee985fa925 , because a translation context was assigned to the RNA
property, but the headers declaration was not updated to extract the
messages with matching contexts.
- The message "Group Input" had a trailing space, which can be added
after translation.
This is something we missed in #104599.
Without it, the default color isn't always set.
Thanks to user roman-13 for pointing out the problem,
and thanks to Hans Goudey for telling me the solution.
Pull Request: blender/blender#105539
- Use dynamic declarations to build simulation node sockets
- Fixes in some node code for futher use of dynamic declarations
- Copying, freeing, reading, and writing of simulation state array
- Add simulation state items with link drag operator
The new sockets won't do anything yet, only geometry sockets are
supported, and there is no way to remove sockets yet.
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
Note: Still unstable. Simulation resets when playback stops bug.
Since the "Run" behavior can basically be implemented with the switch
node already, it's just adding unnecessary complexity to the interface
now, when it's use case isn't clear. We decided to remove it for now,
and only consider it later as a possible convenience feature, rather
than an essential part of the design.
Also, the simulation nodes are now considered "side effect nodes"
for the evaluator, meaning they are *always* evaluated, even if they
aren't needed because of switch nodes, etc. This was the best way
we thought of to make simulations run consistently even through
situations like that.
These aren't theoretically necessary, since you can just created them
as regular outputs. Maybe we will eventually add them back for
convenience, but that's not clear.
Since this is theoretically redundant with simulating a float
with the delta time value, we decided to remove it for now to
make the whole interface simpler.
- Cache is accessed with a string identifier, allowing multiple sockets in the future
- Cache is meant to be stored in a simple array, not sparsely like before
- Persistent cache and temporary "last run" cache are separated more clearly
- Use a "Time Point" class instead of integers, to maybe clarify adding subframe support in the future
- Use a different "sim" namespace (not sure if that will last)
- The value from the last frame is moved, to avoid a copy when no persistent cache is used
I don't think this works now, at least I haven't tested it.
This is a temporary option anyway, the caches will be controlled in a
more unified place at the object or scene level. But for now the name
can be a bit better anyway.
It's the output node that decides whether to requiest the values
from the nodes inside the simulation, so it makes more sense
for it to be there. This is part of a general effort to have less
redundancy in the options.
* Test [daily builds](https://builder.blender.org/) to verify if the issue is already fixed.
* Test [previous versions](https://download.blender.org/release/) to find an older working version.
* For feature requests, feedback, questions or build issues, see [communication channels](https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests).
* Security vulnerabilities should be [reported privately](https://wiki.blender.org/wiki/Process/Vulnerability_Reports).
* If there are multiple bugs, make multiple bug reports.
option(WITH_CYCLES_DEVICE_HIP"Enable Cycles AMD HIP support"ON)
option(WITH_CYCLES_HIP_BINARIES"Build Cycles AMD HIP binaries"OFF)
set(CYCLES_HIP_BINARIES_ARCHgfx900gfx906gfx90cgfx902gfx1010gfx1011gfx1012gfx1030gfx1031gfx1032gfx1034gfx1035gfx1100gfx1101gfx1102CACHESTRING"AMD HIP architectures to build binaries for")
# Radeon VII (gfx906) not currently working with HIP SDK, so left out of the list.
set(CYCLES_HIP_BINARIES_ARCHgfx900gfx90cgfx902gfx1010gfx1011gfx1012gfx1030gfx1031gfx1032gfx1034gfx1035gfx1100gfx1101gfx1102CACHESTRING"AMD HIP architectures to build binaries for")
mark_as_advanced(WITH_CYCLES_DEVICE_HIP)
mark_as_advanced(CYCLES_HIP_BINARIES_ARCH)
endif()
@@ -617,10 +615,12 @@ endif()
option(WITH_OPENGL"When off limits visibility of the opengl headers to just bf_gpu and gawain (temporary option for development purposes)"ON)
option(WITH_GPU_BUILDTIME_SHADER_BUILDER"Shader builder is a developer option enabling linting on GLSL during compilation"OFF)
option(WITH_RENDERDOC"Use Renderdoc API to capture frames"OFF)
mark_as_advanced(
WITH_OPENGL
WITH_GPU_BUILDTIME_SHADER_BUILDER
WITH_RENDERDOC
)
# Vulkan
@@ -646,15 +646,15 @@ if(WIN32)
endif()
# Compiler tool-chain.
if(UNIXANDNOTAPPLE)
if(UNIX)
if(CMAKE_COMPILER_IS_GNUCC)
option(WITH_LINKER_GOLD"Use ld.gold linker which is usually faster than ld.bfd"ON)
mark_as_advanced(WITH_LINKER_GOLD)
option(WITH_LINKER_LLD"Use ld.lld linker which is usually faster than ld.gold"OFF)
@@ -14,3 +14,13 @@ The first three of them were employed by the Blender Foundation during that time
Some features (random sounds, dynamic music, playback manager, convolution and HRTFs support) were added as part of the VALS (Virtual Alliances for Learning Society) project by
- Juan Francisco Crespo Galán <dethon_5@outlook.com>
- Support for OS specific/native audio devices/backends has been added, that is PulseAudio (Linux), WASAPI (Windows) and CoreAudio (MacOS).
- New sound effects have been added, namely Modulator and Equalizer. Thanks to Marcos Perez for contributing the Equalizer.
- File stream info: if an audio file contains multiple streams you can choose which one to process instead of taking the first one (this feature is only supported by ffmpeg, not libsndfile).
- API Change: double instead of float for time values for more precise timing control.
- There have been lots of bugfixes, which are basically the majority of all changes.
- And some other minor improvements were implemented as well.
Detailed list of changes:
d4042d9 Port changes in Blender to upstream.
b60fb45 Equalizer
ab04e84 Fixes
8f0c305 Fix build error with MSVC 17.4+ ported from Blender.
ce44342 Minor documentation update.
cdcb3f4 Migrate from distuils to setuptools for python module.
21eccef Fix FindFFTW to find the float version fftw3f.
ab15e2f Bugfix: API change in new ffmpeg version.
a097be8 Clang format file added, valid from now on.
2fc9fb7 Porting bugfix from Blender upstream.
bb655b7 Bugfix: wrong sample size computation for PulseAudio.
a150495 Bugfix: Buffer did not support buffers > 2 GB.
034645c Update for ffmpeg 5.
932739c Bugfix: WASAPI hangs.
4fcd47c WASAPI: fix bug when switching the default device while there is no playback.
a16fbd2 Python API: fix to get convolution in the python API.
27ac5c1 WASAPI: always switch to default audio device.
1b03e6c Bugfix: catch exception if file cannot be read.
The fast_float library provides fast header-only implementations for the C++ from_chars
functions for `float` and `double` types. These functions convert ASCII strings representing
decimal values (e.g., `1.3e10`) into binary types. We provide exact rounding (including
@@ -28,8 +21,8 @@ struct from_chars_result {
```
It parses the character sequence [first,last) for a number. It parses floating-point numbers expecting
a locale-independent format equivalent to the C++17 from_chars function.
The resulting floating-point value is the closest floating-point values (using either float or double),
a locale-independent format equivalent to the C++17 from_chars function.
The resulting floating-point value is the closest floating-point values (using either float or double),
using the "round to even" convention for values that would otherwise fall right in-between two values.
That is, we provide exact parsing according to the IEEE standard.
@@ -47,7 +40,7 @@ Example:
``` C++
#include "fast_float/fast_float.h"
#include <iostream>
int main() {
const std::string input = "3.1416 xyz ";
double result;
@@ -60,39 +53,60 @@ int main() {
Like the C++17 standard, the `fast_float::from_chars` functions take an optional last argument of
the type `fast_float::chars_format`. It is a bitset value: we check whether
the type `fast_float::chars_format`. It is a bitset value: we check whether
`fmt & fast_float::chars_format::fixed` and `fmt & fast_float::chars_format::scientific` are set
to determine whether we allow the fixed point and scientific notation respectively.
The default is `fast_float::chars_format::general` which allows both `fixed` and `scientific`.
The library seeks to follow the C++17 (see [20.19.3](http://eel.is/c++draft/charconv.from.chars).(7.1)) specification.
The library seeks to follow the C++17 (see [20.19.3](http://eel.is/c++draft/charconv.from.chars).(7.1)) specification.
* The `from_chars` function does not skip leading white-space characters.
* [A leading `+` sign](https://en.cppreference.com/w/cpp/utility/from_chars) is forbidden.
* It is generally impossible to represent a decimal value exactly as binary floating-point number (`float` and `double` types). We seek the nearest value. We round to an even mantissa when we are in-between two binary floating-point numbers.
* It is generally impossible to represent a decimal value exactly as binary floating-point number (`float` and `double` types). We seek the nearest value. We round to an even mantissa when we are in-between two binary floating-point numbers.
Furthermore, we have the following restrictions:
* We only support `float` and `double` types at this time.
* We only support the decimal format: we do not support hexadecimal strings.
* For values that are either very large or very small (e.g., `1e9999`), we represent it using the infinity or negative infinity value.
* For values that are either very large or very small (e.g., `1e9999`), we represent it using the infinity or negative infinity value and the returned `ec` is set to `std::errc::result_out_of_range`.
We support Visual Studio, macOS, Linux, freeBSD. We support big and little endian. We support 32-bit and 64-bit systems.
We assume that the rounding mode is set to nearest (`std::fegetround() == FE_TONEAREST`).
## C++20: compile-time evaluation (constexpr)
In C++20, you may use `fast_float::from_chars` to parse strings
at compile-time, as in the following example:
```C++
// consteval forces compile-time evaluation of the function in C++20.
consteval double parse(std::string_view input) {
double result;
auto answer = fast_float::from_chars(input.data(), input.data()+input.size(), result);
if(answer.ec != std::errc()) { return -1.0; }
return result;
}
// This function should compile to a function which
// merely returns 3.1415.
constexpr double constexptest() {
return parse("3.1415 input");
}
```
## Using commas as decimal separator
The C++ standard stipulate that `from_chars` has to be locale-independent. In
particular, the decimal separator has to be the period (`.`). However,
some users still want to use the `fast_float` library with in a locale-dependent
particular, the decimal separator has to be the period (`.`). However,
some users still want to use the `fast_float` library with in a locale-dependent
manner. Using a separate function called `from_chars_advanced`, we allow the users
to pass a `parse_options` instance which contains a custom decimal separator (e.g.,
to pass a `parse_options` instance which contains a custom decimal separator (e.g.,
- Daniel Lemire, [Number Parsing at a Gigabyte per Second](https://arxiv.org/abs/2101.11408), Software: Pratice and Experience 51 (8), 2021.
## Relation With Other Work
The fast_float library is part of:
- GCC (as of version 12): the `from_chars` function in GCC relies on fast_float.
- [WebKit](https://github.com/WebKit/WebKit), the engine behind Safari (Apple's web browser)
The fastfloat algorithm is part of the [LLVM standard libraries](https://github.com/llvm/llvm-project/commit/87c016078ad72c46505461e4ff8bfa04819fe7ba).
There is a [derived implementation part of AdaCore](https://github.com/AdaCore/VSS).
The fast_float library provides a performance similar to that of the [fast_double_parser](https://github.com/lemire/fast_double_parser) library but using an updated algorithm reworked from the ground up, and while offering an API more in line with the expectations of C++ programmers. The fast_double_parser library is part of the [Microsoft LightGBM machine-learning framework](https://github.com/microsoft/LightGBM).
## References
- Daniel Lemire, [Number Parsing at a Gigabyte per Second](https://arxiv.org/abs/2101.11408), Software: Practice and Experience 51 (8), 2021.
- Noble Mushtak, Daniel Lemire, [Fast Number Parsing Without Fallback](https://arxiv.org/abs/2212.06644), Software: Practice and Experience (to appear)
## Other programming languages
- [There is an R binding](https://github.com/eddelbuettel/rcppfastfloat) called `rcppfastfloat`.
- [There is a Rust port of the fast_float library](https://github.com/aldanor/fast-float-rust/) called `fast-float-rust`.
- [There is a Java port of the fast_float library](https://github.com/wrandelshofer/FastDoubleParser) called `FastDoubleParser`.
- [There is a Java port of the fast_float library](https://github.com/wrandelshofer/FastDoubleParser) called `FastDoubleParser`. It used for important systems such as [Jackson](https://github.com/FasterXML/jackson-core).
- [There is a C# port of the fast_float library](https://github.com/CarlVerret/csFastFloat) called `csFastFloat`.
## Relation With Other Work
The fastfloat algorithm is part of the [LLVM standard libraries](https://github.com/llvm/llvm-project/commit/87c016078ad72c46505461e4ff8bfa04819fe7ba).
The fast_float library provides a performance similar to that of the [fast_double_parser](https://github.com/lemire/fast_double_parser) library but using an updated algorithm reworked from the ground up, and while offering an API more in line with the expectations of C++ programmers. The fast_double_parser library is part of the [Microsoft LightGBM machine-learning framework](https://github.com/microsoft/LightGBM).
## Users
The fast_float library is used by [Apache Arrow](https://github.com/apache/arrow/pull/8494) where it multiplied the number parsing speed by two or three times. It is also used by [Yandex ClickHouse](https://github.com/ClickHouse/ClickHouse) and by [Google Jsonnet](https://github.com/google/jsonnet).
@@ -135,14 +186,14 @@ It can parse random floating-point numbers at a speed of 1 GB/s on some systems.
# Silence warning from USD headers using deprecated TBB header.
add_definitions(
-D__TBB_show_deprecation_message_atomic_H
-D__TBB_show_deprecation_message_task_H
)
list(APPENDINC_SYS
${USD_INCLUDE_DIRS}
)
list(APPENDLIB
cycles_hydra
${USD_LIBRARIES}
)
endif()
cycles_external_libraries_append(LIB)
# Common configuration.
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.