import maya.cmds as cmds
def create_nurbs_curve_set(set_name):
if not cmds.objExists(set_name):
cmds.sets(name=set_name, empty=True)
def add_nurbs_curves_to_set(set_name):
curve_transforms = [cmds.listRelatives(i, p=1, type='transform', fullPath=True)[0] for i in cmds.ls(type='nurbsCurve', o=1, r=1, ni=1)]
for c in curve_transforms:
cmds.sets(c, add=set_name)
def main():
set_name = "Sets"
create_nurbs_curve_set(set_name)
add_nurbs_curves_to_set(set_name)
if __name__ == "__main__":
main()
More than 1 year has passed since last update.
python maya add curves transform to sets
Last updated at Posted at 2023-07-27
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme