diff --git a/.gitignore b/.gitignore index cecec98..2e99bcc 100644 --- a/.gitignore +++ b/.gitignore @@ -130,3 +130,4 @@ dmypy.json *.png *.blend1 *.avi +actions-runner/** diff --git a/scripts/compare_template.py b/scripts/compare_template.py new file mode 100644 index 0000000..a31e5d5 --- /dev/null +++ b/scripts/compare_template.py @@ -0,0 +1,22 @@ +import filecmp +import yaml +import json + +config = {} +sandbox_header_dir = 'sandbox/' + +with open ('template_files.yaml', 'r') as template_files: + config['template_files'] = yaml.load(template_files) + +for file in config['template_files']: + if 'blend' in file: + continue + + print('checking for differences in {}{}'.format(sandbox_header_dir, file)) + areEqual = filecmp.cmp(file, '{}{}'.format(sandbox_header_dir, file)) + if areEqual: + print(' -- good') + else: + print(' -- not equal') + + diff --git a/scripts/generate_template.py b/scripts/generate_template.py new file mode 100644 index 0000000..720a22a --- /dev/null +++ b/scripts/generate_template.py @@ -0,0 +1,24 @@ +import yaml +import json +import os +import shutil + +config = {} +sandbox_header_dir = 'sandbox/' + +with open ('template_files.yaml', 'r') as template_files: + config['template_files'] = yaml.load(template_files) + +print(json.dumps(config, indent=3)) + +print('refreshing sandbox/') +shutil.rmtree(sandbox_header_dir) +os.mkdir(sandbox_header_dir) +os.mkdir(sandbox_header_dir + 'blender/') +os.mkdir(sandbox_header_dir + 'scripts/') +os.mkdir(sandbox_header_dir + 'logs/') + +for file in config['template_files']: + shutil.copy(file, '{}{}'.format(sandbox_header_dir, file)) + print('file created in sandbox: {}{}'.format(sandbox_header_dir, file)) + diff --git a/template_files.yaml b/template_files.yaml new file mode 100644 index 0000000..570e00c --- /dev/null +++ b/template_files.yaml @@ -0,0 +1,4 @@ +- Makefile +- blender/scene.blend +- scripts/render.py +- config.yaml