I don't know python (or any other language other than English!) but can usually work how to edit existing code. My problem is that I don't seem to be able to figure out what the code thinks is a second, or minute...
Here is my code.
Ultimately, I want CycloideGear005 and CycloideGear006 to rotate once every 60s and CycloideGear001 and CycloideGear002 to rotate once every 3600s. The multiples of i in my code are the gear ratios respective to CycloideGear.
I hope someone can help!
Thank you
Code: Select all
from PySide import QtCore
i = 0
def update():
global i
App.getDocument("new_watch").CycloideGear.Placement=App.Placement(App.Vector(0,0,0), App.Rotation(App.Vector(0,0,1),(i)+1.9), App.Vector(0,0,0))
App.getDocument("new_watch").CycloideGear001.Placement=App.Placement(App.Vector(14.04,0,0), App.Rotation(App.Vector(0,0,1),(-i*8)), App.Vector(0,0,0))
App.getDocument("new_watch").CycloideGear002.Placement=App.Placement(App.Vector(14.04,0,1.1), App.Rotation(App.Vector(0,0,1),(-i*8)), App.Vector(0,0,0))
App.getDocument("new_watch").CycloideGear003.Placement=App.Placement(App.Vector(25.29,0,1.1), App.Rotation(App.Vector(0,0,1),(i*64)+18), App.Vector(0,0,0))
App.getDocument("new_watch").CycloideGear004.Placement=App.Placement(App.Vector(25.29,0,0), App.Rotation(App.Vector(0,0,1),(i*64)+18), App.Vector(0,0,0))
App.getDocument("new_watch").CycloideGear005.Placement=App.Placement(App.Vector(34.34,0,0), App.Rotation(App.Vector(0,0,1),(-i*480)-8.6), App.Vector(0,0,0))
App.getDocument("new_watch").CycloideGear006.Placement=App.Placement(App.Vector(34.34,0,1.1), App.Rotation(App.Vector(0,0,1),(-i*480)-8.6), App.Vector(0,0,0))
App.getDocument("new_watch").CycloideGear007.Placement=App.Placement(App.Vector(40.94,0,1.1), App.Rotation(App.Vector(0,0,1),(i*4800)+18.5), App.Vector(0,0,0))
i += 1
timer = QtCore.QTimer()
timer.timeout.connect( update )
timer.start()