A small quality of life change to indicate which slots are used.
This only applies to the slots menu, the UI List could show these too
however this requires extending the RNA API.
Ref: !138651
This converts the public `uiItemFullO_ptr` function to an object
oriented API (an `uiLayout::op` overload), matching recents changes
in the API.
Changes include rearranging the `IDProperty *properties` parameter to be
the last parameter. Now is optional (but will be removed), also instead
of using a return parameter the function now returns the pointer to
write properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/139166
With the release of the brush assets project in 4.3, most brush
management moved out of the current .blend file into either the
essentials library or user-created libraries.
With this change, a number of workflows became more difficult:
* Handling a large library of texture and texture properties for brushes
due to ID linkage constraints.
* Having local tweaks to a brush without bloating the the asset library
and reducing discoverability.
This commit introduces an intermediate step to assist with both of the
preceding pain points. The `brush.asset_save_as` operator is extended
to allow saving into the current blend file via the `Duplicate Asset`
context menu entry.
Additionally, these features help ease authoring brush assets in general
from the UI instead of requiring manual datablock management.
This allows brushes to be stored alongside other data inside a specific
blend file.
Related to #129655 and [1].
[1] https://blender.community/c/rightclickselect/XYMA/
Pull Request: https://projects.blender.org/blender/blender/pulls/138105
This commit adds the `BKE_brush_duplicate` function that performs a deep
copy of a brush ID and all associated IDs into the current Main
database.
Unit tests are added with this case to ensure that grandchildren and
embedded data is handled correctly for both Sculpt and Grease Pencil
brushes, as the latter contains more ID references than other brush
types.
Related to #138105
Pull Request: https://projects.blender.org/blender/blender/pulls/138629
Since ec141ba3ff, commits from all branches are listed. Issue is that
commits from different repositories and branches will be mixed.
Personally I prefer grouping commits better, so I always edit the output
manually.
With this, commits will be grouped by branch, or PR if one can be found.
The branches and commits will then be printed under their target
repository. This isn't the owning repository of the branch or PR (often
people's personal fork), but the one it targets. This worked much better
in own tests.
Further:
- For some common repositories more readable names are used, e.g.
"Blender Manual" instead of "blender/blender-manual".
- Commits of the Blender repository are listed first, without grouping
under a `blender/blender`.
- Commits to each repository's main branch are listed first, directly
under the repository grouping.
- See PR for a textual mockup of the output format.
Pull Request: https://projects.blender.org/blender/blender/pulls/138615
Currently the script only includes commits to "main" branches. Much of
people's work is done in branches however, so developers either
customized the script, or they would manually go through own history to
find remaining commits (I asked some).
Even if some people prefer to only list main branch commits, it's much
easier to simply remove some commits than to add missing ones.
To be able to tell which branch a commit was on, this adds a " on
`branch-name`" after the commit hash. Personally I don't find this
optimal, I'd rather group commits under their repository/branch,
proposed separately in #138615.
Pull Request: https://projects.blender.org/blender/blender/pulls/138612
Currently, when using link-drag-search and searching for "Value" shows the bake
node first. This is annoying because it's rarely what one means. It's shown
first because it's a shorter search entry.
This patch reduces the weight of that entry so that the Value node shows up
first.
Pull Request: https://projects.blender.org/blender/blender/pulls/139156
This adds a new modal operator that allows reordering columns interactively.
It's triggered by dragging the column header. Edge panning while dragging the
column to the left or right of the region is supported. Scrolling with a
horizontal scroll wheel works too.
There are three new UI elements to help the user understand what is happening.
These three elements seem to be fairly standard in other spreadsheet software.
* The column that is dragged is highlighted in its original place.
* A "shadow" of that column stays attached to the cursor.
* A line indicates where the column will be inserted.
Note: The column order is not yet persistent when columns disappear temporarily.
That will be worked on separately.
Pull Request: https://projects.blender.org/blender/blender/pulls/139136
This improves implicit node inputs in multiple ways:
* Fix crash when switching a group input socket type from e.g. vector to
integer, while the default input is set to "position". Now, the default input
type is reset automatically if it's invalid.
* Add Left/Right Handle as possible implicit vector inputs (next to Position and
Normal). Those were the only ones that we used internally that were not
exposed yet.
* When creating a new group input from an existing socket, also initialize the
default input based on the socket. E.g. when grouping a `Set Position` node,
the `Position` input of the group will now also use the position attribute by
default.
In addition to these user-level changes, some internal changes were done too:
* Use unified `NodeDefaultInputType` in node declaration instead of function
pointers which were hard to propagate to node groups.
* Use a new reusable `socket_type_supports_default_input_type` function in rna
to filter the list of possible input items.
Pull Request: https://projects.blender.org/blender/blender/pulls/139139
The Smoke Surface Emission is the height of the smoke from the mesh surface.
It is measured in Domain Grid Units, and if the grid unit is relatively big
(compared to the mesh), the smoke emission is huge.
To fix that the Surface Emission was decreased from 1.5 to 1.0. As a result
it is possible to emit smaller smokes (width 2, previously 3).
Further decreasing default value of Surface Emission is not recommended,
as in some cases (too small mesh compared to Grid Unit) will result not
emitted smoke.
Fix#132613: Issue with large smoke domain and small emitter
Pull Request: https://projects.blender.org/blender/blender/pulls/138567
This patch removes the Relative option from the Translate node. This is
now superseded by the Relative To Pixel node, and removal was done to
facilitate the options to inputs project.
Pull Request: https://projects.blender.org/blender/blender/pulls/139147
This converts the public `uiItemFullO` function to an object oriented
API (an `uiLayout::op` overload), matching recents changes in the API.
Changes includes the removal of the paramether `IDProperty *properties`
that seems unused (all places just sets `nullptr`, can be added as last
argument with `nullptr` as default value though), and instead of using a
return paramether the function now returns the pointer to write properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/138961
This is because the warm_shader_specialization was
not called for the actually used specialization since
the samples_len would be updated right before accumulation.
Fixed by calling update_sample_table before the warm shader
call. Also avoid default filter request 4 sample specialization.
This avoid all stall altogether.
Previously this attempted to use the evaluated deform mesh (otherwise
known as the cage mesh). Because this isn't the mesh displayed in the
viewport it can be unintuitive, and it also doesn't work when the other
meshes are procedurally generated or have other "generative" modifiers.
This commit switches to just checking the evaluated mesh.
A potential downside is that modifiers like subdivision are also taken into
account and can potentially make the objects incompatible because of
mismatched vertex counts.
Part of #135095
Pull Request: https://projects.blender.org/blender/blender/pulls/138330
This patch adds the option to take screenshots for asset previews.
Since the functionality lives inside an operator, the screenshot can only
be taken from within the GUI of Blender.
* The operator can be accessed from the dropdown menu in the asset
browser preview n-panel.
* It works for local assets and assets that are managed by blender
(e.g. brush assets)
* Click drag anywhere in Blender to create a capture
* Holding Space will move the capture area
* Holding Shift will unlock the aspect ratio
* On a re-run, the operator remembers it previous capture
area to easily create an identical screenshot
* If the screenshot is fully contained within a single 3D viewport,
the background will render transparent
Pull Request: https://projects.blender.org/blender/blender/pulls/132904
Currently, if a user drags an image file into a node editor with
no node tree, then the operator silently fails.
This patch adds an error to warn the user that adding an image is
only possible if a node tree exists already.
Pull Request: https://projects.blender.org/blender/blender/pulls/138997
Check if either the memory is zero or already matches the default value,
and copy. This simplifies a common pattern to a single line.
Preparing for default initializers in DNA (#134531).
Pull Request: https://projects.blender.org/blender/blender/pulls/138830
* Move colorband and theme DNA to own headers
* Move some anim, curve, modifier and space enums to new headers
* Move data transfer enums to DNA
* Duplicate imbuf proxy and GPU backend enums
For a few reasons:
* Reduce number of includes in DNA headers
* Don't define enums used in DNA outside of DNA
* Move theme settings to separate header for userdef_default_theme.c
* Prepare for using default initializers in DNA headers. (#134531)
Pull Request: https://projects.blender.org/blender/blender/pulls/138831
This is mostly a non-functional change except for
* `overlay_armature.cc` was drawing relationship lines to bone
hidden by collection logic (except that doesn't seem to work anyway,
relationship lines are drawn regardless)
* `transform_snap_armature.cc` it was possible to snap to pose bones
hidden by collection logic.
I assumed those to be oversights so I changed them in this PR.
This does *not* remove all usages of `BONE_HIDDEN_P`
and `BONE_HIDDEN_A`. Some direct access is required in
the UI and for cases where we explicitly don't want to check
collection visibility.
Part of #138482
Pull Request: https://projects.blender.org/blender/blender/pulls/139151
Removes the stutters comming from the film shader.
The number of samples used by the film shader is set
throught a specialization constant. Since the number of
effective sample can depend on jitter position, this
number was fluctuating and trigger compilation on
new specialization until all specialization were
encountered.
Rounding the samples up to the most common sample
count fixes the issue.
Pull Request: https://projects.blender.org/blender/blender/pulls/139154
This caused UB in the tests now that tests are all ran
inside the same context.
A shader could be free but its pointer would be dangling
inside the `Context`. A new shader could have the same
address and generate UB after binding.
This is not the best way to solve this issue but at least
we prevent the use of the UB.
Pull Request: https://projects.blender.org/blender/blender/pulls/139109
If Mix Color node clamps the result, we do not bypass the node, but
disconnect other inputs. However, for the case where both inputs were the
same, the disconnected one would use the stored socket value instead, so
set the factor to 0 to only use the intended input.
Pull Request: https://projects.blender.org/blender/blender/pulls/139098
It's not common for object data to reference it's object type
so name the struct member to make this clear.
Also remove BKE_curve_type_get which is no longer needed.
- #122256: Clamp Size option did not work at all, due to mesh
bounding box still not being calculated (and was firing an assert
in Debug build).
- #123862: Clamp Size option was rounding the resulting scale to
powers of ten, which is not what anyone would expect.
This fixes both issues, and adds test coverage.
Co-authored-by: dshot92 <dshot92@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/139145
- Make Curve::type the source of truth for the curve type,
instead of Curve::vfont, since it's possible for this to be
set to null from RNA which effectively changed it's type.
See #138730.
- Update objects to match the curve type on file read.
Without this, an object may link to a curve in another file which
can be replaced by a curve data-block of a different type.
Note that updating the object type was already being done
when reloading library data and setting object data,
just not on file load.
Ref !139137
The Path Template errors reported in tooltips could be incorrect,
depending on whether the field was visually truncated in the UI or not.
For example, if you had a path `/tmp/{blend_name}{foo`, the error is
that the template expression `{foo` is unclosed. However, if the
available space for the field in the UI is too small, the displayed path
could end up as `/tmp/{blend_na...`. This is for display purposes only,
and shouldn't effect things like template errors. However, it did, and
the error checking would be run on that display string, and report that
`{blend_na...` is unclosed, which is incorrect.
The issue was that the code doing the live error checking for the UI was
using the display string because it was conveniently available.
This fixes the issue by properly querying the property value via RNA,
and using that.
Pull Request: https://projects.blender.org/blender/blender/pulls/139144
The variant of `RNA_property_string_get()` that returns a `std::string`
always returned a string with zero length. The issue is that it was only
calling `reserve()`, which ensures an underlying buffer with enough
*capacity*, but does not set the string length. The property's string
value would then be correctly copied to the reserved buffer, but the
string length would remain zero.
This commit fixes the issue by replacing the call to `reserve()` with a
call to `resize()`, which additionally sets the string length.
Pull Request: https://projects.blender.org/blender/blender/pulls/139106
This adds the following options to Select Grouped in pose mode:
* Children
* Immediate Children
* Parents
* Siblings
Doing so means we are more in line with similar operators in edit mode.
Unfortunately re-using existing functionality from edit mode doesn't seem
possible due to the edit/pose bone difference.
The added functionality can handle multiple armatures in pose mode at once.
Also the same operators can be accessed from weight paint mode.
Implements #137274
Pull Request: https://projects.blender.org/blender/blender/pulls/137960
This patch adds a new Relative To Pixel node in the compositor. The node
converts values that are relative to the image size to values that are
in terms of pixels.
This is useful to use relative values in nodes that take pixel values.
For instance, the Kuwahara node has an input that defines the filter
size in pixels. If one wants to define it relative to the image size
instead, one can use this node.
The node can operate on float and 2D vector values. Further, the node
can do the conversion relative to a number of image properties:
- Per Dimension: Each dimension gets converted independently. The X
value is relative to the X dimension and the Y value is relative to
the Y dimension. This mode is special because in float mode, the
output will be a factor as opposed to a float.
- X: Relative to the x dimension.
- Y: Relative to the y dimension.
- Greater: Relative to the greater dimension.
- Smaller: Relative to the smaller dimension.
- Diagonal: Relative to the diagonal of the image.
Pull Request: https://projects.blender.org/blender/blender/pulls/138773
Blender crashes when a node has a panel whose children input sockets are
all unavailable. This happens when marking sockets as collapsed, where
the non-initialized header_center_y members of such panels are accessed,
causing asserts or crashes.
The update_collapsed_sockets_recursive function has a check that should
avoid such accesses, but it seems wrong due to the negation of the
visibility check.
To fix this, we move the visibility check to a guard condition in the
marking function instead, and simplify the collapsed check in the update
function.
Pull Request: https://projects.blender.org/blender/blender/pulls/139104
Calculating the curve type isn't needed for data which is only written
for text curves.
Note that this complicates a fix for #139133 which changes how curve
type data is accessed, where a version of BKE_curve_type_get that used
old behavior would have had to be kept for version patching.