def saveControls(cls, controls, filepath): """ Save the controls for the asset :param controls: controls that will be written out if they're nurbsCurves :type controls: list | str | tuple """ # declare list that will be used to gather controls to save savedControls = list() # make sure controls is a list before proceeding controls = common.toList(controls) if not isinstance(controls, list): raise RuntimeError("%s must be a list" % controls) # end if for ctrl in controls: if common.isValid(ctrl): if common.isType(ctrl, "nurbsCurve") or common.isType(common.getShapes(ctrl, 0), "nurbsCurve"): savedControls.append(ctrl) # end if # end loop # save the controls in savedControls list control.save(savedControls, filepath=filepath)
def saveJoints(cls, joints, filepath): """ Save the joints for the asset :param joints: joints that will be written out :type joints: list | str | tuple """ # declare list that will be used to gather controls to save savedJoints = list() # make sure controls is a list before proceeding joints = common.toList(joints) if not isinstance(joints, list): raise RuntimeError("%s must be a list" % joints) # end if for jnt in joints: if common.isValid(jnt): if common.isType(jnt, "joint"): savedJoints.append(jnt) # end if # end loop # save the controls in savedControls list joint.save(savedJoints, filepath=filepath)