← All ideas
  • Published 6 Dec 2019

Quick Array when Duplicating/Instancing

It's pretty self explanatory. After duplicating/instancing you can quickly array the object by specifying the count. Furthermore, the xyz values will dynamically change the distance between the arrayed objects.

Thumb.png

100%

Development Status: Open

Upvote 76 Downvote 0
Quinten.Pillen
6 Dec 2019

10 Comments

ad.morris

I wrote a Python script a couple of weeks ago that does this, if it helps anyone. It doesn't work with Fit Length or Fit Curve arrays but it does the job.

import bpy

# Get selected object
selectedObjects = bpy.context.selected_editable_objects
thisObject = selectedObjects[0]

# Get array count
arrayCount = thisObject.modifiers["Array"].count

# Get object dimensions
bpy.context.object.modifiers["Array"].show_viewport = False #turn off modifier to get actual dimensions
xDimension = thisObject.dimensions[0]
yDimension = thisObject.dimensions[1]
zDimension = thisObject.dimensions[2]
bpy.context.object.modifiers["Array"].show_viewport = True

# Get array offset values
xOffset = thisObject.modifiers["Array"].relative_offset_displace[0]
yOffset = thisObject.modifiers["Array"].relative_offset_displace[1]
zOffset = thisObject.modifiers["Array"].relative_offset_displace[2]

# Calculate relative transforms
xTransformRel = xOffset * xDimension
yTransformRel = yOffset * yDimension 
zTransformRel = zOffset * zDimension

# Get constant transforms
xTransformCon = thisObject.modifiers["Array"].constant_offset_displace[0]
yTransformCon = thisObject.modifiers["Array"].constant_offset_displace[1]
zTransformCon = thisObject.modifiers["Array"].constant_offset_displace[2]

# Calculate transforms
xTransform = xTransformRel + xTransformCon
yTransform = yTransformRel + yTransformCon
zTransform = zTransformRel + zTransformCon

# Delete array
bpy.ops.object.modifier_remove(modifier="Array")

# Instance Objects
for i in range(arrayCount - 1):
....bpy.ops.object.duplicate({"object" : thisObject}, linked=True)
....bpy.ops.transform.translate(value=(xTransform, yTransform, zTransform))
1
ammusionist

Could this be solved by adding an option to the Array modifier to "Apply as instances" in addition to the current "Apply" which just adds to the mesh?

1
IIIFGIII

* @ammusionist * This is about quick and handy solution for Object/Edit mode which should work similar to repear last but with duplicaton counter.

Idealy it also mean that we will have already imlemented "Rotate-Duplicate" and "Scale-duplicate" operators ( it was suggested here time before as something about " gizmo " workflow, but I can't found it... ). Current two steps workflow is limited in duplication case. You first duplicate , then transform ( rotate/scale ), then you can repeat, but just transform not duplication...

Array modifier is cumbersome thing, it's good as modifier, but it's not look like something which can be adopted for this case.

1
IIIFGIII

Emm...I checked search. This suggestion is kind of duplicate ( yeah, suggestion about duplicates is duplicate of another suggestion ) of this one blender.community/c/rightclickselect/pscbbc/ but with different mockup. This mockup animated but in other suggestion popup have also name and copy/instance/reference options ( 100% Autodesk from user ). Btw. we still have no " merge " functionality for RCS.

Interesting fact - in Edit mode ( it not exist for any duplication in Object mode ) we already have some " Mode " option while duplicate some mesh. In my case it just do nothing and I can't find any info what it should do.

It really looks like some uncompleted part of mechanic which have to set count of duplication.

Quinten.Pillen Author

* @IIIFGIII * Weird...It does absolutely nothing. Could be an unfinished feature but the name "mode" is a bit odd

u3dreal

What about shift+r ?? repeat last action ? That would speed things up.

Quinten.Pillen Author

* @u3dreal * shift+r works fine but you can't change the count or space between the objects on the fly

zelfit

Yiss. It generally great option for many modelers.

IIIFGIII

Emmmm ... It just some animated mockup or it's comething coded?

Quinten.Pillen Author

* @IIIFGIII * just a poorly made mockup :D