Essentially move the Object-handling logic also into
`bke::greasepencil::convert::`. This code will also be needed for
automatic conversion on fileread etc.
It also helps to keep all the conversion logic in one place (especially
since there is going to be way more done at object level - modifiers,
animation, etc.).
Pull Request: https://projects.blender.org/blender/blender/pulls/118384
The CPU and GPU implementations of the compositor Texture node sample
the texture at different locations, producing differences. This is
primarly an issue with half pixel offsets to evaluate the texture at the
center of the pixels.
The CPU compositor only adds the offsets if interpolation is disabled,
regardless if the texture is of type image or not. Further the offset
was wrong, since it was not a half pixel offset, but a full pixel one.
The offsets should always be added, since it won't make a difference in
the non interpolated case, and it should always be added especially if
interpolation is enabled. A comment in the old code mentions something
about artifacts, but it is possible that this is a consequence of the
wrong offset that was used.
This patch always adds a half pixel offset, following the GPU code.
Pull Request: https://projects.blender.org/blender/blender/pulls/118377
A layer cannot be created e.g. when creating a reserved-name attributes
with the wrong domain/type.
Caused by 101d04f41f [which just did not
check if the layer creation was successful].
This should go into 3.6 LTS as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/118378
Currently, some compositor operations produce en empty output buffer by
specifying a COM_AREA_NONE canvas to indicate an invalid output, for
instance, when the Mask operation references an invalid mask. The
intention is that this buffer would signal that a fallback value should
fill the canvas of consumer operations.
The aforementioned behavior is currently implemented in a rather hacky
way, where it is implemented using the Translate operation as part of
canvas conversion in COM_convert_canvas, where the operation would clear
the entire buffer with zeros since out of bounds checking would always
take the out of bound case due to the empty buffer.
This behavior is problematic because we can't control the fallback
value, which would ideally be an opaque black color. Moreover, since
implicit type conversion happen before canvas conversion by design,
value typed buffers would eventually become transparent, which is rather
unexpected to the end user since float/value outputs can't have
transparency.
This is not a good design or implementation, but a redesign will be too
complex for now. So to fix this, we workaround it by handling the empty
buffer case explicitly in the Translate operation and fill the output
using a fallback black color, which works for both value and color typed
buffers, since this would also be the output of the value to color
implicit conversion.
Pull Request: https://projects.blender.org/blender/blender/pulls/118340
This reverts commit 31b8323b93.
Allocating memory in parallel is fine as long as each threads only
writes to the memory it allocates, which is the case here.
`BKE_lib_override_library_validate` used on fileread to ensure all
liboverrides are valid was using direct call to
`BKE_lib_override_library_free`. However, this was lacking the handling
of embedded dependencies (from liboverride PoV), in particular
ShapeKeys.
Since these shapekeys were still tagged as embedded liboverrides,
liboverride code would later assume their owner (mesh etc.) was also a
valid liboverride, leading to various potential issues.
Use instead `BKE_lib_override_library_make_local`, which also ensures
that embedded dependencies are handled properly.
The intend in the report was to rename a linked object in the NLA
channels. The operator to rename actually does everything right, it
detects that the object is linked and passes through to other operators.
The crash then happens in the attempt to select keyframes of channels
(also doubleclick n the keymap) -- in `select_anim_channel_keys`.
The problem is that `bAnimListElem` `key_data` cannot be expected to be
an `FCurve` in all cases. Code does though, it always casts, but this is
unreliable, basically this would fail for all of the "summary" channels
or any channel type (e.g. mask layers etc.), either it is NULL or
garbage data.
So to resolve, we just check the `bAnimListElem` type -- if it is not
ALE_FCURVE we can early out (preventing the crash).
NOTE: this changes behavior of double clicking on a summary channel that
cannot be renamed slightly in that it will not deselect its keys anymore
(it was not selecting any keys anyways, this is actually more in line of
what would happen if you just select another channel -- this also leaves
key selection alone -- so this is actually an improvement as well imho)
Pull Request: https://projects.blender.org/blender/blender/pulls/118251
Specialization constants was always switching shader even when the
constants were not changed. An early exit path was never taken.
The performance improvement should not be noticable to end users.
But would match with the intention of the design of specialization
constants.
Pull Request: https://projects.blender.org/blender/blender/pulls/118315
The File Output node crashes if it has no image input. That's because we
would be attempting to save a zero sized image. So ensure that the node
has a non zero canvas before saving anything.
The `FILE_PT_operator` panel used in the file browser does not correctly
allow the new UI layout panels to be drawn correctly.
The layout panels depend on drawing the background so that different
colors can denote each panel section. In the case of `FILE_PT_operator`,
this background drawing is skipped entirely leading to a situation where
there's no panel delineation at all.
Forcing the background to be drawn leads to a second problem where
the "typical" panel colors are not used in this part of the file
browser. We need to match the surrounding area otherwise a much
lighter shade of gray will be used and look out of place.
The fix is to extend the processing for PANEL_TYPE_NO_HEADER to account
for both of the above situations.
Pull Request: https://projects.blender.org/blender/blender/pulls/118231
This patch adds support for canceling compositor evaluations for the
realtime compositor. Only the canceling of the Denoise operation is
supported for now. That's because inter-operation canceling is not
feasible since all work will have been submitted to the GPU driver
before the user is able to cancel. So some kind of blocking operations
would need to used to actually allow canceling, which is not something
we are going to investigate as part of this patch.
Pull Request: https://projects.blender.org/blender/blender/pulls/117725
Previously only dropping file-paths was supported by the WM logic,
even though GHOST supported strings.
This is used for dropping a text selection as well as URL's
(on X11 & Wayland).
Add WM_DRAG_STRING, created from GHOST's GHOST_kDragnDropTypeString.
If hooks are not unregistered Blender will report a leak on exit.
Store the hooks as unique_ptrs to remove manual memory management and
encapsulate the previous global list inside a function. These changes
ensure that everything is cleaned up on termination.
Also makes a small change to the hook documentation for a missing
`import` statement.
Pull Request: https://projects.blender.org/blender/blender/pulls/118294
This adds group ids to the `Sample Nearest Surface` node. This allows e.g. finding
the closest point on a specific mesh island.
Three new sockets are added:
* `Group ID`: Is evaluated on the face domain and splits the input mesh into multiple
parts, each with its own id.
* `Sample Group ID`: Determines in which group the closest nearest surface is detected.
* `Is Valid`: Outputs true if a nearest surface was found, it's false if the group is empty.
Pull Request: https://projects.blender.org/blender/blender/pulls/118150