Memory Efficient Circular Duplication Techniques In Blender

Reducing Memory Usage

Circular duplication, the process of creating circular copies arrayed around a central axis or point, can greatly increase scene complexity and memory usage in Blender. As each duplicate is a fully separate object with its own geometry, large numbers of duplicates strain available RAM. We discuss specific methods Blender provides to reduce memory demands when circularly duplicating objects.

Blender’s duplication system fully copies all geometric data and materials for each duplicate generated. This quickly compounds memory consumption as duplicate counts increase. As an example, duplicating a single 10,000 polygon object 100 times results in 1,000,000 polygons to store, render, and manipulate.

Common duplication techniques including using array and curve modifiers, manually placing copies, or using Particle Systems can require large amounts of memory, especially if the base object(s) are detailed. Low polygon proxies should be used in these cases.

Circular Array Modifier

The Array Modifier offers circular duplication capabilities in Blender. This modifier creates copies of a base object distributed evenly around a defined axis. The number of copies and rotation can be precisely controlled.


import bpy
from math import radians

bpy.ops.mesh.primitive_cube_add()
cube = bpy.context.object

# Add array modifier
array_mod = cube.modifiers.new('CircularArray', 'ARRAY')
array_mod.fit_type = 'FIXED_COUNT'
array_mod.count = 8
array_mod.curve = None
array_mod.use_constant_offset = True
array_mod.constant_offset_displace = (0, 0, 0)
array_mod.use_relative_offset = False
array_mod.relative_offset_displace = (0, 0, 0)
array_mod.use_object_offset = True
array_mod.offset_object = None

# Make circular
array_mod.start_cap = None
array_mod.end_cap = None

# Rotate copies in a full circle
array_mod.use_merge_vertices = True
array_mod.use_merge_vertices_cap = True
array_mod.merge_threshold = 1
array_mod.start_cap = cube
array_mod.end_cap = cube

array_mod.offset_u = radians(360)
array_mod.offset_v = 0
array_mod.offset_w = 0

The Circular Array modifier provides precise control over copy distribution and spacing without much setup. However it still fully duplicates geometry per copy. Scene complexity can quickly accumulate with multiple high polygon objects arrayed.

DupliFaces for Efficient Circular Duplication

DupliFaces allow objects to be duplicated across the individual faces of a base object. Rather than fully copying geometry, child objects are instanced as duplications on the base object’s faces. This method can greatly reduce memory consumption compared to traditional circular arrays while retaining flexibility.


import bpy

# Create low poly cube to use as the duplicator
bpy.ops.mesh.primitive_cube_add(size=5)
dupli_ob = bpy.context.active_object

# Subdivide so more face instances can be created
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.subdivide(number_cuts=3)
bpy.ops.object.editmode_toggle()

# Create a more complex object to duplicate
bpy.ops.mesh.primitive_monkey_add()
monkey = bpy.context.active_object

# Position monkey at the cube origin
monkey.location = (0, 0, 0)

# Parent monkey to cube
monkey.parent = dupli_ob

# Enable duplifaces to instance across cube faces instead of scene copies
dupli_ob.instance_type = 'FACES'

# Increase dupli_ob draw type so its faces draw
dupli_ob.draw_type = 'WIRE'

With DupliFaces, memory use depends primarily on the complexity of the base object rather than the quantity of child objects duplicated. This enables large duplicate counts without multiplying memory cost. Materials and textures also do not need unique copies, being shared across instances.

Drawbacks include lack of individual control over each duplicate. Animation and coordination between instances can also be difficult compared to fully duplicated objects. The circular distribution is likewise dependent on the base mesh’s geometry.

Optimizing Your Scene

In addition to efficient duplication methods, further memory savings can be achieved by optimizing scenes for reduced complexity.

Minimizing initial object counts before duplication is critical, as each copy multiplies scene size. Using linked duplicates references a single data block rather than fully copying, saving greatly on mesh data duplication especially across numerous copies.

Reducing polygon counts, material slots, and texture sizes for objects intended for high duplication will improve performance and memory usage of the multiplied results. Simplifying meshes as much as possible while retaining critical shape and appearance gives best results.

Example Workflow

In practice, efficient circular duplication combines optimized base assets with targeted usage of DupliFaces and Modifiers. We walk through a complete example below:

  1. Model a low polygon column asset to be duplicated
  2. Use maximum of a single UV mapped 4k texture for simplicity
  3. Add columns with reduced draw type in areas only needing visual proxy
  4. Make a circular DupliFaces controller object centered where copies needed
  5. Parent column asset to controller object
  6. Enable Face instancing on controller to create radial column copies
  7. For interactive columns, use linked duplicates or Circular Array Mod instead

By following these techniques of reducing base complexity then leveraging instancing, scenes requiring high circular duplication counts can achieve better performance across metrics like render time, playback frame rate, and memory usage. Detailed example files are available for download here.

Leave a Reply

Your email address will not be published. Required fields are marked *