Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Conversation

@feritarou
Copy link

Made in reaction to #89

@klevron
Copy link
Member

klevron commented Apr 7, 2023

Thanks, can you revert chore: build package so the PR is just about Mesh.ts

@feritarou
Copy link
Author

@klevron Sure, just did so (wasn't sure how long it would take you to note/merge this PR but I needed that change urgently so I just built my fork without thinking - sorry for that)

@klevron
Copy link
Member

klevron commented Apr 7, 2023

Thanks

setMaterial won't be called with an array of materials : https://github.com/troisjs/trois/blob/master/src/materials/Material.ts#L50

I think it should be :

setMaterial(material: Material) {
  if (Array.isArray(this.material)) {
    this.material.push(material)
  } else {
    if (this.material) {
      this.material = [this.material, material]
    } else {
      this.material = material
    }
  }
  if (this.mesh) this.mesh.material = material
}

But there should be some HMR problem, I don't have time to test for the moment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants