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.
No comments:
Post a Comment