A very simple duplicator that recursively duplicates objects, scales and moves them in local axes.
Introduction
- A very simple duplicator that recursively duplicates objects, scales and moves them in local axes.
- The transformation can be applied to any object. It will move and scale on the y-axis.
- Parameters can be used to set scale and offset on other axes.
- Script works on local axes!
Python code
import bpy import mathutils duplicates = 1 scale_on_x = 1 scale_on_y = 1.045 scale_on_z = 1 move_on_x = 0 move_on_y = 0 move_on_z = -0.036 def simple_duplicate(dobject, limit, actual): copy_of_dobject = dobject.copy() copy_of_dobject.data = copy_of_dobject.data.copy() bpy.context.collection.objects.link(copy_of_dobject) bpy.context.view_layer.objects.active = copy_of_dobject inv = copy_of_dobject.matrix_world.copy() inv.invert() # move copy_of_dobject.location += mathutils.Vector( (move_on_x, move_on_y, move_on_z) ) @ inv copy_of_dobject.scale = ( copy_of_dobject.scale[0] * scale_on_x, copy_of_dobject.scale[1] * scale_on_y, copy_of_dobject.scale[2] * scale_on_z ) actual += 1 if actual <= limit: print("call") simple_duplicate(copy_of_dobject, limit, actual) # execute simple_duplicate(bpy.context.active_object, duplicates, 1)
Thanks to DevDave for his great guide, all credit goes to his effort. you can also read the original guide from Steam Community. enjoy the game.
Related Posts:
- Blender: How to Import Source 2 Maps
- Blender: How to Run on Windows 7
- Blender: How to Make Image Sequence