0
$\begingroup$

I know how to replace an object with another object. I simply select two objects, press ctrl + L, then Link Object Data. There are 2 problems with this: First, for some reason the new instance of the object is much larger than it's supposed to be, and Second, the object that I'm creating a new instance of is wayyyyy more complicated than the replaced object and it's not practical for using in mass (I plan on replacing every low poly tree with a realistic new tree).
enter image description here

I want to fix the problem by replacing the low poly tree object with a collection instance of the new complicated tree. I put the complex tree into its own collection and made a collection instance of the tree, and I want to replace the low poly tree with a collection instance of the new complicated tree. The problem is that I can't link the object data to a collection instance.
enter image description here

I'm assuming that using a collection instance instead of an object makes the load on the CPU and GPU easier...?

So the 2 questions this boils down to is how do I replace an object with a collection instance so I can replace the low poly trees with new complicated trees? And second, is there a better way to do this?

$\endgroup$
2
  • 1
    $\begingroup$ Does this help? blender.stackexchange.com/questions/249344/… $\endgroup$
    – Benus
    Commented Jan 16, 2022 at 0:21
  • $\begingroup$ That did work. It made the low poly tree get replaced with the new tree but it was still suuuuper CPU intensive. I think it's copying every individual vertex and reconstructing the mesh on every instance of the low poly tree rather than just showing an instance of the collection. The file moves crazy slow and continuously crashes. Thanks for the post though. $\endgroup$ Commented Jan 16, 2022 at 1:25

1 Answer 1

0
$\begingroup$

To replace Objects with Collection Instances, add this script as a new text data block:

import bpy
for obj in bpy.context.selected_objects:
    bpy.ops.object.collection_instance_add(collection='TEST', location=obj.location, rotation=obj.rotation_euler)
    bpy.context.active_object.scale = obj.scale
    

Replace collection name 'TEST' with your collection name (the original one, not an instance of it). Select objects to be replaced, press "Run Script".

$\endgroup$
2
  • $\begingroup$ I tried this script and it just deselected the trees and selected the collection instance. It didn't replace anything $\endgroup$ Commented Jul 27, 2022 at 21:24
  • $\begingroup$ @ChristianOConnor The only way the script deals with selection is that after creating new instances - those remain selected. Are you sure the selected instances aren't new? Are you sure the collection name you provided is the original collection, not the instance name? $\endgroup$
    – kivig
    Commented Jul 29, 2022 at 8:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .