Material assets support: property widget, materials modal, asset deletion#859
Open
vincentfretin wants to merge 6 commits into
Open
Material assets support: property widget, materials modal, asset deletion#859vincentfretin wants to merge 6 commits into
vincentfretin wants to merge 6 commits into
Conversation
A-Frame's upcoming `material` property type (aframevr/aframe#5846) references an <a-material> asset by selector (`#myMaterial`) or an inline `material(...)` definition. Edit it as a raw string committed on blur, like selector/selectorAll: committing on each keystroke would parse partial selectors and detach the entity from its shared material while typing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two <a-material> assets (PBR and textured) shared across entities, plus an inline material(...) definition, to test the material property type. Requires an A-Frame build with aframevr/aframe#5846; with older builds these entities render with a default material and a warning. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The material property type now renders a MaterialWidget: the reference string (committed on blur) plus a swatch previewing the referenced material's color/texture. Clicking the swatch opens a Material Assets modal that: - lists every <a-material> in the scene with a color/texture swatch, - applies the selected asset to the property (USE SELECTED or double-click), - edits the selected material's properties (schema-driven widgets, shader read-only) live for every entity sharing it, - creates new <a-material> assets under <a-assets>. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
When the material component's `material` property references an <a-material> asset, all other properties are ignored (the asset fully defines the material), so only show the material property row. Also prevent text selection when double-clicking a material in the modal gallery to apply it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Map-type properties of an <a-material> now use TextureWidget, opening the textures modal stacked on top of the materials modal. Modal gains stacking awareness: only the topmost open modal reacts to ESC and outside clicks, so interacting with the textures modal no longer closes the materials modal beneath it. ModalTextures is rendered after ModalMaterials so it paints on top, and material swatches refresh when textures finish loading. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
This was referenced Jul 4, 2026
DELETE button in the materials modal (disabled for inline materials, confirmation mentions how many entities use the material) and a trash button on each asset image in the textures modal. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
Companion to aframevr/aframe#5846 (materials as assets and property type).
Material property widget
The new
materialproperty type references an<a-material>asset by selector (#myMaterial) or an inlinematerial(...)definition, and its parsed value is aTHREE.Material. Without these changes, the property fell through to the genericInputWidget, which parses and commits on every keystroke — typing a partial selector like#crateimmediately committed a null material and detached the entity from its shared material while typing.The property is now rendered by a dedicated
MaterialWidget: the raw reference string committed on blur (likeselector/selectorAll), plus a swatch previewing the referenced material's color/texture.Material Assets modal (picker + live editor)
Clicking the swatch opens a Material Assets modal that:
<a-material>in the scene with a color/texture swatch,shadershown read-only since it cannot change after creation) — edits apply live to every entity sharing the material; map properties use the texture picker, stacked on top of the materials modal (Modalis now stacking-aware: only the topmost open modal reacts to ESC/outside clicks),<a-material>assets under<a-assets>(NEW MATERIAL button),The textures modal also gets a trash button on each asset image to remove it from
<a-assets>.The example scene includes two shared
<a-material>assets, an inline definition, and entities using them (requires an A-Frame build with aframevr/aframe#5846; with older builds these entities render with a default material and a warning).Verified against an aframe build of the PR branch: picking switches the entity's shared material (textures included), editing roughness/color in the modal updates all entities sharing the material live, the reset button returns the entity to its own component-managed material, and typing partial selectors no longer detaches the material.
🤖 Generated with Claude Code