Caused by 6a5c14e58f90552b4c01 which still inverted the mask even though
it was being subtracted from the factor, effectively inverting it anyway.
Instead restore the previous logic which gathered the mask before
dealing with visibility. That's preferred because it can be replaced with
a `gather` when mask storage is inverted to be like selection, and
because the logic is a bit simpler. Also remove the clamping of the mask
since it generally shouldn't break sculpt code and because mask values
are clamped by editing tools already.
Resolve regression in [0] which incorrectly replaced
`WM_event_modal_handler_region_replace` with
`WM_event_ui_handler_region_popup_replace`
causing a crash when accessing dangling pointers.
Resolve by restoring the call to clear modal handlers regions.
Ref !122922
[0]: b25eefbf9acb51df61bb264686d9da42d2499e18
Add a `.data<T>()` method that retrieves a mutable span. This is useful
more and more as we change to filling in vertex buffer data arrays
directly, and compared to raw pointers it's safer too because of asserts
in debug builds.
Pull Request: https://projects.blender.org/blender/blender/pulls/123338
This multiscattering term comes from the OpenPBR specification and nicely
preserves energy while correctly modeling increased saturation at high
roughness.
Preparation for adding a diffuse roughness option to the Principled BSDF.
To me, the difference in output and computation seems small enough to
not need an enum for the old behavior.
Note that this also switches sampling to cosine-weighted, in my tests this
gives lower noise. I also checked doing MIS between cosine and uniform,
using the A term as a weight for how often to use cosine (since that term
is Lambertian diffuse), but always using cosine was better.
A nice consequence of that is that you don't get a huge noise jump when
going from 0.0 to 0.01 roughness.
Pull Request: https://projects.blender.org/blender/blender/pulls/123345
This was a missing block of the TAA implementation.
TAA jitter and reprojection have a tedency to soften
the texture. Add a 1.5 bias to make them a bit sharper.
Note that this is a bit different than the usual TAA
blurring. In final render we don't do reprojection
so it is only because the texture filter (box filter
from the LOD) is applied at the same time than our pixel
filter (blackmann-harris). It is less noticeable than
the normal TAA blur, but still blurs ~2px instead of
1.5px.
This adds a "Legacy Behavior" option to the Limit Rotation constraint that makes
it behave how Limit Rotation constraints did prior to
ed2408400d53e943cb6c97db10f12cf6729ef089. Newly created constraints have this
option disabled, but versioning code enables the option on constraints from
older files to ensure that the behavior of e.g. existing rigs is not altered.
This is one part of a two-part fix for #123105. The other part is in PR
extensions/rigify#4.
Pull Request: https://projects.blender.org/blender/blender/pulls/123361
Cycles runs a check to see if the camera is possibly inside a
volumetric object by seeing if the bounding box of the camera
and volumetric object intersect.
If the calculation is wrong (Cycles says the camera is outside the
volume when it's inside it), then the volume will not render properly.
This commit resolves most of these issues by making the camera
bounding box larger than before, taking into consideration
features like:
1. The impact DOF could have on the camera ray start position and how
that should impact the bounding box size.
2. Taking into consideration near clipping, which was missed from the
orthographic camera due to a oversight in a previous commit
(08cc73a9bb).
Pull Request: https://projects.blender.org/blender/blender/pulls/123341
Popups are often spawned with a button under the mouse cursor. For some
kinds of popups this would immediately invoke the tooltip timer, so
after a short moment tooltips would show. This can be annoying, since
the tooltip can overlap elements and the user's input was intended to
spawn a popup, not also spawn a tooltip. Even worse, the asset shelf
popup uses quick tooltips, so spawning that popup would almost instantly
also spawn the quick tooltip (see PR for demo video).
Instead, disable tooltips until the user moves the mouse. Menus
triggered from shortcuts (e.g. the Shift+A "Add" menu) would already
behave this way.
Pull Request: https://projects.blender.org/blender/blender/pulls/123363
`GpencilIOParams.ob` is set to `CTX_data_active_object` at the beginning
of the export [which is not ensured to be a valid `OB_GPENCIL_LEGACY`
object, non-valid objects are filtered out later in
`create_object_list`]. From this (potential non-greasepencil) object's
data, a "global `bGPdata` is stored in `GpencilIOParams`.
From here, it can only go downwards as `stroke_point_radius_get`,
`export_stroke_to_polyline`, `BKE_gpencil_stroke_perimeter_from_view`
all use this "global" `bGPdata`.
Two possible solutions might exist:
- [1] just cancel the operator if the active object is not a
`OB_GPENCIL_LEGACY` object
- [2] make sure we use corresponding `bGPdata` when iterating over
valid objects to export
This PR chooses [2] since it also seems wrong to always use the
`bGPdata` from the active object for certain calculations when iterating
many objects. For example, the export ignores different values for
`Thickness Scale` on different objects and always takes the value from
the active object, which does not seem to be by design.
NOTE: this changes behavior (see above) but for the better
Pull Request: https://projects.blender.org/blender/blender/pulls/123224
When inserting new keys, the depsgraph needs to be updated.
Since that was missing with the new keying code, the NLA wasn't
working properly when inserting the first key.
Pull Request: https://projects.blender.org/blender/blender/pulls/123360
When snapping keyframes in the Graph Editor, handles
that were set to free didn't move.
The issue was that the snapping code didn't set the handle position.
Instead it relied on the handle recalculation (`calchandleNurb_intern`) to do the job.
That code doesn't affect free handles though.
The fix is to also offset the handles in the snapping code. The handle recalculation
will still run for all the other handle types so that behavior isn't expected to change.
This does NOT change the behavior of bezier snapping in the 3D viewport.
Pull Request: https://projects.blender.org/blender/blender/pulls/123173
This implement the holdout flag by switching to
the holdout case in the shader. This has a few benefits:
- Doesn't recompile the shaders.
- Makes the object infos mandatory (already the case in
practice)
- Handle transparent materials properly, keeping the
transparency working.
Fix#123284
Pull Request: https://projects.blender.org/blender/blender/pulls/123315
The callables generated by OSL reference other external functions
(defined in the OSL services module), in which case OptiX cannot
calculate the right stack size just based on the callable alone, it needs to
know all functions linked together in the pipeline to get to an accurate
result. `optixProgramGroupGetStackSize` has an optional pipeline
argument for this purpose, so make use of that to ensure the correct
stack size is calculated.
Ref #122779
Pull Request: https://projects.blender.org/blender/blender/pulls/123368
Texture update ignored layered based offsets and extents. This was
an oversight due to misintepreting the API. This fixes uploading the
utility texture of EEVEE and enables correct material shading.
Pull Request: https://projects.blender.org/blender/blender/pulls/123371
This happened in the following render test:
`render/light/all_light_types_in_volume.blend`
Unfortunately it seems non-deterministic.
To fix this, we change the heuristic to jump
out of the shadow update loop. Also introduce
a upper bound to the number of iteration.
On top of this, add a flush for every loop
to avoid huge command buffer submission.
Thanks @pragma37 for the fix.
In the animation filtering code, avoid passing `bDopesheet *ads` as a
separate parameter. Instead, pass `bAnimContext *ac`. This already
contains the same pointer. Some carefully placed asserts help to
verify that these pointers were indeed the same.
Not only do I think this approach is cleaner, it is a necessary step
for upcoming PRs #123187 and #122672. Those will need a `Main *bmain`
pointer, which is already available in the `bAnimContext` struct.
Mostly this is just dumb search & replace.
- `ads` → `ac->ads`
- `bDopeSheet *ads` parameter → remove, and add `bAnimContext *ac`
parameter if necessary. That parameter should be the first parameter
of the function.
- Unused `ads` parameter translates to unused `ac` parameter. Chances
are, that parameter will be necessary for the `Main *bmain` anyway.
No functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/123305
This PR modifies the check for visibility when selected in the outliner.
With the change the visibility check only affects the selection state, not the active state.
The check has also been swapped with a function call to `ANIM_bone_is_visible_editbone`,
so now correctly works with collection visibility.
This PR also fixes the same issue for `Bone` and `bPoseChannel`
Co-authored-by: Cedric-Hutchings
Pull Request: https://projects.blender.org/blender/blender/pulls/123237