1

I have a script that creates a bunch of object and I would like to rotate them around a global point ( (0, 0, 0) at the moment but I'll need to do this with different points). I was unable to find anything about rotating around a point.

Amir
  • 3,074
  • 2
  • 29
  • 55
Ava
  • 111
  • 3
  • Related https://blender.stackexchange.com/questions/6969/rotate-object-around-cursor-with-python/6970#6970 – kheetor Jun 04 '18 at 07:53

1 Answers1

2

Things to look at. 1) simple script

import bpy
import math

R = 10
start_pos = (R,0,0)

ob = bpy.data.objects["Cube"]

for frame_num in range(1,101):
    angle = 2*math.pi*frame_num/100.0
    x = R*math.cos( angle)
    y = R*math.sin( angle)
    z = 0
    bpy.context.scene.frame_set(frame_num)
    ob.location=(x,y,z)
    ob.keyframe_insert(data_path="location", index = -1)

2) place an empty at the point around which you wish to rotate, and make that parent --- see Olav3D's https://www.youtube.com/watch?v=nmLjYSmaW48

3) understand Euler rotations and their limitations

4) For 'Rolls Royce' rotation --- study quaternions.

Fibon3
  • 59
  • 6