Contact Information

Email - Duylinh.Nguyen@gmail.com
Google Voice - 415-613-2177

Monday, November 21, 2011

Drawing for my Grandpa

This is a drawing I made yesterday for my grandpa. It's graphite on 18 x 24 drawing paper. I just used a 4H for the line drawing underneath, 2B for the majority of the drawing and a 4B for the darker areas.

Tuesday, November 1, 2011

New painting for Dua

Medium - Wacom Intuos 4 and Photoshop CS5. I sure do love the Blur's Good Brush. It just makes laying down color with texture so quickly. I also like how much they resemble traditional mediums. As usual, I start with a sketch and colored it in afterwards. I kind of like that mixture of styles. It's kind of interesting to see how my style has changed through the years.

Nikon d200 Model

Started modeling the Nikon d200 camera. I'm teaching a hard surface and organic modeling class this quarter and requiring my students to model a digital slr of their choice. I figured making them a model for reference would be good too. Why the D200? A student sent me an email asking me how I would approach modeling some parts and I decided to keep running with it. I started this earlier today and taking random breaks in between.



*Update
Was super lazy after the first post of the camera and only worked a little bit on it. Fixed some issues on the model after finding some better references. Maybe I should have modeled the camera I actually own instead of finding pictures online. I suppose that would have been the "smart" thing to do haha.

Tuesday, October 11, 2011

Solar System Generator using Python

This is a script I created after learning Python for Maya. It
actually proved to be fairly easy especially knowing MEL prior
to it. I decided to learn the language due to students struggling
with their 3d Scripting class. Sadly, the white spacing at the
left doesn't want to copy over, so if you plan on using the script,
make sure to add the proper white spacing to the script.

################################################################
##Script: SolarSytemGenerator.py
##Scripted By: Duylinh Nguyen
##Description: Generates a Solar System with user inputs
##Instructions: Select Entire Script and press Ctrl+Enter
##Type SolarSysGen() in command bar to execute script.
################################################################

#imporint maya commands and mel
import maya.cmds as cmds
import maya.mel as mel




#Declaring the global variables
sel = 'sel[]'
#star global variables
starName = 'star'
starRad = 1.0
starPosX = 0.0
starPosY = 0.0
starPosZ = 0.0
#sat global variables
sat = 'sat[]'
satName = 'sat'
satRad = 1.0
satRotX = 0.0
satRotY = 0.0
satRotZ = 0.0
satRotSpeed = 0.0
satOrbitScaleX = 1.0
satOrbitScaleZ = 1.0
satOrbitRotX = 0.0
satOrbitRotY = 0.0
satOrbitRotZ = 0.0
satOrbitSpeed = 0.0
#background stars variables
BGSphereName = 'starrySky'
BGSphereRad = 1.0
BGStarsAmount = 100.0
#asteroid belt variables
astBeltName = 'asteroidBelt'
astBeltScaleX = 1.0
astBeltScaleZ = 1.0
astBeltSecRad = 0.5
astBeltRotX = 0.0
astBeltRotY = 0.0
astBeltRotZ = 0.0

#defs (aka functions) are used to have a set of actions stored within a section. This
#allows you to do repetative tasks easier.

#The main interface window was placed into a def so the user simply needs to call it
#instead of always having to run the full script over and over.

#Main interface window to create solar system
def SolarSysGen():
#Checks to see if the window exists. If it does, close it and create a new one.
if cmds.window ( "SSGWindow", exists = True ):
cmds.deleteUI ( "SSGWindow", window = True )

#Creates the window
SSGWindow = cmds.window( "SSGWindow", title = "Solar System Generator", wh = ( 380, 200 ) )
#The layout used for the window
cmds.rowColumnLayout ( numberOfColumns = 1, columnWidth = ( 1, 370 ) )
#Create star button that calls the CreateStarWindow def
cmds.button ( label = "Create Star", command = "CreateStarWindow()" )
#Separators are used to either fill in gaps or give you extra space between your layout controls
cmds.separator ( height = 20, style = "none" )
#Descriptive text to tell the user what they need to do
cmds.text ( align = "center", font = "boldLabelFont", label = "Select One Star" )
#Create satellite button that calls the CreateSatelliteWindow def
cmds.button ( label = "Create Satellite", command = "CreateSatelliteWindow()" )
cmds.separator ( height = 20, style = "none" )
cmds.text ( align = "center", font = "boldLabelFont" , label = "Select One Star or Satellite" )
#Create asteroid belt button that calls the createAsterBeltWindow def
cmds.button ( label = "Create Asteroid Belt", command = "createAsterBeltWindow ()" )
cmds.separator ( height = 20, style = "none" )
#Create star background button that calls the createBGSStarWindow
cmds.button ( label = "Create Star Background", command = "createBGStarsWindow ()" )
#displays the window
cmds.showWindow ( SSGWindow )


#this def is used to display the CreateStarWindow
def CreateStarWindow () :

#adding global in front of the variable allows you to call the global variables declared in the
#start of the script. If global is not added to the front of these variables, they will be
#considered local instead. Global variables allow you to use these variables across multiple
#defs and not just within the function. Only declare global if you know you need to use it
#in multiple defs.

global starName
global starRad
global starPosX
global starPosY
global starPosZ

#checks if any of the sub windows are opened. If so, it closes them and spawns a new one
if cmds.window( "satWindow", exists = True):
cmds.deleteUI ("satWindow",window = True)
if cmds.window ("ErPlWindow", exists = True):
cmds.deleteUI ("ErPlWindow", window = True)
if cmds.window( "StarWindow", exists = True ):
cmds.deleteUI( "StarWindow", window = True )
if cmds.window( "bgStarsWin", exists = True ):
cmds.deleteUI( "bgStarsWin", window = True )
if cmds.window( "astBeltWin", exists = True ):
cmds.deleteUI( "astBeltWin", window = True )

#creates the window
StarWindow = cmds.window( "StarWindow", title = "Create Star", wh = (300,200))
cmds.columnLayout ()
#control that prompts the user for the name and the button calls the CreateStar def
cmds.textFieldButtonGrp ( starName, label = 'Star Name', text = starName, buttonLabel = 'Create Star', buttonCommand = 'CreateStar()')
#sliders that control attributes on the object
starPosX = cmds.floatSliderGrp ( label = 'Position X', field=True, minValue=-100.0, maxValue=100.0, fieldMinValue=-100.0, fieldMaxValue=100.0, value=0.0 )
starPosY = cmds.floatSliderGrp ( label = 'Position Y', field=True, minValue=-100.0, maxValue=100.0, fieldMinValue=-100.0, fieldMaxValue=100.0, value=0.0 )
starPosZ = cmds.floatSliderGrp ( label = 'Position Z', field=True, minValue=-100.0, maxValue=100.0, fieldMinValue=-100.0, fieldMaxValue=100.0, value=0.0 )
starRad = cmds.floatSliderGrp ( label = 'Radius' , field = True, minValue=-100.0, maxValue=100.0, fieldMinValue=-100.0, fieldMaxValue=100.0, value=1.0 )
cmds.showWindow (StarWindow)

