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

Problem with material reuse in colladaloader2.js #9878

Closed
2 of 11 tasks
BengtGustafsson opened this issue Oct 18, 2016 · 2 comments
Closed
2 of 11 tasks

Problem with material reuse in colladaloader2.js #9878

BengtGustafsson opened this issue Oct 18, 2016 · 2 comments

Comments

@BengtGustafsson
Copy link

BengtGustafsson commented Oct 18, 2016

Description of the problem

I use a tool called OarConv which produces collada files with multiple <polylist> elements in one <mesh> refering to the same material. This works in colladaloader but in colladaloader2 there seems to be a design flaw that the return value of buildGeometry() is a group which is a map indexed by the material name and which contains just one THREE.Mesh (or similar) object per material name, so when the function runs it overwrites the preceeding 's representation with the succeding one.

I am not totally convinced that this Collada is within the specification but it seems logical that you can have multiple s with the same material and these colladas load in blender and 3ds max and unity.

As this is an architectural level issue I don't see a possibility for me to fix it, there is no easy patch that can be done. I was thinking about uniquifying the material name and duplicating the definition but that was too much of a hack for me to bear...

oar_house.txt

Attached .txt file is actually a dae file.

Three.js version
  • [x ] Dev (also tried r74 but the code looks the same)
  • r81
  • ...
Browser
  • All of them (obviously)
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • Linux
  • Android
  • IOS
Hardware Requirements (graphics card, VR Device, ...)
@BengtGustafsson
Copy link
Author

I investigated further and there is nothing in the Collada spec to indicate that reusing a material in more than one polylist would be illegal (see page 5-99 of https://www.khronos.org/files/collada_spec_1_4.pdf). So I do think this is a bug rather than an enhancement, then of course the priorization of this bug is another matter. Note also that it works with colladaloader v1.

@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 18, 2017

ColladaLoader2 should support this now (#11502).

@Mugen87 Mugen87 closed this as completed Aug 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants