You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`id`: optional; a unique `<base>-N` id is generated otherwise (e.g. `material-1` for `a-material`). The id stays stable across undo/redo so later commands referencing the asset keep working.
165
+
-`attributes`: optional object of attribute name to string value.
166
+
167
+
When executed, this emits an `assetcreate` event with the created element.
168
+
When undone, this emits an `assetremove` event with the asset id.
169
+
170
+
### assetupdate
171
+
172
+
Update an attribute of an asset element. Consecutive updates to the same asset attribute are merged in history like entity updates.
173
+
174
+
Usage:
175
+
176
+
```js
177
+
AFRAME.INSPECTOR.execute('assetupdate', {
178
+
assetEl: materialEl, // element or id string
179
+
attribute:'color',
180
+
value:'green'// attribute string, or null to remove the attribute
181
+
});
182
+
```
183
+
184
+
When executed or undone, this emits an `assetupdate` event with `{assetEl, attribute, value}`.
185
+
186
+
### assetremove
187
+
188
+
Remove an asset element from `<a-assets>`. The tag name, attributes and position are captured so undo recreates the asset in place. For `<a-material>`, entities referencing the asset are re-resolved on undo so they use the recreated `THREE.Material` instance.
189
+
190
+
Usage:
191
+
192
+
```js
193
+
AFRAME.INSPECTOR.execute('assetremove', {
194
+
assetEl: materialEl // element or id string
195
+
});
196
+
```
197
+
198
+
When executed, this emits an `assetremove` event with the asset id.
199
+
When undone, this emits an `assetcreate` event with the recreated element.
0 commit comments