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

Matrix api load model with custom colors (closes #549) #746

Closed

Conversation

aozien
Copy link
Collaborator

@aozien aozien commented Jun 10, 2023

This introduces the ability to change elements color in the model through the matrix API (closes #549)

Sending a message of event type "ai.bldrs-share.ChangeViewSettings" will update the viewSettings in store, and will trigger rerendering the current model with those new view settings.

Currently the supported view settings are:

  • "defaultColor" => specifies the default color to be used in all elements.
  • "expressIdsToColorMap" => a key-value object where the express Id is the key and the desired color is the value
  • "globalIdsToColorMap" => a key-value object where the global Id is the key and the desired color is the value

Note: a color is an object with 4 values (x: red, y:green, z: blue, w: opacity) between 0 - 1, similar to ifc.js IfcColor object

The following is an example for coloring all elements gray except for a one blue element (available in cypress tests)

2023-06-10-214605-1.mp4

@netlify
Copy link

netlify bot commented Jun 10, 2023

Deploy Preview for bldrs-share ready!

Name Link
🔨 Latest commit d4ddd74
🔍 Latest deploy log https://app.netlify.com/sites/bldrs-share/deploys/65181e923fd4750008947dcb
😎 Deploy Preview https://deploy-preview-746--bldrs-share.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 26 (no change from production)
Accessibility: 84 (no change from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@pablo-mayrgundter
Copy link
Member

I just merged these changes after some edits in a temp branch. Closing this one.

Guys, sorry this took awhile. It fell out of my notifications.

Please do bug me or one of the team if you have a pending PR that you think we missed.

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.

VYZN: Matrix Widget API: Colorizing of one or more elements programmatically by the app
2 participants