From 92045b8f4b52c04790df37e41003d034c6002c0d Mon Sep 17 00:00:00 2001 From: kovacsv Date: Tue, 24 May 2022 22:27:34 +0200 Subject: [PATCH] Include environment maps in the packages. --- package.json | 3 ++- tools/create_package.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d63c161..6ee1a40 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ ], "files": [ "source/engine/*", - "libs/loaders/*" + "libs/loaders/*", + "website/assets/envmaps/*" ], "scripts": { "start": "http-server", diff --git a/tools/create_package.py b/tools/create_package.py index 515ca8a..f174eb0 100644 --- a/tools/create_package.py +++ b/tools/create_package.py @@ -88,8 +88,15 @@ def CreatePackage (rootDir, websiteDir, packageDir, version): zipPath = os.path.join (packageDir, 'o3dv_' + version + '.zip') zip = zipfile.ZipFile (zipPath, mode = 'w', compression = zipfile.ZIP_DEFLATED) - for lib in os.listdir (os.path.join (websiteDir, 'libs', 'loaders')): - zip.write (os.path.join (websiteDir, 'libs', 'loaders', lib), 'libs/loaders/' + lib) + for file in os.listdir (os.path.join (websiteDir, 'libs', 'loaders')): + zip.write (os.path.join (websiteDir, 'libs', 'loaders', file), 'libs/loaders/' + file) + for file in os.listdir (os.path.join (websiteDir, 'assets', 'envmaps')): + filePath = os.path.join (websiteDir, 'assets', 'envmaps', file) + if os.path.isdir (filePath): + for fileInDir in os.listdir (filePath): + zip.write (os.path.join (filePath, fileInDir), 'envmaps/' + file + '/' + fileInDir) + else: + zip.write (filePath, 'envmaps/' + file) zip.write (os.path.join (rootDir, 'build', 'o3dv.min.js'), 'o3dv.min.js') zip.write (os.path.join (rootDir, 'LICENSE.md'), 'o3dv.license.md') zip.close ()