I made a script called “Poses Script”. It assigns different poses to a certain rig, the Terry rig. The script creates a window with a coloured button for each pose. Each button has an icon or a picture of the pose on it. When a button is clicked the Terry rig assumes the pose that is assigned to that button.
I decided to make this script because I like animating and I think it would be very useful to have a script that puts a model in certain key poses at the click of a button.
I listed the steps I thought I would need to take to develop my script-Make a skeleton Move it into poses required Note the orientation values of the joints Make a window with buttons Make the buttons apply the attributes of the joints of the original skeleton poses to the selected skeleton joints.
These are the script goals I thought I would need to achieve in the making of the poses window-Create procedures or procs for each pose Create a window, checking if it exists already and deleting it if it does
In making my mel script I followed these steps
In this subject I started as a complete newbie knowing absolutely nothing about scripting. I felt overwhelmed because it is a foreign language and every word used has to be the correct one, spelt right and in the right place, not to mention all the new things like ` ++ and arrays, loops, matrices, ‘if’ statements and procs etc etc etc.
I started reading the text books and found that very helpful along with the notes given in the N drive for each week. I have seen Vince write scripts to assign different colours to a group of many grapes and to change a setting on all things in a scene at once and this impressed me as to the usefulness of scriptingt. I saw Emeliano use command documentation to see how to utilise commands and this influenced me to do the same. This came in useful for seeing how to use xform.
We looked at how Maya works and uses mel scripts “Maya’s user interface, which includes all buttons and menus around the edge of the work area, is built using MEL.” (Mark R. Wilkins, 2005) page 20
Then over the weeks we made things like windows with buttons that do things like turn a propeller or make, move and delete poly objects. We made a global proc to list selected objects and rename them. We discovered switch statements, the switch statement is designed for the situation where you have a single variable that can have several specific values for which you want your script to do different things, and recursion which is when you have a procedure that calls itself repeatedly and made a spiral of spheres of decreasing sizes using this. Then we learnt about loops, a loop is a series of instructions that repeat until set conditions are reached. “Conditional statements let us decide whether to do something; loops let us do things many times.” (Jennifer Campbell, 2009) p131
Then we had to come up with an idea for a script, something we would like to be done in Maya. A first I thought of having a body deform automatically in a collision, but this seemed a bit too much for my level so Emeliano and I came up with this idea for poses in animating.
In making my mel script I followed the steps listed above and am delighted with the resulting window and they way it makes the Terry rig assume the poses.
Based on what I have learnt in this subject and the influences of my teachers and the writers of the text books I can imagine using scripting in future to simplify and automate things that I want Maya to do. I imagine I would use it in a similar way in animating even to use the xform command and list command to find and list the values of the original joints automatically and even assign it to any number of rigs by assigning variables to the subsequent rigs joint names.
Jennifer Campbell, P. G. J. M. G. W., 2009. Practical Programming – An Introduction to Computer Science. Raleigh: Pragmatic Bookshelf.
Mark R. Wilkins, C. K., 2005. MEL Scripting for Maya Animators. 2nd ed. San Francisco: Elsevier.
I have added a page called show reel to show some of the end products of what I have done on the course.
These are the steps I did to make 1 surface react like rock, sand then mud as a guy walked over them:
different particles goal pp settings in the component editor for each surface type
I had to make a scene of a mass biplanes flying.
I made a volume emitter into a flattish rectangle, with rate of 2 per second ( this was a good amount of planes flying by) and instanced the biplane to the particles so the particles now look like the biplane. The biplanes emitted sideways so I rotated the original -90 in Y direction so that it points in the X direction and they came out straight. I had to break the connection of the rotate X on the prop to rotate the plane group and freeze the transformations so then I reanimated it to rotate after.
planes emitting sideways (the original and the rectangle can be seen underneath):
I had the speed random too high on the emitter and some were not even moving. I noticed that they flew out at an ok speed but slowed down and I could not alter the emission speed so I put in a gravity field and made it go in the X direction at a strength of 6. I tried varying strengths and this had them flying at a good speed.
The particles have conserve weight of.98, max count -1 so there is no limit on the number of planes.
I tried an expression in the position’ attribute as below but the movements were too uniform they all went up and down at the same time.
vector $pos = particleShape2.position;
particleShape2.position = <<$pos.x, $pos.y+sin(time)/2, $pos.z>>;
A much better way to get them to move randomly was a turbulence field set at about 5. Higher values had them rotating too wildly and at a higher gravity magnitude it was really wild, there would have been far too many crashes.
Aim direction set to velocity has them facing the way they are flying and turning.
At the end I replaced the gravity field with a uniform field to see if that was better. I liked the effect, it pulled them forward and seemed to stop them wobbling so much. I set it at a magnitude of 20 and they speed up a bit as they go further. I also upped the disturbance to 10 so you can see more variation in the way they go up and down, the uniform field coped better with this than the gravity field and it wasn’t so wobbly.
uniform field settings:
I finally changed the lifespan on the particle to 6 and they die just off screen so there aren’t too many where they can’t be seen. and hid the original geo.
I put an expression in the mass attribute to vary the particles weights between .8 and 1.2 and in a uniform field this will vary their speed and I increased emission rate to 4 from 2 so there are more planes.