From 4aa15a2d08e46632de8d4f53a196bce68b0443ff Mon Sep 17 00:00:00 2001 From: Viktor Kovacs Date: Sat, 27 Mar 2021 13:43:04 +0100 Subject: [PATCH 01/35] Update version. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b0487e4..2023097 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "online-3d-viewer", "description": "Online 3D Viewer", - "version": "0.7.2", + "version": "0.7.3", "repository": "github:kovacsv/Online3DViewer", "license": "MIT", "devDependencies": { From dc8d59260cba56557b28203f7ad915f11a1a90cb Mon Sep 17 00:00:00 2001 From: Viktor Kovacs Date: Sat, 27 Mar 2021 18:19:33 +0100 Subject: [PATCH 02/35] Fix mobile layout. --- website/info/info.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/info/info.css b/website/info/info.css index 191aa60..bc22ba7 100644 --- a/website/info/info.css +++ b/website/info/info.css @@ -141,6 +141,8 @@ div.code font-size: 14px; margin: 10px 0px; padding : 5px; + overflow: auto; + white-space: nowrap; } @media only screen and (max-width: 1000px) From 55e52b4e79b13e4e03bf9f7832f83421ef4aa6f9 Mon Sep 17 00:00:00 2001 From: Viktor Kovacs Date: Sun, 28 Mar 2021 09:13:48 +0200 Subject: [PATCH 03/35] Remove unused parameter. --- website/o3dv/dialogs.js | 2 +- website/o3dv/website.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/o3dv/dialogs.js b/website/o3dv/dialogs.js index 56af225..6dcc631 100644 --- a/website/o3dv/dialogs.js +++ b/website/o3dv/dialogs.js @@ -201,7 +201,7 @@ OV.ShowOpenUrlDialog = function (onOk) return dialog; }; -OV.ShowExportDialog = function (model, importer) +OV.ShowExportDialog = function (model) { if (model === null) { return OV.ShowMessageDialog ('Export Failed', 'Please load a model to export', null); diff --git a/website/o3dv/website.js b/website/o3dv/website.js index 873141b..c7631ef 100644 --- a/website/o3dv/website.js +++ b/website/o3dv/website.js @@ -265,7 +265,7 @@ OV.Website = class }); AddSeparator (this.toolbar, true); AddButton (this.toolbar, 'export', 'Export model', true, function () { - obj.dialog = OV.ShowExportDialog (obj.model, obj.modelLoader.GetImporter ()); + obj.dialog = OV.ShowExportDialog (obj.model); }); AddButton (this.toolbar, 'embed', 'Get embedding code', true, function () { obj.dialog = OV.ShowEmbeddingDialog (obj.modelLoader.GetImporter (), obj.viewer.GetCamera ()); From a1210d2129bf66e70e8b26ef184d57a7a2722bb9 Mon Sep 17 00:00:00 2001 From: Viktor Kovacs Date: Sun, 28 Mar 2021 09:59:51 +0200 Subject: [PATCH 04/35] Fix lgtm issues. --- source/import/importer3ds.js | 2 +- source/import/importergltf.js | 5 ++--- tools/sandbox/index.html | 2 +- website/o3dv/dialogs.js | 6 +++--- website/o3dv/utils.js | 7 ++++--- website/o3dv/website.css | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/source/import/importer3ds.js b/source/import/importer3ds.js index cdde82b..b11868f 100644 --- a/source/import/importer3ds.js +++ b/source/import/importer3ds.js @@ -336,7 +336,7 @@ OV.Importer3ds = class extends OV.ImporterBase let v0 = reader.ReadUnsignedInteger16 (); let v1 = reader.ReadUnsignedInteger16 (); let v2 = reader.ReadUnsignedInteger16 (); - let flags = reader.ReadUnsignedInteger16 (); + reader.ReadUnsignedInteger16 (); // flags mesh.AddTriangle (new OV.Triangle (v0, v1, v2)); } diff --git a/source/import/importergltf.js b/source/import/importergltf.js index f8d5017..cc314a1 100644 --- a/source/import/importergltf.js +++ b/source/import/importergltf.js @@ -741,9 +741,6 @@ OV.ImporterGltf = class extends OV.ImporterBase let hasNormals = (primitive.attributes.NORMAL !== undefined); let hasUVs = (primitive.attributes.TEXCOORD_0 !== undefined); let hasIndices = (primitive.indices !== undefined); - if (!hasVertices) { - return; - } let mode = OV.GltfRenderMode.TRIANGLES; if (primitive.mode !== undefined) { @@ -766,6 +763,8 @@ OV.ImporterGltf = class extends OV.ImporterBase reader.EnumerateData (function (data) { mesh.AddVertex (data); }); + } else { + return; } if (hasNormals) { diff --git a/tools/sandbox/index.html b/tools/sandbox/index.html index d85c8a6..e3c99f3 100644 --- a/tools/sandbox/index.html +++ b/tools/sandbox/index.html @@ -11,7 +11,7 @@ + + + + + + + + +
+
+
+
+
+ + + diff --git a/tools/sandbox/index.html b/tools/sandbox/three_minimal.html similarity index 100% rename from tools/sandbox/index.html rename to tools/sandbox/three_minimal.html diff --git a/website/embed_selfhost.html b/website/embed_selfhost.html deleted file mode 100644 index 71e94fd..0000000 --- a/website/embed_selfhost.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - Online 3D Viewer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- - - From 665a419e4957da97e9455dce2f0135ea0f3994c9 Mon Sep 17 00:00:00 2001 From: Viktor Kovacs Date: Sun, 28 Mar 2021 12:02:46 +0200 Subject: [PATCH 07/35] Create test build without analytics. --- appveyor.yml | 2 +- tools/create_package.py | 17 ++++++++++++----- tools/sandbox/embed_selfhost.html | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d7c9c6d..4717929 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,7 +16,7 @@ test_script: - npm run test artifacts: - - path: build\package\* + - path: build\final\package\* deploy: description: 'News:\n- ...' diff --git a/tools/create_package.py b/tools/create_package.py index bc78d40..28678f1 100644 --- a/tools/create_package.py +++ b/tools/create_package.py @@ -37,7 +37,7 @@ def CompressFiles (inputFiles, outputFile): return False return True -def CreateDestinationDir (config, rootDir, websiteDir, version): +def CreateDestinationDir (config, rootDir, websiteDir, version, testBuild): if not os.path.exists (websiteDir): os.makedirs (websiteDir) @@ -71,7 +71,7 @@ def CreateDestinationDir (config, rootDir, websiteDir, version): metaContent = Tools.GetFileContent (metaFile) replacer.ReplaceTokenContent ('', '', metaContent) analyticsFile = os.path.join (rootDir, 'tools', 'website_analytics_data.txt') - if os.path.exists (analyticsFile): + if os.path.exists (analyticsFile) and not testBuild: analyticsContent = Tools.GetFileContent (analyticsFile) replacer.ReplaceTokenContent ('', '', analyticsContent) scriptFile = os.path.join (rootDir, 'tools', 'website_script_data.txt') @@ -96,12 +96,19 @@ def Main (argv): os.chdir (currentDir) rootDir = os.path.abspath ('..') - buildDir = os.path.join (rootDir, 'build') + + testBuild = False + buildDir = os.path.join (rootDir, 'build', 'final') + if len (argv) >= 2 and argv[1] == 'test': + testBuild = True + buildDir = os.path.join (rootDir, 'build', 'test') + PrintInfo ('Creating test build.') + websiteDir = os.path.join (buildDir, 'website') packageDir = os.path.join (buildDir, 'package') if os.path.exists (buildDir): shutil.rmtree (buildDir) - + config = None with open ('config.json') as configJson: config = json.load (configJson) @@ -120,7 +127,7 @@ def Main (argv): version = GetVersion (rootDir) PrintInfo ('Create build directory') - CreateDestinationDir (config, rootDir, websiteDir, version) + CreateDestinationDir (config, rootDir, websiteDir, version, testBuild) PrintInfo ('Compress importer sources.') compressResult = CompressFiles (config['importer_files'], os.path.join (websiteDir, 'o3dv', 'o3dv.min.js')) diff --git a/tools/sandbox/embed_selfhost.html b/tools/sandbox/embed_selfhost.html index c75d0e8..5c435f0 100644 --- a/tools/sandbox/embed_selfhost.html +++ b/tools/sandbox/embed_selfhost.html @@ -9,7 +9,7 @@ Online 3D Viewer - +