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

Check for the possibility that a TextureId is a number while cloning it. #6933

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nick4598
Copy link
Contributor

@nick4598 nick4598 commented Jul 3, 2024

No description provided.

@nick4598 nick4598 requested a review from a team as a code owner July 3, 2024 19:55
@nick4598
Copy link
Contributor Author

nick4598 commented Jul 3, 2024

Should team responsible for Revit Connector be contacted and ask that they bring TextureIds over as hexadecimal strings?

@pmconne
Copy link
Member

pmconne commented Jul 3, 2024

Should team responsible for Revit Connector be contacted and ask that they bring TextureIds over as hexadecimal strings?

100%. It is never correct to store element IDs in JSON as numbers, JavaScript represents them as doubles which lack sufficient precision. @timlawrence-bentley @jffmarker

@nick4598
Copy link
Contributor Author

nick4598 commented Jul 3, 2024

Add more commits by pushing to the [nick/rendermaterial-enhancement](/iTwin/itwinjs-core/tree/nick/rendermaterial-enhancement) branch on iTwin/itwinjs-core.

I will reach out to them with more details, i.e. iModel this was observed in

@@ -198,6 +198,10 @@ export class RenderMaterialElement extends DefinitionElement {
}
if (!Id64.isValid(sourceMap.TextureId) || sourceMap.TextureId === undefined)
continue;
// textureId has a chance to be a base 10 number instead of a hexadecimal string. This was observed in an iModel created with the Revit Connector.
Copy link
Member

Choose a reason for hiding this comment

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

This is going to cause problems in places other than onCloned.

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.

None yet

2 participants