-
Notifications
You must be signed in to change notification settings - Fork 916
Closed
Labels
type: bugSomething isn't workingSomething isn't working
Description
Description
When a variant is selected, any update on materials belonging to the variant seem to have no effect in the viewer. Is this intended behavior? If so I would expect the API to throw an error or a warning. My client offers customizable products which are set up with variants but certain parts on the model need to change (e.g. a customer-provided artwork). I tried to track down the issue in the code and think it might be related to this line but I am not sure:
| cloneVariantMaterials(scene, this.scene); |
Steps to reproduce:
- Go to: https://modelviewer.dev/examples/scenegraph/#variants
- Select the
beachvariant - Get a reference to the <model-viewer>:
$el = document.querySelector('#variants model-viewer')(or via inspector) - Find the corresponding material:
m = $el.model.materials.find(v => v.hasVariant('beach')) - Ensure that it is active:
m.isActive(should reporttrue) - Inspect the current roughness factor:
m.pbrMetallicRoughness.roughnessFactor(will report1) - Update it:
m.pbrMetallicRoughness.setRoughnessFactor(0) - Ensure that the update succeeded:
m.pbrMetallicRoughness.roughnessFactor(will report0) - Notice that the material did not change in the viewer. (seems to affect any material property)
Version
- model-viewer: v3.5.0
Browser Affected
- Chrome, version: 128.0.6613.86
- Edge (not tested)
- Firefox, version: 130.0b9
- IE (not tested)
- Safari (not tested)
OS
- Android
- iOS
- Linux
- MacOS
- Windows
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type: bugSomething isn't workingSomething isn't working