3 Commits
Author SHA1 Message Date
jonas.holzman c7df358fe8 Merge pull request 'fix: shape geometry link behavior.' (#2) from swann.martinez/rig_picker:fix-collection-link-for-create-shape into master
Before the patch, shapes were systematically linked to the scene's main collection (Maybe that's the way it's supposed to be?), regardless of the collection selection. The patch changes this to link geometry only if no canvas collection is selected.

Reviewed-on: #2
Reviewed-by: Jonas Holzman <jonas@autourdeminuit.com>
2025-06-27 16:16:58 +02:00
s.martinez 21c4fe2117 clean: change typo 2025-06-24 18:08:40 +02:00
s.martinez f35fbb95b8 fix: shape geometry link behavior.
Before the patch, shapes were systematically linked to the scene's main collection, regardless of the collection selection. The patch changes this to link geometry only if no canvas collection is selected.
2025-06-24 17:59:53 +02:00
+3 -4
View File
@@ -48,11 +48,10 @@ class RP_OT_create_shape(Operator):
mesh.from_pydata(verts, edges, faces)
for col in bpy.data.collections:
if col.rig_picker.link_shape:
picker_selected_cols = [col for col in bpy.data.collections if col.rig_picker.link_shape]
for col in picker_selected_cols or [scn.collection]:
col.objects.link(ob)
else:
scn.collection.objects.link(ob)
ob.location.z = 0.05
ob.location.x = offset