I want to get blender to work with argparse.
I found the following implementation in blender here and tried to sum it down to this:
import argparse
import sys
argv = sys.argv
if "--" not in argv:
argv = [] # as if no args are passed
else:
argv = argv[argv.index("--") + 1:] # get all args after "--"
usage_text = "Run blender in background mode with this script: blender --background --python " + __file__ + " -- [options]"
parser = argparse.ArgumentParser(description=usage_text)
args = parser.parse_args(argv) # In this example we wont use the args
However when executed named as argparse_blender.py
like this:
blender -b -P argparse_blender.py -- -h
I get as the last line:
Error: Not freed memory blocks: 216
Is there a way to fix this? If not, is it serious? I care about memory leaks.