These name fields run out of space for some of the new Grease Pencil
modifiers, like "GreasePencilEnvelopeModifierData". Only one of these
strings is stored for each modifier type, so this should have almost no
impact on size.
Pull Request: https://projects.blender.org/blender/blender/pulls/117980
Take light shape into consideration and do a small
fade to avoid abrupt lighting changes.
This fixes quite a lot of light leak but doesn't
fix all of them since light can still leak
during the fade. We could do this fade on the
lit side but then it break the working cases.
This does however fix the appearant sharp shadowing
that was visible on big light source.
Co-authored-by: Weizhen Huang <weizhen@blender.org>
This adds the processing required to import and export simple material graphs utilizing the UsdUVTexture outputs channels.
If only r, g or b are specified as output, we hook up a `Separate Color` node and connect the appropriate channel from there.
(if a is specified as output, the Alpha output of an image texture node was used already)
On the export side, we traverse from the socket to the image texture node, and if a `Separate Color` on the way, we are using the channel from there to put on the output.
https://openusd.org/release/spec_usdpreviewsurface.html#texture-reader
Pull Request: https://projects.blender.org/blender/blender/pulls/117901
The IME widget drawing code replaces the button's draw string, but it
did this with a C-style const cast which let this go unnoticed in
089c389b5c which changed the string from a C array to a
C++ std::string, where it's UB to just change the length this way.
To fix the crash, just store the string in a temporary array so we
can use the existing unchanged formatting code.
Pull Request: https://projects.blender.org/blender/blender/pulls/117968
Add new "Soft Falloff" option on point and spot light that uses
the old light behavior from Blender versions before 4.0. Blend
files saved with those older versions will use the option.
This option is enabled by default on new lights.
Fix#114241
Co-authored-by: Weizhen Huang <weizhen@blender.org>
Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/117832
This implements layer parenting and layer transforms.
* Adds a new "Transform" panel in the object-data properties with the (local) translation, rotation and scale.
* Adds a new "Relations" panel with the parent property (and also bone name in case the parent is an armature).
* When converting from GPv2 to GPv3, the parent and transforms are converted too.
* Bone names are updated if they are renamed in the armature.
Implementation details:
* The positions in the drawings are always in layer space. During extraction, we transform the positions to object space. Note that this could be optimized further and done in the render engine itself.
* This means that e.g. the selection code (which needs to know where the positions are on screen) now takes this transform into account.
* The layer transform is calculated when accessed (from the location, rotation, scale properties).
* Code that needs to know where the positions are on screen now takes this new transform into account.
Pull Request: https://projects.blender.org/blender/blender/pulls/117247
The problem was calling a "for eval" function on an original mesh
in the main data-base. The parameters are already copied anyway,
so the call was unnecessary. Also reorder some changes to happen
before the geometry is moved to the original mesh.
The problem was calling a "for eval" function on an original mesh
in the main data-base. The parameters are already copied anyway,
so the call was unnecessary. Also reorder some changes to happen
before the geometry is moved to the original mesh.
Previously the default constructor ran, then the copy or move
assignment. This resulted in extra creations of runtime data,
including allocations of all the shared caches, only for them
to be immediately replaced by the new ones. Move assignment also
didn't clear the source curves completely, which could result in
higher memory usage or worse, extra users for attribute arrays,
which could lead to unnecessary copying.
In a very simple test repeatedly copying a tiny Curves data-block,
I observed a 30% performance improvement.
This also fixes a memory leak of the offsets in the copy assignment.
Pull Request: https://projects.blender.org/blender/blender/pulls/117932
The main simplification is using return values rather than return
arguments, and the additional semantic clarity from std::optional.
Also use `fmt` for formatting and use lambdas instead of macros
as helpers in a few modal keymap formatting functions.
Similar commits:
- a1792e98a4
- f04bc75f8c
- 6abf43cef5
- 7ca4dcac5a
Pull Request: https://projects.blender.org/blender/blender/pulls/117785
This simple operator set the edge sharpness attribute on edges,
either extending the existing values or replacing them completely.
It's meant to make it more convenient to manually control the
sharpness now that there can be more reason to do that after
auto smooth became a modifier.
Pull Request: https://projects.blender.org/blender/blender/pulls/117918
Make sure bf_rna is compiled prior to bf_editor_space_userpref,
so that the RNA_prototypes.h can be included.
Solves possible compilation error when building Blender from
scratch.
Pull Request: https://projects.blender.org/blender/blender/pulls/117937
Although the information displayed in the status bar is strictly
speaking reports, it makes sense to translate them using the Interface
setting instead of Reports, as the tool names and stats terms are
also translated in other UI places (toolbar, menus).
This change includes status bars statistics and keymaps, and viewport
statistics.
The change is quite extensive as it is all or nothing. Translating
keymaps using Interface means some status messages will include them
indirectly, and thus cannot use Reports without having a weird mix of
original and translated words. In turn, having only some messages
translated would be even more confusing.
The result is that all messages related to input are now translated with
Interface, which I think also makes sense.
Discussed as a followup to !116804.
-----
cc. @gtitaev
Pull Request: https://projects.blender.org/blender/blender/pulls/117234
This came up in #117747.
Unless an object was of OB_VOLUME type, the setting was not updating the
viewport accordingly since the introduction in 365bf103d1. So if for
example a mesh has a "Mesh to Volume" node, the update did not take
place.
If we use context, we can check the evaluated GeometrySet on any object
type with a geometry nodes modifier though and if it has a volume, we
can also tag for update.
Pull Request: https://projects.blender.org/blender/blender/pulls/117848
This header is for 'internal' USD code only (also needed by the hydra
code), and uses references to the USD library itself, so its previous
name was a bit too generic.
First step to move the main public Blender USD API header (`usd.h`) to cpp.
Adjust ymax of action in frame range so that height will match with the
channel's height. Use same ymax as in `acf_nlaaction_backdrop`.
Also fixed `ycenter` value.
Pull Request: https://projects.blender.org/blender/blender/pulls/113490
When moving keys in the Graph Editor animators
usually only want to move them on one axis.
While this is possible in a few ways (G+X, or G + Middle Mouse Button click),
we could default the behavior to always lock on an axis.
This was suggested by Dreamworks animators during the
Animation & Rigging module meeting.
https://devtalk.blender.org/t/2024-01-26-animation-rigging-module-meeting/33081#patch-review-decision-time-5
This PR adds an option with which the movement is
always locked to a single axis by default.
The option can be found in the Graph Editor under "View->Auto-Lock Axis".
The movement will then be restricted to the axis along
which you've moved the cursor the most.
You can still manually override the lock behavior by pressing `X` or `Y`.
I am piggybacking off the auto locking feature you get when pressing the middle mouse button.
When the new feature is enabled I call that at the start of the transformation.
Except when:
* only handles are selected
* the tweak mode has been started on a handle
This is to not snap handles, which is a behavior that has
been requested by the artists.
Pull Request: https://projects.blender.org/blender/blender/pulls/117669