def CreateStar () :
#these variables were used in both the CreateStarWindow and CreateStar defs, hence being global
global starName
global starRad
global starPosX
global starPosY
global starPosZ

#this finds what the user typed and stores it into the starNameQuery
starNameQuery = cmds.textFieldButtonGrp ( starName, query = True, text = True)
#Creates a polygon sphere, gives it the name the user inputted and assigns it to the variable Star. Star is an array
Star = cmds.polySphere ( r = 1, sx = 20, sy = 20, ax = (0, 1, 0), cuv = 2, ch = 1, name = starNameQuery)
#connects the slider with the attribute
#Star[0] = grabbing the first name out of the list. Every object by default has 2.
#ie. Star[0] = Sun , Star[1] = SunShape
#The + sign is used to attach text after the variable
#ie. Star[0] + "translateX" = Sun.translateX
cmds.connectControl ( starPosX, Star[0] + ".translateX")
cmds.connectControl ( starPosY, Star[0] + ".translateY")
cmds.connectControl ( starPosZ, Star[0] + ".translateZ")
#connectControl can control multiple attributes at the same time. Just make sure to place a comma afterwords.
cmds.connectControl ( starRad, Star[0] + ".scaleX", Star[0] + ".scaleY", Star[0] + ".scaleZ")



#Creates the sat and Orbit
def CreateSatelliteWindow () :
#declaring global variables that will be used in the CreateSatelliteWindow and CreateSat defs
global satName
global satRad
global satRotX
global satRotY
global satRotZ
global satRotSpeed
global satOrbitScaleX
global satOrbitScaleZ
global satOrbitRotX
global satOrbitRotY
global satOrbitRotZ
global sel
global satOrbitSpeed

#checks to see what objects are selected
sel = cmds.ls ( sl = True )
selObj = cmds.listRelatives ( cmds.listRelatives( parent = True ), parent = True )
#checks to see if the type of object that is selected is a mesh
if cmds.objectType ( cmds.listRelatives ( sel[0] ) ) == 'mesh':
selSize = len(sel)
#checks to see if only one object is selected
if selSize == 1:
if cmds.window( "satWindow", exists = True):
cmds.deleteUI ("satWindow",window = True)
if cmds.window ("ErPlWindow", exists = True):
cmds.deleteUI ("ErPlWindow", window = True)
if cmds.window( "StarWindow", exists = True ):
cmds.deleteUI( "StarWindow", window = True )
if cmds.window( "bgStarsWin", exists = True ):
cmds.deleteUI( "bgStarsWin", window = True )
if cmds.window( "astBeltWin", exists = True ):
cmds.deleteUI( "astBeltWin", window = True )

satWindow = cmds.window ("sattWindow",title = "Create Satellite")
cmds.columnLayout ()
cmds.textFieldButtonGrp ( satName, label = 'Satellite Name', text = satName, buttonLabel = 'Create Satellite', buttonCommand = 'CreateSat()')
satOrbitScaleX = cmds.floatSliderGrp ( label = 'Orbit Scale X', field = True, minValue = -100.0, maxValue = 100.0, fieldMinValue = -100.0, fieldMaxValue = 100.0, value = 0.0 )
satOrbitScaleZ = cmds.floatSliderGrp ( label = 'Orbit Scale Z', field = True, minValue = -100.0, maxValue = 100.0, fieldMinValue = -100.0, fieldMaxValue = 100.0, value = 0.0 )
satOrbitRotX = cmds.floatSliderGrp ( label = 'Orbit Rotate X', field = True, minValue = -100.0, maxValue = 100.0, fieldMinValue = -100.0, fieldMaxValue = 100.0, value = 0.0 )
satOrbitRotY = cmds.floatSliderGrp ( label = 'Orbit Rotate Y', field = True, minValue = -100.0, maxValue = 100.0, fieldMinValue = -100.0, fieldMaxValue = 100.0, value = 0.0 )
satOrbitRotZ = cmds.floatSliderGrp ( label = 'Orbit Rotate Z', field = True, minValue = -100.0, maxValue = 100.0, fieldMinValue = -100.0, fieldMaxValue = 100.0, value = 0.0 )
satRad = cmds.floatSliderGrp ( label = 'Satellite Radius' , field = True, minValue = -100.0, maxValue=100.0, fieldMinValue = -100.0, fieldMaxValue = 100.0, value = 1.0 )
satRotX = cmds.floatSliderGrp ( label = 'Satellite Rotate X' , field = True, minValue = -100.0, maxValue=100.0, fieldMinValue = -100.0, fieldMaxValue = 100.0, value = 1.0 )
satRotZ = cmds.floatSliderGrp ( label = 'Satellite Rotate Z' , field = True, minValue = -100.0, maxValue=100.0, fieldMinValue = -100.0, fieldMaxValue = 100.0, value = 1.0 )
satRotSpeed = cmds.floatSliderGrp ( label = 'Satellite Rotate Speed' , field = True, minValue = -10000.0, maxValue=10000.0, fieldMinValue = -10000.0, fieldMaxValue = 10000.0, value = 0.0 )
satOrbitSpeed = cmds.floatSliderGrp ( label = 'Orbit Speed' , field = True, minValue = 0, maxValue=100, fieldMinValue = 0, fieldMaxValue = 100, value = 0.0 )
cmds.showWindow ( satWindow )

#if there are more than one object selected, an error window will pop up notifying the user of their error
else:
if cmds.window( "satWindow", exists = True):
cmds.deleteUI ("satWindow",window = True)
if cmds.window ("ErPlWindow", exists = True):
cmds.deleteUI ("ErPlWindow", window = True)
if cmds.window( "StarWindow", exists = True ):
cmds.deleteUI( "StarWindow", window = True )
if cmds.window( "bgStarsWin", exists = True ):
cmds.deleteUI( "bgStarsWin", window = True )
if cmds.window( "astBeltWin", exists = True ):
cmds.deleteUI( "astBeltWin", window = True )
ErPlWindow = cmds.window ( "ErPlWindow",title = "Error" )
cmds.rowColumnLayout (numberOfColumns = 1, columnWidth = ( 1, 370 ) )
cmds.text ( label="Error: Too many objects selected" )
cmds.showWindow ( ErPlWindow)

#if nothing is selected, it will error and nothing will pop up
else:
#print command only pops up in the script editor
print "error: nothing is selected"

