So, I don’t know if anyone has created something like this, I just created because I needed it and I couldn’t find a simler way of doing it…
As I was sick of creating empties and rotating them, applying location to objects and etc, I created this:
Update 15/6/2013:
Fixed issues with Blender 2.67b and added an Empty Checker…
# -*- coding: utf-8 -*-
bl_info = {
"name": "Circle Array",
"author": "Antonis Karvelas",
"version": (1, 0),
"blender": (2, 6, 7),
"location": "View3D > Object > Circle_Array",
"description": "Uses an existing array and creates an empty,rotates it properly and makes a Circle Array ",
"warning": "You must have an object and an array, or two objects, with only the first having an array",
"wiki_url": "",
"tracker_url": "",
"category": "Mesh"}
import bpy
from math import radians
class Circle_Array(bpy.types.Operator):
bl_label = "Circle Array"
bl_idname = "objects.circle_array_operator"
def execute(self, context):
if len(bpy.context.selected_objects) == 2:
list = bpy.context.selected_objects
active = list[0]
active.modifiers[0].use_object_offset = True
active.modifiers[0].use_relative_offset = False
active.select = False
bpy.context.scene.objects.active = list[0]
bpy.ops.view3d.snap_cursor_to_selected()
if active.modifiers[0].offset_object == None:
bpy.ops.object.add(type='EMPTY')
empty_name = bpy.context.active_object
empty_name.name = "EMPTY"
active.modifiers[0].offset_object = empty_name
else:
empty_name = active.modifiers[0].offset_object
bpy.context.scene.objects.active = active
num = active.modifiers["Array"].count
print(num)
rotate_num = 360 / num
print(rotate_num)
active.select = True
bpy.ops.object.transform_apply(location = False, rotation = True, scale = True)
empty_name.rotation_euler = (0, 0, radians(rotate_num))
empty_name.select = False
active.select = True
bpy.ops.object.origin_set(type="ORIGIN_CURSOR")
return {'FINISHED'}
else:
active = context.active_object
active.modifiers[0].use_object_offset = True
active.modifiers[0].use_relative_offset = False
bpy.ops.view3d.snap_cursor_to_selected()
if active.modifiers[0].offset_object == None:
bpy.ops.object.add(type='EMPTY')
empty_name = bpy.context.active_object
empty_name.name = "EMPTY"
active.modifiers[0].offset_object = empty_name
else:
empty_name = active.modifiers[0].offset_object
bpy.context.scene.objects.active = active
num = active.modifiers["Array"].count
print(num)
rotate_num = 360 / num
print(rotate_num)
active.select = True
bpy.ops.object.transform_apply(location = False, rotation = True, scale = True)
empty_name.rotation_euler = (0, 0, radians(rotate_num))
empty_name.select = False
active.select = True
return {'FINISHED'}
def circle_array_menu(self, context):
self.layout.operator(Circle_Array.bl_idname, text="Circle_Array")
def register():
bpy.utils.register_class(Circle_Array)
bpy.types.VIEW3D_MT_object.append(circle_array_menu)
if __name__ == "__main__":
register()
Instructions:
a) With one object: add an array modifier, put the number you want in the cout box and finally press Object > Circle Array and voila!!! You will have a new empty and the object will be duplicated around it’s origin…
b) With two objects: add an array modifier to the first object, put the number you want in the cout box, select with shift + RMB the second object and press Object > Circle Array. You will have a new empty and the object will be duplicated around the origin of the second object!
Well, I know that it’s very simple but personally I find it TERRIBLY useful and I hope you find it useful too.
Python File: Circle_Array_AddOn.py.zip (1.07 KB)