NavHeader
journalHeader

Friday, January 14, 2011

Couple of updates...

Great animation I got in the mail from Mike P:



  • Updated the Morpheus Docs with info on the wardrobe project, instructions on mesh selection, and tips for selecting/keying stuff
  • Added page for the bbThingamarig project. Not a whole lot there yet:)
  • TD Matt is awesome
  • Allergies are winning today.

Thursday, January 13, 2011

Announcing the Morpheus Wardrobe Project


From one of the folks there


It's my pleasure to announce the baton has been taken up by the good folks at Ex'pression College to head a Morphy Wardrobe Project. It will be a free to use library that their students will be working on as well as inviting participation from anyone who wants to participate. It's so exciting to see folks excited about Morpheus and wanting to take it further. We'll be establishing protocols for props and clothes to make sure everything works great. Check it out!

In the meantime, work continues on the tools to make the rig even better with 2.0.

And some more great examples of his use from the 11 second club last month:

Wednesday, January 12, 2011

distanceTools.py is kinda workin okay...

Color me surprised. Been workin on this the last two days. Some of the foundation stuff for the project. Still getting used to syntax changes but really enjoying the flexibility python affords.

Also found a better way to display code in posts, woot woot!


"""
distanceTools.py
Josh Burton
www.joshburton.com
1/12/2011

Collection of functions for measuring stuff!

Function Key:
1) distanceBetweenPoints (point1, point2)
    return - distance
    
2) distanceBetweenObjects (obj1, obj2)
    return - distance
    
3) getWSPos (obj)
    return - world space position in array format
    
4) distanceBetweenObjectsArray (objArray)
    return - array of distances between each object in the input array

5) averageDistanceBetweenObjects (objArray)
    return - average of the distancees between the objects in the input array
    
6) measureDistanceBetweenObjs (objArray)
    creates - measure nodes between all ojects in the list,names them,  
              checks for a 'measure_grp' and if it finds none, creates it, parents distance nodes under that 


"""


""" returns the distance between two points in space """
def distanceBetweenPoints (point1, point2):
    from math import sqrt,pow
    distance = sqrt( pow(point1[0]-point2[0], 2) + pow(point1[1]-point2[1], 2) + pow(point1[2]-point2[2], 2) )
    return distance




""" returns the distance between two object's pivots """
def distanceBetweenObjects (obj1, obj2):
    from math import sqrt,pow
    point1 = getWSPos (obj1)
    point2 = getWSPos (obj2)
    distance = sqrt( pow(point1[0]-point2[0], 2) + pow(point1[1]-point2[1], 2) + pow(point1[2]-point2[2], 2) )
    return distance




""" simple worldspace position query """
def getWSPos (obj):
    pos = cmds.xform (obj,q=True, ws=True, rp=True)
    return pos




""" Pass an array of objects into it and get an array of distances """
def distanceBetweenObjectsArray (objArray):
    from math import sqrt,pow
    cnt = 0
    objPositionArray = []
    distancesArray = []
    cnt = (len(objArray) - 1)
    firstTermCnt = 0
    seoncTermCnt = 1

    for obj in objArray:                    
        """get its positional data"""
        tempPos = getWSPos (obj)
        objPositionArray.append (tempPos)
    
    while cnt > 0:
        point1 = objPositionArray[firstTermCnt]
        point2 = objPositionArray[seoncTermCnt]
        distance = sqrt( pow(point1[0]-point2[0], 2) + pow(point1[1]-point2[1], 2) + pow(point1[2]-point2[2], 2) )        
        distancesArray.append (distance)
        firstTermCnt +=1
        seoncTermCnt +=1
        cnt -= 1
  
        if (cnt == 0):
            break
    
    return distancesArray




""" averages the distance between objects in an array"""
def averageDistanceBetweenObjects (objArray):
    distanceArray = distanceBetweenObjectsArray (objArray)
    average = float(sum(distanceArray)) / len(distanceArray)
    return average 



""" Makes measure nodes between every object in the array """
def measureDistanceBetweenObjs (objArray):
    """need to add grouping and naming if I wanna use this"""
    cnt = 0
    locatorPositionArray = []
    cnt = (len(locArray) - 1)
    firstTermCnt = 0
    seoncTermCnt =1
    distanceObjArray = []
    coreNameArray = []
       
    if objExists ('measure_grp'):
        pass    
        
    else:
        tmp = cmds.group (empty=True, name='measure_grp')
        cmds.xform (tmp, os=True, piv= (0,0,0))
    
    for obj in objArray:                    
        """get its positional data"""
        tempPos = cmds.xform (obj,q=True, ws=True, rp=True)
        locatorPositionArray.append (tempPos)
        
        tmp = obj.split('_')
        coreNameArray.append (tmp[0])      
    
    while cnt > 0:
        distanceObj = cmds.distanceDimension( sp=locatorPositionArray[firstTermCnt], ep=locatorPositionArray[seoncTermCnt] )
        tmp = cmds.listRelatives ( [distanceObj], p=True)
        tmp = cmds.rename (tmp, (coreNameArray[firstTermCnt]+'_to_'+coreNameArray[seoncTermCnt]+'_distMeas') )
        distanceObjArray.append (distanceObj)
        firstTermCnt +=1
        seoncTermCnt +=1
        cnt -= 1
            
        cmds.parent (tmp,'measure_grp')

        if (cnt == 0):
            break        

Tuesday, January 11, 2011

Thinkin bout spines...

Python training is coming along well. At least Bokser hasn't gotten the switch out yet. Started into classes yesterday and they're pretty amazing. Progress is humming along on the "skeleton" of bbThingamarig. Bokser must have  had a late night and I have no new python assignments for the morning so in the meantime I thought some r&d would be fitting.

So spines are tricky things. For starters, I'm not thrilled with Morphy's current spine as I've said before and it's one of my major issues with the rig as a whole. That's something I plan on rectifying. And how!

In keeping with Master Schleifer's instruction, the first thing to do is to think. Why don't I like morphy's spine, how it might be better, and look at some other spines out there.

  • Pivots - for starters my pivots are off. I had a version at the end for the testers that was much better but it was gonna add a good bit of work to roll in and I'd rather just do it from scratch.
  • Reverse spine - I've been playing with a prototype spine from my good friend Scott Englert that uses it and it's an intriguing concept
  • Extra channels - another buddy, Tony Bonilla asked for an extra rotation transform on the cog to deal with spins so that's something I wanna do as well.
  • FK/IK blend or more of a mode system - Some rigs go for a strictly fk/ik spine (TSM comes to mind) with a switch while others go for a more hybrid approach (which Morphy's current rig is). At this point I'm leaning towards one or the other with snapping between the two but I'm definitely open to suggestion
  • Ribbon spine - Seen this bandied about some so I'm lookin into this as well courtesy of Aaron Holly's "Rigging for Feature Animation"
  • Any further suggestions for things to look into?
Also, made some homemade mushroom soup this weekend that was the base of some tasty strogganoff which I'm fixin to have for lunch. Just thought the internets would like to know that.

Thursday, January 6, 2011

Python Baby!

Digging in to Python on the tutelage of my good friend and Python Master Bokser. I have to say I have a lot of fun doing scripting and td stuff - it's so immediate in it's objectivity. It works or it doesn't. Me likee.


We're getting underway with what I am temporarily calling 'bbThingamarig'. At this point we're working on low level function building blocks.

Here's a snippit:
def setRotationOrderOnJoint (jnt, ro):
    #Checks for valid rotation order
    validRO = 'True'
    rotationOrderOptions = ['xyz','yzx','zxy','xzy','yxz','zyx']
    if not ro in rotationOrderOptions:
        print (ro + ' is not a valid rotation order. Skipping')
        validRO = 'False'
    else:
        cmds.joint (jnt, e=True, rotationOrder= ro)
    return validRO
I hope to share some fun news about Morphy in the next few days that should prove to provide even more goodies for the community. Good stuff.

What else is going on...ice proofing exterior pipes, training Atticus the super dog on a wireless fence and becoming more convinced that there is a national conspiracy that all barbers have to scalp me every time I grace a barber shop. Good times.

Hope everyone made some good resolutions that last longer than the month:) 

All the stuff on this site is 2000 - by Josh Burton...unless otherwise noted. All rights reserved.