Circle Array Add-On

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.

https://youtu.be/tmkJbmNn2no

Python File: Circle_Array_AddOn.py.zip (1.07 KB)

Looks very usefully. Thx :slight_smile:

I hope it is…

durisimo thanks

Good Job Antoni4040!

Thanks a lot for your add-on. I love it.:eyebrowlift:
Bye
Spirou4D

nice script.it would be useful if it makes instanced objects.(like alt+d)

Doesn’t it? What do you mean? Don’t understand, sorry…

A small update, not much different, basically it applies size to the one_object_selection as well…

@antoni4040: besically Objects referring to the same Mesh datablock

ob1.data = me
ob2.data = me
ob3.data = me

Nice script, you can achieve something similar with Array + Curve Modifiers, but they will deform the objects.

Thanks for this, simple and useful.

Very useful script. Thanks Antoni.

Can someone help out a noob?
How do I install a script like this into Blender? I saw the video with the .py file, but how do I make such a file?

:o

I’ve been looking for something like this, as I also am annoyed by the empties workaround. Thanks!!!

Copy the code to an empty text file and name it as Circle Array.py
Then place it to addons folder and activate it.
Btw thank you Antoni for this!

Thanks a lot, i cant believe that it was that simple :slight_smile:

this is nice, trunk it.
at least put the script in the contrib folder. :smiley:

Working just fine in Blender 2.67, as it did in 2.66!

There seemed to be a problem with Blender 2.67b, but this should fix it:


# -*- coding: utf-8 -*-

bl_info = {  
     "name": "Circle Array",  
     "author": "Antonis Karvelas",  
     "version": (1, 0),  
     "blender": (2, 6, 6),  
     "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()
            bpy.ops.object.add(type='EMPTY')
            empty_name = bpy.context.active_object
            empty_name.name = "EMPTY" 
            bpy.context.scene.objects.active = active
            active.modifiers[0].offset_object = empty_name
            num = active.modifiers["Array"].count
            print(num)
            rotate_num = 360 / num
            print(rotate_num)
            bpy.ops.object.transform_apply(location = False, rotation = True, scale = False) 
            empty_name.rotation_euler = (0, 0, radians(rotate_num))
            empty_name.select = False
            active.select = True
            bpy.ops.object.transform_apply(location = True, rotation = False, scale = True)
            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()
            bpy.ops.object.add(type='EMPTY')
            empty_name = bpy.context.active_object
            empty_name.name = "EMPTY" 
            bpy.context.scene.objects.active = active
            active.modifiers[0].offset_object = empty_name
            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 = False) 
            empty_name.rotation_euler = (0, 0, radians(rotate_num))
            empty_name.select = False
            active.select = True
            bpy.ops.object.transform_apply(location = True, rotation = False, scale = 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()    


Hope that you find it useful :slight_smile:

did test latest verions
and i still get smae problem
i get let say 4 planes but they end up ai different height around

is there something else i should do to make it work !
here is file with example

circlearray1.blend (409 KB)

note
i did not run it as addon but ran it in the text edtior !

thanks for feedback

Oups! Forgot something:


# -*- coding: utf-8 -*-

bl_info = {  
     "name": "Circle Array",  
     "author": "Antonis Karvelas",  
     "version": (1, 0),  
     "blender": (2, 6, 6),  
     "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()
            bpy.ops.object.add(type='EMPTY')
            empty_name = bpy.context.active_object
            empty_name.name = "EMPTY" 
            bpy.context.scene.objects.active = active
            active.modifiers[0].offset_object = empty_name
            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 = False) 
            empty_name.rotation_euler = (0, 0, radians(rotate_num))
            empty_name.select = False
            active.select = True
            bpy.ops.object.transform_apply(location = True, rotation = False, scale = True)
            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()
            bpy.ops.object.add(type='EMPTY')
            empty_name = bpy.context.active_object
            empty_name.name = "EMPTY" 
            bpy.context.scene.objects.active = active
            active.modifiers[0].offset_object = empty_name
            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 = False) 
            empty_name.rotation_euler = (0, 0, radians(rotate_num))
            empty_name.select = False
            active.select = True
            bpy.ops.object.transform_apply(location = True, rotation = False, scale = 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()

If it doesn’t work now, I’m going to kill myself!