class specificationError(Exception): pass ##### Path to deafult in the base pose to alter ##### baseHCposeFile = path.join(funcs.resources_dir, "fsBaseOpticalClosedToOpen.yml") ##### Establish joint angles for the base hand ##### index = hc.finger(MCP=(180, 5), PIP=180, DIP=180) middle = hc.finger(MCP=(180, 2), PIP=180, DIP=180) ring = hc.finger(MCP=(180, -2), PIP=180, DIP=180) pinky = hc.finger(MCP=(180, -4), PIP=180, DIP=180) thmb = hc.thumb(CM=hc.joint(dfFlex=15, dfAbd=9, dfRot=27, dfPro=None), MCP=180, IP=180) wrist = (0, 0, 0) # the wrist values here are not those in the pose file, these need to be changed in the future baseHC = hc.armconfiguration(hc.handconfiguration(index, middle, ring, pinky, thmb), wrist) def ntz(value): """Change a none to zero""" if value == None: value = 0 return value def renderImage(hc, imageOutFile, baseHCposeFile=baseHCposeFile, baseHC=baseHC): ##### Read in the base pose to alter ##### baseHCposefile = open(baseHCposeFile, "r") baseHCpose = yaml.load(baseHCposefile) baseHCposefile.close()
def toArmTarget(self): wrist = hc.joint(dfFlex=phonoOrientations[self.orientation][0], dfRot=phonoOrientations[self.orientation][1], dfPro=phonoOrientations[self.orientation][2]) return hc.armconfiguration(hand=self.handshape.toHandconfigTarget() , wrist=wrist)