{"id":424,"date":"2016-03-11T16:24:02","date_gmt":"2016-03-12T00:24:02","guid":{"rendered":"http:\/\/www.toadstorm.com\/blog\/?p=424"},"modified":"2016-03-11T16:24:02","modified_gmt":"2016-03-12T00:24:02","slug":"blanking-the-viewport-in-maya","status":"publish","type":"post","link":"https:\/\/www.toadstorm.com\/blog\/?p=424","title":{"rendered":"blanking the viewport in maya"},"content":{"rendered":"<p>A while ago I <a href=\"https:\/\/www.toadstorm.com\/blog\/?p=274\">posted<\/a> about how to manage viewports in Maya in order to prevent the screen from redrawing while doing a bake or Alembic export, which slows things down considerably. It turns out there&#8217;s a way easier way to handle this, thanks to a hidden (of course) MEL variable that Maya docs don&#8217;t seem to mention anywhere.<\/p>\n<p>The command is:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\npaneLayout -e -manage false $gMainPane\r\n<\/pre>\n<p>The variable $gMainPane is a shortcut that just refers to Maya&#8217;s main viewport window. You can set the &#8220;managed&#8221; state of the entire pane to False, which simply disables refreshing it until you set it back to True. Just one line of code!<\/p>\n<p>Here&#8217;s another, even easier method, that&#8217;s actually part of the Python cmds module:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\ncmds.refresh(suspend=True)\r\n<\/pre>\n<p>There&#8217;s a catch, though. From the docs on the refresh() command:<\/p>\n<blockquote><p>Suspends or resumes Maya&#8217;s handling of refresh events. Specify &#8220;on&#8221; to suspend refreshing, and &#8220;off&#8221; to resume refreshing. Note that resuming refresh does not itself cause a refresh &#8212; the next natural refresh event in Maya after &#8220;refresh -suspend off&#8221; is issued will cause the refresh to occur. Use this flag with caution: although it provides opportunities to enhance performance, much of Maya&#8217;s dependency graph evaluation in interactive mode is refresh driven, thus use of this flag may lead to slight solve differences when you have a complex dependency graph with interrelations.<\/p><\/blockquote>\n<p>So make sure you test each method with different kinds of bakes before you commit to any one solution.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A while ago I posted about how to manage viewports in Maya in order to prevent the screen from redrawing while doing a bake or Alembic export, which slows things down considerably. It turns out there&#8217;s a way easier way to handle this, thanks to a hidden (of course) MEL [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,15,6],"tags":[],"_links":{"self":[{"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/424"}],"collection":[{"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=424"}],"version-history":[{"count":1,"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/424\/revisions"}],"predecessor-version":[{"id":425,"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/424\/revisions\/425"}],"wp:attachment":[{"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}