def addObjects(self): """Add the Guide Root, blade and locators""" # eye guide self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [0, 0, 1]) self.rotcenter = self.addLoc("rotcenter", self.root, vTemp) vTemp = transform.getOffsetPosition(self.root, [0, .3, 1.3]) self.lipup = self.addLoc("lipup", self.rotcenter, vTemp) vTemp = transform.getOffsetPosition(self.root, [0, -.3, 1.3]) self.liplow = self.addLoc("liplow", self.rotcenter, vTemp) vTemp = transform.getOffsetPosition(self.root, [0, -2, 2]) self.jaw = self.addLoc("jaw", self.root, vTemp) centers = [self.root, self.rotcenter] self.dispcrv = self.addDispCurve("crv", centers) centers = [self.lipup, self.rotcenter] self.dispcrv = self.addDispCurve("crv", centers) centers = [self.liplow, self.rotcenter] self.dispcrv = self.addDispCurve("crv", centers) centers = [self.root, self.jaw] self.dispcrv = self.addDispCurve("crv", centers)
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [0, 1, 0]) self.neck = self.addLoc("neck", self.root, vTemp) vTemp = transform.getOffsetPosition(self.root, [0, 1.1, 0]) self.head = self.addLoc("head", self.neck, vTemp) vTemp = transform.getOffsetPosition(self.root, [0, 2, 0]) self.eff = self.addLoc("eff", self.head, vTemp) v0 = vector.linearlyInterpolate( self.root.getTranslation(space="world"), self.neck.getTranslation(space="world"), 0.333, ) self.tan0 = self.addLoc("tan0", self.root, v0) v1 = vector.linearlyInterpolate( self.root.getTranslation(space="world"), self.neck.getTranslation(space="world"), 0.666, ) self.tan1 = self.addLoc("tan1", self.neck, v1) self.blade = self.addBlade("blade", self.root, self.tan0) centers = [self.root, self.tan0, self.tan1, self.neck] self.dispcrv = self.addDispCurve("neck_crv", centers, 3) centers = [self.neck, self.head, self.eff] self.dispcrv = self.addDispCurve("head_crv", centers, 1)
def addObjects(self): self.root = self.addRoot() vTemp = tra.getOffsetPosition(self.root, [0, 1, 0]) self.neck = self.addLoc("neck", self.root, vTemp) # v1 = vec.linearlyInterpolate(self.root.getTranslation(space="world"), self.neck.getTranslation(space="world"), .666) v1 = tra.getOffsetPosition(self.root, [0, 1.5, 0]) self.eff0 = self.addLoc("eff0", self.neck, v1) vTemp = tra.getOffsetPosition(self.root, [0, 1.5, 0]) self.head = self.addLoc("head", self.neck, vTemp) vTemp = tra.getOffsetPosition(self.root, [0, 2, 0]) self.eff1 = self.addLoc("eff1", self.head, vTemp) v0 = tra.getOffsetPosition(self.root, [0, 1, 0.0001]) self.tan0 = self.addLoc("tan0", self.root, v0) self.blade = self.addBlade("blade", self.root, self.tan0) centers = [self.root, self.neck, self.head] self.dispcrv = self.addDispCurve("neck_crv", centers, 3) centers = [self.neck, self.eff0] self.dispcrv = self.addDispCurve("neck_crv", centers, 1) centers = [self.head, self.eff1] self.dispcrv = self.addDispCurve("head_crv", centers, 1)
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [0, 3, 0]) self.tip = self.addLoc("tip", self.root, vTemp) vTemp = transform.getOffsetPosition(self.root, [0, 1, 0]) self.tan0 = self.addLoc("tan0", self.root, vTemp) vTemp = transform.getOffsetPosition(self.root, [0, 2, 0]) self.tan1 = self.addLoc("tan1", self.tip, vTemp) vTemp = transform.getOffsetPosition(self.root, [0, 4, 0]) self.tan2 = self.addLoc("tan2", self.tip, vTemp) vTemp = transform.getOffsetPosition(self.root, [0, 5, 0]) self.tiptan = self.addLoc("tiptan", self.tan2, vTemp) self.blade = self.addBlade("blade", self.root, self.tan0) centers = [ self.root, self.tan0, self.tan1, self.tip, self.tan2, self.tiptan ] self.dispcrv = self.addDispCurve("spline_crv", centers, 3) centers = [self.root, self.tan0] self.dispcrv = self.addDispCurve("tangentA_crv", centers, 1) centers = [self.tan1, self.tip, self.tan2, self.tiptan] self.dispcrv = self.addDispCurve("tangentB_crv", centers, 1)
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [2, 0, 0]) self.loc = self.addLoc("tip", self.root, vTemp) self.blade = self.addBlade("blade", self.root, self.loc) vTemp = transform.getOffsetPosition(self.root, [3, 0, 0]) self.orbit = self.addLoc("orbit", self.root, vTemp) centers = [self.root, self.loc, self.orbit] self.dispcrv = self.addDispCurve("crv", centers)
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [0, -3, 0.1]) self.knee = self.addLoc("knee", self.root, vTemp) vTemp = transform.getOffsetPosition(self.root, [0, -6, 0]) self.ankle = self.addLoc("ankle", self.knee, vTemp) vTemp = transform.getOffsetPosition(self.root, [0, -6, .5]) self.eff = self.addLoc("eff", self.ankle, vTemp) centers = [self.root, self.knee, self.ankle, self.eff] self.dispcrv = self.addDispCurve("crv", centers)
def addObjects(self): self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [0, 0, 1]) self.sizeRef = self.addLoc("sizeRef", self.root, vTemp) pm.delete(self.sizeRef.getShapes()) attribute.lockAttribute(self.sizeRef) vTemp = transform.getOffsetPosition(self.root, [0, 0, 0]) self.pivot = self.addLoc("pivot", self.root, vTemp) centers = [self.root, self.pivot] self.dispcrv = self.addDispCurve("crv", centers)
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [3, 0, -.01]) self.elbow = self.addLoc("elbow", self.root, vTemp) vTemp = transform.getOffsetPosition(self.root, [6, 0, 0]) self.wrist = self.addLoc("wrist", self.elbow, vTemp) vTemp = transform.getOffsetPosition(self.root, [7, 0, 0]) self.eff = self.addLoc("eff", self.wrist, vTemp) self.dispcrv = self.addDispCurve( "crv", [self.root, self.elbow, self.wrist, self.eff])
def addObjects(self): self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [0, 0, 1]) self.sizeRef = self.addLoc("sizeRef", self.root, vTemp) pm.delete(self.sizeRef.getShapes()) attribute.lockAttribute(self.sizeRef)
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [0, 4, 0]) self.tip = self.addLoc("tip", self.root, vTemp) vTan0 = vector.linearlyInterpolate( self.root.getTranslation(space="world"), self.tip.getTranslation(space="world"), 0.3333) self.tan0 = self.addLoc("tan0", self.root, vTan0) vTan1 = vector.linearlyInterpolate( self.tip.getTranslation(space="world"), self.root.getTranslation(space="world"), 0.3333) self.tan1 = self.addLoc("tan1", self.tip, vTan1) self.blade = self.addBlade("blade", self.root, self.tan0) # spine curve centers = [self.root, self.tan0, self.tan1, self.tip] self.dispcrv = self.addDispCurve("crv", centers, 3) self.dispcrv.attr("lineWidth").set(5) # tangent handles self.disp_tancrv0 = self.addDispCurve("crvTan0", [self.root, self.tan0]) self.disp_tancrv1 = self.addDispCurve("crvTan1", [self.tip, self.tan1])
def addObjects(self): self.root = self.add2DRoot() vTemp = transform.getOffsetPosition(self.root, [0, 0, 1]) self.sizeRef = self.addLoc("sizeRef", self.root, vTemp) pm.delete(self.sizeRef.getShapes()) attribute.lockAttribute(self.sizeRef) # Now we need to show the range of the controls with # template curves. arrow_curves = [ self.addTCurve(self.getName("up"), datatypes.Vector(0, 0, 0), self.root), self.addTCurve(self.getName("right"), datatypes.Vector(0, 0, -90), self.root), self.addTCurve(self.getName("down"), datatypes.Vector(0, 0, 180), self.root), self.addTCurve(self.getName("left"), datatypes.Vector(0, 0, 90), self.root) ] for [arrow_curve, param] in zip(arrow_curves, ["ty_positive", "tx_positive", "ty_negative", "tx_negative"]): sh = arrow_curve.getShape() sh.template.set(1) self.root.attr(param) >> sh.visibility self.root.addChild(sh, add=True, shape=True) pm.delete(arrow_curves)
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [0, 0, 0.5]) self.spineBase = self.addLoc("spineBase", self.root, vTemp) vTemp = transform.getOffsetPosition(self.root, [0, 0, 4]) self.spineTop = self.addLoc("spineTop", self.spineBase, vTemp) vTemp = transform.getOffsetPosition(self.root, [0, 0, 5]) self.chest = self.addLoc("chest", self.spineTop, vTemp) vTan0 = vector.linearlyInterpolate( self.spineBase.getTranslation(space="world"), self.spineTop.getTranslation(space="world"), 0.3333, ) self.tan0 = self.addLoc("tan0", self.spineBase, vTan0) vTan1 = vector.linearlyInterpolate( self.spineTop.getTranslation(space="world"), self.spineBase.getTranslation(space="world"), 0.3333, ) self.tan1 = self.addLoc("tan1", self.spineTop, vTan1) self.blade = self.addBlade("blade", self.root, self.spineTop) # spine curve self.disp_crv_hip = self.addDispCurve( "crvHip", [self.root, self.spineBase] ) self.disp_crv_chst = self.addDispCurve( "crvChest", [self.spineTop, self.chest] ) centers = [self.spineBase, self.tan0, self.tan1, self.spineTop] self.dispcrv = self.addDispCurve("crv", centers, 3) self.dispcrv.attr("lineWidth").set(5) # tangent handles self.disp_tancrv0 = self.addDispCurve( "crvTan0", [self.spineBase, self.tan0] ) self.disp_tancrv1 = self.addDispCurve( "crvTan1", [self.spineTop, self.tan1] )
def addObjects(self): """Add the Guide Root, blade and locators""" lockAttrs = ["tx", "ry", "rz"] self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [0, -3, 0.1]) self.knee = self.addLoc("knee", self.root, vTemp) attribute.lockAttribute(self.knee, lockAttrs) vTemp = transform.getOffsetPosition(self.root, [0, -6, 0]) self.ankle = self.addLoc("ankle", self.knee, vTemp) attribute.lockAttribute(self.ankle, lockAttrs) vTemp = transform.getOffsetPosition(self.root, [0, -9, .2]) self.foot = self.addLoc("foot", self.ankle, vTemp) attribute.lockAttribute(self.foot, lockAttrs) vTemp = transform.getOffsetPosition(self.root, [0, -9, 1]) self.eff = self.addLoc("eff", self.foot, vTemp) centers = [self.root, self.knee, self.ankle, self.foot, self.eff] self.dispcrv = self.addDispCurve("crv1", centers)
def addObjects(self): """Add the Guide Root, blade and locators""" # eye guide self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [0, 0, 0]) vTemp = transform.getOffsetPosition(self.root, [-.1, 0, 0]) self.brow1 = self.addLoc('brow1', self.root, vTemp) self.brow1.s.set(.2, .2, .2) vTemp = transform.getOffsetPosition(self.root, [0, 0, 0]) self.brow2 = self.addLoc('brow2', self.root, vTemp) self.brow2.s.set(.2, .2, .2) vTemp = transform.getOffsetPosition(self.root, [.1, 0, 0]) self.brow3 = self.addLoc('brow3', self.root, vTemp) self.brow3.s.set(.2, .2, .2)
def addObjects(self): self.root = self.addRoot() vTemp = tra.getOffsetPosition(self.root, [2, 0, 0]) self.loc = self.addLoc("tip", self.root, vTemp) self.blade = self.addBlade("blade", self.root, self.loc) centers = [self.root, self.loc] self.dispcrv = self.addDispCurve("crv", centers)
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [0, 4, 0]) self.eff = self.addLoc("eff", self.root, vTemp) self.blade = self.addBlade("blade", self.root, self.eff) centers = [self.root, self.eff] self.dispcrv = self.addDispCurve("crv", centers)
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() self.uplocs = self.addLocMulti("#_uploc", self.root) v = transform.getOffsetPosition(self.root, [0., 1.0, 0.0]) self.upPos = self.addLoc("uploc", self.root, v) v = transform.getOffsetPosition(self.root, [0., -0.1, 0.0]) self.lowPos = self.addLoc("lowloc", self.root, v) v = transform.getOffsetPosition(self.root, [0, 0.0000001, 2.5]) self.tan = self.addLoc("tan", self.root, v) self.blade = self.addBlade("blade", self.root, self.tan) v = transform.getTranslation(self.root) self.sliding_surface = self.addSliderSurface("sliding_surface", self.root, v)
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() self.locs = self.addLocMulti("#_loc", self.root) centers = [self.root] centers.extend(self.locs) self.dispcrv = self.addDispCurve("crv", centers) # Heel and pivots vTemp = transform.getOffsetPosition(self.root, [0, -1, -1]) self.heel = self.addLoc("heel", self.root, vTemp) vTemp = transform.getOffsetPosition(self.root, [1, -1, -1]) self.outpivot = self.addLoc("outpivot", self.root, vTemp) vTemp = transform.getOffsetPosition(self.root, [-1, -1, -1]) self.inpivot = self.addLoc("inpivot", self.root, vTemp) cnt = [self.root, self.heel, self.outpivot, self.heel, self.inpivot] self.dispcrv = self.addDispCurve("1", cnt)
def addObjects(self): self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [0, 0, 1]) self.sizeRef = self.addLoc("sizeRef", self.root, vTemp) pm.delete(self.sizeRef.getShapes()) attribute.lockAttribute(self.sizeRef) self.lookat = self.addLoc("lookat", self.root, vTemp) v = transform.getTranslation(self.root) self.sliding_surface = self.addSliderSurface("sliding_surface", self.root, v)
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [0, 1, 0]) self.top_loc = self.addLoc("top", self.root, vTemp) centers = [self.root, self.top_loc] self.dispcrv = self.addDispCurve("crv", centers) vTemp = transform.getOffsetPosition(self.root, [0, -1, 0]) self.bottom_loc = self.addLoc("bottom", self.root, vTemp) centers = [self.root, self.bottom_loc] self.dispcrv = self.addDispCurve("crv", centers) vTemp = transform.getOffsetPosition(self.root, [1, 0, 0]) self.ext_loc = self.addLoc("ext", self.root, vTemp) centers = [self.root, self.ext_loc] self.dispcrv = self.addDispCurve("crv", centers) vTemp = transform.getOffsetPosition(self.root, [-1, 0, 0]) self.int_loc = self.addLoc("int", self.root, vTemp) centers = [self.root, self.int_loc] self.dispcrv = self.addDispCurve("crv", centers)
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() self.locs = self.addLocMulti("#_loc", self.root) v = transform.getOffsetPosition(self.locs[0], [0, 0.1, 0.0001]) self.tan = self.addLoc("tan", self.root, v) self.blade = self.addBlade("blade", self.root, self.tan) centers = [self.root] centers.extend(self.locs) self.dispcrv = self.addDispCurve("crv", centers) self.addDispCurve("crvRef", centers, 3)
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() self.uplocs = self.addLocMulti("#_uploc", self.root) self.lowlocs = self.addLocMulti("#_lowloc", self.root) v = transform.getOffsetPosition(self.root, [-1, 0.0, 0.0]) self.inPos = self.addLoc("inloc", self.root, v) v = transform.getOffsetPosition(self.root, [1., 0.0, 0.0]) self.outPos = self.addLoc("outloc", self.root, v) v = transform.getOffsetPosition(self.root, [0., 1.0, 0.0]) self.upPos = self.addLoc("uploc", self.root, v) v = transform.getOffsetPosition(self.root, [0., -1.0, 0.0]) self.lowPos = self.addLoc("lowloc", self.root, v) centers = [self.inPos] centers.extend(self.uplocs) centers.append(self.outPos) self.dispcrv = self.addDispCurve("crv", centers) self.addDispCurve("crvRef", centers, 3) centers = [self.inPos] centers.extend(self.lowlocs) centers.append(self.outPos) self.dispcrv = self.addDispCurve("crv", centers) self.addDispCurve("crvRef", centers, 3) v = transform.getTranslation(self.root) self.eyeMesh = self.addEyeMesh("eyeMesh", self.root, v) v = transform.getOffsetPosition(self.root, [0, 0.0000001, 2.5]) self.tan = self.addLoc("tan", self.root, v) self.blade = self.addBlade("blade", self.root, self.tan)
def addObjects(self): """Add the Guide Root, blade and locators""" self.root = self.addRoot() vTemp = transform.getOffsetPosition(self.root, [3, 0, -.01]) self.elbow = self.addLoc("elbow", self.root, vTemp) vTemp = transform.getOffsetPosition(self.root, [6, 0, 0]) self.wrist = self.addLoc("wrist", self.elbow, vTemp) vTemp = transform.getOffsetPosition(self.root, [7, 0, 0]) self.eff = self.addLoc("eff", self.wrist, vTemp) self.dispcrv = self.addDispCurve( "crv", [self.root, self.elbow, self.wrist, self.eff]) # ----------------EXTRA GUIDE BITS----------------- # finger0 self.finger0Start = self.addLoc("finger0Start", self.root, (0, 0, 0)) vTemp = transform.getOffsetPosition(self.finger0Start, [0, -2, 0]) self.finger0Mid = self.addLoc("finger0Mid", self.finger0Start, vTemp) vTemp = transform.getOffsetPosition(self.finger0Start, [0, -4, 0]) self.finger0End = self.addLoc("finger0End", self.finger0Start, vTemp) # finger1 vTemp = transform.getOffsetPosition(self.elbow, [0, 0, 0]) self.finger1Start = self.addLoc("finger1Start", self.elbow, vTemp) vTemp = transform.getOffsetPosition(self.finger1Start, [0, -2, 0]) self.finger1Mid = self.addLoc("finger1Mid", self.finger1Start, vTemp) vTemp = transform.getOffsetPosition(self.finger1Start, [0, -4, 0]) self.finger1End = self.addLoc("finger1End", self.finger1Start, vTemp) # finger2 vTemp = transform.getOffsetPosition(self.wrist, [0, 0, 0]) self.finger2Start = self.addLoc("finger2Start", self.wrist, vTemp) vTemp = transform.getOffsetPosition(self.finger2Start, [0, -2, 0]) self.finger2Mid = self.addLoc("finger2Mid", self.finger2Start, vTemp) vTemp = transform.getOffsetPosition(self.finger2Start, [0, -4, 0]) self.finger2End = self.addLoc("finger2End", self.finger2Start, vTemp) # finger3 vWrist = pm.xform(self.wrist, q=1, t=1, ws=1) vEff = pm.xform(self.eff, q=1, t=1, ws=1) vAvg = [(vWrist[i] + vEff[i]) / 2.0 for i in range(3)] self.finger3Start = self.addLoc("finger3Start", self.wrist, vAvg) pm.parentConstraint(self.wrist, self.eff, self.finger3Start, mo=False) vTemp = transform.getOffsetPosition(self.finger3Start, [0, -2, 0]) self.finger3Mid = self.addLoc("finger3Mid", self.finger3Start, vTemp) vTemp = transform.getOffsetPosition(self.finger3Start, [0, -4, 0]) self.finger3End = self.addLoc("finger3End", self.finger3Start, vTemp) # finger4 vTemp = transform.getOffsetPosition(self.eff, [0, 0, 0]) self.finger4Start = self.addLoc("finger4Start", self.eff, vTemp) vTemp = transform.getOffsetPosition(self.finger4Start, [0, -2, 0]) self.finger4Mid = self.addLoc("finger4Mid", self.finger4Start, vTemp) vTemp = transform.getOffsetPosition(self.finger4Start, [0, -4, 0]) self.finger4End = self.addLoc("finger4End", self.finger4Start, vTemp)