def CreateSat () :

global sel
global satName
global satRad
global satRotX
global satRotY
global satRotZ
global satRotSpeed
global satOrbitScaleX
global satOrbitScaleZ
global satOrbitRotX
global satOrbitRotY
global satOrbitRotZ
global satOrbitSpeed

#finds the name the user input
satNameQuery = cmds.textFieldButtonGrp ( satName, query = True, text = True)
sat = cmds.polySphere ( r = 1, sx = 20, sy = 20, ax = (0, 1, 0), cuv = 2, ch = 1, name = satNameQuery)
#make note how single quotes ' and double quotes " can be interchanged.
#creates a new variable to name the orbit based on the satellite name
satOrbitName = sat[0] + 'Orbit'
#creates the orbit ring for the satellite
satOrbit = cmds.circle ( c = (0, 0, 0), nr = ( 0, 1, 0), sw = 360, r = 1, d = 3, ut = 0, tol = 0.00155, s = 8, ch = 1, name = satOrbitName)
#locator is used to allow the satellite (child) to rotate and move freely if need be
#this also allows the satellite to rotate around its own local axis.
satLoc = cmds.spaceLocator ( p = (0,0,0))
#parents the satellite to the locator
cmds.parent ( sat [0], satLoc [0])
#attaches the satellite to the motionpath. stu = start time U, etu = end time U, turnning off follow allows for the object to rotate freely
orbitPath = cmds.pathAnimation(satLoc[0], curve=satOrbitName, fractionMode = True, stu = 0, etu = 100, follow = False )
#flattens the tangent so there are no ease in and ease outs on the motionpath
cmds.keyTangent ( orbitPath + "_uValue", itt = "linear", ott = "linear")
#adds an attribute to allow the user to input the rotation speed of the satellite
cmds.addAttr ( sat[0], shortName = "rs", longName = "rotateSpeed", defaultValue = 0.0, minValue = -10000, maxValue = 10000, k = True)
#adds a point constraint to the object that the satellite was created for
cmds.pointConstraint ( sel [0], satOrbit [0])
#renames the motion path
cmds.rename ('motionPath1', "" + sat[0] + "moPath")
#mel.eval allows you to call MEL scripts that are not available in Python such as the CBDeleteConnection. This allows you to break
#connections for any attribute listed.
#the .u attribute controls the location on the motion path the object is on.
mel.eval ("source channelBoxCommand; CBdeleteConnection " + sat[0] + "moPath.u;")
#this gives an attribute to the object that controls the speed of which the planet orbits the object
#setting k or key = True allows you to see the attribute on the object.
#dv = default value, sets what value you want it to start with
cmds.addAttr (sat[0], ln = "speed", at = "float", k = True, min = 0, dv =1.0)
cmds.connectControl ( satOrbitSpeed, sat[0] + ".speed")
cmds.connectControl ( satOrbitScaleX, satOrbitName + ".scaleX")
cmds.connectControl ( satOrbitScaleZ, satOrbitName + ".scaleZ")
cmds.connectControl ( satOrbitRotX, satOrbitName + ".rotateX")
cmds.connectControl ( satOrbitRotY, satOrbitName + ".rotateY")
cmds.connectControl ( satOrbitRotZ, satOrbitName + ".rotateZ")
cmds.connectControl ( satRotX, satLoc[0] + ".rotateX")
cmds.connectControl ( satRotZ, satLoc[0] + ".rotateZ")
cmds.connectControl ( satRad, sat[0] + ".scaleX", sat[0] + ".scaleY", sat[0] + ".scaleZ")
cmds.connectControl ( satRotSpeed, sat[0] + ".rotateSpeed")
cmds.expression ( s = "" + sat[0] + ".rotateY = " + sat[0] + ".rotateY - " + sat[0] + ".rotateSpeed")
cmds.expression ( s = "" + sat[0] + "moPath.u = ( frame % (" + sat[0] + ".speed +1)) /" + sat[0] + ".speed;")


def createBGStarsWindow ():
global BGSphereName
global BGSphereRad
global BGStarsAmount

if cmds.window( "satWindow", exists = True):
cmds.deleteUI ("satWindow",window = True)
if cmds.window ("ErPlWindow", exists = True):
cmds.deleteUI ("ErPlWindow", window = True)
if cmds.window( "StarWindow", exists = True ):
cmds.deleteUI( "StarWindow", window = True )
if cmds.window( "bgStarsWin", exists = True ):
cmds.deleteUI( "bgStarsWin", window = True )
if cmds.window( "astBeltWin", exists = True ):
cmds.deleteUI( "astBeltWin", window = True )

bgStarsWin = cmds.window ("bgStarsWin",title = "Create Star Background")
cmds.columnLayout ()
cmds.textFieldButtonGrp ( BGSphereName, label = 'Background Stars Name', text = BGSphereName, buttonLabel = 'Create Stars Background', buttonCommand = 'createBGStars ()')
BGSphereRad = cmds.floatSliderGrp ( label = 'BG Stars Sphere Radius', field = True, minValue = 0, maxValue = 1000.0, fieldMinValue = 0, fieldMaxValue = 1000.0, value = 1 )
BGStarsAmount = cmds.floatSliderGrp ( label = 'Amount of Stars', field = True, minValue = 1, maxValue = 1000.0, fieldMinValue = 1, fieldMaxValue = 1000.0, value = 100.0 )
cmds.showWindow ( "bgStarsWin")

def createBGStars ():
global BGSphereName
global BGSphereRad
global BGStarsAmount

