import bpy
positions = (0,3,2) , (4,1,6) , (3,-5,1) , (3,10,1) , (1,8,1)
start_pos =(0,0,0)
ob = bpy.data.objects ["Sphere"]
frame_num = 0
for position in positions:
bpy.context.scene.frame_set(frame_num)
ob.location = position
ob.keyframe_insert(data_path="location", index =-1)
frame_num +=20有没有人能帮我找出错误以及代码的哪一部分错了?我不明白哪里出了错
这是错误'Python脚本失败,请在系统控制台中检查消息‘
发布于 2019-09-04 10:53:25
python脚本中使用的格式会影响它的解释方式。您需要确保每个代码块都有匹配的缩进,缩进通常设置为每次缩进四个空格。
有一个关于如何格式化python脚本的正式规范,通常称为PEP 8
正确格式化的脚本应如下所示:-
import bpy
positions = (0,3,2) , (4,1,6) , (3,-5,1) , (3,10,1) , (1,8,1)
start_pos =(0,0,0)
ob = bpy.data.objects ["Sphere"]
frame_num = 0
for position in positions:
bpy.context.scene.frame_set(frame_num)
ob.location = position
ob.keyframe_insert(data_path="location", index =-1)
frame_num +=20https://stackoverflow.com/questions/57773871
复制相似问题