question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Material Dedup functionality

See original GitHub issue

When preparing a series of glTF objects for sequencing, the materials for each ‘frame’ object are kept despite being the same across all objects. This may be a side effect of the workflow I am using and creating a solution for (i.e. OBJ Sequence from Blender -> single glTF sequence animation)

Describe the solution you’d like Similar to the existing dedup function, take the base materials from a mesh and remove the extraneous duplicate materials, then reassign the original material to each subsequent ‘frame’ mesh.

Describe alternatives you’ve considered The current workaround I am using is a naive(see: hamfisted) approach where I simply loop through all the materials on the first mesh in the first frame, ignore the first material then detatch & dispose the materials on subsequent meshes. Then copy the material from the first mesh to the subsequent meshes. It would be neat to have this ability packed in as an option for the dedup function as is. The second part of this is not present in the below gist, i havent gotten as far as to write both that functionality or a better test animation for it.

https://gist.github.com/MrMagicPenguin/db149a701f6e36fade56349884756238

If this meshes (pun intended) with your vision for gltf-transform but isnt reasonably worth your time i’d be happy to give writing it as an extension a shot since I will need to make this happen regardless.

Cheers!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
MrMagicPenguincommented, Oct 29, 2021

Okay, thank you for the clarification on the TextureLink since that adds up with my experience using the assert library to double check my work with the isDeepStrictEqual. I will read those articles you sent, thank you! If its just as well to have the comparison tests written like that , I will just apply ample usage of my IDE’s folding function, lol!

Thanks again, I appreciate you lending your ear to my hurdles.

1reaction
donmccurdycommented, Oct 27, 2021

Might be getEmissiveFactor() – that’s a vec3 and would require a deep equality check. There’s a helper method for comparing number[] types, MathUtils.eq.

I usually run yarn watch in a terminal, then edit code in VSC – I would expect it should work the same in any IDE though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is Data Deduplication? | Benefits & Use Cases - NetApp
Data deduplication is a process that eliminates excessive copies of data and significantly decreases storage capacity requirements.
Read more >
What Is Data Deduplication? Types & How it works - Fortinet
Data deduplication is the process of removal of duplicate data in a way that maintains the integrity of the system, and functioning of...
Read more >
List of Top Data Deduplication Tools 2022 - TrustRadius
Data deduplication tools are used for backup and restore operations where large quantities of data are backed up at regular intervals.
Read more >
Data Deduplication For Dummies - Allbound
A system with data deduplication, how- ever, can tell the difference between unique and duplicate blocks inside files and between files, and it's...
Read more >
Data deduplication - Wikipedia
In computing, data deduplication is a technique for eliminating duplicate copies of repeating data. Successful implementation of the technique can improve ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found