py city sun cycle


import maya.cmds

def create_animation(anim_range):

    circle1 = cmds.circle(nr=(0,1,0),r=40)

    for i in range(anim_range):

        cmds.currentTime((i)*100, edit=True)

        cmds.setKeyframe(circle1,v=(i*180), at=attribute)

        cmds.keyTangent('nurbsCircle1', itt='linear', ott='linear')

    cmds.playbackOptions( minTime='0', maxTime='99' )

anim_range=2

attribute="rotateX"

if cmds.window("new_window", exists=True):

    cmds.deleteUI("new_window", window=True)

window = cmds.window( "new_window", title="NEW Window", iconName='Short Name', widthHeight=(300, 202), bgc=(1,0.1,0.3))

cmds.columnLayout( adjustableColumn=True )

cmds.button( label='Create Animation',c='create_animation(anim_range)', height=100)

cmds.button( label='Close', command=('cmds.deleteUI("new_window", window=True)'), height=100, bgc=(1,0,0))

cmds.setParent( '..' )

cmds.showWindow( window )

Leave a comment

Log in with itch.io to leave a comment.