Skip to content

Implement a renaming transform function? #1613

Answered by donmccurdy
rosskevin asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @rosskevin! It should be no problem to rename nodes, materials, and meshes in glTF Transform, yes. The code could be written as a transform, or not, no meaningful difference except the syntax. I usually define an operation as a transform if it operates on the entire document and if its configuration can be described well by a single options declaration. For example, joinPrimitives(prims) is a function that merges a given list of Primitives, and join() is a transform that uses joinPrimitives to combine all compatible primitives throughout the document.

Example:

// function
function renameProperties(properties: Property[], prefix: string) {
  properties.forEach((property, index) => {
    p…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rosskevin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants