Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pymel.core import *
- import math
- def getHiChild(jnt):# gets all children joints
- jnt = jnt
- jntHi = []
- catcher = 100
- while jnt:
- jntHi.append(jnt)
- jnt = listRelatives(jnt,c=1)
- if catcher == 0:
- print "breaking"
- break
- catcher -= 1
- return jntHi
- def getHiPap(jnt):# gets all parent joint
- jntHi = []
- catcher = 100
- x = 1
- while jnt:
- if nodeType(jnt) != "joint":
- break
- if x:
- jntHi.append(jnt)
- x = 0
- else:
- jntHi.append(jnt[0])
- jnt = listRelatives(jnt,p=1)
- if catcher == 0:
- print "breaking"
- break
- catcher -= 1
- return jntHi
- sl = selected()
- for s in sl:
- shi = getHiPap(s)
- r = .1
- minS = .1
- maxS = 1
- range = len(shi)
- js = getAttr(shi[-1].radius)# joint size
- r = float(js)/float(range)
- x = 0
- for ss in shi:
- print x
- x += r
- setAttr(ss.radius, x)
- #norm = .1 +(x-A)*(10-1)/(B-A)
- #y = 1 + (x-A)*(10-1)/(B-A)
- """
- for ss in shi:
- #setAttr(ss.radius, r)
- normalized = (x-min(x))/(max(x)-min(x))
- r += .2
- """
Advertisement
Add Comment
Please, Sign In to add comment