{"id":495,"date":"2009-12-05T02:06:24","date_gmt":"2009-12-05T00:06:24","guid":{"rendered":"http:\/\/www.svenneve.com\/?p=495"},"modified":"2009-12-16T16:19:52","modified_gmt":"2009-12-16T14:19:52","slug":"maya-open-reference-in-new-instance-of-maya","status":"publish","type":"post","link":"http:\/\/www.svenneve.com\/?p=495","title":{"rendered":"Maya : open Reference in new instance of Maya."},"content":{"rendered":"<p>Ever work with lots of references in a scene and you keep opening new instances of Maya to tweak a referenced file as a\u00a0workaround trying to avoid using the save reference edits because of the (well justified) fear of wrecking a perfectly good referenced asset?<\/p>\n<p>Well, no more, here&#8217;s a way to add a new feature to the RMB menu and File menu in the Reference Editor that opens the currently selected reference in a new instance of Maya.<\/p>\n<p>Before you start doing this, know that it involves changing the MAYA_LOCATION\/scripts\/other\/referenceEditorPanel.mel file that is an essential part of Maya, so, <span style=\"color: #ff6600;\"><strong>BACKUP referenceEditorPanel.mel<\/strong><strong> BEFORE PROCEEDING<\/strong><\/span>.<\/p>\n<p>If you screw up files that are an integral part of Maya and you don&#8217;t have extra workstations with Maya installs that can be used to restore those files should you screw up, there&#8217;s only one way to restore those files, and that is a reinstall of Maya.<\/p>\n<p>The procedure is very simple,<br \/>\nOpen up the MAYA_LOCATION\/scripts\/other\/referenceEditorPanel.mel file in your favourite script editor.<br \/>\nGo to the end of line 214 (Maya 2009 and 2010, x86 and x64 on Windows) and create a new line.<br \/>\nCopy the folowing piece of code.<\/p>\n<pre lang=\"perl\" colla=\"+\">\t\t\/\/ START HOS EXTRAS\r\n\t\t\/\/ in Maya 2010 add at the end of line 214 of referenceEditorPanel.mel\r\n\t\tmenuItem -divider true;\r\n\r\n\t\tmenuItem\r\n\t\t\t-label (\"Edit in New instance\")\r\n\t\t\t-annotation (\"Opens a new instance of Maya with the file\")\r\n\t\t\t-command (\"string $referenceFile[] = `sceneEditor -q -si $gReferenceEditorPanel`;\" + \"system(\\\"start \\\\\\\"\\\" + getenv(\\\"MAYA_LOCATION\\\") + \\\"\/bin\/maya.exe\\\\\\\" \\\\\\\"\\\"+$referenceFile[0]+\\\"\\\\\\\"\\\");\")\r\n\r\n\t\t\treferenceEdInstance;\r\n\r\n\t\t\/\/ END HOS EXTRAS<\/pre>\n<p>And paste it at the newly created line.<br \/>\nSave, start Maya, and you are ready to go.<\/p>\n<p>That&#8217;s it.<\/p>\n<p>edit : I just noticed that WordPress&#8217; auto formatting screwed with the code, fixed it now (if you tried this and it didn&#8217;t work, WordPress was the reason as to why.<\/p>\n<p><a href=\"http:\/\/www.svenneve.com\/wp-content\/2009\/12\/ref_script_editor_01.png\" rel=\"lightbox[495]\"><img loading=\"lazy\" class=\"size-thumbnail wp-image-504 alignnone\" title=\"ref_script_editor_01\" src=\"http:\/\/www.svenneve.com\/wp-content\/2009\/12\/ref_script_editor_01-120x116.png\" alt=\"ref_script_editor_01\" width=\"120\" height=\"116\" srcset=\"http:\/\/www.svenneve.com\/wp-content\/2009\/12\/ref_script_editor_01-120x116.png 120w, http:\/\/www.svenneve.com\/wp-content\/2009\/12\/ref_script_editor_01-300x290.png 300w, http:\/\/www.svenneve.com\/wp-content\/2009\/12\/ref_script_editor_01.png 800w\" sizes=\"(max-width: 120px) 100vw, 120px\" \/><\/a><a href=\"http:\/\/www.svenneve.com\/wp-content\/2009\/12\/referencesEII_01.png\" rel=\"lightbox[495]\"><img loading=\"lazy\" class=\"alignnone size-thumbnail wp-image-502\" title=\"referencesEII_01\" src=\"http:\/\/www.svenneve.com\/wp-content\/2009\/12\/referencesEII_01-120x83.png\" alt=\"referencesEII_01\" width=\"120\" height=\"83\" srcset=\"http:\/\/www.svenneve.com\/wp-content\/2009\/12\/referencesEII_01-120x83.png 120w, http:\/\/www.svenneve.com\/wp-content\/2009\/12\/referencesEII_01-300x209.png 300w, http:\/\/www.svenneve.com\/wp-content\/2009\/12\/referencesEII_01.png 643w\" sizes=\"(max-width: 120px) 100vw, 120px\" \/><\/a><a href=\"http:\/\/www.svenneve.com\/wp-content\/2009\/12\/referencesEII_02.png\" rel=\"lightbox[495]\"><img loading=\"lazy\" class=\"alignnone size-thumbnail wp-image-503\" title=\"referencesEII_02\" src=\"http:\/\/www.svenneve.com\/wp-content\/2009\/12\/referencesEII_02-120x83.png\" alt=\"referencesEII_02\" width=\"120\" height=\"83\" srcset=\"http:\/\/www.svenneve.com\/wp-content\/2009\/12\/referencesEII_02-120x83.png 120w, http:\/\/www.svenneve.com\/wp-content\/2009\/12\/referencesEII_02-300x209.png 300w, http:\/\/www.svenneve.com\/wp-content\/2009\/12\/referencesEII_02.png 643w\" sizes=\"(max-width: 120px) 100vw, 120px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever work with lots of references in a scene and you keep opening new instances of Maya to tweak a referenced file as a\u00a0workaround trying to avoid using the save reference edits because of the (well justified) fear of wrecking a perfectly good referenced asset? Well, no more, here&#8217;s a way to add a new&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[19,18],"tags":[23,94,16],"_links":{"self":[{"href":"http:\/\/www.svenneve.com\/index.php?rest_route=\/wp\/v2\/posts\/495"}],"collection":[{"href":"http:\/\/www.svenneve.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.svenneve.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.svenneve.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.svenneve.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=495"}],"version-history":[{"count":36,"href":"http:\/\/www.svenneve.com\/index.php?rest_route=\/wp\/v2\/posts\/495\/revisions"}],"predecessor-version":[{"id":571,"href":"http:\/\/www.svenneve.com\/index.php?rest_route=\/wp\/v2\/posts\/495\/revisions\/571"}],"wp:attachment":[{"href":"http:\/\/www.svenneve.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.svenneve.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=495"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.svenneve.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}