The code path isn't well defined when there aren't any faces, causing
the vert, face, and corner normal caches to call each other, potentially
trying to lock the same mutex twice.
Duplicating a strip that references an ID like the scene strip would not
duplicate the scene. This is wanted in some workflows.
To align with the rest of Blender, this changes the behavior for how
strips are duplicated:
* `Shift + D` ("duplicate"): Duplicate the strip and also duplicate the
IDs referenced by the strip. Currently this only affects `Scene`,
`MovieClip`, and `Mask` strips.
* `Alt + D` ("duplicate linked"): Duplicate the strip, but reference the
same IDs. This is the current behavior in `main`.
Part of #144063.
Pull Request: https://projects.blender.org/blender/blender/pulls/144138
This is similar to #144199. It needs a few more changes because more places
handle geometries in a special way compared to data-block sockets.
It might be that there are more usages of `GeometrySet` as value for geometry
sockets instead of `SocketValueVariant`. Unfortunately, there isn't really an
automated way to find these. So far I found all the places that needed fixing
through tests.
This is the last socket type that did not use `SocketValueVariant` yet. So
afterwards, it's likely possible to simplify a bunch of code to use
`SocketValueVariant` instead of `void *`.
Pull Request: https://projects.blender.org/blender/blender/pulls/144355
During a short period (Blender 500 sub 33) the legacy custom data
struct was saved in an invalid state. This adds a check to
avoid crashing when loading a file that was saved during that time.
Pull Request: https://projects.blender.org/blender/blender/pulls/144337
Use signed range and indices to avoid dereferencing tokens
before the start of the Token array.
# Conflicts:
# source/blender/gpu/glsl_preprocess/shader_parser.hh
The --debug-ffmpeg flag now is the same as --log video, and only exists for
backwards compatibility. The ffmpeg verbosity can now be controlled with
--log-level.
Pull Request: https://projects.blender.org/blender/blender/pulls/143447
This PR proposes to add an environment variable for forcing vsync to
be on or off. My primary use case was to disable vsync for forcing
viewport rendering performance tests not to be capped at the display
refresh rate when #142984 is used for removing animation frame rate
limits.
I initially added the environment variable "GHOST_VSYNC_OFF", but
found "GHOST_VSYNC=0/1" to be more easily understandable.
Usage:
- GHOST_VSYNC=0 => Vsync is forced off
- GHOST_VSYNC=1 => Vsync is forced on
Pull Request: https://projects.blender.org/blender/blender/pulls/143049
This was only affecting the shadow pass because it is the
only one to use multiview.
The `drw_ResourceID_iface.resource_index` was incorrectly
set up in the vertex shader to the already shifted index,
resulting in double shift which resulted in resource index
being 0 in fragment shader.
Candidate for backport to 4.5 LTS
Pull Request: https://projects.blender.org/blender/blender/pulls/144341
When using the resize dyntopo operator the overlay helping to choose
the new size didn't work properly on AMD GPUs. The cause was that only 2
components of the line displacement was initialized.
Also fixes: #83623
Pull Request: https://projects.blender.org/blender/blender/pulls/144338
The remapping from old to new linked IDs was done one by one, with all
the related pre/post processing. In particular for objects, this could
easily lead to quadratic cost (need to loop over all objects for each
object)...
Solved by reworking the remapping logic in relocation code to process
all linked data in a single call.
From quick tests locally, it makes relocating a library with 10k object
got from 50s to about 5s.
A 40k linked objects case goes from 'way too long to measure' to about 4
minutes.
So there is likely still some things that could be improved here
(processing time still does not seem to be O(n)), but at least it's
usable now.
Pull Request: https://projects.blender.org/blender/blender/pulls/144207
The previous code to get unique instance ids did not actually ensure 100%
uniqueness. Now the code does and hence the "almost" from the name is removed.
In practice, this change likely does not have any impact because the fallback
case is very unlikely to be reached.
Pull Request: https://projects.blender.org/blender/blender/pulls/144324
The fix is to detect when the compute context is recursive and to stop the
search early in that case. Currently, this does not generate a warning. There
will be a warning when trying to evaluate the recursive closure though.
Pull Request: https://projects.blender.org/blender/blender/pulls/144330
Use `SocketValueVariant` for all the data-block types as well. Before it was
used for e.g. float, integer and menu sockets.
The only remaining type afterwards is the geometry socket which will be moved
separately.
Using `SocketValueVariant` for all socket types will simplify code later on and
also removes the need for dealing with raw memory in more cases.
Pull Request: https://projects.blender.org/blender/blender/pulls/144199
I'm not sure why the edge domain was handled differently than the other
domains with regards to attributes on unexpected domains. Now use a
simpler more consistent solution that removes invalid selection
attributes before they're used at all.
Broken with new 4.5 cache implementation; the loop for building
image sequence proxies was not flushing the intra-frame cache
between frame changes. This affects image proxies since they go
through the whole VSE render stack; does not affect video proxies
since they just manually decode the file frames.
Pull Request: https://projects.blender.org/blender/blender/pulls/144269
This PR adds a region flag to specify that it should indicate, with a
line or gradient, that content overflows any edge. This then enables
this for the Properties area and categories, Outliner, Spreadsheet,
File Browser main area, Asset Browser, Preferences, 3D View Sidebar and
Toolbar. And for headers.
Pull Request: https://projects.blender.org/blender/blender/pulls/144091
The change changes the way the converted curves are evaluated.
It may be better and a valid choice, but it needs to be considered
more carefully since it would be a breaking change.
Hides Resolution field in "Curve Data" panel if at least one poly curve
is selected. For these curves, the field is ignored. Moreover its value
is `0` for them, for all other curve types minimum is `1`.
Also conversion of `CURVE_TYPE_POLY` to `CURVE_TYPE_NURBS` is fixed to
emit curves of order 2. This gives same shape as input had. Resolution
is set to `1`, because "Curve to Mesh" node ignores curves with
Resolution `0`.
Pull Request: https://projects.blender.org/blender/blender/pulls/144239
Maintain the active object for the 3D viewports clipboard.
This avoids the need to activate the object after pasting to edit
its materials or change modes.
Matches the behavior for notes (see !143832) and addresses #143833.
Ref !144192
When the median was being calculated, the division was by the total number of transform data, rather than the selected number of transform data.
Under most circumstances this would be the same, but when transforming bezier control points without the handles selected, or when having proportional editing on. This the median calculation would return a wrong result.
Note: This problem could occur almost every object type not just Grease Pencil.
Resolves: #143534
Pull Request: https://projects.blender.org/blender/blender/pulls/144245
Next step of #140360, continuing after 39c066ee53
Moves more animation theme properties shared by different editors to the new Common panel.
- Playhead (was shared by 7 editors)
- Marker Line (was shared by 5 editors)
- Marker Line Selected (was shared by 5 editors)
- Channel (was shared by 3 editors)
- Sub-channel (was shared by 3 editors)
- Channel Group (was shared by 2 editors)
- Active Channel Group (was shared by 2 editors)
In total, 27 properties are replaced with 7.
---
User Visible Changes:
- "Current Frame" is renamed to "Playhead". It was general sentiment among
Anim and UI modules to rename this everywhere after "Playhead Snapping" was
added, and this is first step towards that. Name is more recognizable and it's
clear it refers to UI element, rather than something as generic as "current frame".
- Channel, Sub-channel, Channel Group, and Active Channel Group colors in
Dope Sheet had alpha, but ones in Graph and NLA editors didn't. New common
property is used for all three of them and has alpha, meaning two editors gain
alpha as well, but they don't use alpha, still only Dope Sheet does.
- Channel and Sub-channel had different color in NLA and didn't match Dope Sheet
and Graph Editor, now since it's shared it has same color, which is a visual change
(slighlty lighter blue).
Pull Request: https://projects.blender.org/blender/blender/pulls/144060
The short description of the root of the problem is that 2D texture
paint properly handled non-color paint while 3D painting did not (for
both painting and color sampling).
This change makes it so 3D texture paint avoids color space conversion
of brush color (which is assumed to be in display space) to scene linear
when painting on images set to Non-Color.
On the design level this change moves code closer to the following
design:
- Brush color is specified in display space.
- Float buffers are in scene linear space (or a non-color).
- When painting on color float buffers brush color gets linearized
- When painting on non-color float buffers brush color is used as-is.
For painting on non-color images it means: values from brush color
are used as-is, without any color space conversion.
The change makes 3D painting behave the same as 2D painting.
There are a couple of tricky parts remaining. Relatively small thing
is that the color displayed on the brush color swatch is not what it
will be after making a stroke. This is because brush colors are used
as-is, image is not color managed (and is drawn as-is on a surface
which is assumed to be in scene linear), and the brush color swatch
is color managed. Generally it means the swatch color is darker than
what the stroke on non-color image would look like.
The bigger topic is color sampling that read pixel value from frame
buffer. This change makes it so sampling color in such cases (by either
using eyedropper from the color swatch popup, or by using Shift-X
sampling operator outside of painting object/texture) will set brush
color in a way that making stroke will result in the same color as it
was on the screen. When painting on non-color images it means the
brush color will be sampled darker than when painting on a color
textures.
This introduces some context dependency to the way how sampling works
which might be undesirable.
Pull Request: https://projects.blender.org/blender/blender/pulls/143642
This removes one limitation of the guarded scopes that needed to
not have return statement. Now a dummy return statement is created.
See #139233 for original implementation.
This adds the following features:
- `class` keyword support: checked by C++, mutated to struct for shader.
- `private` and `public` keywords: checked by C++, removed for shader.
- `static` methods.
- `const` and non-const methods.
What is not supported:
- Constructors
- Destructors
- operators
- Method definition outside of class definition
- member reference without `this` keyword.
This is implemented using a very simple lexer/parser allowing semantic traversal.
Pull Request: https://projects.blender.org/blender/blender/pulls/144025
There should be minimal user-measurable changes since the old algorithm
is not the same as OpenSubdiv. For example now creases (both edge and
vertex ones) are properly supported.
This allows to have less dependencies on the old subdivision surface code
which ideally will be removed soon.
Pull Request: https://projects.blender.org/blender/blender/pulls/143712
Previously copying grease pencil strokes implicitly requires materials
to be available in `grease_pencil_copy_strokes_exec` which isn't
necessarily the case sometimes. Now just set material session uid to 0
when material is not found. When pasting, non-existent materials will
be created as a fallback already.
Additionally, this PR corrects material
access by using `BKE_object_material_get` instead of manually getting
the material from grease pencil material array, making it consistent
with the rest of the logic in blender.
Pull Request: https://projects.blender.org/blender/blender/pulls/142702
overlay_wireframe_frag doesn't always set the gl_FragDepth. Depending on
how the driver deals with this it can use uninitialize values or previous
values. This leads to render artifacts as depth testing/storage could be
wrong.
Pull Request: https://projects.blender.org/blender/blender/pulls/144198