There is a special case in the compositor code where viewer nodes are
treated as composite nodes. This patch renames relevant methods and
updates comments to clarify this use case.
Pull Request: https://projects.blender.org/blender/blender/pulls/133811
This patch changes how the Wrap option in the Translate node works. It
now repeats infinitely when realized, and not just in its own domain.
This is essentially how it used to work prior to version 4.2, so we are
reverting that change. We also rename Wrap to Repeat for clarity.
This is part of an ongoing to project to allow the user to control how
boundaries and empty areas are filled after transformations. So similar
options will be added to all transform nodes. But this patch is the
first step, since the functionality is already there, we just need to
extend it to work in all domains.
Pull Request: https://projects.blender.org/blender/blender/pulls/133766
Small changes to the status bar display when the active object has non-
uniform or negative scale. Use CTX_data_active_object rather than
BKE_view_layer_active_object_get. Case correction for a text string.
Small spacing change. Improved comments.
Pull Request: https://projects.blender.org/blender/blender/pulls/133834
The original function did extensive calculations to get the nearest handle,
even though none of the calling functions used that information.
Its functionality was very similar to `mouseover_strips_sorted_get`, except
that it was less precise and did not factor in `STRIP_OFSBOTTOM/OFSTOP`.
`mouseover_strips_sorted_get` is called by
`ED_sequencer_pick_strip_and_handle`, so update all of the calling functions to
use this instead.
Refactor and replace `find_nearest_seq` into `mouseover_strip_get`, which does
not factor in padded strip handles, and is used only by
`ED_sequencer_special_preview_set` as a static function for scrubbing over
strips.
Pull Request: https://projects.blender.org/blender/blender/pulls/133744
Adds new function `foreach_content_slice_by_offsets` that gathers mask's
indices into `IndexRange` lists grouped by given offsets. New approach
doesn't need temporary `points_to_duplicate` array of size
`curves.points_num()`. Traversal is more effective as only selected
indices get visited. Also point data is copied by point ranges instead
of point by point.
Performance was tested with following code:
```cpp
TEST(curves_geometry, DuplicatePoints)
{
CurvesGeometry curves = create_basic_curves(100000, 100);
IndexMaskMemory memory;
IndexMask every_second = IndexMask::from_predicate(
curves.points_range(), GrainSize(100), memory, [](const int i) {
return bool(i % 2);
});
for (const int i : IndexRange(1000)) {
CurvesGeometry copy = curves;
const int expected_point_count = copy.points_num() + every_second.size();
ed::curves::duplicate_points(copy, every_second);
EXPECT_EQ(copy.points_num(), expected_point_count);
}
}
```
| | main | mask slices | slices & copy by ranges |
| -------- | -------- | ----------- | ----------------------- |
| full copy| 3346 ms | 2270 ms | 1614 ms |
| `i % 2` | 8084 ms | 5918 ms | 5112 ms |
| `!((i % 10 == 0) or` <br/>`(i % 10 == 1) or` <br/>`(i % 10 == 2))` | 4522 ms | 2860 ms | 2343 ms|
| `(i % 10 == 0) or` <br/> `(i % 10 == 1) or` <br/> `(i % 10 == 2)`| 4088 ms | 1961 ms | 1639 ms|
| `IndexRange(50020, 70)` <br/> <sub>(one small range in the middle)</sub>| 1966 ms | 100 ms | ~75 ms |
Pull Request: https://projects.blender.org/blender/blender/pulls/133101
This adds support for Transform MouseInputMode INPUT_ERROR using a new
transform cursor HLP_ERROR (dashed line ending with WM_CURSOR_STOP.
This is shown when attempting an object rotation or scale when
transforms are set to "Affect Only Locations". At this time the status
bar is also cleared and an warning message is shown.
Pull Request: https://projects.blender.org/blender/blender/pulls/132957
Operators should not act on non-visible entities really.
Posemode already did the combination of "visible and selected" via
`FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN`, editmode didnt.
To resolve, add `EBONE_VISIBLE` as a condition (as done elsewhere).
Pull Request: https://projects.blender.org/blender/blender/pulls/133660
Previously, the global storage of these types either used a GHash or a
blender::Map. VectorSet is preferrable to GHash because it's type safe,
clearer, and faster. It's preferrable to Map because the key doesn't
have to be duplicated and because iteration is faster.
This PR moves these registered types to VectorSet, just like the
node, node socket, and node tree types. Note that none of these types
use RAII for allocation, so freeing is still done manually.
Testing was manually interacting with each of these systems, including
with addons that register their own types.
Pull Request: https://projects.blender.org/blender/blender/pulls/133778
This was caused by the subpass input workaround for non-tilebased
GPU using `texelFetch` on an `image`. This was supported before
the cleanup 9c0321ae9b.
But is against the GLSL specification and was removed inside the
cleanup.
Using `imageLoad` instead of `texelFetch` fixes the crash.
However rendering seems to be broken for other reasons.
Currently the "Show All" layer operator operator only enables visibility
for layers only. If the Grease Pencil object has layers that are children
to a Layer Group that is hidden, these layers would not be revealed
to the user.
This pull request modifies the grease_pencil_layer_reveal_exec function
to iterate through Layer Groups present in the object and sets them visible.
Pull Request: https://projects.blender.org/blender/blender/pulls/133613
10/12bpp movie writing code assumes that input image is properly
floating point for these cases. That is always true for regular
rendering, however VSE can produce 8bpp images, if there
are no float/HDR strips in there. Make these convert into a float
image in the render pipeline when needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/133802
Was just getting the default name, but if we also have a bone selected
in weightpaint mode, these should be named after the bone (otherwise the
armature modifier does not deform accordingly).
To resolve, basically do the same we do for meshes in
`ED_wpaint_ensure_data`.
Pull Request: https://projects.blender.org/blender/blender/pulls/133804
This adds another operator mode for changing brush radius and opacity while the
modal primitive operator is running. It's based on the `wm.radial_control`
operator but only implements simple mouse control for these two properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/133675
In renderdoc the debug stack got corrupted when render graphs where
reused. The previous usage didn't clear the stack. This PR clears
the debug stack when render graphs are reset.
This patch adds support for drag and dropping colors (from color buttons) into
the Compositing, Shading and Geometry node trees.
Additional support was added for dragging and dropping colors with an Alpha
component (which was previously ignored), both in the context of the Node Editor
and for Color Buttons in general. This handles cases like drag and dropping a
color from an RGB to an RGBA button, which recreates the color with a default
Alpha value of 1.0.
Pull Request: https://projects.blender.org/blender/blender/pulls/129026
Changes to the compositor Normal node does not propagate and the
compositor result is not updated. That's because the node is a special
case since its output socket value is used as its input property, which
is not tracked by the node update code.
Apparently, a similar node exists in shader nodes, and a workaround is
implemented for that node in the node updater, so we just need to extend
that check to include the compositor node as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/133803
Refactor the keyframe copy-paste code to prepare for supporting action slots.
This is a non-functional change, as the slots are stored but otherwise completely ignored. This way the refactor to the new data structure can be reviewed & tested before actually changing the behaviour.
Related: #129690
Pull Request: https://projects.blender.org/blender/blender/pulls/133497
There were three methods with succinct but slightly unclear names:
- Action::slot_move()
- Channelbag::channel_group_move()
- Channelbag::fcurve_move()
The ambiguity is due to other functions with similar names that e.g.
move fcurves *between* Channelbags, etc. Whereas these methods only move
items to other positions within the array they're already in.
To make this clearer, this PR adds `_to_index` to the end of these
array-oriented methods.
Pull Request: https://projects.blender.org/blender/blender/pulls/133730
The current poll function uses `ED_view3d_context_user_region` [which
falls back to `ED_view3d_area_user_region` if the context region is
flagged `RV3D_LOCK_ROTATION`, so it finds the non-locked region in quad
view]. So in a way it is permissive to do the roll even when we are
within one of the quad regions which is actually locked. This can be
useful if we just want to roll by a specific angle or use one of the
types `V3D_VIEW_STEPLEFT`/`V3D_VIEW_STEPRIGHT` - these are then executed
in the non-locked region.
However for mouse-interacting roll, we should not do this at all when
initiated from a locked region.
To resolve, we could use `view3d_rotation_poll` (instead of
`ED_operator_rv3d_user_region_poll`), but that would prevent us from the
useful scenarios mentioned above. So instead, once we reach the mouse-
interacting code path, check again if we are really in a non-locked
region and only proceed if we are.
Pull Request: https://projects.blender.org/blender/blender/pulls/133643
- There's only a few unit conversion options, just test all of them
- Use reference instead of pointer when passing export settings struct
- Organize scaling struct fields to keep similar options together
Pull Request: https://projects.blender.org/blender/blender/pulls/133774
Artists often want to quickly switch back and forth between two or more nodes while compositing.
This patch implements two operators `NODE_OT_viewer_shortcut_set` and `NODE_OT_viewer_shortcut_get` that allow users to map a viewer node to a shortcut. For example, pressing `cltr+1` while a node is selected, assigns that node to the shortcut `1`, creates a viewer node if it has none attached and sets that viewer node to active. Pressing `1` will set the active node with shortcut `1` to active.
Shortcuts are saved in DNA to preserve them after saving/loading blend files.
Limitations:
- Only compositor node tree is supported, because shading editor has no viewer node and geometry nodes viewer works differently.
Pull Request: https://projects.blender.org/blender/blender/pulls/123641
Adding an image object using drag and drop can fail without an apparent reason.
This patch shows an error when this happens so that the user can react accordingly (in this example switch to object mode, add the image and switch back to edit mode).
Pull Request: https://projects.blender.org/blender/blender/pulls/132994
In certain setups, nodes whose inputs are single value and whose outputs
are expected to be single value wrongly return an image. That's because
they wrongly join a pixel operation that operates on images.
To fix this, we split pixel operations by their value types. Single
value sub-trees get compiled into their own pixel operation and none
single value sub-trees get compiled into their own pixel operation.
This might unfortunately break up a long chain of pixel operations if
one of them was single value. This is solvable, but will require more
time and research, so we need to fix the bug first then look into it.
Pull Request: https://projects.blender.org/blender/blender/pulls/133701
The scene graph instancing export code contains logic for
determining which instances need to be converted to prototypes
because the original prototypes are not included in the export
(e.g., because they are not visible).
This commit fixes an error in this logic, which incorrectly
assumed that if the root of the original prototype is included
in the export, then the entire original hierarchy beneath the
root is included as well.
To fix this, the logic in AbstractHierarchyIterator::
determine_duplication_references was updated so that if any
descendants of an instance are converted to prototypes, the
parent instance is converted to a prototype as well.
This addresses the bug noted by Brecht in
https://projects.blender.org/blender/blender/pulls/131707#issuecomment-1403309
Pull Request: https://projects.blender.org/blender/blender/pulls/133750
Blender crashes when appending a node group containing a Glare node from
older versions. That's because the Glare node is versioned taking the
scene resolution into account, and in case of appending a node group,
there is associated scene, and accessing a nullptr scene causes the
crash.
To fix this, assume some default resolution in cases where the node
can't be associated with a scene.