-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Fix GLTFExporter bug #16267
Fix GLTFExporter bug #16267
Conversation
What is the bug you're trying to fix? From your earlier comments:
Agreed, if
I don't agree here – reusing an index as a vertex attribute is too much of an edge case. If we can reduce the +50 lines of code in this change by omitting this case, we should do so. |
Yes, that one. We didn't duplicate before (in case no multi materials). #16265 has regression.
I think I'm ok +50 lines for that. But no strong opinion. If we distinguish index attributes from vertex attributes, maybe adding BTW, if we don't like this +50 lines functions and distinguish index from attributes, how simply we can write index cache? |
A cheap idea is temporal uid. var uids = new Map();
var uid = 0;
function getUID( object ) {
if ( ! uids.has( object ) ) {
uids.set( object, uid ++ );
}
return uids.get( object );
}
var key = getUID( geometry.index ) + ':' + start + ':' + count;
if ( cachedData.indices.has( key ) ) {
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new version (with a Map and incrementing counter) looks good to me 👍
Thanks! |
This PR fixes a regression added to
GLTFExporter
by #16265 (comment). Simpler solution idea is welcome.