Skip to content

dispose() vertexColors #309

Answered by arpu
arpu asked this question in Q&A
Jul 20, 2021 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

looks like this does it:

for (const mesh of doc.getRoot().listMeshes()) {

                 const hasVertexColor =  mesh.listPrimitives().some((prim) => prim.getAttribute('COLOR_0'))

                 if ( hasVertexColor) {
                      for (const prim of mesh.listPrimitives()) {
                             prim.getAttribute('COLOR_0').dispose()
                         }
                 }


}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@donmccurdy
Comment options

Answer selected by arpu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants