mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2024-12-27 10:04:10 +00:00
3380f4c71d
* started docs for Blender Blenvy add-on * started migration guide * got rid of a few examples * moved (for now, wip) all remaining examples under the Blenvy umbrella * updated main README * fixed issue with undeleted bin file when setting gltf export options for gltf/bin mode * updated release tools (internal_generate_release_zips) * moved main TODO to root of repo * a lot of related prep work & cleanup
27 lines
813 B
Python
27 lines
813 B
Python
import os
|
|
import zipfile
|
|
|
|
ignore_list = ['.pytest_cache', '__pycache__']
|
|
|
|
def zipdir(path, ziph):
|
|
# ziph is zipfile handle
|
|
for root, dirs, files in os.walk(path):
|
|
# filter out invalid paths
|
|
root_path = os.path.normpath(root)
|
|
root_path = root_path.split(os.sep)
|
|
add_file = True
|
|
for sub_path in root_path:
|
|
if sub_path in ignore_list:
|
|
add_file = False
|
|
break
|
|
|
|
if add_file:
|
|
for file in files:
|
|
ziph.write(os.path.join(root, file),
|
|
os.path.relpath(os.path.join(root, file),
|
|
os.path.join(path, '..')))
|
|
|
|
with zipfile.ZipFile("blenvy.zip", mode="w", compression=zipfile.ZIP_DEFLATED) as archive:
|
|
zipdir('./blenvy', archive)
|
|
|