Objects Replacer
Installation:
Select edit->preferences->addons->install, navigate to the folder where object_replacer.zip is placed, select it, check the box.
Usage:
Location after installation: View3D > Object menu
Shortcut: shift+ctrl+R
Select the objects that need to be replaced or don’t select anything if you intend to use objects from a target collection.
Turn an object into active, if you intend to replace your target objects with it or don’t if you are going to use a collection of objects as a source.
Run the script
Changelog
05/16/2023 version: 1.10 - lights support! lights can replace meshes or other lights!
07/20/2021 version: 1.06 - additional option for custom step rotation and step scale.
Source Objects
source collection - active object
Choose the source of objects.
If you already have a single active object for that, select active.
If you'll use a collection of objects, from the dropdown menu, select the collection where the source objects are located.
random appearance - linear appearance (active option if source collection is checked)
Choose the way source objects will be picked for replacement. Randomly or linearly.
The first option makes a totally random selection. The second takes the objects one by one. All the objects will appear equal times after replacement.
randomization tuning (active option if source collection is checked and random appearance is checked)
An additional feature for controlling the randomization is available by renaming objects.
If an object inside the source collection is named with a suffix eg: “%10”, this means that the chance for this object to be picked for replacement is multiplied by 10.
For example, If we need some objects to be more frequent, we give them a suffix of “%2” or higher and leave the rest with no suffix or suffix “%1”.
If all objects have the same or no suffix, they will have equal chances.
The tool provides buttons to batch set the desired suffix-chance to selected objects.
There are also buttons to remove the suffix from the selected or from all objects inside the source collection to make the process fast and easier.
So before running the script, instead of selecting target objects, select the source objects that need a suffix number.
Target Objects
Make instances
Choose if instances should be created after replacement or not.
From collection - Selected objects
Choose where the target objects that need to be replaced are.
If you intend to use target objects from a collection, choose the collection from the drop-down menu.
If you need to select them manually and you didn't so far, then close the script, make the target selection and run it again.
scale-rotation - names
Choose a scale, rotation, and a rename option for the selected objects.
move to collection
Finally, choose if the final replaced objects will remain in the same collection or if they should be moved in a new or an already existing collection.
LIGHTS
Since 1.10 version, lights are supported!
A light ,a collection of lights , or selected lights can replace a mesh , a collection of meshes or selected meshes. They can replace other lights too!
On the other hand, a mesh cannot replace a light.