Thursday, May 12, 2011

Final Project Turn In - Finished Project

So, this blog post will link to my final .zip packaged that I've finished for my final project. In my project, I have made an animation that demonstrates all 12 animation principles first created by the Disney animators. For the project, I have linked 4 programs: Maya (to make the flour sack and animate it) the cygwin bash terminal ffmpeg (to make the movie) imagemagick (to add the frame count and titles) In Maya, I open the blank flour sack, animate it using a .mel script, and save the scene. Next, I run from the terminal I run the maya render executable file to render out my frames of the flour sack. With image magick, I add titles for the animation principles and the frame count. Then with ffmpeg, I make a new movie out of the changed frames. This is all run from the terminal with one script, calling to other scripts. This a sample of the animation the script produces:





And here is the link to my .zip file that I've saved in dropbox:

FinalLink

It contains:

A README.txt file explaining the contents
The original maya file to be worked on
A script that scripts the animation with mel
A pipeline script that puts it all together
A finished video of what the output should be

These scripts will work from the directory, but where I have direct file paths, they must be changed to match to where:
You put the orginal maya file
Where your maya.exe file is located
Where your scripts are located

Friday, May 6, 2011

Assignment 4.3 Final Turn In Blog

So here's the link to my final .zip folder in dropbox:

Tess's Final

The .zip file includes the history from my bash terminal, a maya file with my blank flour sack, a .mel script that animates the file, a README text file, and a bash script that runs it all.

I originally wanted to do a more elaborate animation, but getting all of the programs to run together in the bash terminal took up most of my time.

This project was most useful to me regarding adding a frame counter to my animations. In my version of maya, I can't seem to playblast. The scenes will render, but it will not playblast which gives me a convinient frame counter. It only gives me a black screen. This project will open maya, animate the flour sack, add a frame counter, and assemble the frames into a movie. With larger files, the codec screws up the resolution. For this project to be the most useful to me, I would need to figure out the best codec so my high quality renders don't get become fragmented.

Wednesday, May 4, 2011

Final Project Trial and Error 3

After being able to run the animation and render it from Maya, I tried to get it to run from bash, that way I can demonstrate the two programs communicating. I was able to do so by giving it this command:

./maya.exe -command 'source "C:/Program Files/Autodesk/Maya2011/bin/SquastTes
t.mel"';./Render.exe -r mr -s 1 -e 35 -b 1 C:/Users/Tess/Desktop/IFDM210/TestTe
stAgainTest.ma

Now it will open a fresh flour sack without animation, animate it to do a squash and stretch, save it out as a .ma file, then the user has to exit out of maya. Then the render process starts, and it batch renders out the files.

My next move is going to be to find the images, put them in a list, mogrify them with image magick, and combine them into a new movie with ffmpeg.

Final Trail and Error 2

Ok, so still having the saving problems. I've figured out how to get the batchRender command to work in the mel script, but it needs a file to source. I can't find a way to say THIS is the file I want to render. I can give it the current path:



batchRender -f "C:/Users/Tess/Desktop/IFDM210/TestTest.mb";



but it'll render the file without the changed animation. Which brings us back to the saving problem.

Next, I've tried to source the script so I can call it. However, the default place to source the script is


C:\Users\Tess\Documents\maya\2011-x64\prefs\scriptEditorTemp


And if I try to put the file in there, it gets deleted the next time I try to source the file.
Next I tried to use the mel command
source: (then it goes directly to the SwashAndStretchy file)
That was able to use the Swash command, but then it wasn't able to call it again after that once sourcing.

Wait, I got it! In order to get it to save properly, I had to use the command :

source "C:/Program Files/Autodesk/Maya2011/bin/SwashAndStretchy.mel"


Then it was able to open the blank flour sack, animate it, save it out, and render it out. From here I'm going to try to run it through the bash terminal.

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.

Assignment 4.3

So, here is the completed assignment 4.3 or a finishing up of the test from the last class. In the command line, you enter the name of the script (for example, ./makeNewMovie.sh), then it takes the command line arguments of what movie you want to run the script on and another parameter of whether you want the frame counter. The user has to put in that parameter of whether they want the frame counter, so if they don't they should put something like no. If you don't give the command any arguments, it'll spit back "I need a movie to use" and exit the script. The user can put in any mogrify command they want, such as -charcoal 5.

#!/usr/bin/bash

#These are the command line arguments that the user puts in when calling the script
#This is the name of the movie you give
MOVIE=$1
#This is the mogrify or convert command you want
STRING=$2
#This is where the user tells if they want the frame counter. They have to put frame in the command if they want to use it. They have to write something
TEXT=$3
#If the command line has no arguments...
if [ $# == 0 ];
then
echo I need a movie to use
exit
fi
#It tells the user it needs a movie and exits
echo Processing the video called: $MOVIE

#This will streamline the image files it dumps out
FRAMEPRE=${MOVIE}-frame-
echo I will call the frames this:- $FRAMEPRE -with frame numbers following

#This dumps out the frames
ffmpeg -i ${MOVIE} -r 24 -s 640x360 -f image2 ${FRAMEPRE}%04d-expelled.png

#This compiles the dumped frames into a variable
FRAMES=`ls *expelled.png`
#Set I that we will increment in the loop
I=1

#For every object in the variable FRAMES
for FRAME in $FRAMES
#start the loop
do
#This does what the person wants to do, any string is fine. Imagemagick is preferable
${STRING} $FRAME
#This is for the third argument. The user has to put in SOMETHING or it won't work. They could put no for example.
if [ $TEXT == frame ];
then
#This puts the frame counter on
mogrify -pointsize 16 -font courier -annotate +50+50 "Frame ${I}" $FRAME
fi
#This renames all the expelled names to flop names
NFN=`printf "${FRAMEPRE}%04d-flop.png" $I`
#Increment the loop
I=$(($I+1))
#This moves FRAME to NFN or new file name
mv $FRAME $NFN
#This converts the .png to jpg. I found this gave the movie the best quality than just doing .jpg Just .png gives weird blue fragments
convert $NFN $NFN.jpg
echo converting frame $I
#cp $FRAME $NFN
done

#This compiles the movie at a rate of 24fps
ffmpeg -f image2 -r 24 -s 640x360 -i ${FRAMEPRE}%04d-flop.png.jpg RedoneMovie.mov
#These 2 remove all of the images, so you are left with just the original movie and the changed movie
rm *.png
rm *.png.jpg

This is the original movie that I put in (an image of it).


And this is the movie that the script made.

Monday, April 25, 2011

Final Project: Animation Scripting

So, for my final project I'm thinking about demonstrating the 12 principles of animation through running a script in maya that animates this flour sack rig I have, then it renders these frames out to a folder in my computer. ffmpeg then takes those files, writes something on them, (most likley using the mogrify command) and compiles the frames into a movie that I can showcase.

The whole reason I wanted to join IFDM was to become an animator, and the main elements of animation were first devoloped by the original animators at Disney. The principles are:

*Swash and Stretch
*anticipation
*staging
*straight ahead and pose to pose (different processes of animation)
*follow through and overlapping
*arcs
*secondary action
*timing
*exaggeration
*solid drawing
*appeal

I also considered doing a user interface in maya that could help me with some of these animations, but I haven't used one before, so I'm not sure what the goals would be for that.




This was an awesome video I found that describes what I want to demonstrate with the flour sack. This would be a benchmark I would want to compare my results to.