Rather than recalculate it - How can I read the Transform Median X,Y,Z that is displayed in the Transform Median Dialog.Screen Shot of Transform Median.

The code to calculate it is straight forward but I'm just curious as to "where this data is coming from"?. It's right there and I can't get my pythonic hands on it.

The tool help for it is bpy.ops.ui.editsource but the documentation doesn't reveal anything.

Should I be looking in the BMesh class?

Similarly: In object mode - the Transform Location is that of the last selected object. But the "pop up tool tip" at least gives me the "Slot Info"

Popup reveals the slots for bpy.data.objects["Cube"].location 0, 1, and 2.


I didn't see a response but this is the code that I used: I think the original author was CodeManX

    def calcpivotpoint(theobject):
        ob = theobject
        me = ob.data    

        bm = bmesh.from_edit_mesh(me)
        verts_sel = [v.co for v in bm.verts if v.select]

        pivot = sum(verts_sel, Vector()) / len(verts_sel)

        return ob.matrix_world @ pivot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.