See #103343.
We had attempted to move the file to C++ twice before but found failing
tests each time. To find the code with changed behavior between C and
C++, I temporarily added a header declaring all the functions and moved
them one by one. The problem ended up being one function's use of `exp`
which used floats instead of doubles in C++.
Pull Request: https://projects.blender.org/blender/blender/pulls/112693
The workaround for shader draw parameters isn't working for OpenGL. The
reason is that it isn't looking for the correct attribute to attach the
buffer to.
This fixes the issue that all objects where drawn using the unit matrix when
starting blender with `--debug-gpu-force-workarounds`.

Fixes#112641
Pull Request: https://projects.blender.org/blender/blender/pulls/112668
With a callback to node panels similar to the one for nodes. Used in the
Principled BSDF to place enums in the relevant panels.
Longer term we want to make enums into sockets, but even then there are
still potentially some types of buttons we want to have in panels.
Pull Request: https://projects.blender.org/blender/blender/pulls/112591
The layout for this is not great but consistent with existing
collapse/expand functionality there. There are ideas to replace this
entire material properties drawing longer term, but for 4.0 it's
important to show the panels in some way.
Pull Request: https://projects.blender.org/blender/blender/pulls/112591
Shortening names based on context is something we do in the user
interface throughout Blender. This is a simple automatic mechanism to do
it for node panels as well, which significantly improves the Principled
BSDF layout.
We want the properties and sockets to be identifiable outside of the
panel contextcontent, for example in the animation editor, API docs, or
when exposing a single socket as a group input. So making the actual
name shorter is not an option.
Pull Request: https://projects.blender.org/blender/blender/pulls/112591
Replace the import/export of armature layers with bone collections.
The Old Way:
- Export: Each bone would store which armature layer it was on.
- Import: All armature layers that contain at least a bone are shown.
The New Way:
- Export: Each armature contains a list of its bone collections,
including which one is active and which ones are visible.
- Export: Each bone stores which bone collection it is on.
- Import: the above data is simply used as-is.
Due to limitations of the current Collada importer code, each "extra"
tag can only occur once per Collada node. This means that it was
impossible to write a `<collection name="Bones">` tag for each bone
collection, as only one of those would actually be stored by the
importer for further processing. To work around this limitation, all
bone collection related tags store their values as newline-separated
strings. Example:
```
<node id="Armature">
<extra>
<technique profile="blender">
<collections sid="collections" type="string">Layer 1
Layer 3b
Group
That One Bone</collections>
<visible_collections sid="visible_collections" type="string">Layer 1
Layer 3b
That One Bone</visible_collections>
<active_collection sid="active_collection" type="string">That One Bone</active_collection>
</technique>
</extra>
</node>
```
Instead of adding the default "Bones" bone collection to every Armature
data-block, only add it for Armatures that are added in the 3D View with
Shift+A > Armature.
This simplifies things like importers, which otherwise would have needed
to remove that default collection before creating the imported ones.
Additionally, this also ensures that the one bone you get by default is
actually assigned to the default bone collection.
Move the 'set active bone collection by name' functionality from RNA
to the ANIM module, so that it can be used in other places.
No functional changes.
When clearing the parent of an object that has keys,
the object position jumped back to world space immediately.
This didn't allow for keying the current position
and was inconsistent with setting a parent.
This PR fixes it by not instantly re-evaluating the animation.
Pull Request: https://projects.blender.org/blender/blender/pulls/112670
This patch has been originally authored by Ares Deveaux #106520
I am just finishing it up.
This is a new operator for the Graph Editor.
It shifts the value of the keys in time,
while keeping the actual key positions in the same place.
It supports wrapping, so when offsetting beyond the range
of the F-Curve it will take values from the other end,
but offset in y-value so there is no jump.
This works best with dense key data.
Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/110540
Rather than always snapping the region size to the closest multiple of
the row height, remember the amount of rows displayed after the user
resized the region, and try to preserve that. This gives a lot more
predictable behavior, especially when the "Show Names" option is toggled
on and off, and the region resizes in response. With the old method the
amount of visible rows could change multiple times while toggling.
This also enables us to clamp the amount of rows (e.g. while the preview
size is increased and the region becomes too large for the area; or,
when a catalog tab is activated with fewer assets and thus fewer rows)
but still restore the amount of rows the user chose earlier, as soon as
possible.
Part of #107881.
Pull Request: https://projects.blender.org/blender/blender/pulls/112637
This adds an operator `graph.select_key_handles` to the graph editor
that changes the selection of the different parts of a bezier keyframe. It
operates on all keys that are either themselves selected or have either of
their handles selected, and changes whether the key itself and/or its handles
are selected.
The operator has three options:
- `left_handle_action`
- `right_handle_action`
- `key_action`
Each of which can be set to:
- Select
- Deselect
- Keep (do nothing)
Co-authored-by: cgtinker <Denys.Hsu@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111143
With 9d0907560a, button tooltips would now often display the label even though
it's already visible in the button itself.
This fix brings back the old logic for displaying the label, but it's still
possible to override the label via the callback introduced in the earlier
commit.
Comments are updated/added here to make the behavior more clear.
Pull Request: https://projects.blender.org/blender/blender/pulls/110469
The issue was that the `user_data` pointer in the local user data
is not necessarily valid, because a different user-data might be
passed in when a lazy-function is called a second time (it's semantically
the same user-data but, might have a different pointer).
The solution is to not keep around the dangling pointer but to pass
it in when it is actually needed. I still keep the old constructor of the
local-user-data, because more stuff might be added to it, that needs
the user-data, as was the case in the past already (before 142541c27).
Blender 4.0 requires OpenGL 4.3 which always support SSBO's.
Platforms that don't support enough SSBO bind points will be marked
as unsupported.
Users who start Blender on those platforms will be informed via a
dialog. This PR also updates the `--debug-gpu-force-workarounds`
to match our minimum requirements. Note that some bugs are still
there that should be solved in other PRs:
* Workbench only renders the object using a unit matrix this is because
there is a bug in the workaround for shader_draw_parameters
* Navigating with middle mouse button is not working. Unsure what the
cause is, but might be a missing feature check in the OpenGL backend.
Related to #112224
Pull Request: https://projects.blender.org/blender/blender/pulls/112572
This seems to be an issue deep inside UI drawing code. The nodes render
the panel button in the correct place,
but it doesn't correctly update the button state after a redraw, unless
the mouse is moved. The button is still in a `BUTTON_STATE_HIGHLIGHT`
state after drawing, and a mouse press will trigger it regardless of
where the mouse cursor actually is.
A common hack to force a reset of the button state is to add a fake
mouse move event using `WM_event_add_mousemove`.
Pull Request: https://projects.blender.org/blender/blender/pulls/112503
Use magenta fallback color for sockets without a `draw_color_simple`
callback. This is not ideal, but without a context or node instance
the older `draw_color` callback can't be used.
Pull Request: https://projects.blender.org/blender/blender/pulls/112658
This patch adds multi editing support to
FCurve modifiers using the ALT key like in the rest of Blender.
Just like object modifiers they need to be named exactly
the same and be of the same type in order for the multi editing to work.
Pull Request: https://projects.blender.org/blender/blender/pulls/112419
Mismatch between what drawing assumes and what the function to query the
full preview tile uses. This would cause previews to be scaled down
because the button wasn't tall enough. Only affected the asset shelf and
the asset view template.
This implement the diffuse tracing as simple
screen-space ray trace. This is extremely inefficient
and should only be used for reference purpose.
The real screen space diffuse implementation will
be done in another PR.
Depends on #112507

Pull Request: https://projects.blender.org/blender/blender/pulls/112539