Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
This node implements shortening each spline in the curve based on
either a length from the start of each spline, or a factor of the
total length of each spline, similar to the "Start & End Mapping"
panel of curve properties.
For Bezier curves, the first and last control points are adjusted
to maintain the shape of the curve, but NURB splines are currently
implicitly converted to poly splines.
The node is implemented to avoid copying where possible, so it outputs
a changed version of the input curve rather than a new one.
Differential Revision: https://developer.blender.org/D11901
|
|
`split_multicam` used split operator, where if more strips than
multicam were selected, all would be split, which is undesirable.
Add `Sequence.split()` RNA API function. to split individual strips.
Function accepts `frame` and `split_method arguments`. Returns right
strip after splitting.
In case when strip being split have effects, these will be split too, so
no invalid state should be created.
Selection is not handled, this is by design up to user.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D11926
|
|
We need to be more strict about trying to retrieve a list of vertex group
names from objects now, as only three object types support them.
This commit adds a check for vertex group support in a few places, the
data transfer operator/modifier, copying vertex groups to selected
objects, and the vertex group remove and clear functions.
Differential Revision: https://developer.blender.org/D11947
|
|
When a vertex group is used to limit the influence of the modifier
to a subset of vertices, binding data for vertices with zero weight
is not needed. This wastes memory, disk space and CPU cycles.
If the vertex group contents is known to be final and constant,
it is reasonable to optimize by only storing data group vertices.
This has to be an option in case the group can change.
Supporting this requires adding a vertex index field and spliting
the vertex count into mesh and bind variants, but both happen to
fit in available padding. The old numverts field is renamed to the
new bound vertex count field to maintain the array length invariant.
Versioning is used to initialize the other new fields.
If a file with sparse binding is opened in an old blender version,
it is corrupted into a non-sparse bind with vertex count mismatch,
preventing the modifier from working until rebind.
Differential Revision: https://developer.blender.org/D11924
|
|
|
|
|
|
|
|
The asset view UI template is a mini-version of the Asset Browser that
can be placed in regular layouts, regions or popups. At this point it's
made specifically for placement in vertical layouts, it can be made more
flexible in the future.
Generally the way this is implemented will likely change a lot still as
the asset system evolves.
The Pose Library add-on will use the asset view to display pose
libraries in the 3D View sidebar.
References:
* https://developer.blender.org/T86139
* https://code.blender.org/2021/06/asset-browser-project-update/#what-are-we-building
* https://code.blender.org/2021/05/pose-library-v2-0/#use-from-3d-viewport
Notes:
* Important limitation: Due to the early & WIP implementation of the
asset list, all asset views showing the same library will show the
same assets. That is despite the ID type filter option the template
provides. The first asset view created will determine what's visible.
Of course this should be made to work eventually.
* The template supports passing an activate and a drag operator name.
The former is called when an asset is clicked on (e.g. to apply the
asset) the latter when dragging (e.g. to .blend a pose asset). If no
drag operator is set, regular asset drag & drop will be executed.
* The template returns the properties for both operators (see example
below).
* The argument list for using the template is quite long, but we can't
avoid that currently. The UI list design requires that we pass a
number of RNA or custom properties to work with, that for the Pose
Libraries should be registered at the Pose Library add-on level, not
in core Blender.
* Idea is that Python scripts or add-ons that want to use the asset view
can register custom properties, to hold data like the list of assets,
and the active asset index. Maybe that will change in future and we
can manage these internally.
As an example, the pose library add-on uses it like this:
```
activate_op_props, drag_op_props = layout.template_asset_view(
"pose_assets",
workspace,
"active_asset_library",
wm,
"pose_assets",
workspace,
"active_pose_asset_index",
filter_id_types={"filter_action"},
activate_operator="poselib.apply_pose_asset",
drag_operator="poselib.blend_pose_asset",
)
drag_op_props.release_confirm = True
drag_op_props.flipped = wm.poselib_flipped
activate_op_props.flipped = wm.poselib_flipped
```
|
|
So far all UI lists had to be defined in Python, this makes it possible
to define them in C as well. Note that there is a whole bunch of special
handling for the Python API that isn't there for C. I think most
importantly custom properties support, which currently can't be added
for C defined UI lists.
The upcoming asset view UI template will use this, which needs to be
defined in C.
Adds a new file `interface_template_list.cc`, which at this point is
mostly a dummy to have a place for the `ED_uilisttypes_ui()` definition.
I plan a separate cleanup to move the UI-list template to that file.
|
|
Makes it possible to create tooltips for UI list rows, which can be
filled in .py scripts, similar to how they can extend other menus. This
is used by the (to be committed) Pose Library add-on to display pose
operations (selecting bones of a pose, blending a pose, etc).
It's important that the Python scripts check if the UI list is the
correct one by checking the list ID.
For this to work, a new `bpy.context.ui_list` can be checked. For
example, the Pose Library add-on does the following check:
```
def is_pose_asset_view() -> bool:
# Important: Must check context first, or the menu is added for every kind of list.
list = getattr(context, "ui_list", None)
if not list or list.bl_idname != "UI_UL_asset_view" or list.list_id != "pose_assets":
return False
if not context.asset_handle:
return False
return True
```
|
|
This is more of a first-pass refactor for the UI list template. More
improvements could be done, but that's better done separately. Main
purpose of this is to make the UI list code more manageable and ready
for the asset view template.
No functional changes for users.
* Split the huge template function into more manageable functions, with
clear names and a few structs with high coherency.
* Move runtime data management to the template code, with a free
callback called from BKE. This is UI data and should be managed at
that level.
* Replace boolean arguments with bit-flags (easily extendable and more
readable from the caller).
* Allow passing custom-data to the UI list for callbacks to access.
* Make list grip button for resizing optional.
* Put logic for generating the internal UI list identifier (stored in
.blends) into function. This is a quite important bit and a later
commit adds a related function. Good to have a clear API for this.
* Improve naming, comments, etc.
As part of further cleanups I'd like to move this to an own file.
|
|
New function `BKE_pose_apply_action_all_bones()`, which will be
necessary for the upcoming pose library v2.0.
This renames the function `BKE_pose_apply_action` to
`BKE_pose_apply_action_selected_bones`, to reflect that it only works on
selected bones, to contrast it to the new function.
|
|
Adds the following to `bpy.types.FileSelectEntry`:
* `id_type`: The data-block type the file represenets, if any.
* `local_id`: The local data-block it represents, if any (assets only).
And the following to `bpy.types.AssetHandle`:
* `local_id`: The local data-block the asset represents, if any.
This kind of information and the references are important for asset related
operators and UIs. They will be used by upcoming Pose Library features.
|
|
Implements a basic, WIP version of the asset list. This is needed to
give the asset view UI template asset reading and displaying
functionality.
See:
* Asset System: Data Storage, Reading & UI Access - https://developer.blender.org/T88184
Especially the asset list internals should change. It uses the
File/Asset Browser's `FileList` API, which isn't really meant for access
from outside the File Browser. But as explained in T88184, it does a lot
of the stuff we currently need, so we (Sybren Stüvel and I) decided to
go this route for now. Work on a file-list rewrite which integrates well
with the asset system started in the `asset-system-filelist` branch.
Further includes:
* Operator to reload the asset list.
* New `bpy.types.AssetHandle.get_full_library_path()` function, which
gets the full path of the asset via the asset-list.
* Changes to preview loading to prevent the preview loading job to run
eternally for asset views. File Browsers have this issue too, but
should be fixed separately.
|
|
With temporary I mean that this is not intended to be part of the
eventual asset system design. For that we are planning to have an
`AssetRepresentation` instead, see T87235. Once the `AssetList` is
implemented (see T88184), that would be the owner of the asset
representations.
However for the upcoming asset system, asset browser, asset view and
pose library commits we need some kind of asset handle to pass around.
That is what this commit introduces.
Idea is a handle to wrap the `FileDirEntry` representing the asset, and
an API to access its data (currently very small, will be extended in
further commits). So the fact that an asset is currently a file
internally is abstracted away. However: We have to expose it as file in
the Python API, because we can't return the asset-handle directly there,
for reasons explained in the code. So the active asset file is exposed
as `bpy.context.asset_file_handle`.
|
|
This per-workspace active asset library will be used by the asset views
later. Note that Asset Browsers have their own active asset library,
overriding the one from the workspace.
As part of this the `FileSelectAssetLibraryUID` type gets replaced by
`AssetLibraryReference` which is on the asset level now, not the
File/Asset Browser level. But some more work is needed to complete that,
which is better done in a separate commit.
This also moves the asset library from/to enum-value logic from RNA to
the editor asset level, which will later be used by the asset view.
|
|
Update vertex weights between simulation steps if they have changed.
This allows for animated vertex weights in the cloth sim.
Reviewed By: Sebastian Parborg
Differential Revision: http://developer.blender.org/D11640
|
|
Match the same shortcut for the 3D view & UV editor.
|
|
This shows the text as part of the assertion message.
|
|
|
|
This adds id_properties_clear() and id_properties_ensure() functions
to RNA structs. This is meant as an initial change based on discussion
in review of D9697. However, they may be useful in other situations.
The change requires refactoring the internal idproperties callback to
return a pointer to the IDProperty pointer, which actually turns out
to be quite a nice cleanup.
An id_properties attribute could be added in the future potentially.
Differential Revision: https://developer.blender.org/D11908
|
|
properties.
Non-pointer-like properties that are not editable should never generate
override operations.
While harmless (those would never be applied back anyway), better not
clutter override operations list, and also enjoy the symbolic
performances improvement here.
NOTE: Pointer-like properties (pointers and collections) remain
processed as usual here since they usually imply recursivity. We could
make an exception to the exception for ID pointers, but for now I don't
think this is worth it.
|
|
Found loading a cycles-x .blend file saved with different integer values for
enum items.
|
|
This commit moves the storage of `bDeformGroup` and the active index
to `Mesh`, `Lattice`, and `bGPdata` instead of `Object`. Utility
functions are added to allow easy access to the vertex groups given
an object or an ID.
As explained in T88951, the list of vertex group names is currently
stored separately per object, even though vertex group data is stored
on the geometry. This tends to complicate code and cause bugs,
especially as geometry is created procedurally and tied less closely
to an object.
The "Copy Vertex Groups to Linked" operator is removed, since they
are stored on the geometry anyway.
This patch leaves the object-level python API for vertex groups in
place. Creating a geometry-level RNA API can be a separate step;
the changes in this commit are invasive enough as it is.
Note that opening a file saved in 3.0 in an earlier version means
the vertex groups will not be available.
Differential Revision: https://developer.blender.org/D11689
|
|
|
|
This commit adds a curve primitive node for creating squares,
rectangles, trapezoids, kites, and parallelograms. It also includes
a mode where the four points are just vector inputs.
Differential Revision: https://developer.blender.org/D11665
|
|
The node group interface panels were still implemented in C.
Now they ported over to python for easier maintenance.
Differential Revision: https://developer.blender.org/D11834
|
|
Use the term `ensure` as existing data is used when present.
|
|
|
|
Was caused by recent clange sequences_all iterator in RNA (D11793).
|
|
|
|
|
|
Use "Snap Playhead to Strips" option to enable playhead snapping.
Change behavior of CTRL key to invert snapping similar to transform operator.
Currently this option is disabled by default. It makes editing quite unpleasant
for me personally, but ideally I should gather feedback from more users.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D11745
|
|
This field was used to reference "parent" meta strips in `sequences_all`
RNA collection iterator functions.
Use `SeqIterator` wrapped in `BLI_Iterator` to iterate over elements.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D11793
|
|
The menu lists all socket types that are valid for the node tree.
Changing a socket type updates all instances of the group and keeps
existing links to the socket.
If changing the socket type leads to incorrect node connections the
links are flagged as invalid (red) and ignored but not removed. This is
so users don't lose information and can then fix resulting issues.
For example: Changing a Color socket to a Shader socket can cause an
invalid Shader-to-Color connection.
Implementation details:
The new `NODE_OT_tree_socket_change_type` operator uses the generic
`rna_node_socket_type_itemf` function to list all eligible socket types.
It uses the tree type's `valid_socket_type` callback to test for valid
types. In addition it also checks the subtype, because multiple RNA
types are registered for the same base type. The `valid_socket_type`
callback has been modified slightly to accept full socket types instead
of just the base type enum, so that custom (python) socket types can be
used by this operator.
The `nodeModifySocketType` function is now called when group nodes
encounter a socket type mismatch, instead of replacing the socket
entirely. This ensures that links are kept to/from group nodes as well
as group input/output nodes. The `nodeModifySocketType` function now
also takes a full `bNodeSocketType` instead of just the base and subtype
enum (a shortcut `nodeModifySocketTypeStatic` exists for when only
static types are used).
Differential Revision: https://developer.blender.org/D10912
|
|
Collection"
Note that this name is essentially never used anywhere, besides as 'information'
mostly accessible from python console. Those embedded IDs are not in Main, so they
are not accessible by name ever, and mostly unusable from animation perspective
(either drivers or fcurves).
Therefore, no breakage is expected in user scripts or addons, nor when
loading in older versions of Blender.
Reviewed By: dfelinto, brecht
Differential Revision: https://developer.blender.org/D11812
|
|
When introduced in {rB61050f75b13e} this was actually working (meaning
it checked the Outliner OB_RESTRICT_RENDER flag and skipped the object if
desired).
Behavior has since then been commented in rBae6e9401abb7 and apparently
refactored out in rB2917df21adc8.
If checked, it seemed to be working (objects marked non-renderable in
the Outliner were pruned from the export), however unchecking that
option did not include them in the export.
Now it changed - for the worse if you like - in rBa95f86359673 which
made it so if "Renderable Objects" only is checked, it will still export
objects invisible in renders. So since we now have the non-functional
option with a broken/misleading default, it is better to just remove it
entirely.
In fact it has been superseeded by the "Visible Objects" option (this
does the same thing: depsgraph is evaluated in render mode) and as a
second step (and to make this even clearer) a choice whether
Render or Viewport evaluation is used can be added (just like the USD
exporter has). When that choice is explicit, it's also clear which
visibility actually matters.
This is breaking API usage, should be in release notes.
ref. T89594
Maniphest Tasks: T89594
Differential Revision: https://developer.blender.org/D11808
|
|
This node creates a poly spline line in one of 2 modes:
- Line between two points
- Start Point, Direction, and Length
Both modes create splines with only start and endpoints.
A resample node can be used afterward to increase the point count.
Differential Revision: https://developer.blender.org/D11769
|
|
This patch adds a very simple node that explicitly converts a float to
an int. While this may seem redundant, it would offer 2 benefits to the
current requirement to use implicit float conversions:
1. It makes the node tree's intent more clear and self-documenting
(especially if changes in the future require integer inputs).
2. It eliminates undefined behavior in current/future nodes from float
inputs by guaranteeing that the input is an integer.
The node offers a variety of rounding techniques to make it more flexible.
Differential Revision: https://developer.blender.org/D11700
|
|
|
|
|
|
This adds a viewer node similar to the one in the compositor.
The icon in the headers of nodes is removed because it served
the same purpose and is not necessary anymore.
Node outputs can be connected to the active viewer using
ctrl+shift+LMB, just like in the compositor. Right now this collides
with the shortcut used in the node wrangler addon, which will
be changed separately.
As of now, the viewed geometry is only visible in the spreadsheet.
Viewport visualization will be added separately.
There are a couple of benefits of using a viewer node compared
to the old approach with the icon in the node header:
* Better support for nodes that have more than one geometry output.
* It's more consistent with the compositor.
* If attributes become decoupled from geometry in the future,
the viewer can have a separate input for the attribute to visualize.
* The viewer node could potentially have visualization settings.
* Allows to keep "visualization points" around by having multiple
viewer nodes.
* Less visual clutter in node headers.
Differential Revision: https://developer.blender.org/D11470
|
|
|
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
|
|
Add a new transformation space choice for bone constraints, which
represent the local transformation of the target bone in the constraint
owner's local space.
The use case for this is transferring the local (i.e. excluding the
effect of parents) motion of one bone to another one, while ignoring
the difference between their rest pose orientations.
The new option replaces the following setup:
* A `child` bone of the `target`, rotated the same as `owner` in rest pose.
* A `sibling` bone of the `target`, positioned same as `child` in rest
pose and using Copy Transforms in World Space from `child`.
* The `owner` bone constraint uses Local Space of `sibling`.
(This analogy applies provided both bones use Local Location)
Differential Revision: https://developer.blender.org/D9493
|