我收到一条消息说
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'update' is not defined
原始代码是
from PySide import QtCore
i = 0
def update();
global i
App.getDocument("Unnamed2").Pad001.Placement=App.Placement(App.Vector(0,127.5,0), App.Rotation(App.Vector(0,0,1),-i), App.Vector(0,0,0))
App.getDocument("Unnamed2").Pad.Placement=App.Placement(App.Vector(0,0,0), App.Rotation(App.Vector(0,0,1),i*(74.0/28.0)), App.Vector(0,0,0))
i += 0.01
timer = QtCore.QTimer()
timer.timeout.connect( update )
timer.start( 1 )
这是齿轮动画的代码,但它不起作用。我在编码方面不是那么好,所以我不确定是什么问题。如果有人可以帮助我,那就太好了。谢谢你。:)