Skip to content

Handle missing mixins and applying mixin attributes to mappings of primitives#5483

Merged
dmarcos merged 1 commit intoaframevr:masterfrom
mrxz:mixin-handling
Mar 14, 2024
Merged

Handle missing mixins and applying mixin attributes to mappings of primitives#5483
dmarcos merged 1 commit intoaframevr:masterfrom
mrxz:mixin-handling

Conversation

@mrxz
Copy link
Contributor

@mrxz mrxz commented Feb 29, 2024

Description:
Primitives handled mixins differently compared to a-node. In case a mixin was referenced that didn't exist, the primitive would throw an error while the a-node silently ignored it. Now a warning is logged in both cases. Primitives now also check if attributes on mixins correspond to any of their mappings, allowing things like the following to work:

<a-assets>
    <a-mixin id="red" color="red"></a-mixin>
</a-assets>

<a-box mixin="red"></a-box>

Fixes #4455
Fixes #4717

Changes proposed:

  • Log warning when mixin can't be found (instead of throwing an error or silently continuing).
  • Apply mapping in primitive for any mixin attributes that correspond with defined mappings.

@dmarcos
Copy link
Member

dmarcos commented Mar 14, 2024

Thanks!

@dmarcos dmarcos merged commit aef9537 into aframevr:master Mar 14, 2024
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.

Color property not applying to primitive as expected. Inconsistent behaviour for missing mixin

2 participants