Uify Widget – automatically layout 3d objections on a UI


Here’s a widget I create that layouts out 3d objects on a 2d QWidget. It allows you to quickly layout selected objects in a UI to use as buttons. It could be useful if you have a bunch of controls on a character and you need them organized quickly and on the fly. I used the M3dView to get the active viewport’s view and projection matrix and apply those to the 3d transforms to create 2d points. Then I remap the points into Qt’s coordinate system, turn them into rectangles, and apply some extra matrices (for panning and zooming) before they are drawn in a custom paint event.

Download the widget + an example here