I am using DepthKit V0.8.0 to export OBJ’s using the ‘Export Textured Geometry Sequence’ option. Is it possible to export just the OBJ files, without also exporting the MTL and PNG files? It’s not an option in the DepthKit interface, but i was wondering if there was a work-around?
Not exporting MTL and PNG files would save me a ton of time deleting files that are unneeded and gradually fill up my hard drive.
PS - Im using version 8.0 because of the mesh-decimation works really well for my project.
@GrahamPlumb Unfortunately, neither the current release nor the version you are using are able to export the OBJ’s without the material and texture files.
The only workaround I can think of is to have a script running which watches your export folder and automatically deletes MTL & PNG/JPG files as they are created.
Here’s an AI-generated [USE THIS CODE AT YOUR OWN RISK] Python script which uses the watchdog library to accomplish this:
import os
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
# Folder to monitor
WATCH_FOLDER = "path/to/your/watch/folder"
# File extensions to delete
TARGET_EXTENSIONS = {".mtl", ".jpg", ".png"}
class FileDeletionHandler(FileSystemEventHandler):
"""Custom event handler for deleting specific files."""
def on_created(self, event):
"""Triggered when a file or folder is created."""
if not event.is_directory:
self.handle_file(event.src_path)
def on_modified(self, event):
"""Triggered when a file or folder is modified."""
if not event.is_directory:
self.handle_file(event.src_path)
def handle_file(self, file_path):
"""Delete the file if it matches the target extensions."""
_, ext = os.path.splitext(file_path)
if ext.lower() in TARGET_EXTENSIONS:
try:
os.remove(file_path)
print(f"Deleted: {file_path}")
except Exception as e:
print(f"Error deleting {file_path}: {e}")
def monitor_watch_folder():
"""Start monitoring the watch folder."""
event_handler = FileDeletionHandler()
observer = Observer()
observer.schedule(event_handler, WATCH_FOLDER, recursive=False)
print(f"Monitoring folder: {WATCH_FOLDER}")
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
print("Stopping monitor...")
observer.stop()
observer.join()
if __name__ == "__main__":
# Ensure the watch folder exists
if not os.path.exists(WATCH_FOLDER):
print(f"Error: The folder '{WATCH_FOLDER}' does not exist.")
else:
monitor_watch_folder()