BGSphere = cmds.polySphere ( r = 1, sx = 20, sy = 20, ax = (0,1,0), cuv = 2, ch = 1, name = BGSphereName)
BGSEmit = cmds.emitter ( BGSphere [0], type = "surface", r = 100, sro = 0, nuv = 0, cye = "none", cyi = 1, spd = 1, srn = 0, nsp = 1, tsp = 0, mxd = 0, mnd = 0, dx = 0, dy = 0, dz = 0, sp = 0, name = BGSphere[0] + "Emit")
BGSPart = cmds.particle (name = BGSphere[0] + "Part")
cmds.connectDynamic ( BGSPart[0], em = BGSEmit)
cmds.connectControl ( BGSphereRad, BGSphere[0] + ".scaleX", BGSphere[0] + ".scaleY", BGSphere[0] + ".scaleZ")
cmds.connectControl ( BGStarsAmount, BGSEmit[1] + ".rate")
print BGSEmit
print BGSPart
cmds.setAttr ( BGSphere[0] + ".template", 1)
cmds.setAttr ( BGSphere[0] + "Shape.primaryVisibility", 0)
cmds.setAttr ( BGSphere[0] + "Shape.motionBlur", 0)
cmds.setAttr ( BGSphere[0] + "Shape.receiveShadows", 0)
cmds.setAttr ( BGSphere[0] + "Shape.castsShadows", 0)
cmds.setAttr ( BGSphere[0] + "Shape.smoothShading", 0)
cmds.setAttr ( BGSphere[0] + "Shape.visibleInReflections", 0)
cmds.setAttr ( BGSphere[0] + "Shape.visibleInRefractions", 0)
cmds.setAttr ( BGSphere[0] + "Shape.doubleSided", 0)
cmds.setAttr ( BGSPart[1] + ".particleRenderType", 7)
cmds.setAttr ( BGSPart[1] + ".lifespanMode", 2)
cmds.setAttr ( BGSPart[1] + ".lifespan", 2)
cmds.addAttr ( BGSPart[1], internalSet = True, ln = "radius", at = "float", min = 0, max = 10, dv = 0.1)
cmds.addAttr ( BGSPart[1], ln = "radiusPP", dt = "doubleArray")
cmds.addAttr ( BGSPart[1], ln = "radiusPP0", dt = "doubleArray")
cmds.setAttr ( BGSPart[1] + ".radius", .05)
cmds.dynExpression ( BGSPart[1], s = "" + BGSPart[1] + ".radiusPP = rand (.03, .1)", c = True)


def createAsterBeltWindow ():
global sel
global astBeltName
global astBeltScaleX
global astBeltScaleZ
global astBeltSecRad
global astBeltRotX
global astBeltRotY
global astBeltRotZ
#checks to see if the object is selected
sel = cmds.ls ( sl = True )
selObj = cmds.listRelatives ( cmds.listRelatives( parent = True ), parent = True )
if cmds.objectType ( cmds.listRelatives ( sel[0] ) ) == 'mesh':
selSize = len(sel)
if selSize == 1:
if cmds.window( "satWindow", exists = True):
cmds.deleteUI ("satWindow",window = True)
if cmds.window ("ErPlWindow", exists = True):
cmds.deleteUI ("ErPlWindow", window = True)
if cmds.window( "StarWindow", exists = True ):
cmds.deleteUI( "StarWindow", window = True )
if cmds.window( "bgStarsWin", exists = True ):
cmds.deleteUI( "bgStarsWin", window = True )
if cmds.window( "astBeltWin", exists = True ):
cmds.deleteUI( "astBeltWin", window = True )

astBeltWin = cmds.window ("astBeltWin",title = "Create Asteroid Belt")
cmds.columnLayout ()
cmds.textFieldButtonGrp ( astBeltName, label = 'Asteroid Belt Name', text = astBeltName, buttonLabel = 'Create Asteroid Belt', buttonCommand = 'createAsterBelt()')
astBeltScaleX = cmds.floatSliderGrp ( label = 'Asteroid Belt Scale X', field = True, minValue = 1, maxValue = 100.0, fieldMinValue = 1, fieldMaxValue = 100.0, value = 1.0 )
astBeltScaleZ = cmds.floatSliderGrp ( label = 'Asteroid Belt Scale Z', field = True, minValue = 1, maxValue = 100.0, fieldMinValue = 1, fieldMaxValue = 100.0, value = 1.0 )
astBeltRotX = cmds.floatSliderGrp ( label = 'Asteroid Belt Rotate X', field = True, minValue = -100, maxValue = 100.0, fieldMinValue = -100, fieldMaxValue = 100.0, value = 1.0 )
astBeltRotY = cmds.floatSliderGrp ( label = 'Asteroid Belt Rotate Y', field = True, minValue = -100, maxValue = 100.0, fieldMinValue = -100, fieldMaxValue = 100.0, value = 1.0 )
astBeltRotZ = cmds.floatSliderGrp ( label = 'Asteroid Belt Rotate Z', field = True, minValue = -100, maxValue = 100.0, fieldMinValue = -100, fieldMaxValue = 100.0, value = 1.0 )
astBeltSecRad = cmds.floatSliderGrp ( label = 'Asteroid Belt Section Radius', field = True, minValue = 0, maxValue = 10, fieldMinValue = 1, fieldMaxValue = 10, value = 1.0 )
cmds.showWindow ( "astBeltWin")
else:
if cmds.window( "satWindow", exists = True):
cmds.deleteUI ("satWindow",window = True)
if cmds.window ("ErPlWindow", exists = True):
cmds.deleteUI ("ErPlWindow", window = True)
if cmds.window( "StarWindow", exists = True ):
cmds.deleteUI( "StarWindow", window = True )
if cmds.window( "bgStarsWin", exists = True ):
cmds.deleteUI( "bgStarsWin", window = True )
if cmds.window( "astBeltWin", exists = True ):
cmds.deleteUI( "astBeltWin", window = True )
ErPlWindow = cmds.window ( "ErPlWindow",title = "Error" )
cmds.rowColumnLayout (numberOfColumns = 1, columnWidth = ( 1, 370 ) )
cmds.text ( label="Error: Too many objects selected" )
cmds.showWindow ( ErPlWindow)

else:
print "error"

def createAsterBelt ():
global sel
global astBeltName
global astBeltScaleX
global astBeltScaleZ
global astBeltSecRad
global astBeltRotX
global astBeltRotY
global astBeltRotZ

astBeltNameQuery = cmds.textFieldButtonGrp ( astBeltName, query = True, text = True)

asterBelt = cmds.circle (c = (0, 0, 0), nr = (0, 1, 0), sw = 360, r = 1, d = 3, ut = 0, tol = 0.00155, s = 8, ch = 1, name = astBeltNameQuery)
asterEmit = cmds.emitter ( asterBelt [0], type = "curve", r = 100, sro = 0, nuv = 0, cye = "none", cyi = 1, spd = 1, srn = 0, nsp = 1, tsp = 0, mxd = 0, mnd = 0, dx = 0, dy = 0, dz = 0, sp = 0, name = asterBelt[0] + "Emit")
asterPart = cmds.particle (name = asterBelt[0] + "Part")
cmds.connectDynamic ( asterPart [0] , em = asterEmit [0])
print sel
cmds.pointConstraint ( sel [0], asterBelt [0])
cmds.connectControl ( astBeltScaleX, asterBelt[0] + ".scaleX")
cmds.connectControl ( astBeltScaleZ, asterBelt[0] + ".scaleZ")
cmds.connectControl ( astBeltRotX, asterBelt[0] + ".rotateX")
cmds.connectControl ( astBeltRotY, asterBelt[0] + ".rotateY")
cmds.connectControl ( astBeltRotZ, asterBelt[0] + ".rotateZ")

