Move objects from one collection into another - #62
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds functionality to move Blender objects between collections by introducing a new move_objects function. The function supports moving single objects or lists of objects by unlinking them from their current collections and linking them to a target collection.
- Added
move_objectsfunction to handle single or multiple object transfers between collections - Exported the new function in the package's public API
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| databpy/collection.py | Implements the move_objects function that unlinks objects from current collections and links them to a target collection |
| databpy/init.py | Adds move_objects to the module's public exports |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The co-pilot suggestions seem good if you could address them. I would additionally rename the function to something else as currently |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Changes applied! |
|
Thanks, will also need you to add a couple of tests and also fix the linting issues that have been raised by |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62 +/- ##
==========================================
+ Coverage 90.57% 90.65% +0.08%
==========================================
Files 13 13
Lines 785 792 +7
==========================================
+ Hits 711 718 +7
Misses 74 74 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
better late then never, just added tests and linting also got fixed. There is one error in the tests for blender 5.1, but I think that's unrelated to this pr. × No solution found when resolving dependencies:
╰─▶ Because only the following versions of bpy are available:
bpy<5.1.dev0
bpy==5.1.0b0
bpy>5.2.dev0
and bpy==5.1.0b0 has no wheels with a matching Python implementation tag
(e.g., `cp311`), we can conclude that bpy==5.1.* cannot be used.
And because you require bpy==5.1.*, we can conclude that your
requirements are unsatisfiable.
hint: You require CPython 3.11 (`cp311`), but we only found wheels for
`bpy` (v5.1.0b0) with the following Python implementation tag: `cp313` |
|
I'm going to bump versions and set up databpy |
Move objects from one collection into another, like this:
See here:
Screen.Recording.2025-11-17.at.15.55.03.mp4
Developed using this notebook: