Wednesday, December 5, 2012

Final Assignments

Due Dec 13th:
lit and rendered or screen cast of script in action

Mark: IK to FK switch

Dane: Grenade explosion

Casey: The coolest firework ever

April: Grand finale fireworks

Sierra: Lava flow out of a tube onto the floor

Python beginings

Show your homework.


Use the powers of the internet to help you:

Create a python script that makes 20+ spheres in a loop and place them randomly around your scene.

Look up (google) how to move/rotate/scale things with python in Maya and copy someone else's code tweak it to get your own altered results.


-------------------------------------
What does this script do?

lightsInScene = cmds.ls(type='light')


percentage = 1.0


# If there are no lights in the scene, there is no point running this script
if not lightsInScene:
raise RuntimeError, 'There are no lights in the scene!'


# Loop through each light
for light in lightsInScene:

# The getAttr command is used to get attribute values of a node

currentIntensity = cmds.getAttr('%s.intensity' % light)

# Calculate a new intensity

newIntensity = currentIntensity * percentage

# Change the lights intensity to the new intensity

cmds.setAttr('%s.intensity' % light, newIntensity)

# Report to the user what we just did

print 'Changed the intensity of light %s from %.3f to %.3f' % (light, currentIntensity, newIntensity)


Change this script so it will set all lights to the desired exact intensity.




Just like the Homework:


import maya.cmds as mc

from random import uniform as rand # import python's random.uniform module and give it a nickname
for i in range(20): # create 20 of these
    mc.polySphere(radius=rand(0.2,1)) # create a sphere with random radius
    mc.move(rand(-5,5),rand(-5,5), rand(-5,5)) # move to a random position within a 10x10x10 cube

Change this so the sphere are dispersed  across a larger area and more variety in radius (between 1 and 20).




Final Assignment
Each student will choose a project which involves either scripting(mel/python) or fluids or dynamics of some sort.  The concept will be extremely short but developed to completion, so it could appear on your reel.

For example:  If you want to make a Python or Mel tool create a working script/UI/etc and screen cast yourself demonstrating how your script works.

For example: If you want to create a bottle rocket launching see the project through to render and show break down of what you created.

You have 1 hour to inform the Instructor of what you want to deliver.

Monday, December 3, 2012

Python in Maya

To Begin we need the right tools:

First, install the same version of Python on your machine as is being used inside of Maya.


To find out what version you are running go to your Python Tab and execute:


import sys

print sys.version


What version are you running?


Go here to download the correct version:

http://www.python.org/download/releases/

We also need to install

Ipython:

pyreadline:

and


numpy
http://www.scipy.org/Download

Download Eclipse Classic from:
http://www.eclipse.org/downloads/?osType=win32

Show ipython inside a command prompt

import numpy

use tab complete to find:

numpy.random.sample?


Where can we execute python in Maya?
from the command line of Maya

create sphere
create polyCube

Script Editor:
create new tabs
show "quick help" and call documentation


New Scene, use import maya.cmds

import maya.cmds

Explain modules in Python, think about Photoshop, or booting your PC

Ways to execute import maya.cmds?

Use Enter by the num pad, or right-click marking menu execute, or "play" button

next 
import maya.cmds
dir()

dir(maya)

dir(maya.cmds)

dir(maya.cmds.CreatePolygonSphere)

How many commands are inside of maya.cmds?

print (len(dir(maya.cmds)))

List what is in my scene:
maya.cmds.ls()

maya.cmds.ls(assemblies=True)

Create an Alias for maya.cmds
import maya.cmds as mc


Let's Create some items
mc.sphere()
mc.spaceLocator()
mc.camera()
mc.polyCube()

Select objects of different types
mc.ls(type='mesh')
mc.ls(type='geometryShape')

Put those items in a list
shapes = mc.ls(type='geometryShape')
print shapes[]
print shapes[0]


BREAK-----------------------------

self teaching...

----------------------------------------

Let's install Eclipse plugins

after launching Eclipse:

Help-> "pydev - http://pydev.org/updates/" Add and step through installing a Python Dev environment


Homework:
Use the powers of the internet to help you:

Create a python script that makes 20+ spheres in a loop and place them randomly around your scene.

Look up (google) how to move/rotate/scale things with python in Maya and copy someone else's code tweak it to get your own altered results.




Monday, November 26, 2012

Monday, November 19, 2012

Only HW due Wed is Flamethrower

Flamethrower is Due by Wed midnight, email me the playblast or animation you have posted on youtube.

Wed night class is a walk.

Particle Tutorial

Last Chance to submit your slag movie.

In Class tonight we will step through Fluids via Gnomon.

http://aii.gnomonlibrary.com.ai.libproxy.edmc.edu/training/tutorial/370

Wednesday, November 14, 2012

Balloon Homework

Homework Due next class:

Last chance to turn in your slag movie!

a playblast and show me your Maya scene of your animated Balloon popping.