Ensure `gl_ViewportIndex` and `gl_Layer` are properly forwarded from the
geometry shader, and don't write to them from the vertex shader if
there's a geometry shader stage.
Fixes the Displacement "dicing" render tests on Nvidia OpenGL.
Pull Request: https://projects.blender.org/blender/blender/pulls/131875
Currently the node rebuilds the target point cloud BVH tree on every call,
potentially thousands of times if the field is evaluated on many elements.
Instead, build the BVH tree once and store it in the function.
Pull Request: https://projects.blender.org/blender/blender/pulls/132073
Currently there are three entry points to building BVH trees for mesh
ata: the caches on the mesh, an older set of functions used in the mesh
remap code, and a new set of functions used in some geometry nodes
sampling nodes. This commit unifies their implementations and switches
some functions from bit spans to index masks for representing a
selection of geometry.
A followup for 5e7f3e5c84.
Make the NOD_static_types.h file less important by moving `enum_name_legacy`
to be defined in the register function of every node. This helps our gradual transition
away from this file.
Also add a fallback to the node idname so that newly added nodes no longer need
to define the string value.
Pull Request: https://projects.blender.org/blender/blender/pulls/132131
This patch disables compositor tests that rely on anisotropic filtering
for GPU testing. This is done until we make sure they pass universally
by not relying on hardware filtering.
Test files that rely on anisotropic filtering were moved to their own
tests to be able to disable them for GPU only.
This commit implements most features needed for simple text editing.
Active text strip can be edited in preview by pressing tab key, which
enabled text editing mode. With this mode active, outline matches text
boundary box and cursor is drawn.
Cursor can be moved with usual keys. Pressing shift starts selection.
Selection and navigation works when text is scaled or rotated. Mirrored
text is not supported in this PR. it can be done, but the text is
unreadable that way, so I kept it simple.
Multi line text is supported. Pressing return key starts new line.
Copy/paste operator uses OS copy paste buffer, so text from other apps
can be pasted.
Text is still limited to 512 characters. Text string property still
exists in side panel and is limited to single line. Individual
characters can not be styled in different way like in 3D viewport, but
the code is mostly ready for such feature.
Ref: #126547
Pull Request: https://projects.blender.org/blender/blender/pulls/127239
When using the "individual origin" pivot mode, calculate the center
based on the following:
* If the stroke is a Bézier stroke, use the center of each handle as the pivot.
* Otherwise, if the stroke is not a Bézier stroke, compute the mean position
of the selected control points in the stroke and use this as the center.
This center value is then used e.g. by the rotation or scale transform modes.
Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/130723
Cryptomatte meta-data are not loaded from EXR images with unnamed
layers. That's because the code assumed the layer is always named, and
thus had full names with a dot prefix, which didn't match the
Cryptomatte type name. To fix this, only add the dot when the layer is
named.
This (optionally) uses the blender mirror for bootstrapping the msys2
environment, this is needed since some upstream providers remove older
packages frequently which makes it difficult to build older libs from
scratch.
Pull Request: https://projects.blender.org/blender/blender/pulls/131617
Action Slots point to the IDs they animate, and after swapping IDs they
also need some swappage (as the Action that first animated `id_a` will
now animate `id_b`, and vice versa).
Instead of doing this in the `id_swap()` function (and requiring
knowledge of how that's supposed to be done), just mark these pointers
as dirty so that they're rebuilt at first use.
This commit contains a little more code than strictly necessary, to add
a function in BKE for this cache invalidation. This avoids having to
have a dependency on the animrig module just for this purpose.
Fixes: #130136
Pull Request: https://projects.blender.org/blender/blender/pulls/131809
This patch removes the references for the GPU tests and uses the CPU
references for both CPU and GPU, since they are expected to match. This
also unifies the tests scripts into a single script with an argument
for execution device.
Change how `action_foreach_id()` reports action slot users. This contains
two changes:
- Report the correct pointer reference, so that the ID remapping code
can actually change the pointers in the cache (necessary, for example,
to nil pointers to deleted IDs).
- Never report anything when it's known the slot user cache is dirty.
Pull Request: https://projects.blender.org/blender/blender/pulls/131808
Previously, code related to reading/writing movie files via ffmpeg was
scattered around: some under blenkernel, some directly in generic
imbuf headers, some under intern/ffmpeg. Some of the files were named
with not exactly clear names. Some parts not directly related to movies
were including ffmpeg headers directly (rna_scene.cc).
What is in this PR:
Movie and ffmpeg related code is now under imbuf/movie:
- IMB_anim.hh: movie reading, proxy querying, various utility functions.
- IMB_movie_enums.hh: simple enum definitions,
- IMB_movie_write.hh: movie writing functions.
- intern: actual implementation and private headers.
- ffmpeg_compat.h: various ffmpeg version difference handling
utilities,
- ffmpeg_swscale.hh/cc: scaling and format conversion utilities
for ffmpeg libswscale,
- ffmpeg_util.hh/cc: misc utilities related to ffmpeg,
- movie_proxy_indexer.hh/cc: proxies and timecode indexing for movies,
- movie_read.hh/cc: decoding of movies into images,
- movie_write.cc: encoding of images into movies.
- tests: basic ffmpeg library unit tests that previously
lived under intern/ffmpeg.
Interface changes (at C++ level, no Python API changes):
- Mostly just movie related functions that were BKE_ previously, are now IMB_.
- I did one large-ish change though, and that is to remove bMovieHandle
struct that had pointers to several functions. Now that is
IMB_movie_write_begin, IMB_movie_write_append, IMB_movie_write_end
functions using a single opaque struct handle. As a result, usages
of that in pipeline.cc and render_opengl.cc have changed.
Pull Request: https://projects.blender.org/blender/blender/pulls/132074
This patch changes how transformations are realized by adjusting the
computed size of the new domain after transformation. Previously, this
was computed with the lower left corner of the domain as the origin of
transformation, while now, the center of the domain is used as the
origin. Consequently, domains shrinks/grows around their center, which
results in a more stable output as transforms are animated.
A consequence of this change is that we can no longer scale odd sized
domains to even sized domains or vice versa, since it grows/shrinks by
the same amount on both sides. Supporting this case requires further
investigation and will probably require passing down information to the
realization functions themselves.
Better to make sure that these functions operate on the passed in data,
and do not access the current context in some way. Generally that's more
predictable, but also makes sure these functions can be called on
inactive spaces (e.g. to update the active tool in the image editor on
changes in the 3D View, see #131062).
Partial fix for #130861.
Once again the issue is entries from the file list cache that get freed once the
cache exceeds its maximum size. Although we already minimized use of these
entries, we'd still keep a reference to all assets to be displayed in the shelf
for the active catalog.
Instead, only request entries from cache for the few assets that are visible and
scrolled into view. This way we only use the cached entry briefly and don't have
to store it in any way.
Note that the entries from the file list cache are only needed for loading the
previews. #122439 would change this, so it's finally independent of the cache.
This basically reverts 0f8e4b3516 which mitigated the issue quite a bit, but
here we take it further.
Pull Request: https://projects.blender.org/blender/blender/pulls/131750
Mistake in 5f9f3116db, ID name needs to be removed from the runtime ID
name cache data _before_ its library pointer is modified.
Library is an important part of an ID 'namesapce', so trying to remove
it after its library has been changed is trying to remove it from the
wrong namespace, leaving it in the original one.
Pull Request: https://projects.blender.org/blender/blender/pulls/132080
This is more associated with brush assets. When non-brush tool is
selected, active brush in that context is not changed (see:
`toolsystem_ref_link`).
Stencil is drawn if brush has active texture on
it (`paint_draw_tex_overlay`), since the `Brush` is still referenced to
old value, stencil is still drawn. To fix this, make sure active tool is brush
before drawing the stencil.
Also note that, trim and filter tools are not brushes but
they intetionally draws brush cursor e140f263d0.
Pull Request: https://projects.blender.org/blender/blender/pulls/131086
The crash happened because `bNodeSocket.runtime` was a nullptr.
That was because the struct pointer was passed instead of the
resolved pointer. Passing the resolved pointer into `BKE_animsys_nla_remap_keyframe_values`
fixes the issue
Pull Request: https://projects.blender.org/blender/blender/pulls/132012
Geometry instances shouldn't be drawn with cage overlays or other
edit mode overlays since they don't necessarily correspond to original
data. In this case the draw manager thought they were in edit mode
because the object data is copied from the instance parent-- we need
_some_ object for rendering.
Pull Request: https://projects.blender.org/blender/blender/pulls/132081
The returned pointer shouldn't be passed to a function expecting
a null terminated C string. Use the StringRef::copy function instead
which is more efficient anyway since it doesn't have to measure the
size of the string again.
Having this operator in the undo history is unnecessary and misleading;
we do not store the previous BVH state during this operator & the data
is all stored at runtime, so memfile undo has no effect here. Undoing
the operator will have no actual effect, and redoing the operator will
waste user time to rebuild the associated data.
Pull Request: https://projects.blender.org/blender/blender/pulls/132087
Introduced in ee2f2f00bd
Without the `register` function we get the following error in the
console when running blender:
Warning! '<path_to_blender>/scripts/startup/nodeitems_builtins.py'
has no register function, this is now a requirement for registerable
scripts
Pull Request: https://projects.blender.org/blender/blender/pulls/132091
Certain color-related operators and brushes are only relevant for certain
modes. Historically, we have performed this check by inspecting the BVH
tree type. To avoid this as a hard requirement and avoid needing to
ensure that the tree is built in these scenarios, this commit changes
the `color_supported_check` to inspect the source of truth for dyntopo
(`SculptSession.bm`) and multires (`BKE_sculpt_multires_active`).
Pull Request: https://projects.blender.org/blender/blender/pulls/132086
As mentioned in cd13f52e75, e072853e63, fb6ac24514 and 9a6beb915d,
`file_draw_preview()` is a rather overloaded and confusing function. I'm
trying to make it more readable.
With the previous changes and all the other logic extracted, it's pretty clear
that the "special icon" drwaing (for the larger folder/file icon with the
folder/file type icon overlayed) also should be split off. Most remaining logic
in `file_draw_preview()` was either for the special icons or normal previews,
but not much code was shared within the function.
Tried to not cause user visible changes. There's a few pixel change in the
horizontal icon placement, but that's because it's centered properly now.
Previously it was just eyeballed I guess.
The removal of the UNDO flag to prevent adding undo steps when using the
`paint.sample_color` operator results in the "Sample Merged" option
being inaccessible to users without them adding a keymap of their own.
This commit makes the following changes:
* For Texture Paint using the default blender keymap, the Shift-Ctrl-X
keybind is assigned to this operator with the merged option set to True
* For Texture Paint, using the industry compatible keymap, the Shift-I
keybind is assigned to this operator with the merged option set to
True
This parameter is only relevant for 3D Texture Painting so it is not
added to the other modes.
For all other `paint.sample_color` entries in both the keymap and in
some menus, the `merge` option is explicitly set to False.
Ref: #101144
Pull Request: https://projects.blender.org/blender/blender/pulls/132047