mozilla / hubs

Duck-themed multi-user virtual spaces in WebVR. Built with A-Frame.

Home Page:https://hubs.mozilla.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BG - Cannot `Set Material` on an entity with multiple material slots

j-conrad opened this issue · comments

Description
If an entity has more than 1 material slot (materials assigned to different faces), trying to perform a Set Material operation fails with the following error:

set material: called on a non mesh

To Reproduce
Steps to reproduce the behavior:

  1. Open attached .blend
  2. Note the graph and setup of materials on the two plane objects
  3. Run in Hubs / click on the hexagon on the floor.
  4. Note the lefthand object changes while the righthand one throws an error.

Expected behavior
There needs to be a way to specify which material slot you want to affect (and perhaps an option for 'all') when using Set Material or Get Material.

Screenshots
This screenshot shows a graph that works on the lefthand object (because it has 1 material slot), whereas the righthand object throws an error due to having 2 material slots.

image

Looking at the ECS Debug reveals the problem. The object is split into two entities because of the material assignments.
image
It appears that the meshes are children of the parent entity which is apparently 'not a mesh'.

Hardware

  • Device: Desktop
  • OS: Windows
  • Browser: Chrome