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

Access element properties #2

Open
OliHas opened this issue Jun 5, 2018 · 4 comments
Open

Access element properties #2

OliHas opened this issue Jun 5, 2018 · 4 comments

Comments

@OliHas
Copy link
Contributor

OliHas commented Jun 5, 2018

Hi!
For a researchproject I'm developping a small three.js viewer, in which BIM models from the BIMServer can be displayed. Now I would like to get the properties of an element directly in the three.js-viewer. Is there a way to access properties of a selected element? Something like a unique id, which is passed from the GltfSerializer? Thanks for your help!

@rubendel
Copy link
Member

rubendel commented Jun 8, 2018

So far I have not come across the ability to add custom data in a glTF (2) file (in the specification). If you know of a place where we could put for example the IfcProduct id, please let me know and I'll add it to the serializer.

@OliHas
Copy link
Contributor Author

OliHas commented Jun 11, 2018

I think this could help: GLTFLoader: Fixes to improve mesh name uniqueness.
I recommend to store the IfcProduct id here: primitive[].extras
This becomes in three.js: mesh[].userData

@OliHas
Copy link
Contributor Author

OliHas commented Jun 13, 2018

Hi!
It is possible to pass data if this is inserted into the code "BinaryGltfSerializer2.java" at line 558:

ObjectNode extrasNode = OBJECT_MAPPER.createObjectNode();
nodeNode.set("extras", extrasNode);
extrasNode.put("IfcProductID", IfcProductID);

How do I find out the IfcProduct id?
Thanks for your help!

@rubendel
Copy link
Member

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

No branches or pull requests

2 participants