3D Pie menu: Support pivotbottom for selected objects #105105

Merged
Pratik Borhade merged 2 commits from PratikPB2123/blender-addons:105091-pie-menu into main 2024-01-12 12:01:30 +01:00
Showing only changes of commit 57bc1cae5d - Show all commits

View File

@ -59,19 +59,20 @@ class PIE_OT_PivotBottom(Operator):
def execute(self, context): def execute(self, context):
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True) bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)
bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY') bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
o = context.active_object
init = 0 init = 0
for x in o.data.vertices: for ob in context.selected_objects:
if init == 0: for x in ob.data.vertices:
a = x.co.z if init == 0:
init = 1 a = x.co.z
elif x.co.z < a: init = 1
a = x.co.z elif x.co.z < a:
a = x.co.z
for x in o.data.vertices: for x in ob.data.vertices:
x.co.z -= a x.co.z -= a
o.location.z += a ob.location.z += a
return {'FINISHED'} return {'FINISHED'}