cmds.setAttr ( asterPart[0] + ".particleRenderType", 7)
cmds.addAttr ( asterPart[1], internalSet = True, ln = "radius", at = "float", min = 0, max = 10, dv = 0.1)
cmds.addAttr ( asterPart[1], ln = "radiusPP", dt = "doubleArray")
cmds.addAttr ( asterPart[1], ln = "radiusPP0", dt = "doubleArray")
cmds.dynExpression ( asterPart[1], s = "" + asterPart[1] + ".radiusPP = rand (.01, .1)", c = True)
cmds.setKeyframe ( asterEmit[1], attribute = "rate", v = 100, time = 100)
cmds.setKeyframe ( asterEmit[1], attribute = "rate", v = 0, time = 101)
cmds.setKeyframe ( asterPart[1], attribute = "conserve", v = 1, time = 200)
cmds.setKeyframe ( asterPart[1], attribute = "conserve", v = 0.9, time = 201)
cmds.select (asterBelt[0])
mel.eval ("createCurveField")
cmds.rename ("volumeAxisField1", "" + asterBelt[0] + "AsterField")
print asterBelt[0] + "AsterField"
cmds.connectDynamic ( asterPart[0], f = "" + asterBelt [0] + "AsterField")
cmds.setAttr ( asterBelt [0] + "AsterField.trapInside", 1)
cmds.setAttr ( asterBelt [0] + "AsterField.turbulence", .05)
cmds.connectControl ( astBeltSecRad, asterBelt[0] + "AsterField.sectionRadius")

New tutorials for Maya and 3ds Max

Here are 3 new videos I've recorded based on questions my students have asked me about in Maya and 3ds Max. I will soon be posting a video that covers Substance texturing in both Maya and 3ds Max.

Multi Subobject in 3ds Max


Smoothing Normals in 3ds Max


Raytraced Shadows in Maya

Monday, October 10, 2011

Painting for Sally

This is a painting I made for Sally from memory. I made it while I was in Denmark.

Tuesday, July 19, 2011

New 3D Head Modeling Tutorials

I've just recorded a new head modeling tutorial using Maya 2011.

Part 1 -


Part 2 -


Part 3 -

Wednesday, June 15, 2011

The Balrog

I've decided to model the Balrog from scratch again. Instead of creating the base mesh inside of Maya though, I opted to us Zspheres and ZSketching instead. That proved to be a much faster way to do things. After doing all of that fun stuff, I sculpted it to get myself a rough form that I could use to retopo. I ended up doing the retopology within 3D Coat and decided to sculpt the wings as a separate mesh. I think it'll be easier that way and to do a final retopo once everything is finished.






Friday, June 10, 2011

Cinema 4D

I've been learning Cinema 4D for about 2 days now and the learning curve has been pretty easy considering that google is essentially teaching me. I feel a lot more comfortable using it already, but at the same time, very limited. The modeling tools seem simple enough to use, but I feel it's lacking a lot of the tools I normally find in other modeling programs. It's just weird to know that the vertices (points) are still floating around even after deleting a face. Maybe there's another way to delete faces that I don't know of. The snapping tools work well enough along with the hierarchy system. I think this program would work great for someone who is new to the 3d world, but if you have modeled for years in another package, it might feel limiting. The good thing at least is that many people have created plugins to fill in the gap of all those missing tools. Anyways.. here's my first model I've made in C4D along with the shaders and lighting :D



updated*
Just started modeling a Macbook Pro. I've decided to change up the shortcut keys so they are more similar to Maya. This has helped a lot to ease my adjustment to the program. I'm still trying to figure out easier ways to align points instead of having to type the actual value.




Tuesday, May 17, 2011

Auto IKFK Blend and Solid Knee Script

This is a script I made for my rigging class so they can see how one would go about creating an auto rig script.

//////////////////////////////////////////////////////
//ikFkSetupLeg.mel //
//scripted by: Duylinh Nguyen //
//description: This script auto creates an IK FK //
//blend setup for desired side of leg. //
//How to use: Create leg joints and //
//name them. Type ikFkSetupLeg and the side of the //
//leg you wish to setup. //
//ie. ikFkSetupLeg right //
//naming conventions //
//L_Hip_Jnt > L_Knee_Jnt > L_Ankle_Jnt > L_Ball_Jnt //
//> L_Toe_Jnt //
//////////////////////////////////////////////////////

