Posts

Final: Auto three point lighting set up

Image
 Final: Auto 3 point lighting set up The idea: This final assignment was pretty free form. I had a couple ideas that I wanted to explore, but I ended up wanting to make an automatic three point lighting set up. When showing off a model one of the most common lighting set ups is a three point one. I thought this would be something that could be useful in quickly setting up some lighting that could be customized.  The process: I ended up using chatgpt as a tool for this assignment. It offered interesting starting places.  Notes: I first tried to use the position of the camera to auto update the locations of the lights, i wanted them to rotate around the subject with the camera. I was thinking of using expressions with mel or using condition nodes, however I ended up not going down that route and the lights would be set up around the subject once and could be set up again by running the script again.  I used the xform function to get the position of the subject, I used ...

Rigging Assignment

Image
 Rigging Assignment Set up for IK FK switch and automatic script that adds controllers to a skeleton and orient constrains the joints I originally wanted to make a script that automatically set up the entire IK FK switch but I ran out of time.  import maya.cmds as cmds import string def find_and_rename_joints(bodyPart, side, num_joints): # "arm", "leg", etc., "Lf" or "Rt"     letters = list(string.ascii_uppercase)          joints = []     childJoints = []          joints.append(cmds.ls(sl=1) [0])          childJoints = cmds.listRelatives(ad=1, type="joint")     childJoints.reverse()          for i in range(num_joints - 1):         joints.append(childJoints[i])          armJoints = []          for i,joint in enumerate(join...

Stretchy Arm Script

 Stretchy Arm Automating Script For this assignment I followed the tutorial on how to manually set up this stretchy arm and then I followed the tips to get started video. The second video walks through setting up the joints into groups so that you can more easily work with the three joints of the arm.  The video also goes through a script on how to rename the joints.  Functions  find_and_rename_joints() import maya.cmds as cmds import string def find_and_rename_joints(bodyPart, side): # "arm", "leg", etc., "Lf" or "Rt"     letters = list(string.ascii_uppercase)          joints = []     childJoints = []          joints.append(cmds.ls(sl=1) [0])          childJoints = cmds.listRelatives(ad=1, type="joint")     childJoints.reverse()          for i in range(2):         joint...

Scripting for Animation and VFX: Week 4

Image
 Scripting for Animation and VFX: Week 4 Functions and Creating Spheres  For this weeks assignment we were working with functions using python in maya. The given code to work with and expand created randomly placed spheres and curves that connected them.  Breaking down the given code: import random import maya.cmds as cmds def create_random_sphere():     # Generate random position     x = random.uniform(-100, 100)     y = random.uniform(-100, 100)     z = random.uniform(-100, 100)     # Create sphere     sphere = cmds.polySphere() [0]     # Move sphere to random position     cmds.move(x, y, z, sphere)     return sphere def create_pipe(start, end):     # Create a pipe between two objects     curve = cmds.curve(degree=1, point=[cmds.xform(start, query=True, translation=True), cmds.xform(end, query=True, translat...

Scripting for Animation and VFX: Week3

Image
 Scripting for Animation and VFX: Week3 Golden Angle In geometry the golden angle is the smaller angle of two angles created by dividing the circumference of a circle using the golden ratio. The golden angle is a pattern that appears in nature. One example being the pattern that sunflower seeds form. The seeds grow in lines in a spiral formation. The amount each seed turns allows there to be no gaps in the pattern. The pattern uses the golden ratio for each turn. The golden ratio is an irrational number, a number that cannot be written as a simple fraction. Using a fraction would mean the lines would eventually stack up making gaps in the pattern.  Golden Angle Maya Script For this week we were given a script to experiment with. This script creates spheres that follow the golden angle pattern.  The script: import maya.cmds as cmds import math for i in range (0,2000):     obj = cmds.polySphere()     goldenAngle = i * math.radians(137.51) ...