roavatar-renderer 1.2.7 → 1.2.9
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/dist/index.d.ts +2 -0
- package/dist/index.js +57 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -954,6 +954,32 @@ const accessoryRefinementUpperBounds = {
|
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
956
|
};
|
|
957
|
+
const AllHeadShapes = [
|
|
958
|
+
"RobloxClassic",
|
|
959
|
+
"Blockhead",
|
|
960
|
+
"Cheeks",
|
|
961
|
+
"Chiseled",
|
|
962
|
+
"CoolThing",
|
|
963
|
+
"EraserHead",
|
|
964
|
+
"FatHead",
|
|
965
|
+
"FlatTop",
|
|
966
|
+
"GoldenKorbloxGeneral",
|
|
967
|
+
"GoldenMrRobot",
|
|
968
|
+
"KnightOfChivalry",
|
|
969
|
+
"KnightOfCourage",
|
|
970
|
+
"ManHead",
|
|
971
|
+
"MercilessNinja",
|
|
972
|
+
"Narrow",
|
|
973
|
+
"Paragon",
|
|
974
|
+
"Peabrain",
|
|
975
|
+
"Perfection",
|
|
976
|
+
"Roll",
|
|
977
|
+
"Roundy",
|
|
978
|
+
"RoxBox",
|
|
979
|
+
"TheEngineer",
|
|
980
|
+
"Trim",
|
|
981
|
+
"WomanHead"
|
|
982
|
+
];
|
|
957
983
|
const REVISION = "180";
|
|
958
984
|
const MOUSE = { ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
959
985
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
@@ -35581,7 +35607,7 @@ function BatchThumbnails() {
|
|
|
35581
35607
|
let auth = void 0;
|
|
35582
35608
|
const body = [];
|
|
35583
35609
|
for (const thumbnailInfo of ThumbnailsToBatch) {
|
|
35584
|
-
if (Date.now() / 1e3 - thumbnailInfo.lastTryTimestamp < 1) {
|
|
35610
|
+
if (Date.now() / 1e3 - thumbnailInfo.lastTryTimestamp < 1 + thumbnailInfo.attempt) {
|
|
35585
35611
|
continue;
|
|
35586
35612
|
}
|
|
35587
35613
|
body.push({
|
|
@@ -49078,6 +49104,10 @@ class WorkerPool {
|
|
|
49078
49104
|
};
|
|
49079
49105
|
worker.onerror = (e) => {
|
|
49080
49106
|
console.warn(e);
|
|
49107
|
+
const index = this.workers.indexOf(worker);
|
|
49108
|
+
this.workers.splice(index, 1);
|
|
49109
|
+
this.workersActiveTasks.splice(index, 1);
|
|
49110
|
+
this.workersResolves.splice(index, 1);
|
|
49081
49111
|
throw new Error("Failed to create worker, try disabling workers by setting FLAGS.USE_WORKERS = false but do note doing so will degrade performance");
|
|
49082
49112
|
};
|
|
49083
49113
|
}
|
|
@@ -59625,11 +59655,18 @@ class AnimatorWrapper extends InstanceWrapper {
|
|
|
59625
59655
|
}
|
|
59626
59656
|
}
|
|
59627
59657
|
const humanoidDescription = humanoid.FindFirstChildOfClass("HumanoidDescription");
|
|
59658
|
+
let staticFacialAnimation = false;
|
|
59628
59659
|
if (humanoidDescription) {
|
|
59629
|
-
|
|
59660
|
+
staticFacialAnimation = humanoidDescription.Prop("StaticFacialAnimation");
|
|
59661
|
+
if (staticFacialAnimation) {
|
|
59630
59662
|
this.restPose(false, true);
|
|
59631
59663
|
}
|
|
59632
59664
|
}
|
|
59665
|
+
if (staticFacialAnimation && this.data.currentMoodAnimation !== "mood") {
|
|
59666
|
+
this.playAnimation("mood", "mood");
|
|
59667
|
+
} else if (!staticFacialAnimation && this.data.currentAnimation?.startsWith("emote.") && this.data.currentMoodAnimation) {
|
|
59668
|
+
this.stopMoodAnimation();
|
|
59669
|
+
}
|
|
59633
59670
|
for (const track of this.data.animationTracks.values()) {
|
|
59634
59671
|
if (!this.data.moodTracks.includes(track)) continue;
|
|
59635
59672
|
const looped = track.tick(addTime);
|
|
@@ -59767,10 +59804,22 @@ class AnimatorWrapper extends InstanceWrapper {
|
|
|
59767
59804
|
}
|
|
59768
59805
|
}
|
|
59769
59806
|
playAnimation(name2, type = "main") {
|
|
59807
|
+
const humanoid = this.instance.parent;
|
|
59808
|
+
if (!humanoid) {
|
|
59809
|
+
throw new Error("Parent is missing from Animator");
|
|
59810
|
+
}
|
|
59811
|
+
const humanoidDescription = humanoid.FindFirstChildOfClass("HumanoidDescription");
|
|
59812
|
+
let staticFacialAnimation = false;
|
|
59813
|
+
if (humanoidDescription) {
|
|
59814
|
+
staticFacialAnimation = humanoidDescription.Prop("StaticFacialAnimation");
|
|
59815
|
+
if (staticFacialAnimation) {
|
|
59816
|
+
this.restPose(false, true);
|
|
59817
|
+
}
|
|
59818
|
+
}
|
|
59770
59819
|
switch (type) {
|
|
59771
59820
|
case "main":
|
|
59772
59821
|
if (this.data.currentAnimation !== name2) {
|
|
59773
|
-
if (!name2.startsWith("emote.")) {
|
|
59822
|
+
if (!name2.startsWith("emote.") || staticFacialAnimation) {
|
|
59774
59823
|
this.playAnimation("mood", "mood");
|
|
59775
59824
|
} else {
|
|
59776
59825
|
this.stopMoodAnimation();
|
|
@@ -61727,11 +61776,11 @@ class RBXRenderer {
|
|
|
61727
61776
|
errorDiv.style = `
|
|
61728
61777
|
display: flex;
|
|
61729
61778
|
flex-direction: column;
|
|
61730
|
-
justify-content:
|
|
61779
|
+
justify-content: center;
|
|
61731
61780
|
align-items: center;
|
|
61732
61781
|
width: 100%;
|
|
61733
61782
|
height: 100%;
|
|
61734
|
-
background-color: rgb(
|
|
61783
|
+
background-color: rgb(255, 89, 89);
|
|
61735
61784
|
`;
|
|
61736
61785
|
const errorTitle = document.createElement("span");
|
|
61737
61786
|
errorTitle.style = `
|
|
@@ -61749,6 +61798,7 @@ class RBXRenderer {
|
|
|
61749
61798
|
font-size: 24px;
|
|
61750
61799
|
color: #fff;
|
|
61751
61800
|
text-align: center;
|
|
61801
|
+
max-width: 90%;
|
|
61752
61802
|
`;
|
|
61753
61803
|
errorText.innerText = "Your browser, device or settings do not support WebGL2";
|
|
61754
61804
|
errorDiv.appendChild(errorText);
|
|
@@ -61759,6 +61809,7 @@ class RBXRenderer {
|
|
|
61759
61809
|
color: #fff;
|
|
61760
61810
|
text-align: center;
|
|
61761
61811
|
`;
|
|
61812
|
+
errorLink.target = "_blank";
|
|
61762
61813
|
errorLink.innerText = "Learn more";
|
|
61763
61814
|
errorLink.href = "https://webglreport.com/?v=2";
|
|
61764
61815
|
errorDiv.appendChild(errorLink);
|
|
@@ -62458,6 +62509,7 @@ export {
|
|
|
62458
62509
|
AllBodyPartsSorts,
|
|
62459
62510
|
AllCharacterSorts,
|
|
62460
62511
|
AllClothingSorts,
|
|
62512
|
+
AllHeadShapes,
|
|
62461
62513
|
AlphaMode,
|
|
62462
62514
|
AnimationPropToName,
|
|
62463
62515
|
AnimationTrack,
|