Moves related variables that are only used by the paint brush into the
existing `paint_brush` anonymous `struct` & removes the `hardness`
property from said `struct` as it is used by most brushes and not just
the paint brush.
Pull Request: https://projects.blender.org/blender/blender/pulls/126712
Part of #126672.
* Groups related mirror modifier data in an anonymous
`mirror_mod_clip` `struct`.
* Stores the inverse of the related matrix to avoid having to
recalculate it multiple times per brush stroke.
Pull Request: https://projects.blender.org/blender/blender/pulls/126717
And same for the `copy_layout` function. These functions do not free any
potentially existing data in destination, but expect it to be uninitialized.
Hopefully these new names will make it more clear and avoid bugs like #122160.
`CustomData_copy` expects uninitialized destination customdata, so in
case the destination has been previously initialized, it needs to be
freed with `CustomData_free` first.
Also added related comments to the BKE CustomData API.
Pull Request: https://projects.blender.org/blender/blender/pulls/126794
EEVEE doesn't trigger a render step between samples which leads to not recycling
memory on Metal backend leading to slower animation rendering and even out of
memory.
This PR uses the same approach as for workbench to solve the issue.
NOTE: Fix needs to be backported to 4.2
Pull Request: https://projects.blender.org/blender/blender/pulls/126781
Workaround for RDNA2 shadow rendering when the geometry it needs
to render is to tiny. In this case the rasterizer can skip triangles
leading to incorrect shadow.
This issue has been forwarded to AMD, but this is a temp workaround
for the current drivers. Note that this workaround adds a performance
penalty of around 50% in selected scenes.
Pull Request: https://projects.blender.org/blender/blender/pulls/126693
Pass the context using const where it makes sense. Had some own code
that called some of these functions, so I had to keep context non-const
there too for no good reason.
Newly validates the following:
- Image mapping transforms on import and export
- Typical normal map setups on import and export
- Alpha-clip node setups on import (was already tested for export)
Pull Request: https://projects.blender.org/blender/blender/pulls/126776
The `normal` input on the UsdPreviewSurface is defined as being of type
`normal3f` rather than a plain old `float3` [1].
Found while adding more test coverage for material reading/writing.
The following could also be seen from `usdchecker` when run over files
produced by Blender:
`Incorrect type for /root/_materials/Material/Principled_BSDF.inputs:normal. Expected 'normal3f'; got 'float3'. (fails 'ShaderPropertyTypeConformanceChecker')`
[1] https://openusd.org/release/spec_usdpreviewsurface.html#preview-surface
Pull Request: https://projects.blender.org/blender/blender/pulls/126747
Additional coverage for the following scenarios:
- Ensures custom properties are exported and imported correctly
- Ensures that xform op modes and scene orientation options are properly
respected during export
Pull Request: https://projects.blender.org/blender/blender/pulls/126723
USD Meshes and their UsdGeomSubset prims only support "face" element
types but our importer was not checking to ensure this was the case.
Additionally, we should guard against out of range indices being used
in general.
Both situations will now also print an obvious warning level log
statement allowing technical users to better toubleshoot on their own.
Test coverage will be added separately in the near future to ensure
multi-material scenarios are handled correctly.
Pull Request: https://projects.blender.org/blender/blender/pulls/126714
In order to recolor icons based on themes, some svg icons have specific
ID names. These names are currently of the pattern "blender.some_name".
However, although CSS ID names are allowed to contain a period in them,
these are problematic as selectors. This is because #tagname.something
looks like a combination of ID and class name. Although these can be
escaped like #tagname\.something that is a pain. This PR replaces the
periods with underscores.
Pull Request: https://projects.blender.org/blender/blender/pulls/126709
The file only had a single function remaining inside of it, moving it
inside `sculpt.cc` seems more prudent until we determine a better place
for related methods.
Pull Request: https://projects.blender.org/blender/blender/pulls/126708
Crash triggered due to null string. Enum list passed to `RNA_enum_from_value`
only has image-editor and UV items so the function returns -1 index in case of other
modes. Because the mode variable is used to contain both editor type or modes,
just assume Image Editor when these are Image Editor modes.
Pull Request: https://projects.blender.org/blender/blender/pulls/126584
This commit moves the namespaced functions inside `paint_intern.hh` into
their own header files, specifically:
* `blender::ed::sculpt_paint::hide` to `paint_hide.hh`
* `blender::ed::sculpt_paint::mask` to `paint_mask.hh`
This commit also moves methods defined in `sculpt_hide.hh` into their
own file (`sculpt_hide.cc`) out from `sculpt.cc` and `paint_hide.cc`
Pull Request: https://projects.blender.org/blender/blender/pulls/126668
Small changes to improve docking when initiated from a menu item or
keyboard shortcut, rather than corner action zones. Process gives
feedback immediately. Split assumes a start from top-left corner.
Canceling always resets mouse cursor.
Pull Request: https://projects.blender.org/blender/blender/pulls/126704
This was a very similar problem to Alembic's #77754 where a background
import can cause issues with Undo in some circumstances.
Mirror what was done for the Alembic fix here now too.
Pull Request: https://projects.blender.org/blender/blender/pulls/126539
Writing to the `curve_type` attribute directly is not allowed as there are other
updates needed and otherwise will result in a crash.
The fix makes sure the `curve_type` is read-only. To change the curve type,
the `grease_pencil.set_curve_type` operator has to be used for now.
Fixes the camera and View3D projection used for calculating the rendered
region for SVG/PDF export. Also drastically simplifies this code by
removing unnecessary variables and using an optional transform to
indicate when camera data is actual available.
Also fixes missing layers in export due to incorrect early exit in the
layer loop.
Pull Request: https://projects.blender.org/blender/blender/pulls/126691
It was a side effect of enabling the depth write.
The fix is to enable the backface culling when it can
be honored.
However, this only works in solid mode.
Candidate for backporting to 4.2
Fix#126351
If a deferred layer doesn't contain any material with
a non-null closure flag, the deferred layer is skipped.
However, material with null closure flag exists and
still need to render opaque.
Fix this case by modifying the closure bits for the
deferred and probe pipelines.
Candidate for backporting to 4.2
Fix#126459
Reorganization to make the retrieval of data from the arguments struct
more explicit, combined with a bit of renaming. Mostly to make a future
diff visually simpler.
Only paint code and brush management code should access this member
directly. Normal code should just use the getter.
Case in point, !125449 might make the querying of the active brush more
involved, so the getter should definitely be used to avoid accessing the
wrong brush.