def RotateAroundWorld(self, obj, rotation): # XCX used?
print(rotation, type(rotation))
origParent = obj.parent
d = bpy.data.new('UTEMP_PL', None)
d.location = Vector((0,0,0))
obj.parent = d
d.rotation_euler = Euler(rotation, 'XYZ')
act_bk = bpy.ops.active
bpy.ops.active = d
bpy.ops.object.transform_apply(rotation=True)
bpy.ops.active = obj
bpy.ops.object.transform_apply(rotation=True)
bpy.ops.active = act_bk
obj.parent = None
bpy.data.objects.remove(d)
# --delete d
# --if (origParent != undefined) then
# -- obj.parent = origParent
评论列表
文章目录