def addParameters(self): if self.settings["ikrefarray"]: self.ikref_names = self.settings["ikrefarray"].split(",") else: self.ikref_names = [] if self.settings["upvrefarray"]: self.upvref_names = self.settings["upvrefarray"].split(",") else: self.upvref_names = [] self.ikref_count = len(self.ikref_names) self.upvref_count = len(self.upvref_names) # Anim ------------------------------------------- # Default parameter to get a better display in the keying panel self.pFullName = self.addAnimParam(self.fullName, c.siString, self.fullName, None, None, None, None, False, True, True) # IK/FK self.pBlend = self.addAnimParam("blend", c.siDouble, self.settings["blend"], 0, 1, 0, 1) self.pIkRoll = self.addAnimParam("roll", c.siDouble, 0, -180, 180, -180, 180) self.pIkCns = self.addAnimParam("ikcns", c.siBool, False, None, None, None, None, False, False, True) # Ik/Upv References if self.ikref_count > 1: self.pIkRef = self.addAnimParam("ikref", c.siInt4, 0, 0, self.ikref_count-1) if self.upvref_count > 1: self.pUpvRef = self.addAnimParam("upvref", c.siInt4, 0, 0, self.upvref_count-1) # Squash and Stretch self.pScale = self.addAnimParam("scale", c.siDouble, 1, 0, None, 0, 2) self.pMaxStretch = self.addAnimParam("maxstretch", c.siDouble, self.settings["maxstretch"], 1, None, 1, 2) self.pSoftness = self.addAnimParam("softness", c.siDouble, 0, 0, 1, 0, 1) self.pSlide = self.addAnimParam("slide", c.siDouble, .5, 0, 1, 0, 1) self.pReverse = self.addAnimParam("reverse", c.siDouble, 0, 0, 1, 0, 1) # Roundness self.pRoundness = self.addAnimParam("roundness", c.siDouble, 0, 0, 1, 0, 1) # Volume self.pVolume = self.addAnimParam("volume", c.siDouble, 1, 0, 1, 0, 1) # Setup ------------------------------------------ self.pDriver = self.addSetupParam("driver", c.siDouble, 0, 0, None, 0, 10, True) # FCurves self.pFCurveCombo = self.addSetupParam("fcurvecombo", c.siInt4, 0, 0, None) self.pSt_profile = self.addSetupFCurveParam("st_profile", self.settings["st_profile"]) self.pSq_profile = self.addSetupFCurveParam("sq_profile", self.settings["sq_profile"]) # Eval Fcurve self.st_value = fcu.getFCurveValues(self.pSt_profile.Value, self.divisions, .01) self.sq_value = fcu.getFCurveValues(self.pSq_profile.Value, self.divisions, .01) if self.options["mode"] == 1: # wip # Stretch/Squash/Roll params self.pEdit = self.addSetupParam("edit", c.siBool, False) self.pStretch = [self.addSetupParam("stretch_%s"%i, c.siDouble, self.st_value[i], -1, 1) for i in range(self.divisions)] self.pSquash = [self.addSetupParam("squash_%s"%i, c.siDouble, self.sq_value[i], -1, 1) for i in range(self.divisions)]
def addParameters(self): if self.settings["headrefarray"]: self.headref_names = self.settings["headrefarray"].split(",") else: self.headref_names = [] if self.settings["ikrefarray"]: self.ikref_names = self.settings["ikrefarray"].split(",") else: self.ikref_names = [] self.headref_count = len(self.headref_names) self.ikref_count = len(self.ikref_names) # Anim ------------------------------------------- # Default parameter to get a better display in the keying panel self.pFullName = self.addAnimParam(self.fullName, c.siString, self.fullName, None, None, None, None, False, True, True) self.pShowIk = self.addAnimParam("showik", c.siBool, True, None, None, None, None, False, False, False) self.pShowFk = self.addAnimParam("showfk", c.siBool, True, None, None, None, None, False, False, False) # Ik/Head References if self.headref_count > 0: self.pHeadRef = self.addAnimParam("headref", c.siInt4, 0, 0, self.upvref_count) if self.ikref_count > 1: self.pIkRef = self.addAnimParam("ikref", c.siInt4, 0, 0, self.ikref_count-1) self.pMaxStretch = self.addAnimParam("maxstretch", c.siDouble, self.settings["maxstretch"], 1, None, 1, 3) self.pMaxSquash = self.addAnimParam("maxsquash", c.siDouble, self.settings["maxsquash"], 0, 1, 0, 1) self.pSoftness = self.addAnimParam("softness", c.siDouble, self.settings["softness"], 0, 1, 0, 1) self.pTan0 = self.addAnimParam("tan0", c.siDouble, 1, 0, None, 0, 4) self.pTan1 = self.addAnimParam("tan1", c.siDouble, 1, 0, None, 0, 4) # Volume self.pVolume = self.addAnimParam("volume", c.siDouble, 1, 0, 1, 0, 1) # Setup ------------------------------------------ self.pDriver = self.addSetupParam("driver", c.siDouble, 0, 0, None, 0, 10) # FCurves self.pFCurveCombo = self.addSetupParam("fcurvecombo", c.siInt4, 0, 0, None) self.pSt_profile = self.addSetupFCurveParam("st_profile", self.settings["st_profile"]) self.pSq_profile = self.addSetupFCurveParam("sq_profile", self.settings["sq_profile"]) self.pRo_profile = self.addSetupFCurveParam("ro_profile", self.settings["ro_profile"]) # Eval Fcurve self.st_value = fcu.getFCurveValues(self.pSt_profile.Value, self.settings["division"], .01) self.sq_value = fcu.getFCurveValues(self.pSq_profile.Value, self.settings["division"], .01) self.ro_value = fcu.getFCurveValues(self.pRo_profile.Value, self.settings["division"], .01) if self.options["mode"] == 1: # wip # Stretch/Squash/Roll params self.pEdit = self.addSetupParam("edit", c.siBool, False) self.pStretch = [self.addSetupParam("stretch_%s"%i, c.siDouble, self.st_value[i], -1, 1) for i in range(self.settings["division"])] self.pSquash = [self.addSetupParam("squash_%s"%i, c.siDouble, self.sq_value[i], -1, 1) for i in range(self.settings["division"])] self.pRoll = [self.addSetupParam("roll_%s"%i, c.siDouble, self.ro_value[i], 0, 1) for i in range(self.settings["division"])]
def setParamsValueFromFCurve(prop, fcv_name, divisions, param_name, minimum=None, maximum=None): values = fcu.getFCurveValues(prop.Parameters(fcv_name).Value, divisions) for i in range(divisions): value = values[i]*.01 if minimum is not None: value = max(minimum, value) if maximum is not None: value = min(maximum, value) prop.Parameters(param_name%i).Value = value
def addParameters(self): # Anim ------------------------------------------- # Default parameter to get a better display in the keying panel self.pFullName = self.addAnimParam(self.fullName, c.siString, self.fullName, None, None, None, None, False, True, True) self.pShowIk = self.addAnimParam("showik", c.siBool, True, None, None, None, None, False, False, False) self.pShowFk = self.addAnimParam("showfk", c.siBool, True, None, None, None, None, False, False, False) self.pPosition = self.addAnimParam("position", c.siDouble, self.settings["position"], 0, 1, 0, 1) self.pMaxStretch = self.addAnimParam("maxstretch", c.siDouble, self.settings["maxstretch"], 1, None, 1, 3) self.pMaxSquash = self.addAnimParam("maxsquash", c.siDouble, self.settings["maxsquash"], 0, 1, 0, 1) self.pSoftness = self.addAnimParam("softness", c.siDouble, self.settings["softness"], 0, 1, 0, 1) self.pLockOri0 = self.addAnimParam("lock_ori0", c.siDouble, self.settings["lock_ori"], 0, 1, 0, 1) self.pLockOri1 = self.addAnimParam("lock_ori1", c.siDouble, self.settings["lock_ori"], 0, 1, 0, 1) self.pTan0 = self.addAnimParam("tan0", c.siDouble, 1, 0, None, 0, 4) self.pTan1 = self.addAnimParam("tan1", c.siDouble, 1, 0, None, 0, 4) # Volume self.pVolume = self.addAnimParam("volume", c.siDouble, 1, 0, 1, 0, 1) # Setup ------------------------------------------ self.pDriver = self.addSetupParam("driver", c.siDouble, 0, 0, None, 0, 10) # FCurves self.pFCurveCombo = self.addSetupParam("fcurvecombo", c.siInt4, 0, 0, None) self.pSt_profile = self.addSetupFCurveParam("st_profile", self.settings["st_profile"]) self.pSq_profile = self.addSetupFCurveParam("sq_profile", self.settings["sq_profile"]) # Eval Fcurve self.st_value = fcu.getFCurveValues(self.pSt_profile.Value, self.settings["division"], .01) self.sq_value = fcu.getFCurveValues(self.pSq_profile.Value, self.settings["division"], .01) if self.options["mode"] == 1: # wip # Stretch/Squash/Roll params self.pEdit = self.addSetupParam("edit", c.siBool, False) self.pStretch = [self.addSetupParam("stretch_%s"%i, c.siDouble, self.st_value[i], -1, 1) for i in range(self.settings["division"])] self.pSquash = [self.addSetupParam("squash_%s"%i, c.siDouble, self.sq_value[i], -1, 1) for i in range(self.settings["division"])]
def addParameters(self): # Anim ------------------------------------------- # Default parameter to get a better display in the keying panel self.pFullName = self.addAnimParam(self.fullName, c.siString, self.fullName, None, None, None, None, False, True, True) self.pShowIk = self.addAnimParam("showik", c.siBool, True, None, None, None, None, False, False, False) self.pShowFk = self.addAnimParam("showfk", c.siBool, True, None, None, None, None, False, False, False) self.pPosition = self.addAnimParam("position", c.siDouble, self.settings["position"], 0, 1, 0, 1) self.pMaxStretch = self.addAnimParam("maxstretch", c.siDouble, self.settings["maxstretch"], 1, None, 1, 3) self.pMaxSquash = self.addAnimParam("maxsquash", c.siDouble, self.settings["maxsquash"], 0, 1, 0, 1) self.pSoftness = self.addAnimParam("softness", c.siDouble, self.settings["softness"], 0, 1, 0, 1) self.pLockOri0 = self.addAnimParam("lock_ori0", c.siDouble, self.settings["lock_ori"], 0, 1, 0, 1) self.pLockOri1 = self.addAnimParam("lock_ori1", c.siDouble, self.settings["lock_ori"], 0, 1, 0, 1) self.pTan0 = self.addAnimParam("tan0", c.siDouble, 1, 0, None, 0, 4) self.pTan1 = self.addAnimParam("tan1", c.siDouble, 1, 0, None, 0, 4) # Volume self.pVolume = self.addAnimParam("volume", c.siDouble, 1, 0, 1, 0, 1) # Setup ------------------------------------------ self.pDriver = self.addSetupParam("driver", c.siDouble, 0, 0, None, 0, 10) # FCurves self.pFCurveCombo = self.addSetupParam("fcurvecombo", c.siInt4, 0, 0, None) self.pSt_profile = self.addSetupFCurveParam( "st_profile", self.settings["st_profile"]) self.pSq_profile = self.addSetupFCurveParam( "sq_profile", self.settings["sq_profile"]) # Eval Fcurve self.st_value = fcu.getFCurveValues(self.pSt_profile.Value, self.settings["division"], .01) self.sq_value = fcu.getFCurveValues(self.pSq_profile.Value, self.settings["division"], .01) if self.options["mode"] == 1: # wip # Stretch/Squash/Roll params self.pEdit = self.addSetupParam("edit", c.siBool, False) self.pStretch = [ self.addSetupParam("stretch_%s" % i, c.siDouble, self.st_value[i], -1, 1) for i in range(self.settings["division"]) ] self.pSquash = [ self.addSetupParam("squash_%s" % i, c.siDouble, self.sq_value[i], -1, 1) for i in range(self.settings["division"]) ]