我正在尝试通过带有联系人集的脚本来驱动旋转关节,但是动画只有一半。
它可以在禁用触点组的情况下工作,但是一旦启用触点组,旋转就只能起作用,直到两个组件接触为止。然后整个动画停止,直到组件停止接触为止。在两个组件停止接触后,动画又回到了正轨。似乎缺少联系人设置动画。
该模型是Example Geneva Drive,我想通过脚本自动将转子和十字一起驱动,如本教程https://www.youtube.com/watch?v=UkGdrTyAaBg所示
#Author-
#Description-
import adsk.core,adsk.fusion,adsk.cam,traceback,math
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
des = adsk.fusion.Design.cast(app.activeProduct)
root = des.rootComponent
joint = root.joints.itemByName('Rev2')
rev = adsk.fusion.RevoluteJointMotion.cast(joint.jointMotion)
for i in range(360):
rev.rotationValue = i * (math.pi/180)
adsk.doEvents()
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))