Skip to content

Conversation

@maidi29
Copy link
Contributor

@maidi29 maidi29 commented Jan 26, 2026

Description

Adds explicit property tracking for setColor and setOpacity highlight methods to fix issues where:

  1. Color values (plain RGB objects) weren't normalized to THREE.Color instances in setColor
  2. Combining multiple partial highlight updates (e.g., setColor then setOpacity) was overwriting previous properties instead of preserving them

Changes:

  • Add _explicitProps array to MaterialDefinition to track which properties were explicitly set
  • Normalize plain RGB objects to THREE.Color in setColor with proper colorspace
  • Modify getNewHighFromPast to merge explicit properties correctly when combining highlights
  • Update MaterialManager serialization to only apply explicitly set highlight properties

This ensures that calling setColor followed by setOpacity (or vice versa) preserves both properties correctly.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

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.

1 participant