global proc ikFkSetupLeg (string $sideLegLong)
{
//Records errors in this variable
int $legWarning = 0; //0 = No Errors
//1 = Error Found

//Checks to see which side is selected
//Checks if the argument is correct

string $sideLeg;
if (($sideLegLong != "left") && ($sideLegLong != "right"))
{
$legWarning = 1;
warning "Unknown argument. Please specify either left or right. ie: ikFkSetupLeg right; \n";
}else
{
if ($sideLegLong == "left")
$sideLeg = "L_";
if ($sideLegLong == "right")
$sideLeg = "R_";
}

//Checks to see if objects exist in the scene
if($legWarning == 0)
{
if(!((`objExists ($sideLeg + "Hip_Jnt")`)
&&(`objExists ($sideLeg + "Knee_Jnt")`)
&&(`objExists ($sideLeg + "Ankle_Jnt")`)
&&(`objExists ($sideLeg + "Ball_Jnt")`)
&&(`objExists ($sideLeg + "Toe_Jnt")`)))
{
$legWarning = 1;
warning "Cannot find all required objects to setup leg. Please check names. \n";
}
}

//If there are no errors, continue
if ($legWarning == 1)
{
warning "The script has encountered an error. Check script editor for details. \n";
}else
{
print "Prerequisites have been fullfilled. \n";

//Sets the axis the foot rotates downwards in (-Z by default)
$footAxis = "Z"; //Change this value if the axis needs to be different
$isFootNegative = -1; //Change this to 1 if the foot axis is positive to rotate down.

//Creates foot controller

curve -d 1 -p -0.5 0 0.5 -p 0.5 0 0.5 -p 0.5 0 -0.5 -p -0.5 0 -0.5 -p -0.5 0 0.5 -k 0 -k 1 -k 2 -k 3 -k 4 -n ($sideLeg + "Foot_CON");
//Orient Joints
select -r ($sideLeg+"Hip_Jnt"); //-r = replace
joint -e -oj xyz -ch -zso; //-e = edit, -oj = joint orientation -ch = children

//Duplicates and rename joints
select -r ($sideLeg + "Hip_Jnt");
duplicate -rr; //rr = returns root only
duplicate -rr;

//Renaming FK Joints
rename ($sideLeg + "Hip_Jnt1") ($sideLeg + "FK_Hip_Jnt");
rename ($sideLeg + "FK_Hip_Jnt|" + $sideLeg + "Knee_Jnt") ($sideLeg + "FK_Knee_Jnt");
rename ($sideLeg + "FK_Hip_Jnt|" + $sideLeg + "FK_Knee_Jnt|" + $sideLeg + "Ankle_Jnt") ($sideLeg + "FK_Ankle_Jnt");
rename ($sideLeg + "FK_Hip_Jnt|" + $sideLeg + "FK_Knee_Jnt|" + $sideLeg + "FK_Ankle_Jnt|" + $sideLeg + "Ball_Jnt") ($sideLeg + "FK_Ball_Jnt");
rename ($sideLeg + "FK_Hip_Jnt|" + $sideLeg + "FK_Knee_Jnt|" + $sideLeg + "FK_Ankle_Jnt|" + $sideLeg + "FK_Ball_Jnt|" + $sideLeg + "Toe_Jnt") ($sideLeg + "FK_Toe_Jnt");

//Renaming IK Joints
rename ($sideLeg + "Hip_Jnt2") ($sideLeg + "IK_Hip_Jnt");
rename ($sideLeg + "IK_Hip_Jnt|" + $sideLeg + "Knee_Jnt") ($sideLeg + "IK_Knee_Jnt");
rename ($sideLeg + "IK_Hip_Jnt|" + $sideLeg + "IK_Knee_Jnt|" + $sideLeg + "Ankle_Jnt") ($sideLeg + "IK_Ankle_Jnt");
rename ($sideLeg + "IK_Hip_Jnt|" + $sideLeg + "IK_Knee_Jnt|" + $sideLeg + "IK_Ankle_Jnt|" + $sideLeg + "Ball_Jnt") ($sideLeg + "IK_Ball_Jnt");
rename ($sideLeg + "IK_Hip_Jnt|" + $sideLeg + "IK_Knee_Jnt|" + $sideLeg + "IK_Ankle_Jnt|" + $sideLeg + "IK_Ball_Jnt|" + $sideLeg + "Toe_Jnt") ($sideLeg + "IK_Toe_Jnt");

//Creates FK controllers
circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.00393701 -s 8 -ch 1 -n ($sideLeg + "FK_Hip_CON");
group -n ($sideLeg + "FK_Hip_CON_NULL");
circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.00393701 -s 8 -ch 1 -n ($sideLeg + "FK_Knee_CON");
group -n ($sideLeg + "FK_Knee_CON_NULL");
circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.00393701 -s 8 -ch 1 -n ($sideLeg + "FK_Ankle_CON");
group -n ($sideLeg + "FK_Ankle_CON_NULL");
circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.00393701 -s 8 -ch 1 -n ($sideLeg + "FK_Ball_CON");
group -n ($sideLeg + "FK_Ball_CON_NULL");

//Snaps controllers into place, breaks their connections, rotates and freezes their transformations
//FK Hip Controller
//creates the point constraint to position the controller null to the desired joint
pointConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Hip_Jnt") ($sideLeg + "FK_Hip_CON_NULL") ;
delete ($sideLeg + "FK_Hip_CON_NULL_pointConstraint1");
setAttr ($sideLeg + "FK_Hip_CON_NULL.rotateZ") 90;
FreezeTransformations;
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Hip_Jnt") ($sideLeg + "FK_Hip_CON_NULL") ;
delete ($sideLeg + "FK_Hip_CON_NULL_orientConstraint1");
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Hip_CON") ($sideLeg + "FK_Hip_Jnt");;

//FK Knee Controller
pointConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Knee_Jnt") ($sideLeg + "FK_Knee_CON_NULL");
delete ($sideLeg + "FK_Knee_CON_NULL_pointConstraint1");
setAttr ($sideLeg + "FK_Knee_CON_NULL.rotateZ") 90;
FreezeTransformations;
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Knee_Jnt") ($sideLeg + "FK_Knee_CON_NULL");
delete ($sideLeg + "FK_Knee_CON_NULL_orientConstraint1");
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Knee_CON") ($sideLeg + "FK_Knee_Jnt");

//FK Ankle Controller
pointConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ankle_Jnt") ($sideLeg + "FK_Ankle_CON_NULL");
delete ($sideLeg + "FK_Ankle_CON_NULL_pointConstraint1");
setAttr ($sideLeg + "FK_Ankle_CON_NULL.rotateZ") 90;
FreezeTransformations;
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ankle_Jnt") ($sideLeg + "FK_Ankle_CON_NULL");
delete ($sideLeg + "FK_Ankle_CON_NULL_orientConstraint1");
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ankle_CON") ($sideLeg + "FK_Ankle_Jnt");

//FK Ball Controller
pointConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ball_Jnt") ($sideLeg + "FK_Ball_CON_NULL");
delete ($sideLeg + "FK_Ball_CON_NULL_pointConstraint1");
setAttr ($sideLeg + "FK_Ball_CON_NULL.rotateZ") 90;
FreezeTransformations;
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ball_Jnt") ($sideLeg + "FK_Ball_CON_NULL");
delete ($sideLeg + "FK_Ball_CON_NULL_orientConstraint1");
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ball_CON") ($sideLeg + "FK_Ball_Jnt");


//Parents the controllers together
parent ($sideLeg + "FK_Ball_CON_NULL") ($sideLeg + "FK_Ankle_CON");
parent ($sideLeg + "FK_Ankle_CON_NULL") ($sideLeg + "FK_Knee_CON");
parent ($sideLeg + "FK_Knee_CON_NULL") ($sideLeg + "FK_Hip_CON");

//Creates orient constraints
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Hip_Jnt") ($sideLeg + "IK_Hip_Jnt") ($sideLeg + "Hip_Jnt");
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Knee_Jnt") ($sideLeg + "IK_Knee_Jnt") ($sideLeg + "Knee_Jnt");
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ankle_Jnt") ($sideLeg + "IK_Ankle_Jnt") ($sideLeg + "Ankle_Jnt");
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ball_Jnt") ($sideLeg + "IK_Ball_Jnt") ($sideLeg + "Ball_Jnt");

//Changes interpolation types on orient constraints to limit constraint blend problems
setAttr ($sideLeg + "Hip_Jnt_orientConstraint1.interpType") 2;
setAttr ($sideLeg + "Knee_Jnt_orientConstraint1.interpType") 2;
setAttr ($sideLeg + "Ankle_Jnt_orientConstraint1.interpType") 2;
setAttr ($sideLeg + "Ball_Jnt_orientConstraint1.interpType") 2;


//-ln = long name
//-k = keyable
//-at = attribute type
//-min = minimum
//-max = maximum
//-dv = default value
//Adds the attributes for the Foot Controller
addAttr -ln toeTap -k 1 -at double -min -10 -max 10 -dv 0 ("|" + $sideLeg + "Foot_CON");
addAttr -ln peelHeel -k 1 -at double -min 0 -max 10 -dv 0 ("|" + $sideLeg + "Foot_CON");
addAttr -ln standTip -k 1 -at double -min 0 -max 10 -dv 0 ("|" + $sideLeg + "Foot_CON");
addAttr -ln twistHeel -k 1 -at double -min -10 -max 10 -dv 0 ("|" + $sideLeg + "Foot_CON");
addAttr -ln twistToe -k 1 -at double -min -10 -max 10 -dv 0 ("|" + $sideLeg + "Foot_CON");
addAttr -ln ikFk -k 1 -at double -min 0 -max 10 -dv 0 ("|" + $sideLeg + "Foot_CON");
addAttr -ln kneeTwist -k 1 -at double -dv 0 ("|" + $sideLeg + "Foot_CON");

//Set driven key for IK/FK Switch
//-cd = current driver
setAttr ($sideLeg + "Foot_CON.ikFk") 0;
setAttr ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "IK_Hip_JntW1") 1;
setAttr ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "FK_Hip_JntW0") 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "FK_Hip_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "IK_Hip_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 10;
setAttr ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "IK_Hip_JntW1") 0;
setAttr ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "FK_Hip_JntW0") 1;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "FK_Hip_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "IK_Hip_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 0;
setAttr ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "FK_Knee_JntW0") 0;
setAttr ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "IK_Knee_JntW1") 1;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "FK_Knee_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "IK_Knee_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 10;
setAttr ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "FK_Knee_JntW0") 1;
setAttr ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "IK_Knee_JntW1") 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "FK_Knee_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "IK_Knee_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 0;
setAttr ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "FK_Ankle_JntW0") 0;
setAttr ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "IK_Ankle_JntW1") 1;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "FK_Ankle_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "IK_Ankle_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 10;
setAttr ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "FK_Ankle_JntW0") 1;
setAttr ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "IK_Ankle_JntW1") 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "FK_Ankle_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "IK_Ankle_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 0;
setAttr ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "FK_Ball_JntW0") 0;
setAttr ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "IK_Ball_JntW1") 1;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "FK_Ball_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "IK_Ball_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 10;
setAttr ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "FK_Ball_JntW0") 1;
setAttr ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "IK_Ball_JntW1") 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "FK_Ball_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "IK_Ball_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 0;

