Skip to content
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

3MFLoader: fixed multiple build items refecering the same object bug #22663

Merged
merged 5 commits into from
Oct 19, 2021

Conversation

soaresrl
Copy link
Contributor

Multiple build items that reference the same resource object were being ignored as they referenced the same Object3d object. Also the build items meshes were using the same BufferGeometry's reference.

@Mugen87
Copy link
Collaborator

Mugen87 commented Oct 10, 2021

Also the build items meshes were using the same BufferGeometry's reference.

This is actually intended. Why do you think should it be different?

@soaresrl
Copy link
Contributor Author

Also the build items meshes were using the same BufferGeometry's reference.

This is actually intended. Why do you think should it be different?

Actually I thought it was not inteded. I had problems applying matrix transformations and as the build items reference the same buffer geometry both had the geometry updated. The first part was also intended? Because I came across some 3mf files with several build items referencing only one resource object, so I thought could be a problem.

@Mugen87
Copy link
Collaborator

Mugen87 commented Oct 11, 2021

Because I came across some 3mf files with several build items referencing only one resource object, so I thought could be a problem.

Do you mind sharing such a 3MF file for testing?

When I remember correctly cloning should only be necessary in context of <components> elements.

@soaresrl
Copy link
Contributor Author

Do you mind sharing such a 3MF file for testing?

@Mugen87 Sorry for the delay, here is a file with one <object id="1"> and two items <build><item objectid="1" /><item objectid="1" /></build> that references the same <object>: https://we.tl/t-qaJIn4l4ZF

Copy link
Collaborator

@Mugen87 Mugen87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, this change is correct. I've checked the specification and indeed multiple items can refer to the same object resource by having the same value for objectid.

@Mugen87 Mugen87 added this to the r134 milestone Oct 19, 2021
@Mugen87 Mugen87 merged commit 4cdc963 into mrdoob:dev Oct 19, 2021
@mrdoob
Copy link
Owner

mrdoob commented Oct 19, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants