0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

python maya add curves transform to sets

Last updated at Posted at 2023-07-27
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()
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?