{"id":51,"date":"2012-07-29T17:08:24","date_gmt":"2012-07-29T17:08:24","guid":{"rendered":"http:\/\/www.dannywynne.com\/blog\/?p=51"},"modified":"2012-07-29T17:16:49","modified_gmt":"2012-07-29T17:16:49","slug":"uify-widget-automatically-layout-3d-objections-on-a-ui","status":"publish","type":"post","link":"http:\/\/www.dannywynne.com\/blog\/?p=51","title":{"rendered":"Uify Widget &#8211; automatically layout 3d objections on a UI"},"content":{"rendered":"<p><iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"http:\/\/www.youtube.com\/embed\/D5eZxOQC2U0\" frameborder=\"0\" allowfullscreen><\/iframe><br \/>\nHere&#8217;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&#8217;s view and projection matrix and apply those to the 3d transforms to create 2d points. Then I remap the points into Qt&#8217;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. <\/p>\n<p>Download the widget + an example  <a href=\"http:\/\/dannywynne.com\/scripts\/uify.zip\" title=\"timeline_markers\">here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,8],"tags":[3,11,15,5],"class_list":["post-51","post","type-post","status-publish","format-standard","hentry","category-maya-scripting","category-pyqt","tag-maya","tag-maya-python-api","tag-pyqt","tag-python"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/51","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=51"}],"version-history":[{"count":0,"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/51\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}