How to recalculate transform and rotation from origin? I'm still fairly new at this, so I might be asking the wrong question, but here's what I'm trying to accomplish.

I made a ring of objects using an array modifier, which I then broke apart into individual objects.  I need to be able to use these as placeholders in code, so my goal is to read the transform and rotation of each one and place an object there.  The problem is, since these were created by breaking apart a composite object, all of them have their transform and rotation as all zeros.  How can I recalculate each object so that its transform is an offset from origin and its rotation is "correct"?  To illustrate:



If you look at the selected cube, what I would like is to recalculate the transform to be whatever the correct offset is from origin, and the rotation should be 30° on the Z axis.
Click Shift+Ctrl+Alt+C, then click Origin to Geometry