roavatar-renderer 1.6.4 → 1.6.5

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 CHANGED
@@ -60,5 +60,8 @@ if (!(outfitModel instanceof OutfitModel)) throw new Error("Failed to get outfit
60
60
  **RESULT:**
61
61
  <img src="https://devforum-uploads.s3.dualstack.us-east-2.amazonaws.com/uploads/original/5X/9/f/a/d/9fadf25d9770b63e8a2e480369930cad94ad04aa.png">
62
62
 
63
- For more examples check out the OutfitRenderer, BackgroundRenderer, RoAvatar (avatarPreview.tsx) or RoValra (ItemRender.ts) source code
63
+ For more code examples check out the OutfitRenderer, BackgroundRenderer, RoAvatar (avatarPreview.tsx) or RoValra (ItemRender.ts) source code
64
+
65
+ For a live renderer example on a website check out https://roavatar.net
66
+
64
67
  There is also a discord server you can ask for help in: https://discord.gg/PHa5Vgtbva
package/dist/index.d.ts CHANGED
@@ -2026,7 +2026,7 @@ export declare class HumanoidDescriptionWrapper extends InstanceWrapper {
2026
2026
  getAccessoryIds(): bigint[];
2027
2027
  getAccessoryDescriptionWithId(id: bigint): Instance | undefined;
2028
2028
  getBodyPartDescription(bodyPart: number): Instance | undefined;
2029
- getBodyPartColor(bodyPart: number): Color3;
2029
+ getBodyPartColor(bodyPart: number): Color3 | undefined;
2030
2030
  setBodyPartId(bodyPart: number, id: bigint): void;
2031
2031
  setBodyPartHeadShape(bodyPart: number, headShape: string): void;
2032
2032
  getBodyPartId(bodyPart: number): bigint;
@@ -3678,12 +3678,12 @@ declare class RenderDesc extends DisposableDesc {
3678
3678
  compiled: boolean;
3679
3679
  failed: boolean;
3680
3680
  constructor(renderScene: RBXRendererScene);
3681
- isSame(_other: RenderDesc): boolean;
3682
- needsRegeneration(_other: RenderDesc): boolean;
3683
- fromRenderDesc(other: RenderDesc): void;
3684
- transferFrom(other: RenderDesc): void;
3685
- virtualTransferFrom(_other: RenderDesc): void;
3686
- virtualFromRenderDesc(_other: RenderDesc): void;
3681
+ isSame(_newDesc: RenderDesc): boolean;
3682
+ needsRegeneration(_newDesc: RenderDesc): boolean;
3683
+ fromRenderDesc(newDesc: RenderDesc): void;
3684
+ transferFrom(oldDesc: RenderDesc): void;
3685
+ virtualTransferFrom(_oldDesc: RenderDesc): void;
3686
+ virtualFromRenderDesc(_newDesc: RenderDesc): void;
3687
3687
  fromInstance(_child: Instance): void;
3688
3688
  compileResults(_renderer: THREE.WebGLRenderer, _scene: THREE.Scene): Promise<THREE.Object3D[] | Response | undefined>;
3689
3689
  updateResults(): void;
package/dist/index.js CHANGED
@@ -43278,27 +43278,27 @@ class RenderDesc extends DisposableDesc {
43278
43278
  this.renderScene = renderScene;
43279
43279
  }
43280
43280
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
43281
- isSame(_other) {
43281
+ isSame(_newDesc) {
43282
43282
  throw new Error("Virtual method isSame called");
43283
43283
  }
43284
43284
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
43285
- needsRegeneration(_other) {
43285
+ needsRegeneration(_newDesc) {
43286
43286
  throw new Error("Virtual method needsRegeneration called");
43287
43287
  }
43288
- fromRenderDesc(other) {
43289
- if (this.needsRegeneration(other)) {
43288
+ fromRenderDesc(newDesc) {
43289
+ if (this.needsRegeneration(newDesc)) {
43290
43290
  throw new Error("These RenderableDesc objects have differences that require recompilation");
43291
43291
  }
43292
- this.virtualFromRenderDesc(other);
43292
+ this.virtualFromRenderDesc(newDesc);
43293
43293
  }
43294
- transferFrom(other) {
43295
- this.virtualTransferFrom(other);
43294
+ transferFrom(oldDesc) {
43295
+ this.virtualTransferFrom(oldDesc);
43296
43296
  }
43297
43297
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
43298
- virtualTransferFrom(_other) {
43298
+ virtualTransferFrom(_oldDesc) {
43299
43299
  }
43300
43300
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
43301
- virtualFromRenderDesc(_other) {
43301
+ virtualFromRenderDesc(_newDesc) {
43302
43302
  throw new Error("Virtual method virtualFromRenderDesc called");
43303
43303
  }
43304
43304
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -46533,20 +46533,20 @@ class MaterialDesc {
46533
46533
  }
46534
46534
  return propertiesSame && layersSame;
46535
46535
  }
46536
- needsRegeneration(other) {
46537
- if (this.dirty || other.dirty) return true;
46538
- const propertiesSame = this.isDecal === other.isDecal && this.doubleSided === other.doubleSided && this.visible === other.visible && this.canHaveMipmaps === other.canHaveMipmaps && this.resampleMode === other.resampleMode;
46536
+ needsRegeneration(newDesc) {
46537
+ if (this.dirty || newDesc.dirty) return true;
46538
+ const propertiesSame = this.isDecal === newDesc.isDecal && this.doubleSided === newDesc.doubleSided && this.canHaveMipmaps === newDesc.canHaveMipmaps && this.resampleMode === newDesc.resampleMode;
46539
46539
  let layersSame = true;
46540
- if (this.layers.length !== other.layers.length) {
46540
+ if (this.layers.length !== newDesc.layers.length) {
46541
46541
  layersSame = false;
46542
46542
  } else {
46543
46543
  for (let i = 0; i < this.layers.length; i++) {
46544
46544
  const thisLayer = this.layers[i];
46545
- const otherLayer = other.layers[i];
46545
+ const otherLayer = newDesc.layers[i];
46546
46546
  layersSame = layersSame && thisLayer.isSame(otherLayer);
46547
46547
  }
46548
46548
  }
46549
- return !propertiesSame || !layersSame;
46549
+ return (!propertiesSame || !layersSame) && newDesc.visible;
46550
46550
  }
46551
46551
  getTexturesOfType(textureType) {
46552
46552
  const urls = [];
@@ -47084,6 +47084,7 @@ class MaterialDesc {
47084
47084
  fromMaterialDesc(other) {
47085
47085
  this.transparency = other.transparency;
47086
47086
  this.transparent = other.transparent;
47087
+ this.visible = other.visible;
47087
47088
  }
47088
47089
  updateTransparency() {
47089
47090
  if (this.result) {
@@ -47096,8 +47097,14 @@ class MaterialDesc {
47096
47097
  }
47097
47098
  }
47098
47099
  }
47100
+ updateVisibility() {
47101
+ if (this.result) {
47102
+ this.result.visible = this.visible;
47103
+ }
47104
+ }
47099
47105
  updateResult() {
47100
47106
  this.updateTransparency();
47107
+ this.updateVisibility();
47101
47108
  }
47102
47109
  addClothingLayers(parent) {
47103
47110
  const pants = parent.FindFirstChildOfClass("Pants");
@@ -47802,13 +47809,13 @@ class ObjectDesc extends RenderDesc {
47802
47809
  isSame(other) {
47803
47810
  return this.cframe.isSame(other.cframe) && this.meshDesc.isSame(other.meshDesc) && this.materialDesc.isSame(other.materialDesc) && this.isBodyPart === other.isBodyPart && this.size.isSame(other.size) && this.skeletonDesc === other.skeletonDesc;
47804
47811
  }
47805
- needsRegeneration(other) {
47812
+ needsRegeneration(newDesc) {
47806
47813
  if (!this.renderScene.forceAccurateNeedsRegeneration) {
47807
47814
  if (this.meshDesc.layerDesc && Date.now() / 1e3 - this.meshDesc.compilationTimestamp < FLAGS.LAYERED_CLOTHING_COOLDOWN) {
47808
47815
  return false;
47809
47816
  }
47810
47817
  }
47811
- return !this.meshDesc.isSame(other.meshDesc) || this.materialDesc.needsRegeneration(other.materialDesc);
47818
+ return !this.meshDesc.isSame(newDesc.meshDesc) || this.materialDesc.needsRegeneration(newDesc.materialDesc);
47812
47819
  }
47813
47820
  virtualFromRenderDesc(other) {
47814
47821
  this.cframe = other.cframe;
@@ -49839,7 +49846,9 @@ class HumanoidDescriptionWrapper extends InstanceWrapper {
49839
49846
  let bodyColorsSame = true;
49840
49847
  let bodyPartsSame = true;
49841
49848
  for (const bodyPart of AllBodyParts) {
49842
- if (!isSameColor(this.getBodyPartColor(bodyPart), originalW.getBodyPartColor(bodyPart))) {
49849
+ const originalBodyPartColor = originalW.getBodyPartColor(bodyPart);
49850
+ const newBodyPartColor = this.getBodyPartColor(bodyPart);
49851
+ if (!originalBodyPartColor || !newBodyPartColor || !isSameColor(originalBodyPartColor, newBodyPartColor)) {
49843
49852
  bodyColorsSame = false;
49844
49853
  }
49845
49854
  if (this.getBodyPartId(bodyPart) !== originalW.getBodyPartId(bodyPart)) {
@@ -50010,7 +50019,6 @@ class HumanoidDescriptionWrapper extends InstanceWrapper {
50010
50019
  if (bodyPartDesc) {
50011
50020
  return bodyPartDesc.Prop("Color");
50012
50021
  }
50013
- return new Color3(0, 0, 0);
50014
50022
  }
50015
50023
  setBodyPartId(bodyPart, id) {
50016
50024
  const bodyPartDesc = this.getBodyPartDescription(bodyPart);
@@ -51069,6 +51077,7 @@ class HumanoidDescriptionWrapper extends InstanceWrapper {
51069
51077
  this._applyScale(humanoid);
51070
51078
  this._applyScale(humanoid);
51071
51079
  }
51080
+ console.log(diffs);
51072
51081
  }
51073
51082
  const values = await Promise.all(promises);
51074
51083
  if (this.cancelApply) return void 0;
@@ -51604,11 +51613,11 @@ class EmitterDesc extends DisposableDesc {
51604
51613
  const particleMax = this.initialParticleCount + calculatedMax;
51605
51614
  return particleMax;
51606
51615
  }
51607
- needsRegeneration(other) {
51608
- return this.texture === other.texture && this.alphaTexture === other.alphaTexture && this.colorTexture === other.colorTexture && this.rate === other.rate;
51616
+ needsRegeneration(newDesc) {
51617
+ return this.texture === newDesc.texture && this.alphaTexture === newDesc.alphaTexture && this.colorTexture === newDesc.colorTexture && this.rate === newDesc.rate;
51609
51618
  }
51610
- isSame(other) {
51611
- return !this.needsRegeneration(other) && this.lockedToPart === other.lockedToPart && this.lifetime.isSame(other.lifetime) && this.spreadAngle.isSame(other.spreadAngle) && this.speed.isSame(other.speed) && this.rotation.isSame(other.rotation) && this.rotationSpeed.isSame(other.rotationSpeed) && this.localAcceleration.isSame(other.localAcceleration) && this.acceleration.isSame(other.acceleration) && this.drag === other.drag && this.timeScale === other.timeScale && this.orientation === other.orientation && this.zOffset === other.zOffset && this.offset.isSame(other.offset) && this.shapeInOut === other.shapeInOut && this.opacity === other.opacity && this.lightEmission === other.lightEmission && this.lightInfluence === other.lightInfluence && this.blending === other.blending && this.color.isSame(other.color) && this.size.isSame(other.size) && this.squash.isSame(other.squash) && this.transparency.isSame(other.transparency) && this.normalizeSizeKeypointTime === other.normalizeSizeKeypointTime && this.flipbookLayout === other.flipbookLayout && this.flipbookBlendFrames === other.flipbookBlendFrames && this.flipbookFramerate.isSame(other.flipbookFramerate) && this.flipbookMode === other.flipbookMode && this.flipbookSizeX === other.flipbookSizeX && this.flipbookSizeY === other.flipbookSizeY && this.flipbookStartRandom === other.flipbookStartRandom;
51619
+ isSame(newDesc) {
51620
+ return !this.needsRegeneration(newDesc) && this.lockedToPart === newDesc.lockedToPart && this.lifetime.isSame(newDesc.lifetime) && this.spreadAngle.isSame(newDesc.spreadAngle) && this.speed.isSame(newDesc.speed) && this.rotation.isSame(newDesc.rotation) && this.rotationSpeed.isSame(newDesc.rotationSpeed) && this.localAcceleration.isSame(newDesc.localAcceleration) && this.acceleration.isSame(newDesc.acceleration) && this.drag === newDesc.drag && this.timeScale === newDesc.timeScale && this.orientation === newDesc.orientation && this.zOffset === newDesc.zOffset && this.offset.isSame(newDesc.offset) && this.shapeInOut === newDesc.shapeInOut && this.opacity === newDesc.opacity && this.lightEmission === newDesc.lightEmission && this.lightInfluence === newDesc.lightInfluence && this.blending === newDesc.blending && this.color.isSame(newDesc.color) && this.size.isSame(newDesc.size) && this.squash.isSame(newDesc.squash) && this.transparency.isSame(newDesc.transparency) && this.normalizeSizeKeypointTime === newDesc.normalizeSizeKeypointTime && this.flipbookLayout === newDesc.flipbookLayout && this.flipbookBlendFrames === newDesc.flipbookBlendFrames && this.flipbookFramerate.isSame(newDesc.flipbookFramerate) && this.flipbookMode === newDesc.flipbookMode && this.flipbookSizeX === newDesc.flipbookSizeX && this.flipbookSizeY === newDesc.flipbookSizeY && this.flipbookStartRandom === newDesc.flipbookStartRandom;
51612
51621
  }
51613
51622
  fromEmitterDesc(other) {
51614
51623
  this.lockedToPart = other.lockedToPart;
@@ -51928,18 +51937,18 @@ class EmitterGroupDesc extends RenderDesc {
51928
51937
  return emitter;
51929
51938
  }
51930
51939
  //inherited from RenderDesc
51931
- isSame(other) {
51932
- if (this.needsRegeneration(other)) {
51940
+ isSame(newDesc) {
51941
+ if (this.needsRegeneration(newDesc)) {
51933
51942
  return false;
51934
51943
  }
51935
- return this.time === other.time;
51944
+ return this.time === newDesc.time;
51936
51945
  }
51937
- needsRegeneration(other) {
51938
- if (this.emitterDescs.length !== other.emitterDescs.length) {
51946
+ needsRegeneration(newDesc) {
51947
+ if (this.emitterDescs.length !== newDesc.emitterDescs.length) {
51939
51948
  return true;
51940
51949
  }
51941
51950
  for (let i = 0; i < this.emitterDescs.length; i++) {
51942
- if (!this.emitterDescs[i].needsRegeneration(other.emitterDescs[i])) {
51951
+ if (!this.emitterDescs[i].needsRegeneration(newDesc.emitterDescs[i])) {
51943
51952
  return true;
51944
51953
  }
51945
51954
  }
@@ -52674,8 +52683,8 @@ class AttachmentDesc extends RenderDesc {
52674
52683
  isSame(other) {
52675
52684
  return this.visible === other.visible && this.cframe.isSame(other.cframe);
52676
52685
  }
52677
- needsRegeneration(other) {
52678
- return this.visible !== other.visible;
52686
+ needsRegeneration(newDesc) {
52687
+ return this.visible !== newDesc.visible;
52679
52688
  }
52680
52689
  virtualFromRenderDesc(other) {
52681
52690
  this.cframe = other.cframe.clone();
@@ -52734,8 +52743,8 @@ class LightDesc extends RenderDesc {
52734
52743
  isSame(other) {
52735
52744
  return this.enabled === other.enabled && this.shadows === other.shadows && this.color.isSame(other.color) && this.brightness === other.brightness && this.range === other.range && this.lightType === other.lightType && this.angle === other.angle && this.face === other.face && this.cframe.isSame(other.cframe);
52736
52745
  }
52737
- needsRegeneration(other) {
52738
- return this.lightType !== other.lightType;
52746
+ needsRegeneration(newDesc) {
52747
+ return this.lightType !== newDesc.lightType;
52739
52748
  }
52740
52749
  virtualFromRenderDesc(other) {
52741
52750
  this.enabled = other.enabled;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roavatar-renderer",
3
- "version": "1.6.4",
3
+ "version": "1.6.5",
4
4
  "description": "A renderer for Roblox avatars, used by the RoAvatar extension.",
5
5
  "author": "steinan",
6
6
  "type": "module",