Forum

Remove double planes - how?

08 August 2016 12:11
I need to clean up a file that has double planes massively.
What is a good way to do that?
08 August 2016 12:57
How many files do you want to process?
I've wrote the script, based on the approach explained here.
import bpy

for o in bpy.data.objects:
    if o.type == 'MESH':
        r = o.data.validate()
        if r:
            print("object '%s' has been corrected" % o.name)
print("saving the file")
bpy.ops.wm.save_mainfile()


For a single file you should run this script primarily inside Blender or pass it as a command line argument:

blender -b file_to_process.blend -P validate.py
// option -b means running Blender in background without GUI
// option -P tells Blender to run specified script after scene being loaded.


Ensure that paths to .blend and to validate.py are correct.
Note that at the end of script blender will resave your blend file.

If you have multiple files, you should run this script for each of them.
Alexander (Blend4Web Team)
twitter
 
Please register or log in to leave a reply.