Jump to content

PY - Map Object Remover


Recommended Posts

M2 Download Center

Hidden Content

    Give reaction to this post to see the hidden content.
( Internal )

Hi! Today, i'm gonna give u simple tool, to remove all objects from map with one command, i think it's useful (;

 

import os, sys

try:
    directory = os.path.relpath(str(sys.argv[1]))
    dirs = []
except IndexError:
    print "usage: deleteObjects.py <mapfolder>"
else:
    if os.path.isdir(directory):
        directoryListing = os.listdir(directory)
        for file in directoryListing:
            file = os.path.join(directory, file)
            if os.path.isdir(file):
                dirs.append(file)

        for dir in dirs:
            with open(os.path.join(dir, "areadata.txt"), "a") as f:
                f.truncate()
                f.write("AreaDataFilennnObjectCount 0")
                f.close()
    else:
        print "Maaan, directory " + directory + " doesn't exist"
        print "usage: deleteObjects.py <mapfolder>"
 
 
  • Love 3
Link to comment
  • 11 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.