I’m currently making a tool in my lunch that gets a value of a selected object then moves it by 5 (Simple but trying to get fundamentals down…
This is my code section I need help with
def By5() :
cmds.ls(selection=True)
mc.move( 0, translate_x_value + 5, 0 )
selected = cmds.ls(selection=True)
for item in selected:
translate_x_value = cmds.getAttr("%s.translateX" % item)
# do something with the value. egs:
print translate_x_value
The issue I’m having that once its been ran once (With GUI and a button to run the command, it’ll move by 5 once and no more…
I don’t know much about python but do I need to run a loop to request the position of cube constantly?
Thanks and apologies for the noob question