<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic New to MEL: updating a scene for a render without loading maya. in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/new-to-mel-updating-a-scene-for-a-render-without-loading-maya/m-p/4108486#M16895</link>
    <description>Hello,&lt;BR /&gt; &lt;BR /&gt;At the end of the day I'd like to be able to position my camera in various positions while rendering the scene.&lt;BR /&gt;&lt;BR /&gt;Speed is also a factor so I'm very interested to know of MEL scripts can be executed without having to load up Maya.  I know the Maya batch renderer can render scenes without opening the application &amp;amp;#40;./Render -cam persp file&amp;amp;#41;, can the same be done with MEL?&lt;BR /&gt;&lt;BR /&gt;I also cannot animate the scene since the positions of the camera will be user specified while the script is running. &lt;BR /&gt;&lt;BR /&gt;Here's what I have so far for my MEL script:&lt;BR /&gt;&lt;BR /&gt;//I Load up my scene and update the "persp" camera position, save, and quit.&lt;BR /&gt;&lt;PRE&gt;file -import -type "OBJ" -ra true -namespace "test" -pr -loadReferenceDepth "all" "modelname";&lt;BR /&gt;setAttr "persp.translateX" 10;&lt;BR /&gt;setAttr "persp.translateY" 10;&lt;BR /&gt;setAttr "persp.translateZ" 10;&lt;BR /&gt;file -rename "supercool_filename";&lt;BR /&gt;file -f -save -options "v=0" -type "mayaAscii";&lt;BR /&gt;quit -a;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;In a console:&lt;BR /&gt;I run the script:&lt;BR /&gt;./maya -script myScript &lt;BR /&gt;&lt;BR /&gt;I render the scene:&lt;BR /&gt;./Render -cam persp -im uniqueRender -of png supercool_filename.ma &lt;BR /&gt;&lt;BR /&gt;Right now, I have to wait about 13 seconds for the MEL script to run and about 7 seconds for the Render to take place.  The scene only has 18 triangles so I was hoping to get faster times.&lt;BR /&gt;&lt;BR /&gt;Thus, is there way I can shave off a few seconds by not wasting time opening maya just to update the camera position?&lt;BR /&gt;&lt;BR /&gt;Thanks for your patience for a MEL nub.</description>
    <pubDate>Thu, 13 Aug 2009 19:10:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-08-13T19:10:01Z</dc:date>
    <item>
      <title>New to MEL: updating a scene for a render without loading maya.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/new-to-mel-updating-a-scene-for-a-render-without-loading-maya/m-p/4108486#M16895</link>
      <description>Hello,&lt;BR /&gt; &lt;BR /&gt;At the end of the day I'd like to be able to position my camera in various positions while rendering the scene.&lt;BR /&gt;&lt;BR /&gt;Speed is also a factor so I'm very interested to know of MEL scripts can be executed without having to load up Maya.  I know the Maya batch renderer can render scenes without opening the application &amp;amp;#40;./Render -cam persp file&amp;amp;#41;, can the same be done with MEL?&lt;BR /&gt;&lt;BR /&gt;I also cannot animate the scene since the positions of the camera will be user specified while the script is running. &lt;BR /&gt;&lt;BR /&gt;Here's what I have so far for my MEL script:&lt;BR /&gt;&lt;BR /&gt;//I Load up my scene and update the "persp" camera position, save, and quit.&lt;BR /&gt;&lt;PRE&gt;file -import -type "OBJ" -ra true -namespace "test" -pr -loadReferenceDepth "all" "modelname";&lt;BR /&gt;setAttr "persp.translateX" 10;&lt;BR /&gt;setAttr "persp.translateY" 10;&lt;BR /&gt;setAttr "persp.translateZ" 10;&lt;BR /&gt;file -rename "supercool_filename";&lt;BR /&gt;file -f -save -options "v=0" -type "mayaAscii";&lt;BR /&gt;quit -a;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;In a console:&lt;BR /&gt;I run the script:&lt;BR /&gt;./maya -script myScript &lt;BR /&gt;&lt;BR /&gt;I render the scene:&lt;BR /&gt;./Render -cam persp -im uniqueRender -of png supercool_filename.ma &lt;BR /&gt;&lt;BR /&gt;Right now, I have to wait about 13 seconds for the MEL script to run and about 7 seconds for the Render to take place.  The scene only has 18 triangles so I was hoping to get faster times.&lt;BR /&gt;&lt;BR /&gt;Thus, is there way I can shave off a few seconds by not wasting time opening maya just to update the camera position?&lt;BR /&gt;&lt;BR /&gt;Thanks for your patience for a MEL nub.</description>
      <pubDate>Thu, 13 Aug 2009 19:10:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/new-to-mel-updating-a-scene-for-a-render-without-loading-maya/m-p/4108486#M16895</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-13T19:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: New to MEL: updating a scene for a render without loading maya.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/new-to-mel-updating-a-scene-for-a-render-without-loading-maya/m-p/4108487#M16896</link>
      <description>Perhaps you could use the -preRender flag for commandline render, something like&lt;BR /&gt;render -preRender "source myScript" -cam persp -im uniqueRender -of png supercool_filename.ma</description>
      <pubDate>Fri, 21 Aug 2009 09:06:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/new-to-mel-updating-a-scene-for-a-render-without-loading-maya/m-p/4108487#M16896</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-21T09:06:28Z</dc:date>
    </item>
  </channel>
</rss>

