2
$\begingroup$

in my scene I had an object with a mirror-modifier attached. I made several copies of it. Now I discovered that it also copied the empty I used as the mirror object. I want all new objects using the same empty as mirror object. So I changed (most of) them to point to the original emtpy. Now I want to delete the unused copies of the empty. Is there a way to figure out which empties I can delete and which I have to keep because some are still used for mirroring.

$\endgroup$
0
8
$\begingroup$

If you want to delete all empties in the current scene, which are not used as mirror object by a mirror modifier, you can use the following script:

import bpy

scene = bpy.context.scene
obs = set()

for ob in scene.objects:
    for mod in ob.modifiers:
        if mod.type == 'MIRROR':
            obs.add(mod.mirror_object)
            
for ob in scene.objects:
    if ob.type == 'EMPTY' and ob not in obs:
        #scene.objects.unlink(ob) # version < 2.8 
        bpy.data.objects.remove(ob) # do unlink is default

Note that it will remove empties even if they are used by other modifiers for instance. There is no direct way to figure out all dependencies to tell what users a certain object has.

$\endgroup$
-1
$\begingroup$

This method works for me:

  • Export as .fbx, unselect "empty" from object types
  • Import .fbx in to a new Blender project

et, voila

$\endgroup$
1
  • 1
    $\begingroup$ Exporting and importing is rarely a correct solution for anything. Gone are any materials, modifiers, and properties your objects had $\endgroup$ – Duarte Farrajota Ramos Sep 23 '20 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.