Tuesday, May 3, 2011

Final Project trial and error 1

Ok, so I am trying to run a mel script through cygwin. So far I can open maya and the mel script that gives me the first principle: squash and stretch. It opens maya though, and I'm hoping to run the script through maya without actually opening it because it takes a while to open the application. My main problem is when I try to use the function "batchRender" When I put BatchRender at the end of my mel script, it gives me the error :

// Warning: The renderer ('base_OpenGL_Renderer') is not a registered renderer. Renderer will not be set. //
// Error: No object matches name: strokeGlobals.wrapH //



I tried giving it the file path to the Render.exe file, but that gave me the same error.
This is what I tried at the end of the file.

BatchRender "C:\Program Files\Autodesk\Maya2011\bin\Render.exe";


Ok, so now I found you can render from the command line itself:
I used the code


./Render.exe -r -mr -s 10 -e 15 -b 1 TessFlourRevise.mb



So, the last part of my problem I'm facing is the proper way to save the file as a new name. I've tried to put this in my script:


file -rename "C:/Users/Tess/Desktop/IFDM210/newSceneName";
file -save -type "mayaBinary";


But when I run it at the same time as my code that animates the file, it doesn't save the right things. When I open the file, it gives me this error:

Maya binary file parse error: : (5) bad block

Looking in online forums, they said it's a bad save and you need to scrap the file.

I'm not sure how I'm saving it wrong. It renames the file and saves it, but it loses all of my data.

Now I'm trying to run both the mel script and the render script in the same file.


#!/usr/bin/bash

./maya.exe SwashAndStretchy.mel

./Render.exe -r mr -s 1 -e 35 -b 1 C:/Users/Tess/Desktop/IFDM210/TestFlourSackBlah.mb


When I run it, I have to exit out of the maya file it opens before the batch render can begin. My question that I'm trying to answer is can you run a mel script affecting the scene in maya without actually having to open the file in maya? And how can I properly save with a mel script without it corrupting the file.

No comments:

Post a Comment