Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.3 kB
6
Indexable
Never
import pymel.core as pm


# get module name

result = pm.promptDialog(    title ="Module Maker",
                            message ="Enter a name for your module... if you dare!",
                            button = ["Confirm", "Cancel"],
                            defaultButton = "Confirm",
                            cancelButton = "Cancel")


if result == "Confirm":
    moduleName = pm.promptDialog(query=True, text=True)
else:
    print("Coward.")


if result == "Confirm":
    # create top group
    topGroup = pm.group(name=f"{moduleName}_grp", empty=True)
    
    # create inputs group
    inputsGroup = pm.group(name=f"{moduleName}_inputs", empty=True)
    
    # create controls group
    controlsGroup = pm.group(name=f"{moduleName}_controls", empty=True)
    
    # create deform group
    deformGroup = pm.group(name=f"{moduleName}_deform", empty=True)
    
    # parent groups under top group
    #for eachGroup in [inputsGroup, controlsGroup, deformGroup]:
    # pm.parent(eachGroup, topGroup)
    
    pm.parent([inputsGroup, controlsGroup, deformGroup], topGroup)
    
    # create main input
    mainInput = pm.group(name=f"{moduleName}_input_0", empty=True)
    
    # parent main input under inputs grp
    pm.parent(mainInput, inputsGroup)
Leave a Comment