roavatar-renderer 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/index.js +16 -12
- package/package.json +8 -1
package/README.md
CHANGED
|
@@ -8,6 +8,10 @@ Also available on npm: https://www.npmjs.com/package/roavatar-renderer
|
|
|
8
8
|
IMPORTANT: Assets are NOT included in the npm module or this repository, you have to get them from the main RoAvatar repository
|
|
9
9
|
|
|
10
10
|
Basic (not really) example on how to load an avatar, that is also untested:
|
|
11
|
+
```html
|
|
12
|
+
<!--I know this is kind of terrible but... it has to be included-->
|
|
13
|
+
<script src="/draco_decoder.js"></script>
|
|
14
|
+
```
|
|
11
15
|
```ts
|
|
12
16
|
//setup instance wrappers and renderer
|
|
13
17
|
RegisterWrappers()
|
package/dist/index.js
CHANGED
|
@@ -57609,18 +57609,21 @@ const compositMeshPaths = [
|
|
|
57609
57609
|
"rbxasset://avatar/compositing/R15CompositTorsoBase.mesh"
|
|
57610
57610
|
];
|
|
57611
57611
|
const compositMeshCache = /* @__PURE__ */ new Map();
|
|
57612
|
-
|
|
57613
|
-
|
|
57614
|
-
|
|
57615
|
-
|
|
57616
|
-
|
|
57617
|
-
|
|
57618
|
-
|
|
57619
|
-
|
|
57620
|
-
|
|
57621
|
-
|
|
57622
|
-
|
|
57623
|
-
|
|
57612
|
+
function loadCompositMeshes() {
|
|
57613
|
+
console.log("Loading composit meshes");
|
|
57614
|
+
for (const meshPath of compositMeshPaths) {
|
|
57615
|
+
compositMeshCache.set(meshPath, new Promise((resolve) => {
|
|
57616
|
+
API.Asset.GetMesh(meshPath).then((result) => {
|
|
57617
|
+
if (result instanceof Response) {
|
|
57618
|
+
throw new Error(`Missing file for composit mesh: ${meshPath}`);
|
|
57619
|
+
} else {
|
|
57620
|
+
const threeGeometry = fileMeshToTHREEGeometry(result);
|
|
57621
|
+
compositMeshCache.set(meshPath, threeGeometry);
|
|
57622
|
+
resolve(threeGeometry);
|
|
57623
|
+
}
|
|
57624
|
+
});
|
|
57625
|
+
}));
|
|
57626
|
+
}
|
|
57624
57627
|
}
|
|
57625
57628
|
async function getCompositGeometry(path) {
|
|
57626
57629
|
return compositMeshCache.get(path);
|
|
@@ -60090,6 +60093,7 @@ class RBXRenderer {
|
|
|
60090
60093
|
static resolution = [420, 420];
|
|
60091
60094
|
/**Fully sets up renderer with scene, camera and frame rendering*/
|
|
60092
60095
|
static fullSetup() {
|
|
60096
|
+
loadCompositMeshes();
|
|
60093
60097
|
RBXRenderer.create();
|
|
60094
60098
|
RBXRenderer.setupScene();
|
|
60095
60099
|
RBXRenderer.setupControls();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "roavatar-renderer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "A renderer for Roblox avatars, used by the RoAvatar extension.",
|
|
5
5
|
"author": "steinan",
|
|
6
6
|
"type": "module",
|
|
@@ -8,6 +8,13 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": "./dist/index.js"
|
|
10
10
|
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/steinann/RoAvatar-Renderer.git"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"provenance": true
|
|
17
|
+
},
|
|
11
18
|
"files": [
|
|
12
19
|
"dist",
|
|
13
20
|
"assets"
|