9 Commits

Author SHA1 Message Date
Campbell Barton
2119d271e0 Cleanup: remove "-noaudio" argument in background mode
This is no longer needed as background mode implies -noaudio.
2024-02-14 00:13:38 +11:00
Sybren A. Stüvel
135b42c3c4 Anim: fix Python bone collection unit tests
The bone collection unit tests in Python were failing, but this failure
was not propagated to `ctest` and thus went unnoticed.

Both issues are now fixed.
2024-01-11 14:37:11 +01:00
Sybren A. Stüvel
66cdc112fc Anim: Bone Collections, replace .move_to_parent() with .child_number
Instead of moving bone collections by absolute index, they can now be
moved by manipulating `.child_number`. This is the relative index of the
bone collection within the list of its siblings.

This replaces the much more cumbersome `collections.move_to_parent()`
function. Since that function is now no longer necessary (it's been
replaced by assignment to `.parent` and `.child_number`), it's removed
from RNA. Note that this function was never part of even a beta build of
Blender.
2024-01-05 16:54:46 +01:00
Sybren A. Stüvel
29be81ec23 Anim: make RNA property bone_collection.parent writable
Moving a bone collection to another parent is now possible in Python by
assigning to `bone_collection.parent`.

Thanks to Sergey for the implementation.
2024-01-04 15:41:19 +01:00
Sybren A. Stüvel
65d25ed813 Anim: add bone_collection.bones_recursive property
Add a `bone_collection.bones_recursive` property that returns the set of
bones assigned to that bone collection or any of its child collections.

This property is implemented in Python, as that made it considerably
simpler to create the set semantics.
2024-01-02 16:55:55 +01:00
Sybren A. Stüvel
99d43c9198 Anim: add test for bone_collection.bones
Add Python test for access to `bone_collection.bones`.
2024-01-02 16:55:55 +01:00
Sybren A. Stüvel
bb7468260c Anim: tests, load factory-startup homefile in unit tests
Use `bpy.ops.wm.read_homefile(use_factory_startup=True)` to load the
default 'homefile'. Otherwise Blender will load the saved-as-default file,
which can be quite different from the default startup file.
2024-01-02 16:55:55 +01:00
Sybren A. Stüvel
9f38c6e887 Anim: Add bone_collection.parent accessor to RNA
Add a read-only property `bone_collection.parent` to RNA that returns
the parent bone collection.

This performs two scans of the array (one to find the bone collection's
index, and the other to find the parent index). This might look bad, but
as long as `Object.children` still loops, in Python, over all of
`bpy.data.objects`, this should also be acceptable.
2024-01-02 12:49:04 +01:00
Sybren A. Stüvel
2aac1528f2 Anim: add unit test for armature bone collections
Add a Python unit test that covers some of the armature/bone collections.
Some of these tests cover the same functionality as the C++ tests, albeit
via the Python/RNA API.

Another test was added to check that joining armatures works as expected.
2023-12-29 12:31:38 +01:00