Previous method of doing the projection from the spot of the camera
was not reliable (depending on where the view/camera was located).
Instead, use the same ray origin for all methods and define the plane at
the placement location (with the view direction).
This is also easier to read I think.
Pull Request: https://projects.blender.org/blender/blender/pulls/131790
Previous implemenation of 5 < d < 50 was taken from the main paper,
fitting for smaller sizes are found in the supplemental. They are less
forward-scattering.
Pull Request: https://projects.blender.org/blender/blender/pulls/130234
Previously, the number of material slots on the geometry (e.g. mesh) was the
ground truth. However, this had limitations in the case when the object had more
material slots than the evaluated geometry. All extra slots on the object were
ignored.
This patch changes the definition so that the number of materials used for
rendering is the maximum of the number of material slots on the geometry and on
the object. This also implies that one always needs a reference to an object
when determining that number, but that was fairly straight forward to achieve in
current code.
This patch also cleans up the material count handling a fair amount by using the
`BKE_object_material_*_eval` API more consistently instead of manually accessing
`totcol`. Cycles uses the the same API indirectly through RNA.
Pull Request: https://projects.blender.org/blender/blender/pulls/131761
This PR improves the animation editor's display of node socket property
animation names, and names from geometry nodes modifier inputs. In both
cases, the names currently displayed are not very useful.
For geometry nodes inputs, the we now look up the name of the the input
rather than just displaying the identifier from the IDProperty name.
For node sockets, we now display the name of the socket instead of just
"Default Value" (which is technically the name of the RNA property).
We also display the label of the node if it's available. We also display
node labels instead of names for node properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/131766
Add a comment that documents the assumption that a node tree can only be
embedded by animatable ID types. At this moment this assumption holds.
`blender::animrig::internal::rebuild_slot_user_cache()` uses this for an
optimisation. It fully skips all non-animatable IDs, and would therefore
also not see any hypothetically animated node tree embedded in a
non-animatable ID type.
Pull Request: https://projects.blender.org/blender/blender/pulls/131844
`OtherInlineBufferCapacity <= InlineBufferCapacity` implies
`size <= InlineBufferCapacity` and can be done at compile time.
So if that is true already (as it commonly is), the `else` branch
is not necessary. This can improve performance in theory, although
I couldn't measure that in practice.
Additionally, this change also reduces the binary size (because of the
omitted else branch). Since this code is inlined fairly often, the impact
is measurable: the binary size is reduced by 50kb.
All restriction toggles supports:
- isolating active element with ctrl click
- Recursively set values to child when holding `shift`,
except "exclude" property. Now added support for `exclude` property in
this PR. When clicked on property of active collection, excute
`view_layer__layer_collection_set_flag_recursive_fn`.
Resolves#131366
Pull Request: https://projects.blender.org/blender/blender/pulls/131423
Requesting an icon from an invalid icon ID was always handled
gracefully, resulting in the icon not being shown and an error print in
debug mode. 2b7a968909 caused a null pointer dereference in that case,
leading to a crash.
button created from python (`ui_def_but_rna`) does not seem to assign
free/copy callbacks to the menu with rnaprop. So instead of an assert
check, assign callback functions in `ui_but_rna_menu_convert_to_menu_type`.
Pull Request: https://projects.blender.org/blender/blender/pulls/131719
Instead of using `BKE_library_foreach_ID_link()` as a way to find
embedded IDs in a generic way, explicitly just get the embedded node
tree. That's the only animatable embeddable ID anyway. And calling
`BKE_library_foreach_ID_link()` can have some unwanted side-effects
(especially when the rebuilding happens while already using a similar
function to loop over IDs).
Pull Request: https://projects.blender.org/blender/blender/pulls/131807
`animrig::Slot::users_remove()` now also works when there are multiple
occurrences of the same ID. Because of the above-mentioned pointer
remapping now working correctly, the pointers in the slot user list
are not 100% under control of the Slot class, and thus there could
hypothetically be duplicates there.
This doesn't fix any concrete issues, it's just a safety measure.
Pull Request: https://projects.blender.org/blender/blender/pulls/131806
`float4(float3 &)` is currently problematic because of implicit conversions
to and from `float *`. Writing the constructor explicitly fixes the problem.
Also add const to the arguments.
Pull Request: https://projects.blender.org/blender/blender/pulls/131828
MoltenVK dynamic rendering is built on top of render passes and framebuffers.
This also means that dynamic rendering has the same limitations.
This PR enables the workarounds for gaps between attachments for MoltenVK.
Pull Request: https://projects.blender.org/blender/blender/pulls/131816
This reverts commit 26ea1f42c3.
In line with [0] which prevents default characters from being used when
a font is selected, don't return characters from the default font when
the font cannot be loaded.
This should be addressed using place holder characters instead.
[0]: 6fa5295c1d
Currently when a character is requested that is not found in the
selected font we first look in other fonts that are already loaded that
include some of the requested Unicode range. If not found in any of
those we then look in unloaded fonts. But multiple fonts often have
overlapping coverage, so this means you can sometimes get a character
from different fonts depending on the order they are requested. Since
the design of that character could differ, this can lead to visual
changes. This PR changes the fallback search to do so in a consistent
order, not favoring loaded or unloaded. This does not lead to any
measurable performance changes in testing.
Pull Request: https://projects.blender.org/blender/blender/pulls/131812
When "Developer Extras" is disabled, the experemental options
must not be used.
Some checks for experemental options weren't using the macro which
checks both are set.
Add comment to avoid this happening in the future.
Instead of storing an optional in the runtime data of each node,
move the field status for the socket to an array in the node tree's
runtime data. This wasn't possible before because selecting nodes
reordered nodes which caused too much cache recomputation.
The benefit is having less geometry-nodes specific data in the
node socket runtime struct, and a slight move to a more data-
oriented storage format.
Pull Request: https://projects.blender.org/blender/blender/pulls/131822
Use static CreateInfos for Overlay-Next shaders using a similar approach to Workbench shader variations.
Remove unused infos and shader sources.
Remove the `gpu_shader_create_info_get_unfinalized_copy` workaround.
Pull Request: https://projects.blender.org/blender/blender/pulls/131514
When the user selects a font, only use characters from that font,
see code comments in BKE_vfontdata_char_from_freetypefont
for details.
Partially reverts [0] which changed behavior when VFont was
updated to use BLF.
Ref: !131821
[0]: 604ee2d036
Rendering animations from Python scripts via `bpy.ops.render.opengl()`
did not trigger any of the notifications in the Metal back-end to
indicate a frame had been rendered and that the associated resources
could be released. This adds a call to GPU_render_step() after each
render. For the original asset in the bug report this reduces the high
memory watermark from 30gb to 13gb for 500 frames. 13gb is likely
still too high and therefore it is likely there are additional leaks
that need to be addressed so this should only be considered a partial
fix.
Authored by Apple: James McCarthy
Co-authored-by: James McCarthy <jamesmccarthy@apple.com>
Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/131085
Don't just initialize new values to zero but actually take the existing attribute into account.
Once supported, this can also automatically take defaults for built-in attributes into account
without further changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/131794
- Use return values instead of return arguments
- Remove the socket index lookup which was only used once
- Always use the topology cache for node_find_node
- Improve the documentation
- Add a const version of node_find_node
Overall, I think always using the topology cache will give more
predictable performance. Though it may require more cache
rebuilds after the node tree is changed, in practice there are
plenty of other things that require that already. This way, code
that doesn't change the node tree will get better performance
without having to think about the caching.
Pull Request: https://projects.blender.org/blender/blender/pulls/131811
Two commits that basically do the same thing for two `enum`s: give
them a name.
- the `IDWALK_…` enum → `LibraryForeachIDFlag`.
- the `IDWALK_CB_…` enum → `LibraryForeachIDCallbackFlag`.
This way the flags are type-safe, and it's known where values come
from. This is much preferred (at least by me) to just having `int
flags`.
Uses of `0` have been replaced with `IDWALK_NOP` and `IDWALK_CB_NOP`,
as those have the same value and are of the right type.
One invalid use of `IDWALK_NOP` was detected by this change, and is
replaced by `IDWALK_CB_NOP`. And another one in the opposite
direction.
This change might be incomplete; I gave the enum a name, fixed the
compiler errors, and then also updated assignments like `int cb_flag =
cb_data->cb_flag`. I might have missed some assignments to `int`
though.
No functional changes.
----------
I intend to land this PR as its two separate commits. I just put them in the same PR so the buildbot can handle them in one go, and we don't have a stack of highly relatled PRs.
In the future this could also apply to the `IDWALK_RET_…` enum. This one I left out, though, because a proper cleanup there would also have to include their ambiguity on whether they are bitflags (like the enums in this PR) or not. Their values and the code in `BKE_lib_query_foreachid_process()` implies they are bitflags, but in practice they are never or'ed together and just used as discrete values.
Pull Request: https://projects.blender.org/blender/blender/pulls/131803
The material returned by `BKE_object_material_get` could be nullptr when
the material is somehow not a grease pencil material and this situation
needs to be handled. This is likely caused by faulty file from previous
verisons.
Pull Request: https://projects.blender.org/blender/blender/pulls/131714
This patch optimizes the Distance Dilate code by limiting the search
window to areas within the image, avoiding fallback image sampling and
looping redundant pixels. Gives a 1.8x improvement.
Either initial fix (9405bd25d6) was not fully correct (and properly
tested), or something else changed since then, but the handling of
liboverrides in copy/paste of poses would not be correct for local
overrides.
Instead of relying on generic `BKE_lib_id_make_local` to also work
for local liboverrides, add some more logic in `PartialWriteContext::make_local`
to properly handle local liboverrides when the override data needs to get
removed in the copy buffer blendfile.
NOTE: Not super-happy with how make local and removal of liboverrides
somewhat mix together currently. Will need to revisit once again that
whole process at some point.
This only affected the drawing of the modifier UI, not the actual evaluation.
There was a missing check for the object type before retrieving the data from it.
This was reported for freestyle, but was also the case for regular
renders.
So even though MotionBlurModule::init and MotionBlurModule::step return
early when motionblur is disabled, Sampling::init would still up the
samples with motionblur samples (even if motionblur was disabled
alltogether).
To resolve, only do this when motionblur is enabled.
Pull Request: https://projects.blender.org/blender/blender/pulls/131795
The "use attribute" and "attribute name" IDProperties were missing
the overrideable status and the static type status. This was an oversight
from when those tags were added.
This commit fixes the flag on new modifier properties as they're created
and applies versioning to old properties. It also fixes the poll of the toggle
input attribute operator so that it isn't possible on non-editable objects.
Pull Request: https://projects.blender.org/blender/blender/pulls/131768