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):
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)
bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
o = context.active_object
init = 0
for x in o.data.vertices:
if init == 0:
a = x.co.z
init = 1
elif x.co.z < a:
a = x.co.z
for ob in context.selected_objects:
for x in ob.data.vertices:
if init == 0:
a = x.co.z
init = 1
elif x.co.z < a:
a = x.co.z
for x in o.data.vertices:
x.co.z -= a
for x in ob.data.vertices:
x.co.z -= a
o.location.z += a
ob.location.z += a
return {'FINISHED'}