diff --git a/release/scripts/mgear/core/applyop.py b/release/scripts/mgear/core/applyop.py index 9e03685d..cbb86422 100644 --- a/release/scripts/mgear/core/applyop.py +++ b/release/scripts/mgear/core/applyop.py @@ -146,7 +146,7 @@ def oriCns(driver, driven, maintainOffset=False): maintainOffset (bool): Keep the offset. Returns: - pyNode: Orientation constraintn node. + pm.node._Node: Orientation constraintn node. Example: .. code-block:: python @@ -182,7 +182,7 @@ def pathCns(obj, curve, cnsType=False, u=0, tangent=False): tangent (bool): Keep tangent orientation option. Returns: - pyNode: The newly created constraint. + pm.node._Node: The newly created constraint. """ node = pm.PyNode(pm.createNode("motionPath")) node.setAttr("uValue", u) @@ -223,7 +223,7 @@ def aimCns( maintainOffset (bool): Maintain offset. Returns: - pyNode: Newly created constraint. + pm.node._Node: Newly created constraint. """ node = pm.aimConstraint( @@ -320,7 +320,7 @@ def gear_raycast( connect_srt (str, optional): scale rotation traanslation flag Returns: - PyNode: The raycast node + pm.node._Node: The raycast node """ node = pm.createNode("mgear_rayCastPosition") pm.connectAttr( @@ -357,7 +357,7 @@ def gear_matrix_cns( scl_mult (list, optional): scale multiplier for XYZ Returns: - PyNode: The matrix constraint node + pm.node._Node: The matrix constraint node """ node = pm.createNode("mgear_matrixConstraint") if isinstance(in_obj, pm.node._NodeTypes) and in_obj.type() == "matrix": @@ -421,7 +421,7 @@ def gear_spring_op(in_obj, goal=False, solver="mgear_springNode"): solver (str, optional): Spring solver Returns: - pyNode: Newly created node + pm.node._Node: Newly created node """ if not goal: goal = in_obj @@ -459,7 +459,7 @@ def gear_spring_gravity_op(in_obj, goal=False): goal (dagNode): By default is False. Returns: - pyNode: Newly created node + pm.node._Node: Newly created node """ return gear_spring_op(in_obj, goal=goal, solver="mgear_springGravityNode") @@ -480,7 +480,7 @@ def gear_mulmatrix_op(mA, mB, target=False, transform="srt"): value s r t Returns: - pyNode: Newly created mGear_multMatrix node + pm.node._Node: Newly created mGear_multMatrix node """ node = pm.createNode("mgear_mulMatrix") @@ -520,7 +520,7 @@ def gear_intmatrix_op(mA, mB, blend=0): blend (float or connection): Blending value. Returns: - pyNode: Newly created mGear_intMatrix node + pm.node._Node: Newly created mGear_intMatrix node """ node = pm.createNode("mgear_intMatrix") @@ -546,7 +546,7 @@ def gear_curvecns_op(crv, inputs=[]): Also the order should be the same as the points Returns: - pyNode: The curvecns node. + pm.node._Node: The curvecns node. """ pm.select(crv) node = pm.deformer(type="mgear_curveCns")[0] @@ -571,7 +571,7 @@ def gear_curveslide2_op( softness (float): Default softness value (from 0 to 1). Returns: - pyNode: The newly created operator. + pm.node._Node: The newly created operator. """ pm.select(outcrv) node = pm.deformer(type="mgear_slideCurve2")[0] @@ -602,7 +602,7 @@ def gear_spinePointAtOp(cns, startobj, endobj, blend=0.5, axis="-Z"): axis (string): Axis direction. Returns: - pyNode: The newly created operator. + pm.node._Node: The newly created operator. """ node = pm.createNode("mgear_spinePointAt") @@ -634,7 +634,7 @@ def gear_spinePointAtOpWM(cns, startobj, endobj, blend=0.5, axis="-Z"): axis (str): Axis direction. Returns: - pyNode: The newly created operator. + pm.node._Node: The newly created operator. """ node = pm.createNode("mgear_spinePointAt") @@ -692,7 +692,7 @@ def gear_ikfk2bone_op( blend (float): Default blend value (0 for full ik, 1 for full fk). Returns: - pyNode: The newly created operator. + pm.node._Node: The newly created operator. """ node = pm.createNode("mgear_ikfk2Bone") @@ -764,7 +764,7 @@ def gear_rollsplinekine_op(out, controlers=[], u=0.5, subdiv=10): subdiv (int): spline subdivision precision. Returns: - pyNode: The newly created operator. + pm.node._Node: The newly created operator. """ node = pm.createNode("mgear_rollSplineKine") @@ -800,11 +800,11 @@ def gear_squashstretch2_op( sclref (dagNode): Global scaling reference object. length (float): Rest Length of the S&S. axis (str): 'x' for scale all except x axis... - scaleComp (list of float): extra scale compensation to avoid double + scaleComp (str | pm.Attribute): extra scale compensation to avoid double scale in some situations. Returns: - pyNode: The newly created operator. + pm.node._Node: The newly created operator. """ node = pm.createNode("mgear_squashStretch2") @@ -843,7 +843,7 @@ def gear_inverseRotorder_op(out_obj, in_obj): in_obj (dagNode): Input object. Returns: - pyNode: The newly created operator. + pm.node._Node: The newly created operator. """ node = pm.createNode("mgear_inverseRotOrder") @@ -869,7 +869,7 @@ def create_proximity_constraint(shape, out_trans (str, optional): Output transform node. Returns: - tuple: (output transform, proximityPin node) + tuple[pm.node._Node, pm.node._Node]: (output transform, proximityPin node) """ if not cmds.objExists(shape): @@ -957,7 +957,7 @@ def create_proximity_constraints(shape, in_trans_list): in_trans_list (List[PyNode] or List[str]): List of in transforms Returns: - List[PyNode]: List of output transforms + list[pm.node._Node]: List of output transforms """ # Convert shape to PyNode if necessary if isinstance(shape, str): @@ -1022,7 +1022,7 @@ def create_uv_pin_constraint(shape, out_trans (str, optional): Output transform node. Returns: - tuple: (output transform, uvPin node) + tuple[str, str]: (output transform, uvPin node) """ if not cmds.objExists(shape): raise RuntimeError("Shape '{}' does not exist.".format(shape)) diff --git a/release/scripts/mgear/core/attribute.py b/release/scripts/mgear/core/attribute.py index 727956d7..62cf6a40 100644 --- a/release/scripts/mgear/core/attribute.py +++ b/release/scripts/mgear/core/attribute.py @@ -53,7 +53,7 @@ def addAttribute( when the attribute is not keyable. (optional) Returns: - pm.Attribute: A pymaya `Attribute` wrapper of the new attribute. + pm.Attribute: A pymaya ``Attribute`` wrapper of the new attribute. """ if isinstance(node, str): try: @@ -245,7 +245,7 @@ def addEnumAttribute( writable (bool): Set if the attribute is writable or not. (optional) Returns: - str: The long name of the new attribute + pm.Attribute: A pymaya ``Attribute`` wrapper of the new attribute. """ if node.hasAttr(longName): @@ -1709,7 +1709,7 @@ def get_alias_for_attr(full_attr_name): ########################################################## -def add_mirror_config_channels(ctl, conf=[0, 0, 0, 0, 0, 0, 0, 0, 0]): +def add_mirror_config_channels(ctl, conf=(0, 0, 0, 0, 0, 0, 0, 0, 0)): """Add channels to configure the mirror posing Args: diff --git a/release/scripts/mgear/core/curve.py b/release/scripts/mgear/core/curve.py index c54c4aee..8f5f0a28 100644 --- a/release/scripts/mgear/core/curve.py +++ b/release/scripts/mgear/core/curve.py @@ -64,14 +64,14 @@ def addCurve( Arguments: parent (dagNode): Parent object. name (str): Name - points (list of float | list of datatypes.Vector | list of om2.MPoint): + points (list[float] | list[om2.MVector] | list[om2.MPoint]): points of the curve in a one dimension array [point0X, point0Y, point0Z, 1, point1X, point1Y, point1Z, 1, ...]. close (bool): True to close the curve. degree (int): 1 for linear curve, 3 for Cubic. m (matrix): Global transform. - op (bool, optional): If True will add a curve that pass over the points - This is equivalent of using"editPoint " flag + op (bool, optional): If True will add a curve that pass over the points. + This is equivalent of using "editPoint" flag. Returns: dagNode: The newly created curve. diff --git a/release/scripts/mgear/core/transform.py b/release/scripts/mgear/core/transform.py index 6e02626a..00127e43 100644 --- a/release/scripts/mgear/core/transform.py +++ b/release/scripts/mgear/core/transform.py @@ -169,12 +169,12 @@ def getChainTransform(positions, normal, negate=False, axis="xz"): """Get a tranformation list from a positions list and normal. Arguments: - positions(list of vector): List with the chain positions. - normal (vector): Normal direction. + positions (list[om2.MVector | datatypes.Vector]): List with the chain positions. + normal (om2.MVector | datatypes.Vector): Normal direction. negate (bool): If true invert the chain orientation. - returns: - list of matrix: The list containing the transformation matrix + Returns: + list[datatypes.Matrix]: The list containing the transformation matrix for the chain. >>> tra.getChainTransform(self.guide.apos, self.normal, self.negate) @@ -204,12 +204,12 @@ def getChainTransform2(positions, normal, negate=False, axis="xz"): getChainTransform2 is using the latest position on the chain Arguments: - positions(list of vector): List with the chain positions. - normal (vector): Normal direction. + positions (list[om2.MVector | datatypes.Vector]): List with the chain positions. + normal (om2.MVector | datatypes.Vector): Normal direction. negate (bool): If true invert the chain orientation. - returns: - list of matrix: The list containing the transformation matrix + Returns: + list[datatypes.Matrix]: The list containing the transformation matrix for the chain. >>> tra.getChainTransform2(self.guide.apos, @@ -249,10 +249,10 @@ def getTransformFromPos(pos): """Create a transformation Matrix from a given position. Arguments: - pos (vector): Position for the transformation matrix + pos (om2.MVector | datatypes.Vector): Position for the transformation matrix Returns: - matrix: The newly created transformation matrix + datatypes.Matrix: The newly created transformation matrix >>> t = tra.getTransformFromPos(self.guide.pos["root"]) @@ -266,18 +266,19 @@ def getTransformFromPos(pos): return m -def getOffsetPosition(node, offset=[0, 0, 0]): +def getOffsetPosition(node, offset=(0, 0, 0)): """Get an offset position from dagNode Arguments: node (dagNode): The dagNode with the original position. - offset (list of float): Ofsset values for xyz. - exp : [1.2, 4.6, 32.78] + offset (list[float] | tuple[float]): Offset values for xyz. + Example: [1.2, 4.6, 32.78] Returns: - list of float: the new offset position. + datatypes.Vector: the new offset position. Example: + .. code-block:: python self.root = self.addRoot() diff --git a/release/scripts/mgear/shifter/component/__init__.py b/release/scripts/mgear/shifter/component/__init__.py index 9ee56d6f..b13d2c81 100644 --- a/release/scripts/mgear/shifter/component/__init__.py +++ b/release/scripts/mgear/shifter/component/__init__.py @@ -59,8 +59,8 @@ def __init__(self, rig, guide): # -------------------------------------------------- # Main Objects - self.rig = rig - self.guide = guide + self.rig = rig # type: mgear.shifter.Rig + self.guide = guide # type: mgear.shifter.guide.Rig self.options = self.rig.options self.model = self.rig.model @@ -947,7 +947,7 @@ def addCtl( iconShape, tp=None, lp=True, - mirrorConf=[0, 0, 0, 0, 0, 0, 0, 0, 0], + mirrorConf=(0, 0, 0, 0, 0, 0, 0, 0, 0), guide_loc_ref=None, add_2_grp=True, **kwargs @@ -1371,7 +1371,7 @@ def addAnimParam( from the component name or instance name.(optional) Returns: - pm.Attribute: A pymaya `Attribute` wrapper of the new attribute. + pm.Attribute: A pymaya ``Attribute`` wrapper of the new attribute. """ if not uihost: @@ -1451,7 +1451,7 @@ def addAnimEnumParam( uihost (dagNode): Optional uihost, if none self.uihost will be use Returns: - str: The long name of the new attribute + pm.Attribute: A pymaya ``Attribute`` wrapper of the new attribute. """