-
-
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
GLTFExporter: Fix export of multi-material meshes. #16265
Conversation
I remember that And I think even if it's a bit complicated but making utility functions like below may be less problematic. What do you think? // geometry.attributes/morphAttributes
if ( hasAttributeCache( attribute ) ) {
result = getAttributeCache( attribute );
} else {
result = foo;
setAttributeCache( result, attribute );
}
// geometry.index
if ( hasAttributeCache( attribute, start, count ) ) {
result = getAttributeCache( attribute, start, count );
} else {
result = foo;
setAttributeCache( result, attribute, start, count );
}
function hasAttributeCache( attribute, start, count ) {
return cachedData.attributes.has( attribute ) &&
cachedData.attributes.get( attribute ).has( start ) &&
cachedData.attributes.get( attribute ).get( start ).has( count );
}
function getAttributeCache( attribute, start, count ) {
return cachedData.attributes.get( attribute ).get( start ).get( count );
}
function setAttributeCache( data, attribute, start, count ) {
if ( ! cachedData.attributes.has( attribute ) ) {
cachedData.attributes.set( attribute, new Map() );
}
if ( ! cachedData.attributes.get( attribute ).has( start ) ) {
cachedData.attributes.get( attribute ).set( start, new Map() );
}
cachedData.attributes.get( attribute ).get( start ).set( count, data );
} |
Plus, using |
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.
Let's merge this PR for now so the user in the forum has a fixed version of |
TBH, I don't think we should merge because this PR has a regression even though it solves an issue. If they need a fixed version right now, I can make another PR now. |
Ah, you already merged. OK I'll make PR. |
I don't think I agree with this... export is an expensive operation, and a very reasonable time to use |
My concern is memory consumption can keep big even after exporting. If we introduce lazy uuid generation and if exporter refers objects uuid which are not generated yet, uuids are generated at that time. Memory consumption increases. And the objects don't release their uuids. If the objects are kept using after exporting, memory consumption keeps big. If we don't have any solutions except for using uuid, it may be ok to use. But if we have another solution I prefer not using uuid as much as possible. Of course, we don't have lazy uuid generation now. And not really sure whether we will do. So just my preference. Not strong opinion. |
Thanks! |
Fixed #16263