//Creates the IK handles for the inverse foot and IK Leg
ikHandle -n ($sideLeg + "BallIk") -sol ikSCsolver -s 0 -sj ($sideLeg + "IK_Ankle_Jnt") -ee ($sideLeg + "IK_Ball_Jnt"); //-sol = solver, -s = sticky
ikHandle -n ($sideLeg + "ToeIk") -sol ikSCsolver -s 0 -sj ($sideLeg + "IK_Ball_Jnt") -ee ($sideLeg + "IK_Toe_Jnt");
ikHandle -n ($sideLeg + "LegIk") -sol ikRPsolver -s 0 -sj ($sideLeg + "IK_Hip_Jnt") -ee($sideLeg + "IK_Ankle_Jnt");

//Group IK Handles for reverse foot
group -n ($sideLeg + "ToeTapGroup") ($sideLeg + "ToeIk") ($sideLeg + "BallIk");
group -n ($sideLeg + "PeelHeelGroup")($sideLeg + "LegIk");
group -n ($sideLeg + "ToePivotGroup") ($sideLeg + "ToeTapGroup") ($sideLeg + "PeelHeelGroup");
group -n ($sideLeg + "HeelPivotGroup");
group -n ($sideLeg + "FootGroup");

//Creates the nodes for the Solid Knee Setup
createRenderNodeCB -asUtility "" multiplyDivide"";

//Renames the utility nodes
rename ("multiplyDivide1") ($sideLeg + "flipKneeRotate");

//Connects the attributes between the foot controller, the utility nodes and the leg's IK
connectAttr ($sideLeg + "Foot_CON.kneeTwist") ($sideLeg + "flipKneeRotate.input1X");
connectAttr ($sideLeg + "flipKneeRotate.outputX") ($sideLeg + "LegIk.twist");

setAttr ($sideLeg + "flipKneeRotate.input2X") -1; //multiplies the output of the kneeFix with -1 to reverse the direction


//Move pivots of foot groups for reverse foot.
float $worldSpaceOfJoint[];

//xform = find or set any element in the transform node. It can also set pivot points.
//-ws = worldspace
//-rp = rotate pivot
//-q = query mode

$worldSpaceOfJoint = `xform -q -ws -rp ($sideLeg + "Ball_Jnt")`;
move -a $worldSpaceOfJoint[0] $worldSpaceOfJoint[1] $worldSpaceOfJoint[2] ($sideLeg + "ToeTapGroup.scalePivot") ($sideLeg + "ToeTapGroup.rotatePivot");

$worldSpaceOfJoint = `xform -q -ws -rp ($sideLeg + "Ball_Jnt")`;
move -a $worldSpaceOfJoint[0] $worldSpaceOfJoint[1] $worldSpaceOfJoint[2] ($sideLeg + "PeelHeelGroup.scalePivot") ($sideLeg + "PeelHeelGroup.rotatePivot");

$worldSpaceOfJoint = `xform -q -ws -rp ($sideLeg + "Toe_Jnt")`;
move -a $worldSpaceOfJoint[0] $worldSpaceOfJoint[1] $worldSpaceOfJoint[2] ($sideLeg + "ToePivotGroup.scalePivot") ($sideLeg + "ToePivotGroup.rotatePivot");

$worldSpaceOfJoint = `xform -q -ws -rp ($sideLeg + "Ankle_Jnt")`;
move -a $worldSpaceOfJoint[0] $worldSpaceOfJoint[1] $worldSpaceOfJoint[2] ($sideLeg + "HeelPivotGroup.scalePivot") ($sideLeg + "HeelPivotGroup.rotatePivot");

$worldSpaceOfJoint = `xform -q -ws -rp ($sideLeg + "Ball_Jnt")`;
move -a $worldSpaceOfJoint[0] $worldSpaceOfJoint[1] $worldSpaceOfJoint[2] ($sideLeg + "FootGroup.scalePivot") ($sideLeg + "FootGroup.rotatePivot");

//Attach Foot Controller
group -n ($sideLeg + "Foot_CONAlign") ($sideLeg + "Foot_CON");
delete `orientConstraint ($sideLeg + "Ball_Jnt") ($sideLeg + "Foot_CONAlign")`;
delete `pointConstraint ($sideLeg + "Ball_Jnt") ($sideLeg + "Foot_CONAlign")`;
parent ($sideLeg + "FootGroup") ($sideLeg + "Foot_CON");
FreezeTransformations;
performFreezeTransformations(0);
setAttr ($sideLeg + "LegIk.poleVectorX") 0;
setAttr ($sideLeg + "LegIk.poleVectorY") 0;
setAttr ($sideLeg + "LegIk.poleVectorZ") 0;

// SET DRIVEN KEY FOR REVERSE FOOT
// TOE TAP
setAttr ($sideLeg + "Foot_CON.toeTap") 0;
setAttr ($sideLeg + "ToeTapGroup.rotate" + $footAxis) 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.toeTap") ($sideLeg + "ToeTapGroup.rotate" + $footAxis);

setAttr ($sideLeg + "Foot_CON.toeTap") 10;
setAttr ($sideLeg + "ToeTapGroup.rotate" + $footAxis) (90*$isFootNegative);
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.toeTap") ($sideLeg + "ToeTapGroup.rotate" + $footAxis);

setAttr ($sideLeg + "Foot_CON.toeTap") -10;
setAttr ($sideLeg + "ToeTapGroup.rotate" + $footAxis) (-90*$isFootNegative);
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.toeTap") ($sideLeg + "ToeTapGroup.rotate" + $footAxis);
setAttr ($sideLeg + "Foot_CON.toeTap") 0;

// PEEL HEEL
setAttr ($sideLeg + "Foot_CON.peelHeel") 0;
setAttr ($sideLeg + "PeelHeelGroup.rotate" + $footAxis) 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.peelHeel") ($sideLeg + "PeelHeelGroup.rotate" + $footAxis);

setAttr ($sideLeg + "Foot_CON.peelHeel") 10;
setAttr ($sideLeg + "PeelHeelGroup.rotate" + $footAxis) (90*$isFootNegative);
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.peelHeel") ($sideLeg + "PeelHeelGroup.rotate" + $footAxis);
setAttr ($sideLeg + "Foot_CON.peelHeel") 0;

// STAND TIP
setAttr ($sideLeg + "Foot_CON.standTip") 0;
setAttr ($sideLeg + "ToePivotGroup.rotate" + $footAxis) 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.standTip") ($sideLeg + "ToePivotGroup.rotate" + $footAxis);

setAttr ($sideLeg + "Foot_CON.standTip") 10;
setAttr ($sideLeg + "ToePivotGroup.rotate" + $footAxis) (90*$isFootNegative);
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.standTip") ($sideLeg + "ToePivotGroup.rotate" + $footAxis);
setAttr ($sideLeg + "Foot_CON.standTip") 0;

// TWIST HEEL
setAttr ($sideLeg + "Foot_CON.twistHeel") 0;
setAttr ($sideLeg + "HeelPivotGroup.rotateY") 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.twistHeel") ($sideLeg + "HeelPivotGroup.rotateY");

setAttr ($sideLeg + "Foot_CON.twistHeel") -10;
setAttr ($sideLeg + "HeelPivotGroup.rotateY") 90;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.twistHeel") ($sideLeg + "HeelPivotGroup.rotateY");

setAttr ($sideLeg + "Foot_CON.twistHeel") 10;
setAttr ($sideLeg + "HeelPivotGroup.rotateY") -90;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.twistHeel") ($sideLeg + "HeelPivotGroup.rotateY");
setAttr ($sideLeg + "Foot_CON.twistHeel") 0;

// TWIST TOE
setAttr ($sideLeg + "Foot_CON.twistToe") 0;
setAttr ($sideLeg + "ToePivotGroup.rotateY") 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.twistToe") ($sideLeg + "ToePivotGroup.rotateY");

setAttr ($sideLeg + "Foot_CON.twistToe") -10;
setAttr ($sideLeg + "ToePivotGroup.rotateY") 90;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.twistToe") ($sideLeg + "ToePivotGroup.rotateY");

setAttr ($sideLeg + "Foot_CON.twistToe") 10;
setAttr ($sideLeg + "ToePivotGroup.rotateY") -90;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.twistToe") ($sideLeg + "ToePivotGroup.rotateY");
setAttr ($sideLeg + "Foot_CON.twistToe") 0;

//Setup is finished, inform user that the script has made it all the way through.
print ("The " + $sideLegLong + " leg has been setup. \n");
}
}

Orient controller to joint script

//////////////////////////////////////////////////////////////////
//jointOrientController.mel //
//Scripted By: Duylinh Nguyen //
//Description: This script takes a curve, orients it to the //
//desired joint and applies an orient constraint on the //
//joint. //
//How to use- //
//type jointOrient "name of controller" "name of joint"; //
//ie. jointOrient shoulder_CON shouler_Jnt; //
//////////////////////////////////////////////////////////////////

proc jointOrient (string $conName, string $jntName)
{
//Creates a group Null
select -r ($conName);
group -n ($conName + "_NULL");
//Snaps the controller to the desired joint, rotates and freezes it's transforms
pointConstraint -offset 0 0 0 -weight 1 $jntName ($conName + "_NULL") ;
delete ($conName + "_NULL_pointConstraint1");
setAttr ($conName + "_NULL.rotateZ")90;
FreezeTransformations;
//Snaps the orientation of the controller to the joint
orientConstraint -offset 0 0 0 -weight 1 $jntName ($conName + "_NULL");
delete ($conName + "_NULL_orientConstraint1");
//Orient Constrains the joint to the controller
orientConstraint -offset 0 0 0 -weight 1 $conName $jntName;
}

Yet another big update

It seems my posts are getting fewer and further apart. I'll try my best from now on to update this on a for normal basis. I've been in a scripting mood lately, so if you see several scripts, you'll know why haha.

First sculpt pass for my orc


Still have to design clothing for this dude



A Tank I modeled for my students to create LOD's for

Tuesday, April 5, 2011

Super Post!!

It seems the gap between each post is getting larger and larger. hmm.. I need to change that. There are a few pieces I've been backlogged on posting. I figured I should at least post my work haha.

A rather quick 3d sculpt I did and figured I should start texturing the poor old man.




A new female sculpt that I'm still working on and refining. No worries, she will have clothing in the end.



A male 3d model I decided to work on in Maya. Work in progress



A digital painting I made for Sally. She's a huge fan of the newer Hawaii Five-O


A tank I made for my students so they could create LOD models for their final.



Textures I used to create the shader for the old man.
Overall Color


Diffuse Color


Epidermal Color


Subdermal Color


Backscatter Color


Roughness


Reflection


Gloss


Displacement


Normal (Only for pores)

Wednesday, January 26, 2011

Audi S5

Audi S5 I worked on for a few days as part of my daily digital sketchbook. The model was made using 3ds Max 2011 as a way to get me to practice using 3ds Max again to model. I must say it took me longer then it would have if I were to use Maya. I guess my modeling style just revolves around Maya's tools so much. It was a nice change of pace though.