Wednesday, May 4, 2011

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.

Movie Review: Source Code



source

So, one movie I put of seeing was Source Code. I wanted to see it since it came out a few weeks ago, but I hadn't gotten around to it until yesterday.

Talking about the movie other that the general plot will give away some spoilers. It's the story of a military guy who is forced to go into a dead man's body for the last 8 minutes of his life through the program called the Source Code. If you want to think about it this way: it's basically Groundhog Day where the same 8 minutes on a train about to blow up is relived until he can find the bomber.

I liked the film overall, but it wasn't amazing. It was interesting trying to figure out who the bomber is, but it was a little obvious who it was (my friend who was seeing it with me guessed it during the first time going in the Source Code).

What I really liked about the movie where some of the special effects in it. They were done by a company by Modus X in Montreal, and I liked their effects like the explosions and the train itself. Other than a few scenes, the explosions looked believable. They were a little bit over the top at some parts though.

The movie was enjoyable, but I would not need to watch it a second time to pick up more details like I had to for something like Inception.

Monday, April 11, 2011

Assignment 4.2 - Bash Scripting Tutorials

This next part of the assignment was to find the best scripting tutorial to exectute scripts in the bash shell.



This was the first tutorial I used for creating bash scripts. It's a good tutorial for understanding how to exectute a script in bash. In class I didn't understand the chmod to allow a script to be exectutable, but this explained it nicely.



This tutorial showed how to use while loops in bash along with how to write commands on one line using the semicolon. I followed it and was able to write a script that made a while loop that printed out what it showed in the video.

Here's my history saved to a .txt file:

1 cd /cygdrive/c/Documents\ and\ Settings/Tess

2 ls -la

3 cd Desktop/

4 pwd

5 which bash

6 ls -la

7 bash testcode.sh

8 chmod +x testcode.sh

9 ./testcode.sh

10 ./testcode.sh

11 ./testcode.sh

12 ./testcode.sh

13 history >> history_apr6

14 history >> history_apr6.txt


And this is the code:

#!/usr/bin/bash
let x=1;while [ $x -lt 11 ];do echo "x is : $x";let x=$x+1;sleep 1;done

Wednesday, April 6, 2011

Assignment 4.2 Bash Scripting Part 1

Part 1: Using Bash Shell

So, I was finally able to install cyquin after the upteenth time trying. I had to restart my computer, and when I did that it was able to cleanly install the program. I thought a video would be nicer in helping me understand navigating in bash. This is helpful for navigating basically around your computer using bash. Here is my history that I saved into a txt file on my desktop when I was finally able to navigate to it. It was a much different way then on a mac, like the example in class.


1 cd
2 cd..
3 cd ..
4 cd
5 pwd
6 cd .
7 pwd
8 cd ..
9 pwd
10 cd ..
11 cd /home/
12 cd /Desktop
13 ls
14 ls -la
15 cd /
16 ls
17 ls -la
18 ls -al home
19 cd /
20 pwd
21 cd ..
22 cd /home
23 ls -la
24 cd /
25 ls -la
26 cd ~
27 pwd
28 ls -la
29 pwd
30 cd ..
31 cd /usr
32 ls -la
33 cd ~
34 pwd
35 cd /
36 pwd
37 mkdir tmp
38 mkdir test_tmp
39 pwd
40 cd /test_tmp
41 ls -la
42 history
43 history > apr6_test.txt
44 cd /
45 pwd
46 ls -la
47 /cygdrive/C
48 cd /cydribe/C:
49 cd /cygdrive/C
50 ls -la
51 cd /
52 cd /home/Tess
53 pwd
54 cd /home/Tess/Desktop
55 cd /home/Tess
56 ls -la
57 cd /cygdrive/c
58 ls -la
59 cd /cygdrive/c/Documents\ and\ Settings
60 ls -la
61 cd /cydrive/c/Documents]
62 pwd
63 cd /cydrive/c/Documents\ and\ Settings/desktop
64 ls -la
65 Tess
66 cd Tess
67 ls -la
68 cd Desktop/
69 history > history_apr6.txt