Skip to content

Commit

Permalink
feat(editor): pass run test: when close Modal, show cube1 anim
Browse files Browse the repository at this point in the history
create ui in index.html in publish action;
operate ui in script;
  • Loading branch information
yyc-git committed Mar 11, 2024
1 parent 61a3dc7 commit aaa67ea
Show file tree
Hide file tree
Showing 32 changed files with 770 additions and 308 deletions.
17 changes: 13 additions & 4 deletions contributes/meta3d-action-publish/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meta3d-action-publish",
"version": "1.3.1",
"version": "1.3.11",
"publisher": "meta3d",
"protocol": {
"name": "meta3d-action-publish-protocol"
Expand All @@ -9,25 +9,34 @@
"scripts": {
"watch": "tsc -w -noEmit",
"webpack": "webpack --config webpack.config.js",
"webpack_publish": "webpack --config webpack.config.publish.js",
"meta3d:publish_dev_auto": "yarn version --patch --no-git-tag-version && yarn meta3d:publish_dev",
"meta3d:publish_dev": "cross-env NODE_ENV=development npm run webpack && gulp publish_local_env",
"meta3d:publish_pro": "cross-env NODE_ENV=production npm run webpack && gulp publish_production_env"
"meta3d:publish_dev": "cross-env NODE_ENV=production npm run webpack_publish && cross-env NODE_ENV=production npm run webpack && gulp publish_local_env",
"meta3d:publish_pro": "cross-env NODE_ENV=production npm run webpack_publish && cross-env NODE_ENV=production npm run webpack && gulp publish_production_env"
},
"keywords": [],
"packageDependencies": {
"meta3d-engine-whole-protocol": "^0.20.0"
},
"dependencies": {
"@ant-design/charts": "^1.4.2",
"@ant-design/icons": "^4.6.0",
"antd": "^5.12.2",
"lodash": "^4.17.20",
"meta3d-action-publish-protocol": "^1.2.0",
"meta3d-action-run-protocol": "^1.3.0",
"meta3d-editor-whole-protocol": "^1.3.0",
"meta3d-type": "^1.3.0"
"meta3d-type": "^1.3.0",
"react": ">=16.8.4",
"react-dom": ">=16.8.4"
},
"devDependencies": {
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"cross-env": "^7.0.3",
"cz-customizable": "^6.3.0",
"gulp": "^4.0.2",
"html-webpack-plugin": "^5.5.0",
"meta3d-tool-publish": "^1.3.0",
"source-map-loader": "^3.0.0",
"ts-loader": "^9.2.6",
Expand Down
123 changes: 2 additions & 121 deletions contributes/meta3d-action-publish/publish/index.html
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,126 +1,7 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8" />
<title>Meta3D</title>

<style>
#loading {
<!doctype html><html><head><meta charset="UTF-8"/><title>Meta3D</title><style>#loading {
display: block;
/* color: #e7981f; */
/* margin-top: 10px; */
font-size: 85px;
font-weight: bold;
}
</style>
</head>

<body>
<section>
<span id="loading">
<!-- TODO use logo + loading gif -->
loading...
</span>
</section>

<!-- TODO full screen -->
<canvas id="canvas" width=800 height=800></canvas>

<script src="./meta3d.js"></script>

<script>
window.onload = () => {
let _removeLoadingUI = () => {
document.querySelector("#loading").remove()
}

let _loop = (
[

update, render,
],
meta3dState,
) => {
return update(meta3dState).then((meta3dState) => {
render(meta3dState).then((meta3dState) => {
requestAnimationFrame(() => {
_loop(
[
update, render,
],
meta3dState
)
})
})
})
}

let _main = () => {
let isDebug = true

let float9Array1 = new Float32Array(9)
let float32Array1 = new Float32Array(32)
let transformCount = 100000
let geometryCount = 100000
let geometryPointCount = 10000000
let pbrMaterialCount = 100000

let canvas = document.querySelector("#canvas")

fetch("./Engine.arraybuffer")
.then(response => response.arrayBuffer())
.then(enginePackageBinaryFile => {
return fetch("./Scene.glb")
.then(response => response.arrayBuffer())
.then(sceneGlb => {
_removeLoadingUI()

return [enginePackageBinaryFile, sceneGlb]
})
})
.then(([enginePackageBinaryFile, sceneGlb]) => {
let [meta3dState, _, entryExtensionProtocolName] = Meta3d.loadPackage(enginePackageBinaryFile)

if (entryExtensionProtocolName !== "meta3d-engine-whole-protocol") {
throw new Error(
`entryExtensionProtocolName: ${entryExtensionProtocolName} should be meta3d-engine-whole-protocol`
)
}


let { loadScene, prepare, init, update, render, scene } = Meta3d.getExtensionService(meta3dState, entryExtensionProtocolName)

meta3dState = prepare(
meta3dState,
isDebug,
{
float9Array1,
float32Array1,
transformCount,
geometryCount,
geometryPointCount,
pbrMaterialCount
}
)

return loadScene(meta3dState, sceneGlb).then(meta3dState => {
return init(meta3dState, canvas).then(meta3dState => {
console.log("init success", meta3dState)

_loop([update, render], meta3dState)
})
})
})
.catch(error => {
console.error(error)
})
}

_main()
}
</script>
</body>


</html>
}</style><script defer="defer" src="static/js/main.js"></script></head><body><section><span id="loading">loading...</span></section><canvas id="canvas" width="800" height="800"></canvas><div id="root"></div></body></html>
1 change: 0 additions & 1 deletion contributes/meta3d-action-publish/publish/meta3d.js

This file was deleted.

3 changes: 3 additions & 0 deletions contributes/meta3d-action-publish/publish/static/js/main.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/

/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */

/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license qrcode.react
* Copyright (c) Paul O'Shannessy
* SPDX-License-Identifier: ISC
*/

/** @license MIT License (c) copyright 2010-2014 original author or authors */

/** @license MIT License (c) copyright 2010-2016 original author or authors */

/** @license MIT License (c) copyright 2010-2017 original author or authors */

/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

Large diffs are not rendered by default.

22 changes: 1 addition & 21 deletions contributes/meta3d-action-publish/publish/three/basis/basis_transcoder.js
100755 → 100644

Large diffs are not rendered by default.

34 changes: 1 addition & 33 deletions contributes/meta3d-action-publish/publish/three/draco/gltf/draco_decoder.js
100755 → 100644

Large diffs are not rendered by default.

34 changes: 1 addition & 33 deletions contributes/meta3d-action-publish/publish/three/draco/gltf/draco_encoder.js
100755 → 100644

Large diffs are not rendered by default.

Loading

0 comments on commit aaa67ea

Please sign in to comment.