-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meldis auto-reloading misses changes to glTF files #21194
Comments
Per slack, we might attack this in two stages: (1) Fix the (2) Refactor Meldis to lean on |
Stage one is in flight with #21297. I think stage two requires a bit more discussion. It's certainly reasonable to modify the return value of
I can imagine the hasher creating its own Alternatively, we can try to refactor the code in Can you elaborate on what you had in mind? |
If the new load message is the same as the old load message, and all of the files used in the prior load message still exist and are unchanged, then we know for certain that no reload is necessary. So all we need to do is keep track of the prior load message's overall list of files and their hashes (or maybe one overall hash), and that's all we need. |
File existence should not be the arbiter of whether the load message matches. I can remove a reference to an image without deleting the image. Furthermore, I can add an image to a model and it won't be captured by what I previously loaded. I'm leaning toward simply creating an API that takes a |
If you remove the reference to an image (or add one), the checksum of the gltf (or whatever) that mentions that image will change. |
I am pretty convinced that the right Meldis approach is "Meshcat tells us what files it touched" since that will very clearly be correct and never diverge as the code chnages, instead of having two different control paths where we hope that |
Touche. I keep forgetting hashing the original file. So, to summarize:
On the subject of "subtracting bytes from a hash value": One possible solution is to replace a single aggregate hash value with a |
The flavor I imagined was that Meshcat.SetObject would return[1] the list of all relevant files, including the Mesh/Convex filename. I imagine that simplifies everything -- Meldis would not need to do anything with the load message's filename other than pass it to SetObject and then remember the list of files that comes back. We could promise the Mesh.filename() was first in the returned list, in case that helps anything. I'm not wedded to that though -- if for some reason treating the Mesh.filename() differently made the code cleaner then I'd be fine with that. I'm open to the idea of multiple hash values, but my guess is that a single overall hash still ends up simpler. The "did any of these set of hashes change" versus "did the combined hash over this set of hashes change" seem equivalent. Again, though, I'm willing to trust however the simplest code comes out, whatever that looks like. [1] ... or output argument, or return struct with named fields for future expansion, or ... etc |
I've simplified from what I previously wrote and will be submitting a PR soon. Ultimately, I'm trying to minimize the amount of hashing I'm doing. The goal is two fold:
One resolution, obviously, is to remove the second requirement. But that just seems inelegant to me. But we can move this conversation over to a concrete PR in a bit. |
What happened?
Meldis's
_GeometryFileHasher
providesmeldis
the ability to recognize if a model has changed on disk since it was last loaded and intelligently reload (by considering the set of files that define the model). However, that logic is heavilyobj
-centric. Changes to glTF data on disk do not trigger a model reload.Now that
Meshcat
(the Drake class, not the javascript library) has the intelligence to run down all linked assets, that should be exploited in_meldis.py
so that the right set of assets are included in the hashing.Version
No response
What operating system are you using?
No response
What installation option are you using?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: