This patch unifies the variable size blur between the CPU and GPU
compositor. The difference is due to how weights are computed and used.
The CPU computed a nested array of weights for every possible size, that
is, from size 1 to the base size. Then, it assumed the kernel was
separable and reconstructed a 2D kernel by selecting two 1D weights
array and multiplying them for every pixel of the blur window.
The GPU on the other hand computes a single quadrant of the 2D weights
kernel and sampled it directly in the blur window. We favor the GPU
implementation since it makes no assumptions about the separability of
the weights kernel and since the CPU has no performance advantage even
with the assumption in place.
Pull Request: https://projects.blender.org/blender/blender/pulls/118834
Currently, the CPU compositor smoothes its input size in variable size
mode. It is unclear why this is the case, but it seems the logic is that
sharp transitions in the size input are undesirable. Alternatively, this
is similar to the morphological blurring step in the Defocus node. But
it does not use standard weights and it is not morphological in nature
at all.
This patch removes the smoothing step and uses the original size
provided by the user. Looking at resources online, it seems users almost
always expect the size inputs to be used directly, so there is no reason
for force smooth their inputs.
Pull Request: https://projects.blender.org/blender/blender/pulls/118757
The issue is that when applying filters, the list of channels shrink, but the `View2D` isn't updated accordingly.
When you move the viewport, the channels would jump back into view but not before.
The total height of the channel stack is computed every frame,
and the issue is fixed by calling the `UI_view2d_curRect_clamp_y` after that.
Since this has to be done before `UI_view2d_view_ortho` is called, I had to extract
the height calculations into the caller function.
I thought about making a generic function for all 3 editors but they were too different
to meaningfully do that.
I removed the fix that stopped the channels going off screen when using the cursor to scroll,
since the new logic already does that.
Note: while the report only mentions the Dope Sheet, this fix is applied to
the Graph Editor and NLA editor as well since they had the same issues. This PR fixes them all.
Also fixes#46649
Pull Request: https://projects.blender.org/blender/blender/pulls/118006
Pose-mode selection tools (box, lasso & circle select) now support
pose-mode when weight-painting.
Changes to the key-map [0] caused a regression where it was no longer
possible to select multiple bones because Shift-LMB is now used for
painting. The report #114981 proposes to support pose selection tools
in weight paint mode.
Note that in [1] added the tweak tool, this completes the change by
supporting other tools & fixing W-key shortcut access.
Resolves#114981.
[0]: 6de6d7267f3d0eb913ce08675c9d73e27b8785e4
[1]: edcac1f48b92aee693f01a9bb4d23c03870a8f29
When detecting pose-bone visibility lasso select used the same
armature for all pose bone checks. This caused the PBONE_VISIBLE
to return invalid results.
Simplify the logic by calling ED_view3d_viewcontext_init_object in the
outer loop.
Various fixes to operator preset cleanup:
- Only remove properties that match exactly the properties to exclude
exactly (taking word boundaries into account).
- When the preset path doesn't exist, don't construct paths relative
to the working directory.
- Enforce UTF8 encoded text.
Other minor changes:
- Rename "properties" to "properties_exclude" for clarity.
- Use single underscore for private methods.
- Match each line against a single regex instead of constructing a
string and checking startswith(..) for every property to exclude.
- Use os instead of pathlib, as us used in blender's built in operators
that handle paths.
- Prefer doc-string over bl_description.
- Double quote strings.
- Use single indentation for lists to reduce right-shift.
Adds two nodes as "grid" equivalents to the existing volume nodes:
- **Grid to Mesh**
- **Distribute Points in Grid**
The code for the latter is just duplicated for now. In a later step
old node can be replaced by versioning with two new nodes.
Pull Request: https://projects.blender.org/blender/blender/pulls/118830
Any access to this after calling what_does_obaction would reference
invalid stack memory with undefined behavior.
Set to null to ensure this never happens.
This adds a new special purpose container data structure that can be
used to gather many elements into many (potentially small) lists efficiently.
I originally worked on this data structure because I might want to use it
in #118772. However, also it's useful in the geometry nodes logger already.
I'm measuring a 10-20% speed improvement in my many-math-nodes file
when I enable logging for all sockets (not just the ones that are currently visible).
Pull Request: https://projects.blender.org/blender/blender/pulls/118774
Reduce dependence on Blender headers as much as possible and move closer
to an include-what-you-use setup.
- Removes unnecessary includes
- Replaces some includes with more appropriate, narrower, substitutes
- Removes unnecessary forward declarations
Pull Request: https://projects.blender.org/blender/blender/pulls/118308
This PR consolidates the calculation of `BMesh`'s max edge length used for dyntopo across both the sculpt code and the modal operator that displays the resulting grid. It also adds two unit tests for verifying conversions from the `Brush Detailing` and `Relative Detailing` modes to the `Constant Detailing` mode.
Follow up to #118403
New ("fullframe") CPU compositor backend is being used now, and all the code
related to "tiled" CPU compositor is just never used anymore. The new backend
is faster, uses less memory, better matches GPU compositor, etc.
TL;DR: 20 thousand lines of code gone.
This commit:
- Removes various bits and pieces related to "tiled" compositor (execution
groups, one-pixel-at-a-time node processing, read/write buffer operations
related to node execution groups).
- "GPU" (OpenCL) execution device, that was only used by several nodes of
the tiled compositor.
- With that, remove CLEW external library too, since nothing within Blender
uses OpenCL directly anymore.
Pull Request: https://projects.blender.org/blender/blender/pulls/118819
The issue was caused by Cycles doing dependency tracking on its
side, relying on the fact that view layer needs to be tagged as
modified when its properties change.
This was not the case when custom property on the a view layer is
modified via a driver.
Now the dependency graph will tag IDs which generic properties did
change as ID_RECALC_PARAMETERS, giving it a chance to render engines
to react to it.
Since this is quite generic code which might have unforeseen side
effects the change is not targeted to the current release branch.
Note that this chaneg does not fix the #103140, as the issue there
is use of RNA path to another data-block, without the node tree
registering relation to that data-block.
Also fixes#118117: Compositor does not update image when path is changed via handler
Original Pull Request: https://projects.blender.org/blender/blender/pulls/118134
Pull Request: https://projects.blender.org/blender/blender/pulls/118846
There probably are more cases where crash will happen as it is
rooting into the issue with BKE_object_workob_calc_parent() which
is used in multiple places.
The issue is caused by the access to a runtime field of workob
outside of the BKE_object_workob_calc_parent(): the runtime field
is stack-allocated in the function, and can not be accessed outside
of the function.
The easiest way to reproduce is to use ASAN, and parent mesh to an
armature with automatic weights. Although, on macOS ASAN did not
report issues, so setting workob->runtime to nullptr at the end of
of the BKE_object_workob_calc_parent() was the easiest.
The solution is simple: make the function to return the matrix,
and take care of the working object inside of it, so all tricky
parts are hidden from the API.
The patch is targeting the main branch, as in 4.1 it is not
required to do such change because all uses of the function only
access object_to_world, which is stored in the object in 4.1.
A double-check in the what_does_obaction() might be needed as it
follows the similar pattern, but it does not seem that runtime
field of the workob is accessed in usages of the what_does_obaction().
Pull Request: https://projects.blender.org/blender/blender/pulls/118847
The similar cleanup with a lot of other changes were committed
to the main branch. Is easier to revert this change, copy the
scripts from main, and merge things back.
This reverts commit 4bc1ba3c2d579b2bd4746eac71c0de948985fa45.
Changing socket types like this is not generally supported. Usually one should
modify a property that is stored on the node instead. For custom node trees,
one should generally remove one socket and replace it with the new one.
Existing addons might use this functionality on custom node trees where it's
okayish. This patch forbids changing socket types directly on built-in nodes.
Pull Request: https://projects.blender.org/blender/blender/pulls/118794
The time offset modifier was working differently than in GPv2. This is because in the new implementation, the time offset modifier actually modifies the keyframe mappings. And thus the order of the modifiers, and where the time offset modifier is placed in the stack, matters.
The problem is that this can lead to unexpected results like seeing unmodified drawings.
Technically, the issue here is that other modifiers only modify the current frame as supposed to all drawings in the timeline.
This is done as an optimization, but doesn't work when drawings can be shifted around on the timeline using the time offset modifier.
The fix changes the way the modifiers are executed. Because the time offset modifier can only modify **when** the drawings
are show, and not the drawing data themselves, we execute all the time offset modifiers first (in the order they appear in the stack) and then execute all the other modifiers after.
This means that the user can no longer run into the issue of "moving" drawings away from the current frame where they can't be seen.
It also makes time offset modifier behave the same as they did in GPv2.
Pull Request: https://projects.blender.org/blender/blender/pulls/118842
Regression caused by [0]. Passing "Span" by value caused io_ply test to
fail. References were used so changes would be applied to arguments
passed in.
Revert these changes for "ply_import.cc".
[0]: d338261c55dadc0ef15fcf4afc032d324aee7b5e
New windows on GNOME with LIBDECOR windowing would sometimes have an
unusable title-bar with the whole title-bar acting as the edge-resize.
Would happen predictably when opening large windows which the window
manager would resize to fit the display.
The cause of this was Blender receiving a window configure event
without a window size for new windows. This configure event
would be ignored, causing the title bar not to work properly.
This is a regression from [0] which removed logic to calculate the
window size from the arguments passed to GHOST for window creation.
This wasn't correct either as the it could temporarily set the
window size before the requested size configuration was received.
Resolve the problem by queuing configuration requests,
handling them then the requested window size is known.
[0]: 1455315111ae769d101413fe600662484ff46d62
Make both importers work the same way: first building an array
of the new offsets, then comparing the offsets to check if the
topology changed. Previously the USD importer incorrectly
compared curve offsets to USD point counts.
Also:
- Don't unnecessarily set the resolution to the incorrect default.
The default for the curves system is 12. But it's unnecessary to
fill the attribute to the default value anyway.
- Use some helper methods to iterate over all curves.
- Use float literal instead of integer.
- Use cast and `copy_from` for positions copy
- Pass Span by value
Pull Request: https://projects.blender.org/blender/blender/pulls/118829