Python Script to create objects from intSlider
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey guys,
i am very new to python and want to create a Script to create joints.
The Idea is to get a window and there I can set the number with the intSlider.
Once i press CreateJoints it should create the number i set in the intSlider:
I just can't figer out what's wrong here:
import maya.cmds as cmds
cmds.window(title = "Create Joints", width = 300, height = 100)
cmds.columnLayout("CreateJointsLayout", adjustableColumn = True)
slider = cmds.intSliderGrp ( "CreateJoints", label = "Joints", field = True, fieldMinValue = 1, fieldMaxValue = 10, minValue = 1, maxValue = 100, columnWidth3 = [50, 50, 50], columnAlign3 = ["left", "both", "left"], value = 0, parent = "CreateJointsLayout")
cmds.showWindow()
Number = cmds.intSliderGrp ( "CreateJoints", query = True, value = True)
CreateOne = cmds.button(label = "click me", parent = "CreateJointsLayout", command = CreateJoints)
print Number
def CreateJoints():
for Number in slider:
sel = cmds.joint( p=(0, 0, 0) )
cmds.select( sel, tgl=True )
Thanks for your help and time!
