Compare commits
36
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
931f561e7f | ||
|
|
3e30c61c71 | ||
|
|
7e99243a78 | ||
|
|
cbd380a941 | ||
|
|
e1b2f86a49 | ||
|
|
a048233fce | ||
|
|
9e23ae731f | ||
|
|
4b33f32357 | ||
|
|
62b538999d | ||
|
|
d52cc2e3b7 | ||
|
|
06010c5922 | ||
|
|
c55f34780f | ||
|
|
1ab3886028 | ||
|
|
9a67a25a15 | ||
|
|
0ce43fc399 | ||
|
|
0e7aed40f1 | ||
|
|
d1a56f77cc | ||
|
|
293811aecd | ||
|
|
ed21bcc52d | ||
|
|
577d8dcb27 | ||
|
|
ba59f57a5a | ||
|
|
d038cf3670 | ||
|
|
61be2440bd | ||
|
|
3794faa4aa | ||
|
|
02247f029a | ||
|
|
3931de1f0a | ||
|
|
f2ad88fd03 | ||
|
|
5a82a9ee29 | ||
|
|
b4aa61e394 | ||
|
|
0798aa5d57 | ||
|
|
0553a85220 | ||
|
|
cc1fa6ea3b | ||
|
|
b5e561904c | ||
|
|
3f85d25cc7 | ||
|
|
1b9fbebda1 | ||
|
|
48b1448c57 |
No files matched your search
@@ -6,3 +6,8 @@ rustflags = ["-C", "link-arg=-fuse-ld=mold"]
|
|||||||
|
|
||||||
[alias]
|
[alias]
|
||||||
clean-target = "run -p xtask --bin clean-target --"
|
clean-target = "run -p xtask --bin clean-target --"
|
||||||
|
validate-levels = "run -p xtask --features validate-levels --bin validate-levels --"
|
||||||
|
validate-samples = "run -p xtask --features validate-samples --bin validate-samples --"
|
||||||
|
bake-navigation = "run -p xtask --features validate-levels --bin bake-navigation --"
|
||||||
|
package-project = "run -p xtask --features validate-levels --bin package-project --"
|
||||||
|
upgrade-project = "run -p xtask --features validate-levels --bin upgrade-project --"
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
# Skeletal Animation Import, Preview, And Authoring
|
||||||
|
|
||||||
|
Working implementation plan for Gitea issue
|
||||||
|
[`#46`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/46).
|
||||||
|
This is the minimum production animation loop required by the M7 content-production milestone.
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
Implementation and production acceptance are complete. The persistent/runtime contract, generated
|
||||||
|
manifest, stable model/clip identity, runtime adapter, browser drag workflow, typed inspector, and
|
||||||
|
headless validation are implemented. Live acceptance covers import, placement, preview, scrub,
|
||||||
|
save/reload hydration, PIE playback, source relocation, development packaging, and standalone
|
||||||
|
runtime playback with the committed RobotExpressive fixture.
|
||||||
|
|
||||||
|
## Outcome
|
||||||
|
|
||||||
|
An author can import a supported skinned model, inspect its skeleton and clips, place an animated
|
||||||
|
actor, preview and scrub a clip without dirtying the scene, save a small named state set, and drive
|
||||||
|
the same state changes in PIE and a packaged game. Missing content and skeleton mismatches fail with
|
||||||
|
owner-attributed repair guidance before packaging.
|
||||||
|
|
||||||
|
## Format Policy
|
||||||
|
|
||||||
|
- Animation authoring v1 supports glTF 2.0 (`.gltf` and `.glb`) through Bevy's native scene,
|
||||||
|
skinning, and animation assets.
|
||||||
|
- FBX remains supported for the existing static mesh import path. An FBX containing animation stacks
|
||||||
|
or skin deformers is not a supported animated source and must produce a blocking, actionable
|
||||||
|
diagnostic.
|
||||||
|
- Animated FBX support cannot be enabled until the loader constructs the source hierarchy, Bevy
|
||||||
|
skinned-mesh bindings, and `AnimationClip` assets. Metadata counts alone do not qualify as support.
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
- The asset registry UUID remains the parent model identity. A generated animation manifest under
|
||||||
|
`assets/animations/generated/` records the source fingerprint, skeleton signatures, stable clip
|
||||||
|
sub-asset IDs, clip metadata, and animation events.
|
||||||
|
- `shared::AnimationControllerDesc` is reflected and serializable. It references imported skeletons
|
||||||
|
and clips through stable `EditorAssetRef` values and owns one layer of named states, a default
|
||||||
|
state, playback range/loop/speed, and default crossfade duration.
|
||||||
|
- `game` owns the runtime adapter. It waits for the model `WorldAssetRoot` instance to become ready,
|
||||||
|
attaches transient animation graph/player state, and exposes a request API for changing an actor's
|
||||||
|
named state.
|
||||||
|
- `editor` owns import presentation, clip/skeleton shelves, drag assignment/placement, inspector
|
||||||
|
controls, and non-dirty preview/scrubbing. Preview uses the runtime adapter rather than a separate
|
||||||
|
interpretation of the authored contract.
|
||||||
|
- `scene` and package validation resolve the same manifests and stable references used by editor and
|
||||||
|
runtime hydration.
|
||||||
|
|
||||||
|
## Authoritative Data
|
||||||
|
|
||||||
|
The generated manifest is keyed by the model's stable registry UUID and includes:
|
||||||
|
|
||||||
|
- schema version and source path/fingerprint;
|
||||||
|
- scenes and exact skeleton signatures;
|
||||||
|
- stable skeleton and clip sub-asset IDs;
|
||||||
|
- clip label, source index, duration, target skeleton signature, and event markers;
|
||||||
|
- import diagnostics, including unsupported animated FBX content.
|
||||||
|
|
||||||
|
An exact skeleton signature is a deterministic hash of normalized ordered joint target paths and
|
||||||
|
bind-pose structure. Retargeting v1 accepts only an exact signature match. No implicit joint-name,
|
||||||
|
humanoid, or proportional remapping is allowed.
|
||||||
|
|
||||||
|
## Implementation Sequence
|
||||||
|
|
||||||
|
1. Add the versioned animation manifest schema, stable sub-asset identity rules, glTF extraction,
|
||||||
|
FBX blocking diagnostics, and focused importer tests.
|
||||||
|
2. Add `AnimationControllerDesc`, named state/event types, registration, migration defaults,
|
||||||
|
actor validation, history snapshots, scene round-trip coverage, and runtime-only strip policy.
|
||||||
|
3. Replace broad imported-model child cleanup with a dedicated generated instance root, then hydrate
|
||||||
|
the ready scene instance into a transient graph/player and implement the game state-request API.
|
||||||
|
4. Extend Asset Browser model shelves with skeleton and clip rows, compatibility status, preview,
|
||||||
|
scrub/range/loop controls, and clip drag placement or assignment.
|
||||||
|
5. Add the typed Animation Controller inspector, undoable state edits, PIE pause/stop reconciliation,
|
||||||
|
owner-attributed project validation, and package dependency collection.
|
||||||
|
6. Commit a small redistributable animated GLB and sample scene, then run import, round-trip,
|
||||||
|
headless, live editor/PIE, and packaged-runtime acceptance.
|
||||||
|
|
||||||
|
## Acceptance Gates
|
||||||
|
|
||||||
|
- A committed skinned GLB and its clips import, preview, save, hydrate, and play in PIE and a
|
||||||
|
packaged runtime.
|
||||||
|
- Moving or renaming the source inside the project preserves controller clip references through the
|
||||||
|
registry UUID and stable sub-asset IDs.
|
||||||
|
- Missing manifests/clips and mismatched skeleton signatures produce actor/property-attributed
|
||||||
|
diagnostics with a concrete repair action.
|
||||||
|
- Gameplay can request a valid named state through the public game API; invalid requests leave the
|
||||||
|
current state intact and report a diagnostic.
|
||||||
|
- Preview follows the authored loop/range/speed settings, stops cleanly, and never mutates the scene
|
||||||
|
descriptor, history, or dirty state.
|
||||||
|
- Generated graph/player/instance components never serialize into authored scenes, and model
|
||||||
|
rehydration never deletes authored hierarchy children.
|
||||||
|
- Animated or skinned FBX content blocks animation import with a diagnostic that explains the glTF
|
||||||
|
v1 requirement.
|
||||||
|
- Focused importer, validation, hydration, request-API, and editor operator tests pass alongside
|
||||||
|
workspace tests, `cargo validate-levels`, package validation, and live smoke testing.
|
||||||
|
|
||||||
|
## Deliberate Boundaries
|
||||||
|
|
||||||
|
- V1 provides one animation layer with named states, one default state, and a default crossfade. It
|
||||||
|
does not include a visual state graph, blend trees, transition-condition authoring, inverse
|
||||||
|
kinematics, motion matching, or root-motion extraction.
|
||||||
|
- Event markers are normalized data and runtime notifications; V1 has no timeline scripting system.
|
||||||
|
- Retargeting is exact signature match only.
|
||||||
|
- FBX static mesh import remains available, but animated FBX conversion is separate loader work and
|
||||||
|
cannot silently fall back to bind-pose or metadata-only playback.
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
# Audio Authoring And Runtime Parity
|
||||||
|
|
||||||
|
Working implementation plan for Gitea issue
|
||||||
|
[`#47`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/47).
|
||||||
|
This is the minimum complete audio loop required by the M7 content-production milestone.
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
Completed and production-accepted in Gitea #47. Permanent behavior is documented in
|
||||||
|
[ADR 0030](../../docs/adr/0030-audio-authoring-and-bus-schema.md) and
|
||||||
|
[Audio Authoring](../../docs/editor/audio-authoring.md).
|
||||||
|
|
||||||
|
## Outcome
|
||||||
|
|
||||||
|
An author can import a supported audio clip, place or assign it as an authored source, tune playback
|
||||||
|
and spatial behavior, audition it without dirtying the scene, save/reload it, and hear equivalent
|
||||||
|
behavior in PIE and a packaged game. Projects expose stable Master, Music, and SFX buses with runtime
|
||||||
|
gain/mute hooks and validation that also runs headlessly.
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
- `shared` owns reflected, serializable source/listener/attenuation descriptors and stable actor kinds.
|
||||||
|
- `settings` owns versioned project bus definitions and validation; bus references use stable IDs.
|
||||||
|
- `game` hydrates authoring descriptors into Bevy audio playback/listener components and applies bus
|
||||||
|
controls. Hydrated components remain derived and are never scene source of truth.
|
||||||
|
- `editor` owns asset discovery/import UX, inspector controls, drag/drop placement, visualizers, and
|
||||||
|
transient audition state. Audition never mutates an authored descriptor or marks a scene dirty.
|
||||||
|
- Scene and project validation share the same clip-reference, bus-reference, range, and listener rules
|
||||||
|
used by packaging. Missing, excluded, unsupported, or Git LFS pointer clips block release validation.
|
||||||
|
|
||||||
|
## Supported Content
|
||||||
|
|
||||||
|
- Ogg Vorbis is the baseline runtime format.
|
||||||
|
- WAV, MP3, and FLAC support is enabled explicitly in the workspace Bevy feature set.
|
||||||
|
- Audio sources support gain, pitch, looping, autoplay, spatial blend, attenuation, and bus routing.
|
||||||
|
- Listener authoring supports enabled state, priority, and ear gap; at runtime exactly one enabled
|
||||||
|
listener is selected deterministically.
|
||||||
|
- Default project buses are `master`, `music`, and `sfx`; Music and SFX route to Master.
|
||||||
|
|
||||||
|
## Implementation Sequence
|
||||||
|
|
||||||
|
1. Add shared descriptors, settings schema/defaults/validation, launcher scaffolding, and migrations.
|
||||||
|
2. Add audio clip catalog classification, import target, search/filter/details, and drag payloads.
|
||||||
|
3. Add runtime source/listener hydration, deterministic listener selection, and bus controls.
|
||||||
|
4. Add inspector cards with undoable edits and scene save/validation allowlists.
|
||||||
|
5. Add viewport icons/range visualizers and transient audition/stop using the editor camera listener.
|
||||||
|
6. Add a small sample clip/scene, focused round-trip and PIE tests, live QA, permanent docs, and Gitea
|
||||||
|
acceptance evidence.
|
||||||
|
|
||||||
|
## Acceptance Gates
|
||||||
|
|
||||||
|
- Dragging a clip into the viewport creates an audio source; dropping onto a compatible selected
|
||||||
|
source assigns the clip through one undoable command.
|
||||||
|
- Inspector edits survive save/reload and PIE hydration without generated playback state leaking into
|
||||||
|
the authored scene.
|
||||||
|
- Spatial preview follows the editor camera, stops on explicit Stop, mode/project changes, or source
|
||||||
|
deletion, and never changes scene dirty state.
|
||||||
|
- Bus definitions persist with stable IDs, invalid parent cycles/references are rejected, and runtime
|
||||||
|
gain/mute hooks affect routed sources.
|
||||||
|
- Headless validation reports missing/unpackageable clips, unsupported values, invalid buses, and
|
||||||
|
ambiguous enabled listeners with actor/property context.
|
||||||
|
- Focused unit/integration tests, `cargo validate-levels`, package validation, and live editor/game
|
||||||
|
smoke tests passed for issue `#47` closure.
|
||||||
|
|
||||||
|
## Deliberate Boundaries
|
||||||
|
|
||||||
|
- This slice does not include DSP graphs, reverb zones, waveform editing, audio streaming banks,
|
||||||
|
middleware integration, or platform-specific compression pipelines.
|
||||||
|
- Continuous spatial blend is represented authoritatively and implemented without claiming Bevy
|
||||||
|
supports a native blend control; the runtime adapter owns the mapping/mix behavior.
|
||||||
|
- A future mixer UI may expose additional buses and sends, but it must preserve the stable bus IDs and
|
||||||
|
parent graph established here.
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
# Blacksite Editor Production Readiness Program
|
||||||
|
|
||||||
|
Working milestone plan for the production expansion tracked by Gitea epic
|
||||||
|
[`#1`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/1).
|
||||||
|
The existing Jackdaw-inspired M0-M5 roadmap remains the authoring/tool foundation. This plan adds
|
||||||
|
the reliability and shipping gates required for daily indie game production.
|
||||||
|
|
||||||
|
## Definition Of Production Ready
|
||||||
|
|
||||||
|
Blacksite is production ready only when the evidence matrix in Gitea
|
||||||
|
[`#50`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/50)
|
||||||
|
is signed off. Feature presence alone is insufficient. Recovery, validation, packaging,
|
||||||
|
performance, soak, regression, and first-hour workflows must pass against a representative project.
|
||||||
|
|
||||||
|
## Immediate Sequence
|
||||||
|
|
||||||
|
1. Completed: hierarchy/prefab boundary hardening `#40`, transactional recovery `#39`, stable
|
||||||
|
sessions/diagnostics `#41`, and Project Browser/startup boundaries `#3`.
|
||||||
|
2. Completed: stable scene tabs and composed subscene ownership/validation in `#42`.
|
||||||
|
3. Completed: nested prefabs, variants, and structural overrides passed production acceptance in
|
||||||
|
`#43`; M6 implementation is complete.
|
||||||
|
4. Completed: authoritative content validation `#45` and the validation-gated packaging/Build
|
||||||
|
workflow `#44`.
|
||||||
|
5. Completed: audio `#47`, animation `#46`, and navigation `#48` passed production acceptance.
|
||||||
|
Source-control safety `#49` has complete implementation and source/headless acceptance; live
|
||||||
|
visual acceptance remains before the readiness gate `#50`.
|
||||||
|
|
||||||
|
## Implemented Slice - Collaborative Authored-File Safety
|
||||||
|
|
||||||
|
- Exact BLAKE3 baselines for scene tabs, staged Material/Material Instance documents, and Project
|
||||||
|
Settings.
|
||||||
|
- One guarded atomic publication path for scene save/export, prefab source Apply/history, and
|
||||||
|
editable materials, including missing-file and immediate pre-rename race protection.
|
||||||
|
- Non-destructive background Git porcelain scanning with optional off-thread ownership providers;
|
||||||
|
Git/provider absence is quiet.
|
||||||
|
- Compact active-scene and selected-asset state plus Reload, metadata comparison, Save As, and
|
||||||
|
Cancel conflict recovery. No force-overwrite action exists.
|
||||||
|
- Focused race, read-only, provider-lock, parser, non-repository, modal-render, scene, and material
|
||||||
|
tests pass. Live debug-editor visual acceptance remains pending for a desktop-capable QA session;
|
||||||
|
packaged acceptance remains owner-deferred.
|
||||||
|
|
||||||
|
## M6 - Reliability, Recovery, And Project Workflow
|
||||||
|
|
||||||
|
**Exit:** A normal or interrupted editor session cannot silently lose or corrupt authored work, and
|
||||||
|
projects/scenes/prefabs have stable daily workflows.
|
||||||
|
|
||||||
|
| Issue | Capability | Priority |
|
||||||
|
|-------|------------|----------|
|
||||||
|
| #3 | Project launcher, templates, recent projects, resume | P0 |
|
||||||
|
| #39 | Transactional saves, autosave, crash recovery | P0 |
|
||||||
|
| #40 | Hierarchy, parenting, prefab structure hardening | P0 |
|
||||||
|
| #41 | Session persistence and crash diagnostics | P0 |
|
||||||
|
| #42 | Multi-scene tabs, subscenes, level composition | P1 |
|
||||||
|
| #43 | Nested prefabs, variants, structural overrides | P1 |
|
||||||
|
|
||||||
|
## M7 - Content Production And Shipping
|
||||||
|
|
||||||
|
**Exit:** A clean checkout can validate, build, package, and run a representative project with the
|
||||||
|
minimum animation, audio, and navigation authoring loops required by the game.
|
||||||
|
|
||||||
|
| Issue | Capability | Priority |
|
||||||
|
|-------|------------|----------|
|
||||||
|
| #44 | Build/package profiles and Build panel | P0 |
|
||||||
|
| #45 | Dependency manifest and content release gate | P0 |
|
||||||
|
| #46 | Skeletal animation import/preview/authoring | P1 |
|
||||||
|
| #47 | Audio sources/listeners/buses/spatial preview | P1 |
|
||||||
|
| #48 | Navigation authoring/bake/path preview | P1 |
|
||||||
|
| #49 | Source-control status and collaborative file safety | P2 |
|
||||||
|
| #50 | Production-readiness acceptance matrix | P0 |
|
||||||
|
|
||||||
|
## Cross-Cutting Gates
|
||||||
|
|
||||||
|
- Authored IDs, scene schema, hydration stripping, and extension boundaries remain authoritative.
|
||||||
|
- Every mutation supports meaningful undo/redo; modal tools also support cancel without dirty state.
|
||||||
|
- Editor-only helpers, recovery files, and caches never enter scenes or game packages.
|
||||||
|
- Interactive and headless validation use the same rules and produce equivalent blocking results.
|
||||||
|
- Large asset, terrain, navigation, and geometry work is debounced or dirty-region based.
|
||||||
|
- Visible behavior updates root controls and `docs/editor/`; hard-to-reverse decisions get ADRs.
|
||||||
|
- Production signoff requires a second-person first-hour QA pass and no open P0 blocker.
|
||||||
|
|
||||||
|
## Completed Slice - UI Identity And Structural Dragging
|
||||||
|
|
||||||
|
- Near-black Blacksite shell with compact tool identity rather than a Unity clone.
|
||||||
|
- Pointer-following asset drag preview, viewport reticle, boundary, and corner brackets.
|
||||||
|
- Full-width hierarchy attach targets plus explicit root/reorder/invalid feedback.
|
||||||
|
- World-transform-preserving reparent/unparent with grouped history.
|
||||||
|
- Cycle rejection, subtree-safe multi-drag, parent expansion, and focused regression coverage.
|
||||||
|
|
||||||
|
## Completed Slice - Multi-Scene Production Workflow
|
||||||
|
|
||||||
|
- Independent scene tabs integrated into the right end of the existing main toolbar.
|
||||||
|
- Stable `SceneComposition` resources with project-relative references and no runtime entity IDs.
|
||||||
|
- Recursive missing/cycle/duplicate/path-escape validation shared by editor and CI.
|
||||||
|
- Runtime-only composed ownership, load/lock/focus controls, and owner-save exclusion.
|
||||||
|
- Per-saved-tab recovery, composition undo/redo, PIE-active composition consistency, and fixtures.
|
||||||
|
|
||||||
|
## Completed Slice - Validation-Gated Build And Packaging
|
||||||
|
|
||||||
|
- Shared owner-attributed project validation and runtime-packageability policy in editor, CI, and
|
||||||
|
packaging; unknown schemas, missing LFS objects, excluded references, and unsafe traversal block.
|
||||||
|
- Versioned development/QA/release profiles with Cargo-reported artifacts, rendering/default-scene
|
||||||
|
application, Windows QA symbols, supported-target enforcement, and deterministic metadata.
|
||||||
|
- OS-locked authenticated staging, interrupted-build recovery, complete pre-publish hashing, safe
|
||||||
|
replacement, and unchanged-output reuse.
|
||||||
|
- Non-blocking editor Build/Run/Cancel/Reveal workflow with dirty-tab guard and process-tree cleanup.
|
||||||
|
- Gitea #44 and #45 closed after headless, focused regression, repeated-build, and live packaged
|
||||||
|
development-runtime acceptance.
|
||||||
|
|
||||||
|
## Completed Slice - Audio Authoring And Spatial Preview
|
||||||
|
|
||||||
|
The stable authoring/runtime contract is recorded in
|
||||||
|
[ADR 0030](../../docs/adr/0030-audio-authoring-and-bus-schema.md), with controls, runtime behavior,
|
||||||
|
validation, and the committed sample fixture documented in
|
||||||
|
[Audio Authoring](../../docs/editor/audio-authoring.md). Gitea #47 closed after automated,
|
||||||
|
headless, live editor/PIE, and packaged-runtime acceptance.
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# Collider Authoring Diagnostics - 2026-07-12
|
||||||
|
|
||||||
|
Issue: Gitea #26 (`BS-JD-305`)
|
||||||
|
|
||||||
|
## Outcome
|
||||||
|
|
||||||
|
Collider authoring exposes one consistent health result to the inspector, Collider viewport,
|
||||||
|
Diagnostics panel, and physics placement preflight. Shape changes preserve useful dimensions and
|
||||||
|
remain one typed undo operation.
|
||||||
|
|
||||||
|
## Contract
|
||||||
|
|
||||||
|
- Authored box, sphere, and capsule overlays include actor world scale.
|
||||||
|
- Static mesh colliders show cooked runtime bounds when available.
|
||||||
|
- Green is ready, cyan is a trigger, gray is disabled, amber is warning/stale, and red is invalid
|
||||||
|
or missing.
|
||||||
|
- Invalid dimensions and mesh references block dependent workflows. Missing hydration and
|
||||||
|
colliders over 1,000 meters in world extent are warnings.
|
||||||
|
- Physics placement consumes the same collider-health checks instead of maintaining a separate
|
||||||
|
prerequisite definition.
|
||||||
|
|
||||||
|
## Work
|
||||||
|
|
||||||
|
- [x] Add shared authored/runtime collider diagnostics and focused fixtures.
|
||||||
|
- [x] Add shape/status-aware viewport overlays and selected-collider HUD state.
|
||||||
|
- [x] Add inspector health/repair feedback and dimension-preserving undoable shape switching.
|
||||||
|
- [x] Add scene-wide selectable collider findings to Diagnostics.
|
||||||
|
- [x] Reuse diagnostics in physics placement prerequisites.
|
||||||
|
- [x] Add a committed non-blocking showcase scene and update documentation.
|
||||||
|
- [x] Run source gates and live Wayland acceptance; packaged tests remain skipped by request.
|
||||||
|
- [x] Commit, push, attach native Gitea evidence, close #26, and close M3 when empty.
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# Deterministic Imported-Asset Fingerprints
|
||||||
|
|
||||||
|
**Status:** Complete at `cbd380a9413411667a83f74b66c5a2feda5e1af7`; see
|
||||||
|
[`docs/editor/evaluations/deterministic-asset-fingerprints/`](../../docs/editor/evaluations/deterministic-asset-fingerprints/).
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
Implement Gitea #56 so imported-source identity is content-addressed and editor/validator runs do
|
||||||
|
not rewrite project artifacts because checkout timestamps or serialization whitespace changed.
|
||||||
|
|
||||||
|
## Contract
|
||||||
|
|
||||||
|
- Persist one shared fingerprint for imported model, texture, and audio sources: byte length plus a
|
||||||
|
BLAKE3 digest of the exact source bytes.
|
||||||
|
- Do not persist or compare source mtimes as semantic identity. Legacy timestamp fields remain
|
||||||
|
readable but are ignored.
|
||||||
|
- Static-mesh and animation manifests use the same content identity as the asset registry.
|
||||||
|
- Preserve stable registry UUIDs across metadata-only drift and uniquely identifiable source moves.
|
||||||
|
- Before writing a registry or generated manifest, compare the parsed semantic document; preserve
|
||||||
|
the existing bytes when the result is equivalent.
|
||||||
|
- Project validators stay read-only and validate both length and digest, including same-size edits.
|
||||||
|
|
||||||
|
## Implementation
|
||||||
|
|
||||||
|
1. Add the shared fingerprint type and migrate animation/static-mesh contracts.
|
||||||
|
2. Persist fingerprints for model, texture, and audio registry records and generalize move recovery.
|
||||||
|
3. Make registry and manifest publication semantic and byte-preserving.
|
||||||
|
4. Extend static-mesh and registry validation plus focused migration/read-only tests.
|
||||||
|
5. Update ADRs, asset-pipeline docs, CI clean-worktree assertion, and committed generated artifacts.
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
- Focused editor and scene tests for mtime-only drift, same-size changes, legacy manifests,
|
||||||
|
byte-preserving equivalent refresh, imported source kinds, and read-only validation.
|
||||||
|
- Formatting, diff check, clippy, and workspace all-target tests.
|
||||||
|
- Native editor startup and asset refresh with before/after Git status and source timestamp drift.
|
||||||
|
- `cargo validate-levels --project .` and `cargo validate-samples --project .`, followed by a clean
|
||||||
|
worktree assertion. Packaged-runtime tests remain deferred by owner direction.
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
# Editor Sample Regression Pack
|
||||||
|
|
||||||
|
Date: 2026-07-13
|
||||||
|
Issue: BS-JD-501 / Gitea #32
|
||||||
|
Milestone: M5 - Regression, docs, and first-hour UX
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
|
||||||
|
Ship a deterministic five-scene editor regression pack that is easy to open from the editor and
|
||||||
|
that fails headless validation when its catalog, authored data, or referenced assets drift. The pack
|
||||||
|
must cover Brush, Material, Terrain, Physics Placement, and Rendering workflows.
|
||||||
|
|
||||||
|
## Decisions
|
||||||
|
|
||||||
|
- `assets/samples/editor_samples.ron` is the conventional, versioned pack manifest. This remains a
|
||||||
|
QA/editor convention and does not extend `ProjectSettings`.
|
||||||
|
- The manifest is parsed and validated in the `scene` crate. Editor UI and headless tooling consume
|
||||||
|
that one representation.
|
||||||
|
- Every entry has a stable ID, label, area, project-relative `.scn.ron` path, summary, and nonempty
|
||||||
|
operator checks. Manifest order is menu and report order.
|
||||||
|
- Exactly one entry for each required area is release-gated. Scene paths must remain regular files
|
||||||
|
inside `assets/levels/`; traversal, absolute paths, symlink escapes, duplicates, and future schemas
|
||||||
|
are blocking.
|
||||||
|
- Existing accepted terrain, physics-placement, and rendering fixtures remain canonical entries.
|
||||||
|
Add dedicated brush and material scenes under `assets/levels/samples/` and strengthen weak visual
|
||||||
|
anchors in the existing fixtures instead of duplicating them.
|
||||||
|
- `cargo validate-samples --project .` combines pack-specific structure/feature checks with the
|
||||||
|
authoritative `validate_project` report. It verifies stable actor IDs, required area components,
|
||||||
|
authoring-only scene documents, and referenced content.
|
||||||
|
- Terrain descriptors and their shared material layers become first-class project-validation input.
|
||||||
|
Actor-owned invalid descriptors or missing material references are blocking findings.
|
||||||
|
- `File > Open Sample` is backed by a cached project catalog and opens through normal scene-tab I/O.
|
||||||
|
Invalid or unavailable catalogs produce a disabled, actionable row rather than a panic.
|
||||||
|
- CI hydrates Git LFS before content validation and runs both validation commands. Packaged-runtime
|
||||||
|
tests remain deferred by project-owner request.
|
||||||
|
|
||||||
|
## Implementation
|
||||||
|
|
||||||
|
1. Add the manifest schema, deterministic report, safe path resolver, and sample feature checks to
|
||||||
|
`scene::sample_pack`, with malformed/missing/duplicate/path-escape fixture tests.
|
||||||
|
2. Add typed `TerrainDesc` validation and base/layer material dependency collection to authoritative
|
||||||
|
project validation, including owner-attributed tests.
|
||||||
|
3. Add the `validate-samples` xtask binary, Cargo alias, JSON mode, stable console summary, and CI
|
||||||
|
steps. Enable LFS hydration at checkout and verify hydrated objects.
|
||||||
|
4. Add the five-entry manifest, `brush_blockout.scn.ron`, and `material_lab.scn.ron`. Give every
|
||||||
|
sample actor a stable `ActorId`; add visible rendering anchors and distinct physics shapes where
|
||||||
|
the current fixtures are ambiguous.
|
||||||
|
5. Load the catalog after project startup, render `File > Open Sample` in manifest order, and route a
|
||||||
|
selected stable ID through scene I/O. Add unknown-entry and deterministic-row tests.
|
||||||
|
6. Add a no-GPU typed-deserialization test over every manifest scene so unknown Bevy component
|
||||||
|
registrations fail before native QA.
|
||||||
|
7. Document pack contracts, per-scene checks, release commands, and the editor workflow. Update ADR
|
||||||
|
0028, the root README checklist/controls, editor/docs indexes, feature guides, roadmap status,
|
||||||
|
debt audit, and production-readiness evidence.
|
||||||
|
8. Run source gates, open all five samples through the native menu, exercise one representative tool
|
||||||
|
interaction per area, inspect logs, and attach representative native issue images when useful.
|
||||||
|
|
||||||
|
## Acceptance
|
||||||
|
|
||||||
|
- Five manifest entries cover all required areas and open through `File > Open Sample`.
|
||||||
|
- Every entry type-deserializes and has stable actor IDs plus its required authored feature.
|
||||||
|
- `validate-levels` reports terrain material dependencies and has no blocking findings.
|
||||||
|
- `validate-samples` is deterministic, CI-backed, and exits nonzero for pack or project blockers.
|
||||||
|
- Native viewport captures are nonblank, correctly framed, and free of missing-reference, hydration,
|
||||||
|
render, or operator errors.
|
||||||
|
- Documentation gives contributors a single release-use workflow and explains every sample check.
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
# FBX External Texture Dependencies
|
||||||
|
|
||||||
|
**Issue:** Gitea #58 (`BS-JD-210`)
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
|
||||||
|
Make FBX external texture discovery deterministic from import through runtime loading. Missing or
|
||||||
|
unsafe references must be reported before the Asset Browser queues Bevy loads, while an explicit
|
||||||
|
Authoring Override remains a supported untextured workflow.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
1. Add one path-safe FBX texture-reference resolver shared by the local `bevy_ufbx` loader and the
|
||||||
|
editor asset pipeline. Normalize separators, deduplicate references, retain relative `textures/`
|
||||||
|
and `.fbm/` layouts, and reject absolute or parent-traversing references.
|
||||||
|
2. Decode external images through the FBX `LoadContext`, reuse one handle per normalized path, and
|
||||||
|
consolidate unavailable dependency logging so duplicate ufbx texture records cannot create
|
||||||
|
repeated asset-server failures.
|
||||||
|
3. Generate static-mesh dependencies from parsed FBX texture references. Treat them as required for
|
||||||
|
Source Materials and as declared-but-optional for Authoring Override during read-only project
|
||||||
|
validation.
|
||||||
|
4. Replace the FBX-only file copy with a staged bundle transaction that preflights every referenced
|
||||||
|
file, preserves relative sidecar layout, backs up overwritten destinations, and rolls back a
|
||||||
|
partial commit.
|
||||||
|
5. Preflight source-material thumbnails, retain neutral direct FBX mesh/model previews, and expose a
|
||||||
|
stable failure reason plus missing dependency status in the Asset Browser.
|
||||||
|
6. Deliberately normalize the committed painted-chair fixture to Authoring Override rather than add
|
||||||
|
large absent 2K textures.
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
- Unit tests for sibling `textures/`, `.fbm/`, duplicate references, missing files, path traversal,
|
||||||
|
destination symlink containment, transactional preservation, consolidated project findings, and
|
||||||
|
read-only validation.
|
||||||
|
- `cargo fmt`, focused crate tests, workspace Clippy, workspace tests, `validate-levels`, and
|
||||||
|
`validate-samples`. Packaged tests remain deferred by project-owner direction.
|
||||||
|
- Native editor QA for the painted chair and an intentionally broken Source Materials variant,
|
||||||
|
including log inspection and screenshots published as ordinary Gitea attachments.
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
- Record the cross-crate dependency/override contract in ADR 0044.
|
||||||
|
- Update editor architecture, Asset Browser workflow, root controls/checklist, documentation maps,
|
||||||
|
and an issue-specific evaluation record.
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
# Guarded Shutdown And History Savepoints
|
||||||
|
|
||||||
|
Date: 2026-07-13
|
||||||
|
Issue: BS-PR-709 / Gitea #55
|
||||||
|
Milestone: M7 - Production Readiness
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
|
||||||
|
Route every editor-exit surface through one non-blocking dirty-document decision and make scene
|
||||||
|
dirtiness follow the authored undo timeline. Closing the native window, choosing File > Quit, and
|
||||||
|
requesting an editor exit programmatically must never silently discard dirty scene tabs.
|
||||||
|
|
||||||
|
## Decisions
|
||||||
|
|
||||||
|
- The editor disables Bevy's automatic close-and-exit systems and owns primary-window close
|
||||||
|
requests. A guarded-shutdown resource is the single authority that may emit `AppExit`.
|
||||||
|
- The final dirty-state recheck and `AppExit` authorization run in a dedicated schedule after
|
||||||
|
Bevy's `Last`; session clean-marker persistence runs after that finalizer.
|
||||||
|
- Native window close, File > Quit, and internal editor quit requests enqueue the same shutdown
|
||||||
|
intent. Repeated requests while confirmation or Save As is pending are coalesced.
|
||||||
|
- Clean sessions exit immediately. Dirty sessions use the shared `NativeDialogBroker` and a single
|
||||||
|
Save All / Discard / Cancel decision. Cancel preserves all tabs and live editor state; Discard
|
||||||
|
exits without rewriting authored files; Save All exits only after every dirty tab is saved.
|
||||||
|
- Untitled tabs and other asynchronous Save As work keep shutdown pending until their dialog result
|
||||||
|
is applied on the main thread. Cancellation or any failed write returns the editor to an idle,
|
||||||
|
dirty, recoverable state and does not emit `AppExit`.
|
||||||
|
- Each scene tab retains a canonical authored-content checkpoint established only by a successful
|
||||||
|
load or save. The checkpoint is keyed by stable actor identity, canonical component order, stable
|
||||||
|
parent identity, and scene composition rather than transient Bevy entity numbers.
|
||||||
|
- Push marks the active document dirty. Undo and redo serialize the authoritative authored
|
||||||
|
projection and compare it with that tab's checkpoint, so saving at nonzero history depth,
|
||||||
|
returning to that point, branching, tab switches, and direct non-history mutations remain exact.
|
||||||
|
|
||||||
|
## Implementation
|
||||||
|
|
||||||
|
1. Add per-tab canonical clean checkpoints to scene I/O and reconcile `SceneIo::dirty` after push,
|
||||||
|
undo, redo, save, load, and document switches without persisting Entity-ID-based history stacks.
|
||||||
|
2. Add focused history tests for undo-to-clean, redo-away-from-clean, save at nonzero depth,
|
||||||
|
branching before/after the clean point, and tab isolation.
|
||||||
|
3. Add a guarded-shutdown plugin/resource that intercepts `WindowCloseRequested`, accepts menu and
|
||||||
|
programmatic requests, coordinates non-blocking confirmation/save completion, and emits the only
|
||||||
|
final `AppExit` for the full editor.
|
||||||
|
4. Make Save All report complete, pending, cancelled, or failed explicitly. Resume pending shutdown
|
||||||
|
after untitled Save As completion and preserve the originating tab plus dirty state on failure.
|
||||||
|
5. Add File > Quit and route Switch Project's exit half through the same guard without spawning a
|
||||||
|
replacement process until the dirty-document decision succeeds.
|
||||||
|
6. Update ADR 0023, native-dialog/session-recovery documentation, editor architecture guidance,
|
||||||
|
root README controls/checklist, and production-readiness evidence.
|
||||||
|
7. Run formatting, strict Clippy, workspace tests, and focused headless state-machine tests. Keep
|
||||||
|
packaged tests deferred by project-owner direction.
|
||||||
|
8. Launch the exact editor commit under Hyprland. Exercise Cancel, Discard, Save All, clean close,
|
||||||
|
File > Quit, and the compositor close button; verify the editor remains responsive during native
|
||||||
|
dialogs, no state is lost on cancel/failure, and no process or warning remains after exit.
|
||||||
|
|
||||||
|
## Acceptance
|
||||||
|
|
||||||
|
- Native close, File > Quit, and programmatic editor exit share one guarded implementation.
|
||||||
|
- One or many dirty tabs cannot be lost without explicit Discard; failed or cancelled saves do not
|
||||||
|
exit and preserve the session.
|
||||||
|
- Undoing exactly to the saved state clears the dirty marker; redo or a divergent edit restores it.
|
||||||
|
- Saving at nonzero history depth establishes a new clean point without deleting useful history.
|
||||||
|
- Headless state-machine tests and exact-commit native Linux QA pass with clean logs.
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
# Material Library And Targeted Viewport Drop
|
||||||
|
|
||||||
|
Working implementation plan for Gitea issues
|
||||||
|
[`#16`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/16) and
|
||||||
|
[`#18`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/18).
|
||||||
|
The shared Material/Material Instance and stable renderer-slot foundation from `#51` is already
|
||||||
|
present; this slice completes the production-facing catalog and drag/drop workflow.
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
Implemented on `codex/material-library-targeted-drop` after collaborative-safety `#49` was
|
||||||
|
published and integrated into `main`. Focused and full source-only verification plus live editor
|
||||||
|
acceptance are green; ticket evidence remains before `#16` / `#18` close.
|
||||||
|
|
||||||
|
## Resolved Gaps
|
||||||
|
|
||||||
|
- The dockable Material Library now provides cross-folder Material/Instance catalog, usage counts,
|
||||||
|
health, creation, thumbnails, drag sources, and the guarded existing details editors.
|
||||||
|
- Viewport Material/Texture drops resolve the surface under the pointer and never broaden to the
|
||||||
|
current selection or every renderer slot.
|
||||||
|
- `HydratedRendererMaterialBinding` identifies the exact static/skinned renderer slot; primitives
|
||||||
|
and stable brush-face IDs use their authored component paths.
|
||||||
|
- Unsupported, locked, linked, missing, and payload-incompatible targets reject with an explicit
|
||||||
|
reason and no scene mutation.
|
||||||
|
- Hover previews are reversible, target changes restore the prior snapshot, and release records one
|
||||||
|
typed operator/history transaction.
|
||||||
|
- Viewport pointer tracking remains active while another egui widget owns the drag, so exact target
|
||||||
|
resolution cannot stall at the viewport boundary.
|
||||||
|
- Visibility hierarchy setup now precedes generated hydration content, preventing Bevy parent/child
|
||||||
|
visibility warnings when brush draws are created after scene load.
|
||||||
|
|
||||||
|
## Material Library
|
||||||
|
|
||||||
|
1. Add a dockable `Material Library` panel, opened from Window and placed in the existing bottom dock
|
||||||
|
without adding another permanent toolbar.
|
||||||
|
2. Present project Materials and Material Instances with search, Material/Instance filter, thumbnail
|
||||||
|
grid/list modes, base/dependency health, and source-control status.
|
||||||
|
3. Add a scene-usage section that counts renderer-slot, primitive, and brush-face references and can
|
||||||
|
select/locate users. Do not revive ambiguous hidden scene-local material clones.
|
||||||
|
4. Reuse the existing guarded Material/Instance drafts for Apply, Revert, Create Instance, and
|
||||||
|
texture-parameter editing. Shared-file edits remain explicit; scene assignment changes use
|
||||||
|
history.
|
||||||
|
5. Material and Instance cells are first-class drag sources and preserve the current pointer-following
|
||||||
|
visual identity.
|
||||||
|
|
||||||
|
## Targeted Drop Contract
|
||||||
|
|
||||||
|
Introduce a frame-updated `ViewportAssetDropTarget` resolved by the existing mesh-picking path:
|
||||||
|
|
||||||
|
- A hydrated static/skinned draw maps through `HydratedRendererMaterialBinding` to the authored actor
|
||||||
|
and exact stable slot ID.
|
||||||
|
- A primitive maps to its authored actor-level `MaterialDesc`.
|
||||||
|
- A brush performs authored face intersection and identifies the stable face ID.
|
||||||
|
- An authored but unsupported target remains a visible invalid target with a specific reason.
|
||||||
|
- Empty space remains placement-only for placeable assets and invalid for Material/Texture payloads.
|
||||||
|
|
||||||
|
Payload matrix:
|
||||||
|
|
||||||
|
| Payload | Renderer slot | Primitive | Brush face |
|
||||||
|
|---------|---------------|-----------|------------|
|
||||||
|
| Material / Material Instance | Assign exact hit slot; one-slot actors may assign directly | Replace actor material reference/values | Replace the hit face material reference |
|
||||||
|
| Texture | Reject with guidance to create/edit a Material Instance | Set base-color texture | Set hit-face base-color texture/material binding |
|
||||||
|
|
||||||
|
An explicit `Apply All Slots` command remains available from the renderer inspector/library usage
|
||||||
|
menu; a viewport hit never silently broadens from one slot to all slots.
|
||||||
|
|
||||||
|
## Preview, Commit, And Cancel
|
||||||
|
|
||||||
|
1. Start a persistent drop-preview session when a supported Material/Texture payload enters the
|
||||||
|
viewport. Snapshot only the target's affected authored state.
|
||||||
|
2. Apply a transient visual preview without pushing history or marking the scene dirty.
|
||||||
|
3. When the pointer changes target, restore the previous snapshot before previewing the new target.
|
||||||
|
4. On release, restore the transient state first, then commit exactly one typed history/operator
|
||||||
|
transaction to the identified slot, primitive, or face.
|
||||||
|
5. On Escape, drag cancellation, leaving the viewport, invalid target, or missing source, restore the
|
||||||
|
exact snapshot and remove every preview/helper marker.
|
||||||
|
6. The drag card and target outline name the payload, actor, slot/face, action, and invalid reason.
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
- Focused tests cover exact multi-slot assignment/undo, brush-face-only preview/restore, primitive
|
||||||
|
Material/Texture resolution, renderer Texture rejection, Material Library filtering, and scene
|
||||||
|
usage counts.
|
||||||
|
- Source checks include editor all-target check, focused tests, and strict editor Clippy.
|
||||||
|
- Live acceptance covered the docked catalog, search/type/usage filters, grid/list views, resolved
|
||||||
|
Material Instance thumbnails, exact primitive preview, green actor/surface feedback, one-step
|
||||||
|
commit/undo, and Escape rollback. The same relaunch produced no hydration hierarchy warnings.
|
||||||
|
- Static/skinned exact-slot, brush-face, locked/linked, incompatible Texture, and non-dirty preview
|
||||||
|
contracts remain covered by focused automated tests; shared-asset file creation was deliberately
|
||||||
|
not invoked during live QA to avoid adding throwaway authored files.
|
||||||
|
- Full verification passed: workspace all-target check, strict workspace Clippy, all workspace tests,
|
||||||
|
strict editor Clippy with both `dev` and `hot-reload`, level validation with zero blockers, and
|
||||||
|
navigation artifact freshness. Packaged testing remains deferred until the project owner requests
|
||||||
|
it again.
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
# Navigation Mesh Authoring, Bake Diagnostics, And Path Preview
|
||||||
|
|
||||||
|
Working implementation plan for Gitea issue
|
||||||
|
[`#48`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/48).
|
||||||
|
This is the navigation production loop required by the M7 content-production milestone.
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
Architecture, dependency compatibility, composed-source resolution, persisted path samples,
|
||||||
|
corrective source-level QA, and live debug-editor acceptance are complete. Packaged/release
|
||||||
|
acceptance remains explicitly deferred until the project owner requests another packaged pass.
|
||||||
|
|
||||||
|
## Outcome
|
||||||
|
|
||||||
|
A level designer can author navigation bounds, obstacles, areas, links, and agent profiles; bake a
|
||||||
|
deterministic versioned artifact; inspect stale or invalid data; preview a path in the viewport; and
|
||||||
|
use the same artifact through a game-owned runtime query API and headless release validation.
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
- Shared reflected components own bounds, obstacles, area volumes, links, and scene bake settings.
|
||||||
|
- The scene crate owns deterministic composed-source resolution, source fingerprinting, bake
|
||||||
|
artifact IO, the engine-independent query core, and validation.
|
||||||
|
- Rerecast performs the 3D walkable-surface bake without coupling navigation to a Bevy plugin
|
||||||
|
release. Polyanya performs proven any-angle runtime and editor-preview path queries.
|
||||||
|
- Overlapping primitive and additive-brush triangles enter the deterministic bake source; distant
|
||||||
|
geometry and navigation authoring are excluded from each bounds fingerprint. No synthetic bounds
|
||||||
|
floor is added.
|
||||||
|
- The game crate adapts the shared query core to Bevy types and exposes renderer-free artifact
|
||||||
|
validation. Editor preview and project validation do not implement separate pathfinders.
|
||||||
|
- Generated artifacts live under `assets/navigation/generated/`, are project-relative runtime
|
||||||
|
dependencies, and never serialize viewport helpers into authored scenes.
|
||||||
|
|
||||||
|
## Implementation Sequence
|
||||||
|
|
||||||
|
1. Add reflected authoring schema, versioned bake artifact, source fingerprint, validation, and
|
||||||
|
exact agent-profile settings.
|
||||||
|
2. Add deterministic Rerecast bake input extraction for authored bounds/obstacles and headless bake
|
||||||
|
command coverage.
|
||||||
|
3. Add game-owned artifact loading and Polyanya path-query API, including authored off-mesh links.
|
||||||
|
4. Add typed inspectors, create commands, bake/stale status, viewport overlay, and start/end path
|
||||||
|
preview.
|
||||||
|
5. Add owner-attributed project validation for invalid links, missing/stale artifacts, unreachable
|
||||||
|
preview samples, and bake failures.
|
||||||
|
6. Commit a small sample scene/artifact and run automated, headless, and live debug-editor
|
||||||
|
acceptance. PIE and packaged runtime acceptance remain deferred by project-owner direction.
|
||||||
|
|
||||||
|
## Acceptance Gates
|
||||||
|
|
||||||
|
- A designer can create bounds and obstacles, bake, view the resulting mesh, and preview a valid
|
||||||
|
start-to-end path.
|
||||||
|
- Agent radius, height, climb, and slope settings deterministically affect the bake fingerprint.
|
||||||
|
- Relevant geometry or navigation-authoring changes mark the artifact stale; unrelated scene
|
||||||
|
metadata does not.
|
||||||
|
- Invalid or dangling links, samples outside the mesh, isolated regions, and bake failures identify
|
||||||
|
the owning actor or setting and provide a repair action.
|
||||||
|
- Runtime path queries and editor preview use the same game-owned API and versioned artifact.
|
||||||
|
- Helper meshes, lines, endpoints, and bake state are transient and never serialize.
|
||||||
|
- Headless bake and project validation pass for the committed sample fixture, and package dependency
|
||||||
|
collection includes the current artifact.
|
||||||
|
- Visible subscenes and nested prefab contributors resolve identically from editor snapshots and
|
||||||
|
headless tooling; unsupported structural overrides block with an apply/unpack repair action.
|
||||||
|
|
||||||
|
## Deliberate Boundaries
|
||||||
|
|
||||||
|
- V1 supports static baked navigation plus explicit links. Dynamic crowd avoidance and runtime tile
|
||||||
|
carving are separate work.
|
||||||
|
- Full partial-tile regeneration waits for upstream Rerecast tiling support. V1 records affected
|
||||||
|
source bounds and debounces a deterministic full bake while reporting the dirty region.
|
||||||
|
- Area costs are authored and validated in V1; path-cost weighting beyond walkable/blocked areas is
|
||||||
|
deferred until the runtime exposes per-polygon cost callbacks.
|
||||||
|
- Imported static meshes remain obstacle-authored in V1 because their normalized manifests do not
|
||||||
|
yet expose deterministic collision triangles to the headless scene crate.
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
# Non-Blocking Native Dialogs
|
||||||
|
|
||||||
|
Working implementation plan for the production-readiness defect discovered during live acceptance
|
||||||
|
of collaborative file safety. Opening an `rfd` picker synchronously from an egui/Bevy system stops
|
||||||
|
window event processing long enough for Hyprland to report Blacksite as unresponsive.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
1. Add one project-level native-dialog broker with a typed intent, one active dialog, background
|
||||||
|
native work, and a main-thread result queue.
|
||||||
|
2. Convert scene open/save-as, asset import/export, prefab save/source selection, subscene selection,
|
||||||
|
conflict Save As, diagnostics export, and project-launcher folder selection to the broker.
|
||||||
|
3. Keep destructive or stateful application logic on the Bevy main thread after a path result is
|
||||||
|
received. Background work may only own the native dialog and its returned paths.
|
||||||
|
4. Show a stable pending state and reject duplicate dialog requests while a picker is active.
|
||||||
|
5. Replace blocking native dirty-scene confirmation dialogs with an editor-owned modal when the
|
||||||
|
scene-transition state machine can preserve the original action exactly.
|
||||||
|
|
||||||
|
## Contract
|
||||||
|
|
||||||
|
- The editor continues rendering and processing compositor pings while a native dialog is open.
|
||||||
|
- Cancel returns a typed empty result and does not mutate editor state.
|
||||||
|
- A result is applied once to the intent that created it; stale or duplicate results cannot run.
|
||||||
|
- Paths are validated at the same ownership boundary as before. The dialog broker does not read,
|
||||||
|
write, import, save, or canonicalize project content.
|
||||||
|
- Existing collaborative revision guards remain authoritative after Save As selection.
|
||||||
|
- Project-launcher dialogs use the same broker before the full editor plugin group is active.
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
- Focused tests cover request exclusivity, cancel, one-shot result delivery, and typed intent
|
||||||
|
preservation.
|
||||||
|
- Source-only workspace formatting, check, strict Clippy, and tests run; packaged acceptance remains
|
||||||
|
deferred by project-owner direction.
|
||||||
|
- Native Wayland QA opens representative file, folder, and Save As dialogs under Hyprland and
|
||||||
|
confirms the Blacksite window remains responsive without an unresponsive-application prompt.
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# Operator Invariants Completion
|
||||||
|
|
||||||
|
Working plan for Gitea
|
||||||
|
[`#33`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/33).
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
Implementation complete. Source and headless gates pass on the publication branch; the final exact
|
||||||
|
commit is recorded in the issue closure comment. Packaged-runtime testing remains deferred by the
|
||||||
|
project owner.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
1. Make registered commands distinguish immediate completion from modal Preview ownership.
|
||||||
|
2. Require stable operator IDs and terminal phases for commit, cancel, block, failure, no-op, and
|
||||||
|
automatic interruption paths.
|
||||||
|
3. Make Group Selection and lighting changes atomic history transactions with repeatable undo/redo.
|
||||||
|
4. Exercise production dispatch/finalizers for assets, material drops, brushes, terrain, physics
|
||||||
|
placement, and transform gizmos through reusable semantic projections.
|
||||||
|
5. Publish the invariant contract, acceptance evidence, and production-gate status without claiming
|
||||||
|
release-candidate acceptance.
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
- `cargo test -p editor --lib --no-fail-fast`
|
||||||
|
- `cargo clippy -p editor --lib --tests -- -D warnings`
|
||||||
|
- `cargo fmt --all -- --check`
|
||||||
|
- `cargo test --workspace --all-targets --no-fail-fast`
|
||||||
|
- `cargo clippy --workspace --all-targets -- -D warnings`
|
||||||
|
- `cargo validate-levels --project .`
|
||||||
|
|
||||||
|
Live editor checks cover command-palette modal ownership and the grouped selection/lighting history
|
||||||
|
surface. Packaged tests are deliberately excluded until re-enabled by the project owner.
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
# Physics Placement Tool - 2026-07-12
|
||||||
|
|
||||||
|
Issue: Gitea #25 (`BS-JD-304`)
|
||||||
|
|
||||||
|
## Outcome
|
||||||
|
|
||||||
|
Selected authored props can be released into deterministic Avian gravity, preview their
|
||||||
|
settled transforms in the Scene viewport, and either commit the result as one undoable
|
||||||
|
transform operation or cancel back to the exact pre-placement state.
|
||||||
|
|
||||||
|
## Contract
|
||||||
|
|
||||||
|
- Physics is paused during normal Edit mode and while Play mode is paused.
|
||||||
|
- Placement runs only in Edit mode and owns a transactional physics session.
|
||||||
|
- Selected mutable level objects must have active rigid-body and non-trigger collider
|
||||||
|
authoring. Invalid selections produce a precise, non-destructive diagnostic.
|
||||||
|
- Selected bodies are temporarily dynamic with clean motion state.
|
||||||
|
- Other movable bodies are temporarily static so they remain collision surfaces without
|
||||||
|
advancing unrelated authored state.
|
||||||
|
- Commit restores all temporary runtime overrides and records only changed local transforms
|
||||||
|
as one grouped history command.
|
||||||
|
- Cancel restores transforms and runtime physics state exactly and creates no history entry.
|
||||||
|
- Escape cancels. Enter commits once the session has reached rest. A bounded timeout keeps
|
||||||
|
unstable scenes controllable.
|
||||||
|
|
||||||
|
## Work
|
||||||
|
|
||||||
|
- [x] Establish Edit/Play ownership of `Time<Physics>` and preserve paused single-step PIE.
|
||||||
|
- [x] Implement placement validation, runtime snapshots, deterministic stepping, settling,
|
||||||
|
timeout, commit, and cancel.
|
||||||
|
- [x] Add the placement action and session controls to the existing horizontal viewport
|
||||||
|
toolbar plus a compact status HUD.
|
||||||
|
- [x] Add unit/integration coverage for prerequisites, settling, cancel, commit, and history.
|
||||||
|
- [x] Update editor workflow documentation and implementation checklist.
|
||||||
|
- [x] Run source gates and live Wayland acceptance; packaged tests remain skipped by request.
|
||||||
|
- [x] Commit, push, attach native Gitea evidence, and close #25.
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# Production-Readiness Acceptance Gate
|
||||||
|
|
||||||
|
Working plan for Gitea issue
|
||||||
|
[`#50`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/50).
|
||||||
|
This gate is broader than the M7 feature list: it proves the complete daily authoring, content,
|
||||||
|
recovery, performance, and release workflow against one exact release-candidate commit.
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
Audit in progress. The versioned acceptance matrix exists, but no release candidate is nominated and
|
||||||
|
the gate is not signed off. Packaged/release testing remains explicitly deferred until the project
|
||||||
|
owner requests it again.
|
||||||
|
|
||||||
|
## Sequence
|
||||||
|
|
||||||
|
1. Keep one evidence matrix under `docs/editor/evaluations/production-readiness/`; historical H1-H6
|
||||||
|
notes remain context only.
|
||||||
|
2. Close implementation blockers before nominating a candidate. Renderer foundation `#51`, terrain
|
||||||
|
`#22`-`#24`, physics placement/diagnostics `#25`-`#26`, operator invariants `#33`, collaborative
|
||||||
|
safety `#49`, Material Library/targeted drops `#16`/`#18`, and native-dialog responsiveness `#52`
|
||||||
|
are accepted and integrated.
|
||||||
|
3. Complete the representative regression project, performance budgets, and first-hour workflow
|
||||||
|
tracked by `#32`, `#34`, `#35`, and `#36`.
|
||||||
|
4. Nominate one exact commit, validate it from a clean checkout, and record source/headless results.
|
||||||
|
5. When packaged testing is re-enabled, run the candidate's package/build and packaged-runtime
|
||||||
|
matrix without substituting older artifacts.
|
||||||
|
6. Run the eight-hour soak and measured performance protocol, consolidate limitations by severity
|
||||||
|
and workaround, and obtain independent first-hour/recovery sign-off.
|
||||||
|
7. Post the signed Gitea milestone comment linking the exact commit and immutable evidence. Close
|
||||||
|
`#50` only when every required row passes and no P0 blocker remains.
|
||||||
|
|
||||||
|
## Gate Rules
|
||||||
|
|
||||||
|
- Feature presence is not acceptance evidence.
|
||||||
|
- A local dirty worktree is not a release candidate.
|
||||||
|
- Results from another commit or an old package do not transfer to the candidate.
|
||||||
|
- Deferred, missing, partial, and implementer-only evidence are not passes.
|
||||||
|
- Every failure records an owner ticket or a concrete rerun condition.
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# Renderer Foundation Acceptance Split - 2026-07-12
|
||||||
|
|
||||||
|
Issue: Gitea #51 (`BS-JD-207`)
|
||||||
|
|
||||||
|
## Outcome
|
||||||
|
|
||||||
|
Accept the shipped renderer/material/Surface foundation without claiming two independent future
|
||||||
|
systems. Preserve the existing safe raster/Forward behavior and track each remaining boundary with
|
||||||
|
its own implementation and acceptance contract.
|
||||||
|
|
||||||
|
## Decisions
|
||||||
|
|
||||||
|
- #51 owns stable static/skinned slots, shared Material/Instance assets, Surface ABI parity for
|
||||||
|
eligible geometry, transactional migration, and the honest exclusion of deformed Solari meshes.
|
||||||
|
- #53 owns actual runtime Material Property Block application and promote-to-instance UX. The
|
||||||
|
existing component schema/persistence exclusion is not represented as runtime completion.
|
||||||
|
- #54 owns dynamic post-morph/post-skin buffers and instance BLAS updates. It is a documented P2
|
||||||
|
Solari enhancement, not a raster/Forward production blocker.
|
||||||
|
|
||||||
|
## Work
|
||||||
|
|
||||||
|
- [x] Audit #51 scope and repository evidence against current runtime behavior.
|
||||||
|
- [x] Create focused Gitea follow-ups with independent acceptance criteria.
|
||||||
|
- [x] Correct ADR, material guide, README checklist, evaluation, and production matrix claims.
|
||||||
|
- [x] Run documentation/diff gates, commit, push, and close #51 with exact follow-up links.
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
# Renderer, material, and component foundation
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
|
||||||
|
Separate static and skinned renderer ownership, restore deterministic skinned edit poses, add shared
|
||||||
|
material/material-instance slots, and make authoring components registry-driven and composable.
|
||||||
|
|
||||||
|
## Component foundation milestone
|
||||||
|
|
||||||
|
- Give authoring components immutable IDs distinct from Rust type paths.
|
||||||
|
- Split persisted active state from inspector ordering with legacy-state migration.
|
||||||
|
- Route presence, persistence, add/remove/reset/copy/paste, and component history through Bevy
|
||||||
|
reflection and atomic transactions.
|
||||||
|
- Treat `ActorKind` as a derived compatibility/display hint; validate component data and explicit
|
||||||
|
requirements/conflicts.
|
||||||
|
- Provide one statically linked extension registration helper and reflection round-trip fixture.
|
||||||
|
- Verify registry integrity, transaction undo/redo, scene save inclusion, composition, and legacy
|
||||||
|
enable-state preservation.
|
||||||
|
|
||||||
|
## Related renderer/material milestone
|
||||||
|
|
||||||
|
- Keep `StaticMeshRenderer` and `SkinnedMeshRenderer` as separate authoring and hydration paths.
|
||||||
|
- Give both renderer types stable imported-source/explicit Material slots and preserve orphaned
|
||||||
|
assignments by ID across source changes.
|
||||||
|
- Add versioned Material and direct-base Material Instance assets, sparse editor overrides, shared
|
||||||
|
handle live refresh, and runtime-only property blocks.
|
||||||
|
- Capture and restore imported Transform/MorphWeights baselines; sample only the explicitly chosen
|
||||||
|
default edit clip and never reload a rig for a material-only change.
|
||||||
|
- Compose one validated Surface evaluator into raster and Solari, including normal/emissive/unlit
|
||||||
|
fields and exact cutout candidate acceptance. Safely omit skinned/morph geometry from Solari until
|
||||||
|
instance-owned deformed vertices and dynamic BLAS updates exist.
|
||||||
|
- Upgrade scenes/materials explicitly to schema v4 with dry-run, staged writes, backup, rollback,
|
||||||
|
stable slot normalization, and active-state separation.
|
||||||
|
|
||||||
|
## Acceptance
|
||||||
|
|
||||||
|
- Shared, scene, game, game-hot, editor, Surface, and maintained Solari-fork tests pass.
|
||||||
|
- `cargo --locked validate-levels` reports zero blocking findings.
|
||||||
|
- A second project-upgrade dry run reports no changes after apply.
|
||||||
|
- Editor evidence shows the stable component cards, static/skinned material slots, Material Instance
|
||||||
|
workflow, deterministic animated actor pose, and Surface/Solari diagnostics.
|
||||||
|
- Gitea implementation issue and related roadmap issues link the documentation and screenshot
|
||||||
|
evidence without claiming unsupported dynamic deformed BLAS behavior.
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
# Source-Control Status And Collaborative File Safety
|
||||||
|
|
||||||
|
Working implementation plan for Gitea issue
|
||||||
|
[`#49`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/49).
|
||||||
|
This is the final M7 implementation slice before the production-readiness acceptance gate.
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
Implementation, focused source tests, full editor tests, strict editor clippy, and headless checks
|
||||||
|
are complete. Live debug-editor visual acceptance remains pending for a desktop-capable QA session.
|
||||||
|
Packaged/release acceptance is explicitly deferred until the project owner requests another
|
||||||
|
packaged pass.
|
||||||
|
|
||||||
|
## Outcome
|
||||||
|
|
||||||
|
External edits cannot be silently overwritten by the editor, common Git/read-only/ownership states
|
||||||
|
are visible without dominating the shell, and projects without Git or an ownership provider behave
|
||||||
|
normally.
|
||||||
|
|
||||||
|
## Implementation Sequence
|
||||||
|
|
||||||
|
1. Add exact file revisions, comparison metadata, guarded atomic replacement, and deterministic
|
||||||
|
pre-rename race coverage.
|
||||||
|
2. Capture baselines for scene tabs, material/material-instance drafts, and Project Settings;
|
||||||
|
protect prefab source Apply and exact-file undo/redo with the same guard.
|
||||||
|
3. Add a non-destructive asynchronous Git scanner and optional ownership-provider registry.
|
||||||
|
4. Add compact active-scene and selected-asset status plus a recovery modal with reload, compare
|
||||||
|
metadata, save-as, and cancel.
|
||||||
|
5. Cover missing/present/read-only/external-change races, porcelain parsing, provider absence, and
|
||||||
|
document-specific conflict recovery with focused source tests.
|
||||||
|
6. Run format, strict affected-crate clippy, source tests, headless validation, and live debug-editor
|
||||||
|
QA. Do not run packaged tests until requested by the project owner.
|
||||||
|
|
||||||
|
## Acceptance Gates
|
||||||
|
|
||||||
|
- A loaded authored file changed by another process is never replaced by Save, Apply to source, or
|
||||||
|
prefab source history.
|
||||||
|
- File creation is also conditional: a file that appears after a save-as baseline is captured is
|
||||||
|
not overwritten.
|
||||||
|
- Conflict and read-only UI identifies the path and recovery choices without a force-overwrite
|
||||||
|
escape hatch.
|
||||||
|
- Active-scene and selected-asset Git status remain compact and explain themselves on hover.
|
||||||
|
- Git absence, a non-repository project, and an empty provider registry are quiet normal states.
|
||||||
|
- Git commands are read-only and never alter index, worktree, commits, branches, or locks.
|
||||||
|
- Provider state can block an authored write without coupling core editor code to a vendor.
|
||||||
|
- Source tests simulate a writer changing the target immediately before rename and prove the old or
|
||||||
|
external content survives.
|
||||||
|
|
||||||
|
## Deliberate Boundaries
|
||||||
|
|
||||||
|
- Generated registries, imports, thumbnails, navigation bakes, recovery snapshots, and packages are
|
||||||
|
regenerative/system-owned and do not open authored-file recovery UI.
|
||||||
|
- V1 compares metadata rather than rendering a text diff; external diff-tool integration is future
|
||||||
|
work.
|
||||||
|
- V1 observes ownership/locks. Acquiring, releasing, or stealing locks belongs in a provider-specific
|
||||||
|
follow-up.
|
||||||
|
- Git status is project-local and advisory. The content revision guard remains authoritative even
|
||||||
|
when Git is absent or stale.
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
# Terrain Authoring Foundation
|
||||||
|
|
||||||
|
Working implementation plan for Gitea
|
||||||
|
[`#22`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/22).
|
||||||
|
This establishes the persistent and hydrated terrain contract required by sculpting `#23`, layer
|
||||||
|
painting `#24`, physics placement `#25`, and the regression pack `#32`.
|
||||||
|
|
||||||
|
## Authored Contract
|
||||||
|
|
||||||
|
- Add reflected `TerrainDesc` authoring data with a version, square height-grid resolution, inline
|
||||||
|
finite heights, horizontal sample spacing, vertical scale, chunk quad size, optional shared
|
||||||
|
Material/Material Instance reference, collider generation, and shadow flags.
|
||||||
|
- V1 stores the compact height grid in the scene so save/recovery/history/prefab behavior is exact.
|
||||||
|
A later external heightmap asset migration must be explicit and versioned rather than silently
|
||||||
|
changing ownership.
|
||||||
|
- Validate resolution, exact sample count, finite values, positive scale, and chunk bounds before
|
||||||
|
hydration or publication.
|
||||||
|
|
||||||
|
## Hydration
|
||||||
|
|
||||||
|
- Partition the grid into deterministic non-overlapping quad chunks with shared boundary samples.
|
||||||
|
- Generate triangle-list meshes with normals, UVs, U32 indices, and tangents; each generated child
|
||||||
|
carries owner/chunk coordinates and remains runtime-only.
|
||||||
|
- Use the authored shared material when resolvable and an explicit terrain fallback otherwise.
|
||||||
|
- Optionally attach `ColliderConstructor::TrimeshFromMesh` per chunk.
|
||||||
|
- Rebuild only the owning terrain's generated chunks when descriptor/material/active state changes;
|
||||||
|
disabling/removing terrain cleans every generated child.
|
||||||
|
|
||||||
|
## Editor Integration
|
||||||
|
|
||||||
|
- Register Terrain as a stable authoring component and ActorKind with conflicts against primitive,
|
||||||
|
brush, static renderer, and skinned renderer geometry sources.
|
||||||
|
- Add an inspector for resolution, world scale, chunk size, collider/shadow state, material summary,
|
||||||
|
validation, and a guarded flat-grid resize action. All mutations are one typed history step.
|
||||||
|
- Include terrain bounds in selection framing and generated chunks in authored-parent picking.
|
||||||
|
- Expose Add Terrain through the existing component shelf; no new permanent toolbar is added.
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
- Tests cover descriptor validation, deterministic chunk coverage/mesh topology, hydration and
|
||||||
|
cleanup, generated-child stripping, serialization, and history round-trip.
|
||||||
|
- Source-only workspace format/check/strict-Clippy/tests and level validation run. Packaged tests
|
||||||
|
remain deferred by project-owner direction.
|
||||||
|
- Live native-Wayland acceptance creates or loads a terrain actor, verifies chunk rendering and
|
||||||
|
selection/inspection, changes scale/chunking, exercises undo/redo, and inspects a saved scene to
|
||||||
|
confirm generated chunks are absent.
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# Terrain Material Layers And Weight Painting (#24)
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
- Persist up to four shared Material/Material Instance references on each `TerrainDesc`.
|
||||||
|
- Store normalized RGBA8 layer weights per height sample with an implicit channel-zero default.
|
||||||
|
- Blend layer albedo, normal, metallic, and roughness in the project-owned raster material path.
|
||||||
|
- Assign, clear, reorder, and tile layers from the Terrain inspector.
|
||||||
|
- Paint or erase one selected layer from the existing horizontal viewport toolbar.
|
||||||
|
- Preserve one reflected history transaction per completed pointer stroke and exact cancel restore.
|
||||||
|
|
||||||
|
## Implementation
|
||||||
|
|
||||||
|
1. Extend the backward-compatible terrain schema with four layer descriptors and compact weights.
|
||||||
|
2. Emit normalized weights as terrain chunk vertex colors and attach a runtime-only material binding.
|
||||||
|
3. Build a terrain-specific `ExtendedMaterial` in `blacksite_surface`; keep invalid references on the visible fallback path with diagnostics.
|
||||||
|
4. Add inspector layer controls and a mutually exclusive modal paint operator beside Sculpt.
|
||||||
|
5. Cover serialization, validation, blend transport, paint normalization, cancel, undo, and redo.
|
||||||
|
6. Update ADR 0040, terrain workflow docs, the implementation checklist, and live evidence.
|
||||||
|
|
||||||
|
## Acceptance
|
||||||
|
|
||||||
|
- Two or more project materials visibly blend on one terrain.
|
||||||
|
- Layer weights remain exactly normalized and survive scene save/load.
|
||||||
|
- Live paint preview follows the sampled terrain surface.
|
||||||
|
- Escape/right-click restores exact pre-stroke weights; release creates one undo entry.
|
||||||
|
- Missing or invalid material references remain visible as fallback and produce clear diagnostics.
|
||||||
|
- Formatting, workspace check/clippy/tests, level validation, and live native-Wayland QA pass.
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# Terrain Sculpt Tools (#23)
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
- Add a modal terrain sculpt operator for raise, lower, flatten, smooth, and deterministic noise.
|
||||||
|
- Keep activation and brush settings in the existing horizontal viewport toolbar.
|
||||||
|
- Track a terrain-local cursor hit and render a world-space brush footprint preview.
|
||||||
|
- Apply live stroke previews while preserving one history entry per completed stroke.
|
||||||
|
- Restore the exact pre-stroke height grid on Escape or right-click.
|
||||||
|
|
||||||
|
## Implementation
|
||||||
|
|
||||||
|
1. Add pure heightfield sampling, ray-hit, falloff, and brush-dab functions with focused tests.
|
||||||
|
2. Add editor-only terrain sculpt state and viewport input/preview systems.
|
||||||
|
3. Commit strokes through the reflected component transaction after restoring the pre-stroke snapshot.
|
||||||
|
4. Add compact terrain controls to the existing viewport toolbar and update operator hints.
|
||||||
|
5. Document controls and validation evidence in the terrain editor guide and root checklist.
|
||||||
|
|
||||||
|
## Acceptance
|
||||||
|
|
||||||
|
- All five modes visibly modify terrain.
|
||||||
|
- The brush ring follows the actual terrain surface.
|
||||||
|
- Escape and right-click cancel without dirtying history.
|
||||||
|
- Mouse release creates exactly one undoable transaction regardless of dab count.
|
||||||
|
- Formatting, editor/shared checks, focused tests, and live editor QA pass.
|
||||||
+21
-20
@@ -17,6 +17,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
|
||||||
|
- name: Verify Git LFS checkout
|
||||||
|
run: git lfs fsck
|
||||||
|
|
||||||
- name: Install Linux dependencies
|
- name: Install Linux dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -41,34 +46,30 @@ jobs:
|
|||||||
run: rustup show
|
run: rustup show
|
||||||
|
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
run: cargo fmt --check
|
run: cargo fmt --all --check
|
||||||
|
|
||||||
- name: Check workspace
|
- name: Check workspace
|
||||||
run: cargo check --workspace
|
run: cargo check --workspace --all-targets
|
||||||
|
|
||||||
- name: Clippy
|
- name: Clippy workspace
|
||||||
run: cargo clippy --workspace
|
run: cargo clippy --workspace --all-targets -- -D warnings
|
||||||
|
|
||||||
- name: Clippy foundation crates
|
- name: Test workspace
|
||||||
run: cargo clippy -p game -p shared -- -D warnings
|
run: cargo test --workspace
|
||||||
|
|
||||||
- name: Test foundation helpers
|
|
||||||
run: cargo test -p game --lib
|
|
||||||
|
|
||||||
- name: Test shared hydration and actor validation
|
|
||||||
run: cargo test -p shared
|
|
||||||
|
|
||||||
- name: Test sim crate
|
|
||||||
run: cargo test -p sim
|
|
||||||
|
|
||||||
- name: Validate level scenes
|
- name: Validate level scenes
|
||||||
run: cargo run -p xtask --bin validate-levels
|
run: cargo validate-levels
|
||||||
|
|
||||||
- name: Test scene schema crate
|
- name: Validate editor sample pack
|
||||||
run: cargo test -p scene
|
run: cargo validate-samples
|
||||||
|
|
||||||
- name: Check editor (dev)
|
- name: Assert validation leaves checkout clean
|
||||||
run: cargo check -p editor --features dev
|
run: |
|
||||||
|
git diff --exit-code
|
||||||
|
test -z "$(git ls-files --others --exclude-standard)"
|
||||||
|
|
||||||
|
- name: Clippy launch feature matrix
|
||||||
|
run: cargo clippy -p editor -p game --bins --features dev,hot-reload -- -D warnings
|
||||||
|
|
||||||
- name: Build binaries
|
- name: Build binaries
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# Rust build output
|
# Rust build output
|
||||||
/target/
|
/target/
|
||||||
|
/dist/
|
||||||
|
|
||||||
# Local automation and assistant state
|
# Local automation and assistant state
|
||||||
/.agents/
|
/.agents/
|
||||||
@@ -13,6 +14,7 @@
|
|||||||
# Editor/runtime generated session state
|
# Editor/runtime generated session state
|
||||||
/assets/levels/.pie_session.scn.ron
|
/assets/levels/.pie_session.scn.ron
|
||||||
/assets/.trash/
|
/assets/.trash/
|
||||||
|
/.blacksite/backups/
|
||||||
|
|
||||||
# Backup, temporary, and log files
|
# Backup, temporary, and log files
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
|
|||||||
Vendored
+238
-35
@@ -4,48 +4,251 @@
|
|||||||
{
|
{
|
||||||
"type": "lldb",
|
"type": "lldb",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Debug editor",
|
"name": "Editor: Debug",
|
||||||
"preLaunchTask": "build editor (dev fast-link)",
|
|
||||||
"program": "${workspaceFolder}/target/debug/editor",
|
|
||||||
"args": [],
|
|
||||||
"env": {
|
|
||||||
"BEVY_FPS_HDR": "0",
|
|
||||||
"WGPU_VALIDATION": "0",
|
|
||||||
"CARGO_TARGET_DIR": "${workspaceFolder}/target",
|
|
||||||
"LD_LIBRARY_PATH": "${workspaceFolder}/target/debug/deps:${env:LD_LIBRARY_PATH}"
|
|
||||||
},
|
|
||||||
"cwd": "${workspaceFolder}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "lldb",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "Debug game",
|
|
||||||
"preLaunchTask": "build game (dev fast-link)",
|
|
||||||
"program": "${workspaceFolder}/target/debug/game",
|
|
||||||
"args": [],
|
|
||||||
"env": {
|
|
||||||
"BEVY_FPS_HDR": "0",
|
|
||||||
"WGPU_VALIDATION": "0",
|
|
||||||
"CARGO_TARGET_DIR": "${workspaceFolder}/target",
|
|
||||||
"LD_LIBRARY_PATH": "${workspaceFolder}/target/debug/deps:${env:LD_LIBRARY_PATH}"
|
|
||||||
},
|
|
||||||
"cwd": "${workspaceFolder}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "lldb",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "Run editor (release)",
|
|
||||||
"cargo": {
|
"cargo": {
|
||||||
"args": ["build", "--release", "-p", "editor"],
|
"args": ["build", "-p", "editor", "--bin", "editor", "--features", "dev"],
|
||||||
"filter": { "name": "editor", "kind": "bin" }
|
"filter": { "name": "editor", "kind": "bin" },
|
||||||
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" },
|
||||||
|
"problemMatcher": "$rustc"
|
||||||
},
|
},
|
||||||
"args": [],
|
"args": [],
|
||||||
"env": {
|
"env": {
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
|
"WGPU_VALIDATION": "0",
|
||||||
|
"LD_LIBRARY_PATH": "${workspaceFolder}/target/debug/deps:${env:LD_LIBRARY_PATH}"
|
||||||
|
},
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"terminal": "integrated",
|
||||||
|
"sourceLanguages": ["rust"],
|
||||||
|
"gracefulShutdown": "SIGINT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Editor: GPU validation",
|
||||||
|
"cargo": {
|
||||||
|
"args": ["build", "-p", "editor", "--bin", "editor", "--features", "dev"],
|
||||||
|
"filter": { "name": "editor", "kind": "bin" },
|
||||||
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" },
|
||||||
|
"problemMatcher": "$rustc"
|
||||||
|
},
|
||||||
|
"args": [],
|
||||||
|
"env": {
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
|
"WGPU_VALIDATION": "1",
|
||||||
|
"LD_LIBRARY_PATH": "${workspaceFolder}/target/debug/deps:${env:LD_LIBRARY_PATH}"
|
||||||
|
},
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"terminal": "integrated",
|
||||||
|
"sourceLanguages": ["rust"],
|
||||||
|
"gracefulShutdown": "SIGINT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Editor: Hot reload",
|
||||||
|
"cargo": {
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"-p",
|
||||||
|
"editor",
|
||||||
|
"--bin",
|
||||||
|
"editor",
|
||||||
|
"--features",
|
||||||
|
"dev,hot-reload"
|
||||||
|
],
|
||||||
|
"filter": { "name": "editor", "kind": "bin" },
|
||||||
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" },
|
||||||
|
"problemMatcher": "$rustc"
|
||||||
|
},
|
||||||
|
"args": [],
|
||||||
|
"env": {
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
|
"WGPU_VALIDATION": "0",
|
||||||
|
"LD_LIBRARY_PATH": "${workspaceFolder}/target/debug/deps:${env:LD_LIBRARY_PATH}"
|
||||||
|
},
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"terminal": "integrated",
|
||||||
|
"sourceLanguages": ["rust"],
|
||||||
|
"gracefulShutdown": "SIGINT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Editor: SDR fallback",
|
||||||
|
"cargo": {
|
||||||
|
"args": ["build", "-p", "editor", "--bin", "editor", "--features", "dev"],
|
||||||
|
"filter": { "name": "editor", "kind": "bin" },
|
||||||
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" },
|
||||||
|
"problemMatcher": "$rustc"
|
||||||
|
},
|
||||||
|
"args": [],
|
||||||
|
"env": {
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
"BEVY_FPS_HDR": "0",
|
"BEVY_FPS_HDR": "0",
|
||||||
"WGPU_VALIDATION": "0",
|
"WGPU_VALIDATION": "0",
|
||||||
"LD_LIBRARY_PATH": "${workspaceFolder}/target/release/deps:${env:LD_LIBRARY_PATH}"
|
"LD_LIBRARY_PATH": "${workspaceFolder}/target/debug/deps:${env:LD_LIBRARY_PATH}"
|
||||||
},
|
},
|
||||||
"cwd": "${workspaceFolder}"
|
"cwd": "${workspaceFolder}",
|
||||||
|
"terminal": "integrated",
|
||||||
|
"sourceLanguages": ["rust"],
|
||||||
|
"gracefulShutdown": "SIGINT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Editor: Release",
|
||||||
|
"cargo": {
|
||||||
|
"args": ["build", "--release", "-p", "editor", "--bin", "editor"],
|
||||||
|
"filter": { "name": "editor", "kind": "bin" },
|
||||||
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" },
|
||||||
|
"problemMatcher": "$rustc"
|
||||||
|
},
|
||||||
|
"args": [],
|
||||||
|
"env": { "RUST_BACKTRACE": "1", "WGPU_VALIDATION": "0" },
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"terminal": "integrated",
|
||||||
|
"sourceLanguages": ["rust"],
|
||||||
|
"gracefulShutdown": "SIGINT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Editor: Project root...",
|
||||||
|
"cargo": {
|
||||||
|
"args": ["build", "-p", "editor", "--bin", "editor", "--features", "dev"],
|
||||||
|
"filter": { "name": "editor", "kind": "bin" },
|
||||||
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" },
|
||||||
|
"problemMatcher": "$rustc"
|
||||||
|
},
|
||||||
|
"args": ["--project", "${input:blacksiteProjectRoot}"],
|
||||||
|
"env": {
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
|
"WGPU_VALIDATION": "0",
|
||||||
|
"LD_LIBRARY_PATH": "${workspaceFolder}/target/debug/deps:${env:LD_LIBRARY_PATH}"
|
||||||
|
},
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"terminal": "integrated",
|
||||||
|
"sourceLanguages": ["rust"],
|
||||||
|
"gracefulShutdown": "SIGINT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Game: Debug",
|
||||||
|
"cargo": {
|
||||||
|
"args": ["build", "-p", "game", "--bin", "game", "--features", "dev"],
|
||||||
|
"filter": { "name": "game", "kind": "bin" },
|
||||||
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" },
|
||||||
|
"problemMatcher": "$rustc"
|
||||||
|
},
|
||||||
|
"args": [],
|
||||||
|
"env": {
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
|
"WGPU_VALIDATION": "0",
|
||||||
|
"LD_LIBRARY_PATH": "${workspaceFolder}/target/debug/deps:${env:LD_LIBRARY_PATH}"
|
||||||
|
},
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"terminal": "integrated",
|
||||||
|
"sourceLanguages": ["rust"],
|
||||||
|
"gracefulShutdown": "SIGINT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Game: GPU validation",
|
||||||
|
"cargo": {
|
||||||
|
"args": ["build", "-p", "game", "--bin", "game", "--features", "dev"],
|
||||||
|
"filter": { "name": "game", "kind": "bin" },
|
||||||
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" },
|
||||||
|
"problemMatcher": "$rustc"
|
||||||
|
},
|
||||||
|
"args": [],
|
||||||
|
"env": {
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
|
"WGPU_VALIDATION": "1",
|
||||||
|
"LD_LIBRARY_PATH": "${workspaceFolder}/target/debug/deps:${env:LD_LIBRARY_PATH}"
|
||||||
|
},
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"terminal": "integrated",
|
||||||
|
"sourceLanguages": ["rust"],
|
||||||
|
"gracefulShutdown": "SIGINT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Game: Hot reload",
|
||||||
|
"cargo": {
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"-p",
|
||||||
|
"game",
|
||||||
|
"--bin",
|
||||||
|
"game",
|
||||||
|
"--features",
|
||||||
|
"dev,hot-reload"
|
||||||
|
],
|
||||||
|
"filter": { "name": "game", "kind": "bin" },
|
||||||
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" },
|
||||||
|
"problemMatcher": "$rustc"
|
||||||
|
},
|
||||||
|
"args": [],
|
||||||
|
"env": {
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
|
"WGPU_VALIDATION": "0",
|
||||||
|
"LD_LIBRARY_PATH": "${workspaceFolder}/target/debug/deps:${env:LD_LIBRARY_PATH}"
|
||||||
|
},
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"terminal": "integrated",
|
||||||
|
"sourceLanguages": ["rust"],
|
||||||
|
"gracefulShutdown": "SIGINT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Game: SDR fallback",
|
||||||
|
"cargo": {
|
||||||
|
"args": ["build", "-p", "game", "--bin", "game", "--features", "dev"],
|
||||||
|
"filter": { "name": "game", "kind": "bin" },
|
||||||
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" },
|
||||||
|
"problemMatcher": "$rustc"
|
||||||
|
},
|
||||||
|
"args": [],
|
||||||
|
"env": {
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
|
"BEVY_FPS_HDR": "0",
|
||||||
|
"WGPU_VALIDATION": "0",
|
||||||
|
"LD_LIBRARY_PATH": "${workspaceFolder}/target/debug/deps:${env:LD_LIBRARY_PATH}"
|
||||||
|
},
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"terminal": "integrated",
|
||||||
|
"sourceLanguages": ["rust"],
|
||||||
|
"gracefulShutdown": "SIGINT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Game: Release",
|
||||||
|
"cargo": {
|
||||||
|
"args": ["build", "--release", "-p", "game", "--bin", "game"],
|
||||||
|
"filter": { "name": "game", "kind": "bin" },
|
||||||
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" },
|
||||||
|
"problemMatcher": "$rustc"
|
||||||
|
},
|
||||||
|
"args": [],
|
||||||
|
"env": { "RUST_BACKTRACE": "1", "WGPU_VALIDATION": "0" },
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"terminal": "integrated",
|
||||||
|
"sourceLanguages": ["rust"],
|
||||||
|
"gracefulShutdown": "SIGINT"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"id": "blacksiteProjectRoot",
|
||||||
|
"type": "promptString",
|
||||||
|
"description": "Absolute path to a Blacksite project root",
|
||||||
|
"default": "${workspaceFolder}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Vendored
+159
-55
@@ -2,42 +2,61 @@
|
|||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
{
|
||||||
"label": "cargo fmt (check)",
|
"label": "cargo fmt (workspace check)",
|
||||||
"type": "cargo",
|
"type": "cargo",
|
||||||
"command": "fmt",
|
"command": "fmt",
|
||||||
"args": ["--check"],
|
"args": ["--all", "--check"],
|
||||||
"problemMatcher": [],
|
"problemMatcher": [],
|
||||||
"group": "build"
|
"group": "build"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "cargo check (workspace)",
|
"label": "cargo check (workspace all targets)",
|
||||||
"type": "cargo",
|
"type": "cargo",
|
||||||
"command": "check",
|
"command": "check",
|
||||||
"args": ["--workspace"],
|
"args": ["--workspace", "--all-targets"],
|
||||||
"problemMatcher": ["$rustc"],
|
"problemMatcher": ["$rustc"],
|
||||||
"group": "build"
|
"group": "build"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "cargo clippy (workspace)",
|
"label": "cargo clippy (workspace strict)",
|
||||||
"type": "cargo",
|
"type": "cargo",
|
||||||
"command": "clippy",
|
"command": "clippy",
|
||||||
"args": ["--workspace"],
|
"args": ["--workspace", "--all-targets", "--", "-D", "warnings"],
|
||||||
"problemMatcher": ["$rustc"],
|
"problemMatcher": ["$rustc"],
|
||||||
"group": "build"
|
"group": "build"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "cargo clippy (foundation strict)",
|
"label": "cargo test (workspace)",
|
||||||
"type": "cargo",
|
|
||||||
"command": "clippy",
|
|
||||||
"args": ["-p", "game", "-p", "shared", "--", "-D", "warnings"],
|
|
||||||
"problemMatcher": ["$rustc"],
|
|
||||||
"group": "build"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "cargo test (foundation)",
|
|
||||||
"type": "cargo",
|
"type": "cargo",
|
||||||
"command": "test",
|
"command": "test",
|
||||||
"args": ["-p", "game", "--lib"],
|
"args": ["--workspace"],
|
||||||
|
"problemMatcher": ["$rustc"],
|
||||||
|
"group": "test"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "cargo clippy (launch feature matrix)",
|
||||||
|
"type": "cargo",
|
||||||
|
"command": "clippy",
|
||||||
|
"args": [
|
||||||
|
"-p",
|
||||||
|
"editor",
|
||||||
|
"-p",
|
||||||
|
"game",
|
||||||
|
"--bins",
|
||||||
|
"--features",
|
||||||
|
"dev,hot-reload",
|
||||||
|
"--",
|
||||||
|
"-D",
|
||||||
|
"warnings"
|
||||||
|
],
|
||||||
|
"problemMatcher": ["$rustc"],
|
||||||
|
"group": "build"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "validate level scenes",
|
||||||
|
"type": "cargo",
|
||||||
|
"command": "validate-levels",
|
||||||
|
"args": [],
|
||||||
"problemMatcher": ["$rustc"],
|
"problemMatcher": ["$rustc"],
|
||||||
"group": "test"
|
"group": "test"
|
||||||
},
|
},
|
||||||
@@ -45,7 +64,7 @@
|
|||||||
"label": "build game (debug)",
|
"label": "build game (debug)",
|
||||||
"type": "cargo",
|
"type": "cargo",
|
||||||
"command": "build",
|
"command": "build",
|
||||||
"args": ["-p", "game"],
|
"args": ["-p", "game", "--bin", "game"],
|
||||||
"problemMatcher": ["$rustc"],
|
"problemMatcher": ["$rustc"],
|
||||||
"group": "build"
|
"group": "build"
|
||||||
},
|
},
|
||||||
@@ -53,47 +72,50 @@
|
|||||||
"label": "build editor (debug)",
|
"label": "build editor (debug)",
|
||||||
"type": "cargo",
|
"type": "cargo",
|
||||||
"command": "build",
|
"command": "build",
|
||||||
"args": ["-p", "editor"],
|
"args": ["-p", "editor", "--bin", "editor"],
|
||||||
"problemMatcher": ["$rustc"],
|
"problemMatcher": ["$rustc"],
|
||||||
"group": { "kind": "build", "isDefault": true }
|
"group": "build"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "build editor (dev fast-link)",
|
"label": "build editor (dev fast-link)",
|
||||||
"type": "cargo",
|
"type": "cargo",
|
||||||
"command": "build",
|
"command": "build",
|
||||||
"args": ["-p", "editor", "--features", "dev"],
|
"args": ["-p", "editor", "--bin", "editor", "--features", "dev"],
|
||||||
"options": {
|
"options": {
|
||||||
"env": {
|
"cwd": "${workspaceFolder}",
|
||||||
"CARGO_TARGET_DIR": "${workspaceFolder}/target"
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"problemMatcher": ["$rustc"],
|
"problemMatcher": ["$rustc"],
|
||||||
"group": "build"
|
"group": { "kind": "build", "isDefault": true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "build game (dev fast-link)",
|
"label": "build game (dev fast-link)",
|
||||||
"type": "cargo",
|
"type": "cargo",
|
||||||
"command": "build",
|
"command": "build",
|
||||||
"args": ["-p", "game", "--features", "dev"],
|
"args": ["-p", "game", "--bin", "game", "--features", "dev"],
|
||||||
"options": {
|
"options": {
|
||||||
"env": {
|
"cwd": "${workspaceFolder}",
|
||||||
"CARGO_TARGET_DIR": "${workspaceFolder}/target"
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"problemMatcher": ["$rustc"],
|
"problemMatcher": ["$rustc"],
|
||||||
"group": "build"
|
"group": "build"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "clean build editor (dev)",
|
"label": "clean dev-link crates",
|
||||||
"type": "shell",
|
"type": "cargo",
|
||||||
"command": "cargo clean -p editor && cargo build -p editor --features dev",
|
"command": "clean",
|
||||||
|
"args": ["-p", "editor", "-p", "game", "-p", "game_hot", "-p", "shared"],
|
||||||
"options": {
|
"options": {
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"env": {
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" }
|
||||||
"CARGO_TARGET_DIR": "${workspaceFolder}/target"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"problemMatcher": ["$rustc"],
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "clean build editor (dev)",
|
||||||
|
"dependsOrder": "sequence",
|
||||||
|
"dependsOn": ["clean dev-link crates", "build editor (dev fast-link)"],
|
||||||
|
"problemMatcher": [],
|
||||||
"group": "build"
|
"group": "build"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -102,9 +124,7 @@
|
|||||||
"command": "cargo clean-target",
|
"command": "cargo clean-target",
|
||||||
"options": {
|
"options": {
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"env": {
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" }
|
||||||
"CARGO_TARGET_DIR": "${workspaceFolder}/target"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"problemMatcher": [],
|
"problemMatcher": [],
|
||||||
"group": "build"
|
"group": "build"
|
||||||
@@ -115,9 +135,18 @@
|
|||||||
"command": "cargo clean-target --apply",
|
"command": "cargo clean-target --apply",
|
||||||
"options": {
|
"options": {
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"env": {
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" }
|
||||||
"CARGO_TARGET_DIR": "${workspaceFolder}/target"
|
},
|
||||||
}
|
"problemMatcher": [],
|
||||||
|
"group": "build"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "target cleanup (deep stale, 3 days)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "cargo clean-target --include-artifacts --days 3 --apply",
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" }
|
||||||
},
|
},
|
||||||
"problemMatcher": [],
|
"problemMatcher": [],
|
||||||
"group": "build"
|
"group": "build"
|
||||||
@@ -126,10 +155,11 @@
|
|||||||
"label": "run editor (dev fast-link)",
|
"label": "run editor (dev fast-link)",
|
||||||
"type": "cargo",
|
"type": "cargo",
|
||||||
"command": "run",
|
"command": "run",
|
||||||
"args": ["-p", "editor", "--features", "dev"],
|
"args": ["-p", "editor", "--bin", "editor", "--features", "dev"],
|
||||||
"options": {
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
"env": {
|
"env": {
|
||||||
"BEVY_FPS_HDR": "0",
|
"RUST_BACKTRACE": "1",
|
||||||
"WGPU_VALIDATION": "0",
|
"WGPU_VALIDATION": "0",
|
||||||
"CARGO_TARGET_DIR": "${workspaceFolder}/target"
|
"CARGO_TARGET_DIR": "${workspaceFolder}/target"
|
||||||
}
|
}
|
||||||
@@ -141,9 +171,83 @@
|
|||||||
"label": "run game (dev fast-link)",
|
"label": "run game (dev fast-link)",
|
||||||
"type": "cargo",
|
"type": "cargo",
|
||||||
"command": "run",
|
"command": "run",
|
||||||
"args": ["-p", "game", "--features", "dev"],
|
"args": ["-p", "game", "--bin", "game", "--features", "dev"],
|
||||||
"options": {
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
"env": {
|
"env": {
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
|
"WGPU_VALIDATION": "0",
|
||||||
|
"CARGO_TARGET_DIR": "${workspaceFolder}/target"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"problemMatcher": ["$rustc"],
|
||||||
|
"group": "build"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "run editor (hot reload)",
|
||||||
|
"type": "cargo",
|
||||||
|
"command": "run",
|
||||||
|
"args": [
|
||||||
|
"-p",
|
||||||
|
"editor",
|
||||||
|
"--bin",
|
||||||
|
"editor",
|
||||||
|
"--features",
|
||||||
|
"dev,hot-reload"
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"env": {
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
|
"WGPU_VALIDATION": "0",
|
||||||
|
"CARGO_TARGET_DIR": "${workspaceFolder}/target"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"problemMatcher": ["$rustc"],
|
||||||
|
"group": "build"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "run game (hot reload)",
|
||||||
|
"type": "cargo",
|
||||||
|
"command": "run",
|
||||||
|
"args": ["-p", "game", "--bin", "game", "--features", "dev,hot-reload"],
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"env": {
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
|
"WGPU_VALIDATION": "0",
|
||||||
|
"CARGO_TARGET_DIR": "${workspaceFolder}/target"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"problemMatcher": ["$rustc"],
|
||||||
|
"group": "build"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "run editor (SDR fallback)",
|
||||||
|
"type": "cargo",
|
||||||
|
"command": "run",
|
||||||
|
"args": ["-p", "editor", "--bin", "editor", "--features", "dev"],
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"env": {
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
|
"BEVY_FPS_HDR": "0",
|
||||||
|
"WGPU_VALIDATION": "0",
|
||||||
|
"CARGO_TARGET_DIR": "${workspaceFolder}/target"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"problemMatcher": ["$rustc"],
|
||||||
|
"group": "build"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "run game (SDR fallback)",
|
||||||
|
"type": "cargo",
|
||||||
|
"command": "run",
|
||||||
|
"args": ["-p", "game", "--bin", "game", "--features", "dev"],
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"env": {
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
"BEVY_FPS_HDR": "0",
|
"BEVY_FPS_HDR": "0",
|
||||||
"WGPU_VALIDATION": "0",
|
"WGPU_VALIDATION": "0",
|
||||||
"CARGO_TARGET_DIR": "${workspaceFolder}/target"
|
"CARGO_TARGET_DIR": "${workspaceFolder}/target"
|
||||||
@@ -158,28 +262,28 @@
|
|||||||
"command": "cargo watch -w crates/game_hot -w crates/sim -x \"build -p game_hot --features dylib\"",
|
"command": "cargo watch -w crates/game_hot -w crates/sim -x \"build -p game_hot --features dylib\"",
|
||||||
"options": {
|
"options": {
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"env": {
|
"env": { "CARGO_TARGET_DIR": "${workspaceFolder}/target" }
|
||||||
"CARGO_TARGET_DIR": "${workspaceFolder}/target"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"problemMatcher": ["$rustc"],
|
"problemMatcher": ["$rustc"],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"isBackground": true
|
"isBackground": true,
|
||||||
|
"detail": "Requires cargo-watch: cargo install cargo-watch --locked"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "verify foundation",
|
"label": "verify workspace",
|
||||||
"dependsOrder": "sequence",
|
"dependsOrder": "sequence",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"cargo fmt (check)",
|
"cargo fmt (workspace check)",
|
||||||
"cargo check (workspace)",
|
"cargo check (workspace all targets)",
|
||||||
"cargo clippy (workspace)",
|
"cargo clippy (workspace strict)",
|
||||||
"cargo clippy (foundation strict)",
|
"cargo test (workspace)",
|
||||||
"cargo test (foundation)",
|
"cargo clippy (launch feature matrix)",
|
||||||
|
"validate level scenes",
|
||||||
"build game (debug)",
|
"build game (debug)",
|
||||||
"build editor (debug)"
|
"build editor (debug)"
|
||||||
],
|
],
|
||||||
"problemMatcher": [],
|
"problemMatcher": [],
|
||||||
"group": { "kind": "build", "isDefault": true }
|
"group": "build"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Generated
+1674
-1314
File diff suppressed because it is too large.
Load diff
+53
-11
@@ -1,5 +1,6 @@
|
|||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
|
"crates/blacksite_surface",
|
||||||
"crates/game",
|
"crates/game",
|
||||||
"crates/game_hot",
|
"crates/game_hot",
|
||||||
"crates/shared",
|
"crates/shared",
|
||||||
@@ -18,7 +19,7 @@ edition = "2021"
|
|||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
avian3d = { version = "0.6", default-features = false, features = [
|
avian3d = { version = "0.7", default-features = false, features = [
|
||||||
"3d",
|
"3d",
|
||||||
"f32",
|
"f32",
|
||||||
"parry-f32",
|
"parry-f32",
|
||||||
@@ -26,16 +27,27 @@ avian3d = { version = "0.6", default-features = false, features = [
|
|||||||
"collider-from-mesh",
|
"collider-from-mesh",
|
||||||
"serialize",
|
"serialize",
|
||||||
] }
|
] }
|
||||||
bevy = { version = "0.18", features = ["serialize", "jpeg"] }
|
bevy = { version = "0.19", features = [
|
||||||
bevy_core_pipeline = "0.18"
|
"serialize",
|
||||||
bevy_solari = "0.18"
|
"jpeg",
|
||||||
bevy_ufbx = "0.18"
|
"vorbis",
|
||||||
bevy_egui = "0.39"
|
"wav",
|
||||||
bevy-inspector-egui = "0.36"
|
"mp3",
|
||||||
egui_dock = { version = "0.18", features = ["serde"] }
|
"flac",
|
||||||
egui_phosphor_icons = "0.2"
|
] }
|
||||||
|
bevy_core_pipeline = "0.19"
|
||||||
|
bevy_solari = "0.19"
|
||||||
|
blacksite_surface = { path = "crates/blacksite_surface" }
|
||||||
|
bevy_ufbx = "0.18.1-rc.1"
|
||||||
|
bevy_egui = "0.40"
|
||||||
|
bevy-inspector-egui = "0.37"
|
||||||
|
egui_dock = { version = "0.19.1", features = ["serde"] }
|
||||||
|
egui_phosphor_icons = { version = "0.3.1", default-features = false }
|
||||||
transform-gizmo-bevy = "0.9"
|
transform-gizmo-bevy = "0.9"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
|
nav_glam = { package = "glam", version = "=0.30.10", features = ["serde"] }
|
||||||
|
polyanya = { version = "=0.16.1", default-features = false, features = ["recast", "serde"] }
|
||||||
|
rerecast = { version = "=0.3.2", default-features = false, features = ["std", "serialize"] }
|
||||||
shared = { path = "crates/shared" }
|
shared = { path = "crates/shared" }
|
||||||
game = { path = "crates/game" }
|
game = { path = "crates/game" }
|
||||||
game_hot = { path = "crates/game_hot" }
|
game_hot = { path = "crates/game_hot" }
|
||||||
@@ -45,8 +57,12 @@ settings = { path = "crates/settings" }
|
|||||||
scene = { path = "crates/scene" }
|
scene = { path = "crates/scene" }
|
||||||
|
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
# Linux surface acquire timeouts can be transient on Wayland/Xwayland drivers.
|
# Blacksite Surface ABI and deformation-safety integration for Solari.
|
||||||
bevy_render = { path = "third_party/bevy_render" }
|
bevy_solari = { path = "third_party/bevy_solari" }
|
||||||
|
# Local Bevy 0.19 compatibility patch until upstream publishes a matching FBX loader.
|
||||||
|
bevy_ufbx = { path = "third_party/bevy_ufbx" }
|
||||||
|
# Lossless RON editing fixes used by transactional prefab source edits.
|
||||||
|
ron-edit = { path = "third_party/ron-edit" }
|
||||||
# Atmosphere-aware mesh view bind groups (WYSIWYG editor + transform gizmos).
|
# Atmosphere-aware mesh view bind groups (WYSIWYG editor + transform gizmos).
|
||||||
transform-gizmo-bevy = { path = "third_party/transform-gizmo-bevy" }
|
transform-gizmo-bevy = { path = "third_party/transform-gizmo-bevy" }
|
||||||
|
|
||||||
@@ -59,7 +75,33 @@ rpath = true
|
|||||||
[profile.dev.package."*"]
|
[profile.dev.package."*"]
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
|
||||||
|
# Tests keep source line information without retaining full multi-gigabyte Bevy
|
||||||
|
# debug images or incremental caches. The dev profile remains fully debuggable.
|
||||||
|
[profile.test]
|
||||||
|
opt-level = 1
|
||||||
|
debug = "line-tables-only"
|
||||||
|
incremental = false
|
||||||
|
|
||||||
|
[profile.test.package."*"]
|
||||||
|
opt-level = 3
|
||||||
|
|
||||||
# A snappy release profile for shipping builds.
|
# A snappy release profile for shipping builds.
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = "thin"
|
lto = "thin"
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
|
strip = "symbols"
|
||||||
|
|
||||||
|
# Export profiles keep runtime optimization and compact binaries without forcing
|
||||||
|
# release LTO into normal editor iteration.
|
||||||
|
[profile.package-dev]
|
||||||
|
inherits = "release"
|
||||||
|
lto = false
|
||||||
|
codegen-units = 16
|
||||||
|
strip = "symbols"
|
||||||
|
|
||||||
|
[profile.package-qa]
|
||||||
|
inherits = "release"
|
||||||
|
lto = false
|
||||||
|
codegen-units = 8
|
||||||
|
debug = "line-tables-only"
|
||||||
|
strip = "none"
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# Bevy FPS Foundation
|
# Bevy FPS Foundation
|
||||||
|
|
||||||
A modular first-person game foundation and in-process editor built on **Bevy 0.18** and
|
A modular first-person game foundation and in-process editor built on **Bevy 0.19** and
|
||||||
**Avian 0.6** physics.
|
**Avian 0.7** physics.
|
||||||
|
|
||||||
The runtime game provides a high-fidelity PBR stack (HDR, procedural atmosphere + image-based
|
The runtime game provides a high-fidelity PBR stack (HDR, procedural atmosphere + image-based
|
||||||
lighting, cascaded shadows, SSAO, TAA, bloom, fog, ACES tonemapping) plus Hybrid Auto Solari
|
lighting, cascaded shadows, SSAO, TAA, bloom, fog, ACES tonemapping) plus Hybrid Auto Solari
|
||||||
@@ -21,12 +21,19 @@ native Bevy scene save/load, and BRP support for external tooling.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Check everything
|
# Check everything
|
||||||
cargo fmt --check
|
cargo fmt --all --check
|
||||||
cargo check --workspace
|
cargo check --workspace --all-targets
|
||||||
cargo clippy --workspace
|
cargo clippy --workspace --all-targets -- -D warnings
|
||||||
cargo clippy -p game -p shared -p protocol -p sim -- -D warnings
|
cargo clippy -p editor -p game --bins --features dev,hot-reload -- -D warnings
|
||||||
cargo test -p game --lib
|
cargo test --workspace
|
||||||
cargo test -p sim
|
cargo validate-levels
|
||||||
|
cargo validate-samples
|
||||||
|
cargo bake-navigation --project . --check
|
||||||
|
# Validate one artifact without opening a game window
|
||||||
|
cargo run -p game -- --validate-navigation assets/navigation/generated/navigation_showcase_humanoid.nav.ron
|
||||||
|
# Machine-readable project dependency and finding report
|
||||||
|
cargo validate-levels --json
|
||||||
|
cargo package-project --profile development
|
||||||
|
|
||||||
# Runtime game
|
# Runtime game
|
||||||
cargo run -p game
|
cargo run -p game
|
||||||
@@ -37,6 +44,23 @@ cargo run -p editor
|
|||||||
cargo run -p editor --features dev
|
cargo run -p editor --features dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The standalone `game` binary loads `default_level` from `assets/project.ron` as the initial authored
|
||||||
|
scene. That entrypoint must be a regular `.scn.ron` file under `assets/levels/` so validation audits
|
||||||
|
its complete runtime dependency graph. The in-process editor defers that bootstrap to its scene tabs
|
||||||
|
and `SceneIo`, so opening the editor never creates a competing runtime scene root.
|
||||||
|
|
||||||
|
Open a different validated Blacksite project before engine startup:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cargo run -p editor --features dev -- --project /path/to/project
|
||||||
|
cargo run -p editor --bin project_launcher --features dev
|
||||||
|
```
|
||||||
|
|
||||||
|
The installed **Blacksite Editor** desktop entry also exposes **Open Project Browser** from its
|
||||||
|
desktop action menu. In the editor, **File > Switch Project...** uses the guarded Save All / Discard /
|
||||||
|
Cancel shutdown path before opening the same browser; choosing a project starts a fresh editor
|
||||||
|
process with that root.
|
||||||
|
|
||||||
### Hot reload (gameplay iteration)
|
### Hot reload (gameplay iteration)
|
||||||
|
|
||||||
`--features dev` turns on Bevy **dynamic linking** for faster rebuilds (recommended day-to-day).
|
`--features dev` turns on Bevy **dynamic linking** for faster rebuilds (recommended day-to-day).
|
||||||
@@ -53,7 +77,7 @@ cargo watch -w crates/game_hot -w crates/sim -x "build -p game_hot --features dy
|
|||||||
cargo run -p editor --features dev,hot-reload
|
cargo run -p editor --features dev,hot-reload
|
||||||
```
|
```
|
||||||
|
|
||||||
Or use the VS Code task **watch game_hot (hot reload)** alongside **run editor (dev fast-link)** (enable the `hot-reload` feature on the editor run task when using dylib iteration).
|
Or use the VS Code task **watch game_hot (hot reload)** alongside **run editor (hot reload)**, or choose **Editor: Hot reload** in Run and Debug. The watcher task requires `cargo-watch` (`cargo install cargo-watch --locked`).
|
||||||
|
|
||||||
| Input | Action |
|
| Input | Action |
|
||||||
|-------|--------|
|
|-------|--------|
|
||||||
@@ -76,15 +100,22 @@ Cargo/Bevy debug artifacts can grow quickly. Use the workspace cleanup task befo
|
|||||||
| `cargo clean-target --apply` | Safe cleanup: removes incremental and rust-analyzer flycheck cache. |
|
| `cargo clean-target --apply` | Safe cleanup: removes incremental and rust-analyzer flycheck cache. |
|
||||||
| `cargo clean-target --include-artifacts --days 3 --apply` | Deeper cleanup: also removes stale hashed `deps`, `build`, `.fingerprint`, and example artifacts older than 3 days. Cargo will rebuild anything still needed. |
|
| `cargo clean-target --include-artifacts --days 3 --apply` | Deeper cleanup: also removes stale hashed `deps`, `build`, `.fingerprint`, and example artifacts older than 3 days. Cargo will rebuild anything still needed. |
|
||||||
|
|
||||||
VS Code tasks: **target cleanup (dry run)** and **target cleanup (safe apply)**.
|
Use the safe cleanup during normal iteration and the three-day deep cleanup after Bevy upgrades,
|
||||||
|
feature-matrix builds, or large test runs. The cutoff preserves recent artifacts and avoids the full
|
||||||
|
rebuild caused by `cargo clean`. The workspace test profile keeps line tables but disables full test
|
||||||
|
debuginfo and incremental test caches, so routine test binaries stay materially smaller without
|
||||||
|
reducing normal editor debugging fidelity. The cleanup binary deliberately excludes the scene/Bevy
|
||||||
|
validation dependency; `cargo clean-target` therefore stays cheap even from a cold target. Use
|
||||||
|
`cargo validate-levels` when level and prefab-graph validation is required. VS Code tasks expose dry-run, safe, and
|
||||||
|
deep-stale variants.
|
||||||
|
|
||||||
### Launch Troubleshooting
|
### Launch Troubleshooting
|
||||||
|
|
||||||
- The native game/editor windows force an opaque Wayland surface and opaque camera clears to avoid compositor alpha issues on mixed HDR/SDR desktops.
|
- The native game/editor windows force an opaque Wayland surface and opaque camera clears to avoid compositor alpha issues on mixed HDR/SDR desktops.
|
||||||
- If the window maps but appears transparent on Hyprland or another Wayland compositor, launch with `BEVY_FPS_HDR=0` to force the SDR camera path while debugging monitor/compositor behavior.
|
- If the window maps but appears transparent on Hyprland or another Wayland compositor, launch with `BEVY_FPS_HDR=0` to force the SDR camera path while debugging monitor/compositor behavior.
|
||||||
- The workspace patches `bevy_render` locally so transient Linux swapchain acquire timeouts skip one frame instead of panicking in `prepare_windows`.
|
- Bevy 0.19 removed the prior local `bevy_render` swapchain-timeout patch; launch troubleshooting should start from current wgpu/driver/compositor logs.
|
||||||
- Debug launch configs and run tasks set `WGPU_VALIDATION=0` to quiet the known wgpu/Vulkan validation-layer warning `VUID-StandaloneSpirv-MemorySemantics-10871`. This only disables the Vulkan validation layer for those launches; Rust panics and application errors still surface normally.
|
- Normal Debug and run configurations preserve project HDR and set `WGPU_VALIDATION=0` to suppress known Bevy/Solari Vulkan memory-model VUID noise on this stack. Use **GPU validation** when actively debugging renderer work; it forces `WGPU_VALIDATION=1` and may report those known upstream/driver messages. Use **SDR fallback** for compositor/HDR mapping failures; it additionally sets `BEVY_FPS_HDR=0`.
|
||||||
- If **CodeLLDB / mold** fails with hundreds of `undefined symbol` linker errors, the incremental `target/` cache is stale. Run the VS Code task **clean build editor (dev)** or `cargo clean -p editor && cargo build -p editor --features dev`, then launch **Debug editor** again. Use `cargo run -p editor --features dev` from the terminal if you need `libbevy_dylib` on `LD_LIBRARY_PATH` automatically.
|
- If **CodeLLDB / mold** fails with hundreds of `undefined symbol` linker errors, the incremental `target/` cache is stale. Run the VS Code task **clean build editor (dev)** or `cargo clean -p editor -p game -p game_hot -p shared && cargo build -p editor --bin editor --features dev`, then launch **Editor: Debug** again. Use `cargo run -p editor --features dev` from the terminal if you need `libbevy_dylib` on `LD_LIBRARY_PATH` automatically.
|
||||||
|
|
||||||
## Editor Controls
|
## Editor Controls
|
||||||
|
|
||||||
@@ -106,29 +137,49 @@ VS Code tasks: **target cleanup (dry run)** and **target cleanup (safe apply)**.
|
|||||||
| Click empty viewport / `Esc` | Deselect |
|
| Click empty viewport / `Esc` | Deselect |
|
||||||
| `Delete` / `Backspace` | Delete selection |
|
| `Delete` / `Backspace` | Delete selection |
|
||||||
| `Ctrl+D` | Duplicate selection |
|
| `Ctrl+D` | Duplicate selection |
|
||||||
| `Ctrl+Z` / `Ctrl+Shift+Z` / `Ctrl+Y` | Undo / redo |
|
| `Ctrl+Z` / `Ctrl+Shift+Z` / `Ctrl+Y` | Undo / redo; returning exactly to the last loaded or saved authored state clears that scene tab's dirty marker |
|
||||||
| `F2` in Hierarchy | Rename selection |
|
| `F2` in Hierarchy | Rename selection |
|
||||||
| `W` / `E` / `R` | Translate / rotate / scale gizmo |
|
| `W` / `E` / `R` | Translate / rotate / scale gizmo; multi-selection uses one grouped gizmo and undo step |
|
||||||
| `X` | Toggle world/local gizmo orientation |
|
| `X` | Toggle world/local gizmo orientation |
|
||||||
| `B` | Enter Draw Brush mode |
|
| `B` | Enter Draw Brush mode |
|
||||||
| Draw Brush: LMB / `Enter` / `Esc` / `Backspace` | Place floor points / create brush / cancel / remove last point |
|
| Draw Brush: LMB / `Enter` / mouse up-down / `Esc` / `Backspace` | Place floor points / enter height phase or create / set height / cancel / remove point or return to outline |
|
||||||
| Brush selected: `1` / `2` / `3` / `4` | Vertex / edge / face / clip edit modes |
|
| Brush selected: `1` / `2` / `3` / `4` | Vertex / edge / face / clip edit modes |
|
||||||
| Brush edit mode: LMB / `Shift+LMB` / `Esc` | Select element / toggle element selection / return to object mode |
|
| Brush edit mode: LMB / `Shift+LMB` / `W` / `E` / `R` / `Esc` | Select element / toggle element selection / move / rotate / scale selected brush elements / return to object mode |
|
||||||
| Viewport toolbar (sun / brush / box icons) | Shading: Lit, Unlit (albedo), Colliders (mesh off) |
|
| Viewport toolbar (sun / brush / box icons) | Shading: Lit, Unlit (albedo), Colliders (mesh off) |
|
||||||
| Viewport eye/options | Toggle actor root icon categories, adjust icon/gizmo size, and control colliders, lights, spawns, prefab/model anchors, and runtime player/camera visualizers |
|
| Collider viewport mode | Inspect world-scale box/sphere/capsule overlays and cooked mesh bounds; green/cyan/gray/amber/red identify ready/trigger/disabled/warning/invalid state, with selected health in the lower-left HUD |
|
||||||
|
| Viewport eye/options | Toggle actor root icon categories, adjust icon/gizmo size, and control colliders, lights, spawns, gameplay markers, volumes, prefab/model anchors, and runtime player/camera visualizers |
|
||||||
| `Tab` in viewport | Cycle selection through overlapping objects at last click |
|
| `Tab` in viewport | Cycle selection through overlapping objects at last click |
|
||||||
|
| Viewport selection/orientation HUD | Identify the primary selection, multi-selection count, overlapping-pick position, camera axes, shading mode, and active render path |
|
||||||
| Click Player visualizer in Edit mode | Select or create the authored `PlayerSpawn` (`Player Start`) |
|
| Click Player visualizer in Edit mode | Select or create the authored `PlayerSpawn` (`Player Start`) |
|
||||||
| Select Project Sun | Inspect project default lighting; create a scene sun override |
|
| Select Project Sun | Inspect project default lighting; create a scene sun override |
|
||||||
| Asset Browser project/file views | Browse `assets/`, search/filter/sort, switch grid/list, expand model subassets with generated thumbnails, inspect staged import/material settings, drag assets/submeshes into the viewport |
|
| Asset Browser project/file views | Browse `assets/`, search/filter/sort models, textures, materials, audio clips, levels, and prefabs; switch grid/list; expand model subassets; inspect file details; audition audio; drag supported assets/submeshes into the viewport |
|
||||||
|
| Drag audio clip into viewport | Create an authored audio source; when an audio source is selected, assign the clip instead |
|
||||||
| Asset Browser context/details actions | Apply textures/materials, regenerate thumbnails, reimport models, place assets/submeshes, or move file assets to `assets/.trash/` |
|
| Asset Browser context/details actions | Apply textures/materials, regenerate thumbnails, reimport models, place assets/submeshes, or move file assets to `assets/.trash/` |
|
||||||
| `Ctrl+P` | Command palette; type to filter, use arrow keys to select, Enter to run (`scene.reset_lighting`, `selection.group`, `selection.focus`, `selection.reset_transform`, play commands) |
|
| Window → Material Library | Search/filter project Materials and Material Instances, inspect scene usage and dependency health, create/edit shared assets, and drag them into the viewport |
|
||||||
|
| Drag Material/Instance onto viewport surface | Preview and assign the exact renderer slot, primitive, or brush face under the pointer; release commits one undo step, while Escape/right-click/outside restores the preview |
|
||||||
|
| Drag Texture onto viewport surface | Set a primitive base-color texture or exact brush face; renderer slots reject loose textures and direct you to a Material Instance |
|
||||||
|
| Static/Skinned Mesh Renderer material slots | Assign a shared Material/Material Instance per slot; Browse/Select/Locate the reference, or Clear the override to restore the imported source material |
|
||||||
|
| `Ctrl+P` | Centered command palette; search human labels or stable command IDs, use arrow keys to select, Enter to run |
|
||||||
| `F7` | While paused in Play: advance one sim tick |
|
| `F7` | While paused in Play: advance one sim tick |
|
||||||
| Shift/Ctrl + click (Hierarchy) | Additive selection |
|
| Shift/Ctrl + click (Hierarchy) | Additive selection |
|
||||||
| Hierarchy context | Reparent to other selection / Unparent |
|
| Drag actor row onto another actor (Hierarchy) | Attach/reparent while preserving world placement; multi-selection keeps existing subtrees and commits one undo step |
|
||||||
| File menu | New, Open, Save, Save As, Import Assets, Export Selection, Save Selection As Prefab, Recent Scenes |
|
| Drag actor between rows / onto Scene Root (Hierarchy, Manual sort) | Reorder siblings / unparent to the root |
|
||||||
|
| Hierarchy lock | Excludes the actor from selection, gizmos, multi-drag, structural drops, and mutating context actions |
|
||||||
|
| Hierarchy context | Group selection, create authored local children below linked prefab roots, remove/reparent generated members through same-layer structural overrides, or unparent |
|
||||||
|
| File menu | New, non-blocking native Open/Save As, **Open Sample** for the five-area regression pack, recovery restore/keep-copy/discard when available, Import Assets, Export Selection, Save Selection As Prefab (including linked-root variants), Recent Scenes, Switch Project, and Quit |
|
||||||
|
| Window close / **File > Quit** | Clean sessions exit immediately; dirty scene tabs use one non-blocking **Save All / Discard / Cancel** decision, and cancel or failed saves keep the editor open |
|
||||||
|
| Status strip / Asset Details source-state chip | Inspect compact clean, modified, untracked, conflicted, read-only, and optional ownership status; hover for the source path and provider details |
|
||||||
|
| Authored File Not Saved dialog | Resolve an external edit, read-only target, or ownership lock with Reload, Compare Metadata, Save As, or Cancel; the editor never offers force overwrite |
|
||||||
|
| Main toolbar, right side | Switch or close independent scene tabs, create an untitled tab, and manage loaded/locked composed subscenes |
|
||||||
|
| Prefab Instance inspector | Inspect/recover source health, Apply/Revert overrides by scope, Apply overrides to source, create a variant, **Unpack Layer**, or recursively **Convert to Local** |
|
||||||
| Inspector component card | Collapse with caret, toggle active with status dot, or use triple-dot menu for reset/copy/paste/move/remove actions |
|
| Inspector component card | Collapse with caret, toggle active with status dot, or use triple-dot menu for reset/copy/paste/move/remove actions |
|
||||||
| Inspector footer → Add Component | Expands an inline search shelf for registered authoring, rendering, physics, gameplay, and volume components with descriptions, availability hints, and undo |
|
| Inspector footer → Add Component | Expands an inline search shelf for registered authoring, rendering, physics, gameplay, and volume components with descriptions, availability hints, and undo |
|
||||||
| Edit → Project Settings… | Edit `assets/project.ron` (rendering, physics, input) |
|
| Inspector footer → Add Component → Terrain | Add a height-grid terrain actor; configure grid scale/chunking/collision in its component card and use Resize Flat only for deliberate grid replacement |
|
||||||
|
| Selected Terrain → viewport mountains tool | Sculpt Raise/Lower/Flatten/Smooth/Noise strokes with a terrain-following footprint; release commits one undo step, while Escape/right-click restores the pre-stroke grid |
|
||||||
|
| Terrain card → Material Layers; selected Terrain → viewport paint tool | Assign up to four shared materials, then Paint/Erase normalized layer weights with live blended preview; release commits one undo step and Escape/right-click restores the pre-stroke map |
|
||||||
|
| Selected physics props → viewport hand/down-arrow tool | Release the selection into real gravity/colliders; check commits one grouped transform edit, while Escape/X restores the exact starting state |
|
||||||
|
| Audio Source / Listener inspector | Assign and audition clips; edit gain, pitch, loop/autoplay, spatial blend, attenuation, bus, listener priority, and ear gap |
|
||||||
|
| Edit → Project Settings… | Edit `assets/project.ron` rendering, audio buses, physics, and input |
|
||||||
|
|
||||||
Viewport shortcut keys require the pointer to be in the viewport and are suspended while typing in egui text fields or actively using camera navigation. `Delete`, `Backspace`, duplicate, and undo/redo also defer to text-field focus.
|
Viewport shortcut keys require the pointer to be in the viewport and are suspended while typing in egui text fields or actively using camera navigation. `Delete`, `Backspace`, duplicate, and undo/redo also defer to text-field focus.
|
||||||
|
|
||||||
@@ -168,7 +219,18 @@ Viewport shortcut keys require the pointer to be in the viewport and are suspend
|
|||||||
## Scene Workflow
|
## Scene Workflow
|
||||||
|
|
||||||
- Levels are saved as native Bevy dynamic scenes under `assets/levels/`.
|
- Levels are saved as native Bevy dynamic scenes under `assets/levels/`.
|
||||||
|
- Scene tabs live at the right end of the existing main toolbar. Open creates another tab; each tab
|
||||||
|
retains its own path and dirty state, and close prompts only for that document.
|
||||||
|
- The adjacent **Composition** menu adds validated project-relative subscenes, loads/unloads them,
|
||||||
|
applies read-only hierarchy locks, and focuses their actors. Recursive validation rejects missing
|
||||||
|
or cyclic references before replacing the active world. See
|
||||||
|
[multi-scene-composition.md](docs/editor/multi-scene-composition.md).
|
||||||
- Editable entities use reflectable authoring components from `crates/shared`.
|
- Editable entities use reflectable authoring components from `crates/shared`.
|
||||||
|
- Linked prefabs keep source-generated actors out of owner-scene serialization through runtime
|
||||||
|
`HydratedPrefabMember` ownership. Generated actor properties/components and same-layer structural
|
||||||
|
changes use stable nested override paths; authored local children and nested linked instances can
|
||||||
|
live below an instance root. Saving that linked root and its local hierarchy as a prefab creates
|
||||||
|
the current variant representation. See [prefab-authoring.md](docs/editor/prefab-authoring.md).
|
||||||
- The editable player start is an authored `PlayerSpawn`; moving it with the transform gizmo changes
|
- The editable player start is an authored `PlayerSpawn`; moving it with the transform gizmo changes
|
||||||
where Play mode boots the runtime player.
|
where Play mode boots the runtime player.
|
||||||
- Project settings provide default ambient/sun lighting. A scene-authored directional `LightDesc`
|
- Project settings provide default ambient/sun lighting. A scene-authored directional `LightDesc`
|
||||||
@@ -182,15 +244,43 @@ Viewport shortcut keys require the pointer to be in the viewport and are suspend
|
|||||||
artifacts in `assets/meshes/generated/`. Renderer slots reference imported content-browser mesh
|
artifacts in `assets/meshes/generated/`. Renderer slots reference imported content-browser mesh
|
||||||
and material assets, while generated collision is stored separately in `ColliderDesc` plus
|
and material assets, while generated collision is stored separately in `ColliderDesc` plus
|
||||||
`RigidBodyDesc`. Switch a model asset's placement mode to **Scene Instance** in Asset Browser
|
`RigidBodyDesc`. Switch a model asset's placement mode to **Scene Instance** in Asset Browser
|
||||||
details when you need full `SceneRoot` loading for animation/skinning/scene data. Expanding a
|
details when you need full `WorldAssetRoot` scene data instead of normalized static slots.
|
||||||
model in the Asset Browser exposes normalized mesh/material/texture subassets; dragging a mesh
|
Expanding a model in the Asset Browser exposes normalized mesh/material/texture plus generated
|
||||||
subasset places that part through the same static mesh renderer path.
|
skeleton/animation-clip subassets. Dragging a mesh places that part through the static mesh path;
|
||||||
- Brush actors are persisted as `ActorKind::Brush + BrushDesc`; the MVP hydrates additive convex
|
dragging a clip creates a dedicated skinned renderer or assigns an exact-rig-compatible state to
|
||||||
cube brushes into generated preview meshes while face/edge/CSG editing remains roadmap work.
|
the selected skinned actor. **Default animation** in Model Import Settings optionally selects the
|
||||||
- Draw Brush mode (`B` or toolbar pencil) places snapped floor points and commits an additive
|
exact clip sampled and paused as the edit-rest pose; **Imported rest pose** never guesses a clip.
|
||||||
prism brush with `Enter`; `Esc` or right-click cancels without changing the scene.
|
Preview stop and PIE exit restore imported transforms and morph weights before resampling that
|
||||||
|
explicit default. The Animation Controller inspector edits state IDs, clips,
|
||||||
|
range/loop/speed/default/crossfade and provides non-dirty play/pause/stop/scrub preview. See the
|
||||||
|
[animation authoring guide](docs/editor/animation-authoring.md) and [ADR 0031](docs/adr/0031-animation-authoring-runtime-contract.md).
|
||||||
|
- Navigation bounds, obstacles, areas, and links are created from **Scene > Navigation** or the path
|
||||||
|
icon in the existing horizontal toolbar. Bounds bake versioned Rerecast artifacts under
|
||||||
|
`assets/navigation/generated/`; overlapping primitive and additive-brush triangles participate
|
||||||
|
in the bake fingerprint while distant authoring is excluded. Visible composed subscenes and linked
|
||||||
|
prefab sources resolve through the same deterministic bake path used by CI. The Inspector reports
|
||||||
|
stale/current state, pins named validation paths, and provides a Polyanya-backed path test whose
|
||||||
|
mesh, links, and route render in the viewport. Use
|
||||||
|
`cargo bake-navigation --project . --check` in CI. See the
|
||||||
|
[navigation authoring guide](docs/editor/navigation-authoring.md) and [ADR 0032](docs/adr/0032-versioned-navigation-bake-and-runtime-query.md).
|
||||||
|
- Brush actors are persisted as `ActorKind::Brush + BrushDesc`; valid convex faces hydrate into
|
||||||
|
generated preview meshes. Vertex, edge, and face selections use the standard transform gizmo,
|
||||||
|
face material/UV fields are undoable, and clip/intersect/merge/subtract provide conservative
|
||||||
|
bounds-based blockout operations with preview-before-commit.
|
||||||
|
- Draw Brush mode (`B` or toolbar pencil) places snapped floor points; `Enter` locks the outline,
|
||||||
|
mouse up/down adjusts height, and `Enter` or left-click commits additive prism brushes. Simple
|
||||||
|
concave outlines decompose into convex brush parts, while self-intersections are blocked with
|
||||||
|
status text. The viewport shows quick brush key hints while drawing. `Esc` or right-click cancels
|
||||||
|
without changing the scene.
|
||||||
- Runtime-only handles/colliders are not serialized directly, keeping scenes stable and portable.
|
- Runtime-only handles/colliders are not serialized directly, keeping scenes stable and portable.
|
||||||
- Editor-only cameras and helper roots are filtered from selection, hierarchy, and scene save.
|
- Editor-only cameras and helper roots are filtered from selection, hierarchy, and scene save.
|
||||||
|
- Loaded scenes, prefab source Apply/history, Materials, Material Instances, and Project Settings
|
||||||
|
retain exact BLAKE3 disk revisions. Save verifies the revision again immediately before atomic
|
||||||
|
replacement; an external edit, create race, read-only target, or provider lock leaves the
|
||||||
|
existing file untouched and opens the collaborative recovery dialog. Git status is observational
|
||||||
|
and optional. See the
|
||||||
|
[collaborative file-safety guide](docs/editor/collaborative-file-safety.md) and
|
||||||
|
[ADR 0037](docs/adr/0037-collaborative-authored-file-safety.md).
|
||||||
- **PIE restores player sim only** (transform, velocity, jump state) when you stop Play; authored
|
- **PIE restores player sim only** (transform, velocity, jump state) when you stop Play; authored
|
||||||
`LevelObject` edits made during PIE **remain** in the scene (the level may show as dirty).
|
`LevelObject` edits made during PIE **remain** in the scene (the level may show as dirty).
|
||||||
- Play mode swaps the unified viewport between the player camera (possessed) and editor fly camera
|
- Play mode swaps the unified viewport between the player camera (possessed) and editor fly camera
|
||||||
@@ -204,8 +294,8 @@ Viewport shortcut keys require the pointer to be in the viewport and are suspend
|
|||||||
|
|
||||||
1. Check the **mode badge** (bottom-right of the viewport). **Collider** hides meshes — click the **sun** toolbar icon for **Lit** shading.
|
1. Check the **mode badge** (bottom-right of the viewport). **Collider** hides meshes — click the **sun** toolbar icon for **Lit** shading.
|
||||||
2. **Window → Rendering → Active Camera**: check **Runtime lights** (directional/point/spot counts), scene vs project sun status, and contributing post-process volumes. Scene directionals override the project sun; use **Scene → Lighting → Use project sun** to restore project defaults.
|
2. **Window → Rendering → Active Camera**: check **Runtime lights** (directional/point/spot counts), scene vs project sun status, and contributing post-process volumes. Scene directionals override the project sun; use **Scene → Lighting → Use project sun** to restore project defaults.
|
||||||
3. **Solari requested but not visually changing**: check **Window → Rendering → Active Camera** for requested/effective GI, fallback reason, tagged meshes, Solari-compatible mesh assets, render instances, bind-group readiness, and compatible lights. Effective Solari forces an HDR camera target because Bevy Solari writes through a storage texture; imported/custom meshes need TriangleList geometry, POSITION/NORMAL/UV_0/TANGENT attributes, and U32 indices for Bevy 0.18 Solari.
|
3. **Solari requested but not visually changing**: check **Window → Rendering → Active Camera** for requested/effective GI, fallback reason, tagged meshes, Solari-compatible mesh assets, render instances, bind-group readiness, and compatible lights. Effective Solari forces an HDR camera target because Bevy Solari writes through a storage texture; imported/custom meshes need TriangleList geometry, POSITION/NORMAL/UV_0/TANGENT attributes, and U32 indices for Bevy 0.19 Solari.
|
||||||
4. **Lighting changes do nothing in Solari**: Bevy 0.18 Solari samples directional lights and emissive meshes, not point/spot lights. Use Directional lights or emissive materials in Solari; switch to Forward PBR for point/spot light authoring.
|
4. **Lighting changes do nothing in Solari**: Bevy 0.19 Solari samples directional lights and emissive meshes, not point/spot lights. Use Directional lights or emissive materials in Solari; switch to Forward PBR for point/spot light authoring.
|
||||||
5. **GiMode Auto shows Forward**: Solari RT wgpu features are unavailable on this GPU. Dev RT override: `BEVY_FPS_FORCE_SOLARI=1`.
|
5. **GiMode Auto shows Forward**: Solari RT wgpu features are unavailable on this GPU. Dev RT override: `BEVY_FPS_FORCE_SOLARI=1`.
|
||||||
6. **Volume overrides ignored**: confirm camera is inside volume AABB; check priority in Rendering → Volumes tab.
|
6. **Volume overrides ignored**: confirm camera is inside volume AABB; check priority in Rendering → Volumes tab.
|
||||||
7. **Custom post FX**: RON under `assets/post_fx/`; assign path in volume inspector (see [docs/editor/rendering.md](docs/editor/rendering.md)).
|
7. **Custom post FX**: RON under `assets/post_fx/`; assign path in volume inspector (see [docs/editor/rendering.md](docs/editor/rendering.md)).
|
||||||
@@ -217,7 +307,51 @@ Viewport shortcut keys require the pointer to be in the viewport and are suspend
|
|||||||
|
|
||||||
### Hierarchy scrolls during drag
|
### Hierarchy scrolls during drag
|
||||||
|
|
||||||
Scroll-to-drag is disabled while dragging actors. Release the mouse to finish or cancel the drag.
|
Scroll-to-drag is disabled while dragging actors. The pointer card reports the pending action:
|
||||||
|
drop on a full actor row to attach, on the **Scene Root** zone to unparent, or between rows in
|
||||||
|
**Manual** sort to reorder. Amber means attach, cyan means reorder/root, and red blocks a hierarchy
|
||||||
|
cycle. Release away from a valid target to cancel.
|
||||||
|
|
||||||
|
### Scene recovery
|
||||||
|
|
||||||
|
Dirty saved scenes create a recovery snapshot every 120 seconds and retain the newest five
|
||||||
|
generations under `$XDG_STATE_HOME/blacksite-editor/recovery` or
|
||||||
|
`~/.local/state/blacksite-editor/recovery`. If a snapshot is newer than the authored scene, the
|
||||||
|
status strip shows `[recovery]` and recovery actions become available in **File**. **Restore
|
||||||
|
Recovery Snapshot** loads it into dirty editor state for inspection, **Save Recovery Copy As...**
|
||||||
|
writes a separate transactional scene copy without changing the active scene, and **Discard
|
||||||
|
Recovery Snapshot** retires all generations. Restore keeps the generation available until **Save**
|
||||||
|
commits the active scene or discard explicitly retires it. The **Diagnostics** window retains the
|
||||||
|
latest 32 scene I/O results, including exact recovery paths and failures, for the current session.
|
||||||
|
Unsaved new scenes are not yet covered by automatic recovery.
|
||||||
|
For recovery testing only, `BLACKSITE_RECOVERY_INTERVAL_SECS=<seconds>` overrides the interval for
|
||||||
|
the current process without changing preferences.
|
||||||
|
|
||||||
|
### Session recovery
|
||||||
|
|
||||||
|
Clean editor exits restore the last authored scene, panel visibility, and viewport bookmarks from
|
||||||
|
the versioned machine-local session document. After an abnormal exit, Blacksite opens the safe
|
||||||
|
startup scene and asks whether to **Resume Last Scene** or **Continue Safe**; modal tools and dirty
|
||||||
|
preview state are never restored. Session metadata lives under
|
||||||
|
`$XDG_STATE_HOME/blacksite-editor/session.ron` or `~/.local/state/blacksite-editor/session.ron` and
|
||||||
|
contains no scene contents or credentials. See [ADR 0024](docs/adr/0024-versioned-editor-session-state.md).
|
||||||
|
|
||||||
|
Open **Window → Diagnostics** and choose **Export Diagnostic Bundle** to write a transactional
|
||||||
|
support report under `$XDG_STATE_HOME/blacksite-editor/diagnostics` or
|
||||||
|
`~/.local/state/blacksite-editor/diagnostics`. The report includes build/platform and renderer
|
||||||
|
identity, project and active-scene paths, dirty flags, aggregate validation counts, prior-crash
|
||||||
|
state, and the bounded Scene I/O log. It excludes scene and asset contents, environment values,
|
||||||
|
host/user identity, credentials, access tokens, and modal tool state.
|
||||||
|
|
||||||
|
### External file changes and read-only assets
|
||||||
|
|
||||||
|
The active scene status strip and selected asset header show compact Git/read-only/ownership state
|
||||||
|
when available. If Save or Apply detects a different disk revision, Blacksite leaves that revision
|
||||||
|
untouched and opens **Authored File Not Saved**. Use **Compare Metadata** to inspect both revisions,
|
||||||
|
**Save As** to preserve the editor copy elsewhere, **Reload** to take the disk version, or **Cancel**
|
||||||
|
to keep the local draft unsaved. Git and ownership providers are optional; the status scanner never
|
||||||
|
stages, commits, resets, checks out, restores, or discards files. See
|
||||||
|
[collaborative-file-safety.md](docs/editor/collaborative-file-safety.md).
|
||||||
|
|
||||||
## Cursor / VSCode Setup
|
## Cursor / VSCode Setup
|
||||||
|
|
||||||
@@ -226,8 +360,8 @@ The `.vscode/` folder is preconfigured:
|
|||||||
- `extensions.json` recommends rust-analyzer, Even Better TOML, CodeLLDB, crates, and Error Lens.
|
- `extensions.json` recommends rust-analyzer, Even Better TOML, CodeLLDB, crates, and Error Lens.
|
||||||
- `settings.json` runs `clippy` on save, enables proc-macro/build-script support, formats on save,
|
- `settings.json` runs `clippy` on save, enables proc-macro/build-script support, formats on save,
|
||||||
and excludes `target/` from search/watch.
|
and excludes `target/` from search/watch.
|
||||||
- `tasks.json` provides workspace check/clippy plus game/editor build/run tasks.
|
- `tasks.json` mirrors the full workspace formatting, all-target check, strict Clippy, test, level-validation, build/run, hot-reload, and target-cleanup workflows. **build editor (dev fast-link)** is the default build task.
|
||||||
- `launch.json` provides CodeLLDB launch configs for the editor and game.
|
- `launch.json` uses CodeLLDB Cargo artifact filtering for editor/game Debug, GPU-validation, hot-reload, SDR fallback, and Release configurations. Normal launches keep HDR enabled while quieting known Vulkan validation noise; dynamic-link launches set the required `LD_LIBRARY_PATH` automatically.
|
||||||
- `.github/workflows/ci.yml` mirrors local formatting, check, clippy, test, and binary build verification.
|
- `.github/workflows/ci.yml` mirrors local formatting, check, clippy, test, and binary build verification.
|
||||||
|
|
||||||
## Architecture Decisions
|
## Architecture Decisions
|
||||||
@@ -241,6 +375,10 @@ The `.vscode/` folder is preconfigured:
|
|||||||
- [ADR 0014: Unified Viewport Model](docs/adr/0014-unified-viewport-model.md)
|
- [ADR 0014: Unified Viewport Model](docs/adr/0014-unified-viewport-model.md)
|
||||||
- [ADR 0016: Unified Rendering Contract](docs/adr/0016-unified-rendering-contract.md)
|
- [ADR 0016: Unified Rendering Contract](docs/adr/0016-unified-rendering-contract.md)
|
||||||
- [ADR 0017: Normalized Static Mesh Assets](docs/adr/0017-normalized-static-mesh-assets.md)
|
- [ADR 0017: Normalized Static Mesh Assets](docs/adr/0017-normalized-static-mesh-assets.md)
|
||||||
|
- [ADR 0034: Registry-driven Authoring Components](docs/adr/0034-registry-driven-authoring-components.md)
|
||||||
|
- [ADR 0037: Collaborative Authored-File Safety](docs/adr/0037-collaborative-authored-file-safety.md)
|
||||||
|
- [ADR 0043: Content-Addressed Import Fingerprints](docs/adr/0043-content-addressed-import-fingerprints.md)
|
||||||
|
- [ADR 0044: Sandboxed FBX External Texture Dependencies](docs/adr/0044-sandboxed-fbx-external-texture-dependencies.md)
|
||||||
|
|
||||||
## Project Layout
|
## Project Layout
|
||||||
|
|
||||||
@@ -270,6 +408,14 @@ crates/
|
|||||||
- [x] Filtered hierarchy, inspector, viewport, toolbar, asset browser, and status panels
|
- [x] Filtered hierarchy, inspector, viewport, toolbar, asset browser, and status panels
|
||||||
- [x] Delete, duplicate, rename, and structural/material undo-redo
|
- [x] Delete, duplicate, rename, and structural/material undo-redo
|
||||||
- [x] Native Bevy scene New/Open/Save/Save As with dirty title tracking
|
- [x] Native Bevy scene New/Open/Save/Save As with dirty title tracking
|
||||||
|
- [x] First-class height-grid Terrain actor with deterministic generated render/collider chunks, reflected history, validation, and a committed showcase fixture ([ADR 0039](docs/adr/0039-inline-height-grid-terrain-foundation.md), [terrain guide](docs/editor/terrain.md), [Gitea #22](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/22))
|
||||||
|
- [x] Modal terrain Raise/Lower/Flatten/Smooth/Noise sculpting with a terrain-following footprint, deterministic noise, safe cancel restore, and one undo transaction per stroke ([terrain guide](docs/editor/terrain.md), [Gitea #23](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/23))
|
||||||
|
- [x] Four shared terrain Material/Material Instance layers with compact normalized sample weights, blended raster hydration, drag/browse assignment, Paint/Erase preview, exact cancel, and one undo transaction per stroke ([ADR 0040](docs/adr/0040-terrain-material-layer-weights.md), [terrain guide](docs/editor/terrain.md), [Gitea #24](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/24))
|
||||||
|
- [x] Transactional physics placement with real Avian gravity/colliders, paused Edit-mode physics, prerequisite diagnostics, isolated non-selected bodies, exact cancel, and grouped transform undo ([ADR 0041](docs/adr/0041-transactional-editor-physics-placement.md), [workflow guide](docs/editor/physics-placement.md), [Gitea #25](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/25))
|
||||||
|
- [x] Collider authoring health shared by the inspector, Collider viewport, Diagnostics panel, and physics placement, with scaled shape overlays, cooked mesh bounds, missing/stale/invalid/oversized findings, and undoable dimension-preserving shape switching ([collider guide](docs/editor/collider-authoring.md), [Gitea #26](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/26))
|
||||||
|
- [x] Non-blocking native file/folder/confirmation broker across scene, asset, prefab, composition, collaboration, and Project Browser workflows ([ADR 0038](docs/adr/0038-non-blocking-native-dialog-broker.md), [workflow guide](docs/editor/native-dialogs.md), [Gitea #52](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/52))
|
||||||
|
- [x] Guarded native/menu/programmatic editor shutdown with asynchronous multi-tab Save All / Discard / Cancel and canonical per-tab clean checkpoints for exact undo/redo dirtiness ([ADR 0042](docs/adr/0042-guarded-editor-shutdown-and-document-savepoints.md), [Gitea #55](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/55))
|
||||||
|
- [x] Scoped egui action safety for toolbar/navigation spawns, Inspector state, cross-panel selection/tab requests, diagnostics selection, and full-slice selection precedence ([evaluation](docs/editor/evaluations/scoped-ui-actions/), [Gitea #57](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/57))
|
||||||
- [x] Asset import, static mesh/prefab placement, texture assignment, and selection export
|
- [x] Asset import, static mesh/prefab placement, texture assignment, and selection export
|
||||||
- [x] PIE player-only snapshot/restore (authored `LevelObject` edits persist on stop)
|
- [x] PIE player-only snapshot/restore (authored `LevelObject` edits persist on stop)
|
||||||
- [x] Unified viewport render-to-texture target + Play session bootstrap
|
- [x] Unified viewport render-to-texture target + Play session bootstrap
|
||||||
@@ -278,32 +424,58 @@ crates/
|
|||||||
- [x] Cursor/VSCode workspace tasks + launch configs
|
- [x] Cursor/VSCode workspace tasks + launch configs
|
||||||
- [x] Opaque Wayland window launch defaults + SDR/HDR runtime toggle
|
- [x] Opaque Wayland window launch defaults + SDR/HDR runtime toggle
|
||||||
- [x] CI workflow for format, check, clippy, tests, and binary builds
|
- [x] CI workflow for format, check, clippy, tests, and binary builds
|
||||||
|
- [x] Deterministic five-area editor sample regression pack with stable actor IDs, **File > Open Sample**, typed scene checks, headless validation, and committed brush/material/terrain/physics/rendering fixtures ([sample guide](docs/editor/sample-regression-pack.md), [Gitea #32](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/32))
|
||||||
- [x] ADRs for roadmap architecture and Bevy migration policy
|
- [x] ADRs for roadmap architecture and Bevy migration policy
|
||||||
- [x] Determinism harness: same inputs over same ticks produce the same state summary/hash
|
- [x] Determinism harness: same inputs over same ticks produce the same state summary/hash
|
||||||
|
- [x] Production operator invariants across palette dispatch, assets/material drops, brush/terrain/physics modal tools, grouping/lighting, and the transform finalizer: stable terminal status, exact cancel/failure rollback, helper cleanup, grouped history, and repeated undo/redo projections ([testing contract](docs/editor/operator-regression-testing.md), [evaluation](docs/editor/evaluations/operator-invariants/), [Gitea #33](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/33))
|
||||||
- [x] Verify: `cargo fmt --check` / `cargo check --workspace` / `cargo clippy --workspace` / strict foundation clippy / `cargo test -p sim`
|
- [x] Verify: `cargo fmt --check` / `cargo check --workspace` / `cargo clippy --workspace` / strict foundation clippy / `cargo test -p sim`
|
||||||
- [x] Stable asset registry with UUIDs + import settings in asset browser details
|
- [x] Stable asset registry with UUIDs + import settings in asset browser details
|
||||||
|
- [x] Deterministic imported-source fingerprints for models, textures, and audio; BLAKE3-backed
|
||||||
|
static/animation manifests; byte-preserving equivalent refresh; and read-only validator checkout
|
||||||
|
assertions ([ADR 0043](docs/adr/0043-content-addressed-import-fingerprints.md), [evaluation](docs/editor/evaluations/deterministic-asset-fingerprints/), [Gitea #56](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/56))
|
||||||
|
- [x] Sandboxed FBX external-texture discovery for sibling and `.fbm/` layouts, transactional
|
||||||
|
referenced-bundle import, manifest-first consolidated validation, deduplicated loader reads, and
|
||||||
|
stable Asset Browser dependency status ([ADR 0044](docs/adr/0044-sandboxed-fbx-external-texture-dependencies.md), [Gitea #58](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/58))
|
||||||
- [x] Asset Browser expandable model subasset shelves, independent mesh/material/texture thumbnails, staged import/material details with shader-schema parameters, context actions, and trash-first file removal
|
- [x] Asset Browser expandable model subasset shelves, independent mesh/material/texture thumbnails, staged import/material details with shader-schema parameters, context actions, and trash-first file removal
|
||||||
|
- [x] Audio clip catalog/import foundation for Ogg, WAV, MP3, and FLAC with dedicated filtering, file details, and stable runtime-resolvable asset references
|
||||||
|
- [x] Audio source/listener authoring, non-dirty spatial audition, viewport icons/range gizmos, stable buses, PIE/runtime parity, device diagnostics, and shared release validation ([ADR 0030](docs/adr/0030-audio-authoring-and-bus-schema.md); production acceptance completed in [Gitea #47](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/47))
|
||||||
|
- [x] glTF/GLB skeletal animation manifests, stable controller states, non-dirty preview, PIE/runtime hydration, and exact-signature compatibility validation ([ADR 0031](docs/adr/0031-animation-authoring-runtime-contract.md); production acceptance completed in [Gitea #46](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/46))
|
||||||
|
- [x] Navigation bounds/obstacles/areas/links, persisted validation samples, composed-source resolution, deterministic stale-checked bake artifacts, viewport path preview, headless bake, and shared game/runtime query API ([ADR 0032](docs/adr/0032-versioned-navigation-bake-and-runtime-query.md); [evaluation](docs/editor/evaluations/navigation-authoring/); [Gitea #48](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/48))
|
||||||
|
- [x] Exact authored-file revision guards for scenes, prefab source Apply/history, Materials, Material Instances, and Project Settings; compact observational Git/read-only/ownership state; and explicit Reload/Compare Metadata/Save As/Cancel recovery without force overwrite ([ADR 0037](docs/adr/0037-collaborative-authored-file-safety.md), [collaboration guide](docs/editor/collaborative-file-safety.md), [Gitea #49](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/49))
|
||||||
- [x] Prefab instances (`PrefabInstance`) + save-as-prefab + unpack
|
- [x] Prefab instances (`PrefabInstance`) + save-as-prefab + unpack
|
||||||
- [x] Unsaved-scene confirm on New/Open/Recent
|
- [x] Independent dirty-tab close confirmation and all-tab save guard when switching projects
|
||||||
|
- [x] Transactional scene writes + bounded user-local recovery snapshots ([ADR 0023](docs/adr/0023-transactional-scene-persistence-and-recovery.md))
|
||||||
|
- [x] Versioned clean/crash session resume + privacy-bounded diagnostic bundle ([ADR 0024](docs/adr/0024-versioned-editor-session-state.md))
|
||||||
- [x] Hierarchy multi-select, reparent undo, multi-entity gizmo transform
|
- [x] Hierarchy multi-select, reparent undo, multi-entity gizmo transform
|
||||||
- [x] Typed inspector undo (light, rigid body, collider, primitive, material, static mesh renderer) + registry-driven Add Component footer
|
- [x] Typed inspector undo (light, rigid body, collider, primitive, material, static mesh renderer) + registry-driven Add Component footer; skinned renderer sources are asset-owned and inspectable
|
||||||
- [x] Gameplay authoring markers + visualizers (`WeaponSpawn`, `TriggerVolume`, etc.)
|
- [x] Gameplay authoring markers + visualizers (`WeaponSpawn`, `TriggerVolume`, etc.)
|
||||||
- [x] Command palette execution; PIE sim step (F7); `xtask validate-levels`
|
- [x] Command palette execution; PIE sim step (F7); `xtask validate-levels`
|
||||||
- [x] ADRs 0005–0012 (prefab/registry, scene schema, EditorPlugin, editor structure, authoring/hydration, ActorKind, sun policy, zero-debt)
|
- [x] ADRs 0005–0012 (prefab/registry, scene schema, EditorPlugin, editor structure, authoring/hydration, ActorKind, sun policy, zero-debt)
|
||||||
- [x] `ActorInspectorSection` registry + game demo section (`game::editor_ext`)
|
- [x] `ActorInspectorSection` registry + game demo section (`game::editor_ext`)
|
||||||
- [x] Command palette: reset lighting, group selection, focus selection
|
- [x] Command palette: reset lighting, group selection, focus selection
|
||||||
- [x] CI: `cargo test -p shared`, scene authoring-only check on repo level, `cargo check -p editor --features dev`
|
- [x] CI: `cargo test -p shared`, scene authoring-only check on repo level, `cargo check -p editor --features dev`
|
||||||
- [x] `scene` crate schema stamp/migrate/validate on save/load + CI `validate-levels`
|
- [x] `scene` crate schema stamp/migrate/validate on save/load + CI `validate-levels` for levels and prefab graphs
|
||||||
- [x] Project Settings draft + Apply (HDR/swapchain safe); File → Project New/Open
|
- [x] Project Settings draft + Apply (HDR/swapchain safe)
|
||||||
|
- [x] Project Browser UI, strict manifest validation, `--project` startup activation, recent filtering, sandbox scaffolding, clean process handoff, and desktop launcher action ([ADR 0025](docs/adr/0025-project-root-is-a-startup-boundary.md))
|
||||||
|
- [x] Independent scene tabs + stable subscene composition, recursive validation, ownership locks, active-world PIE consistency, and per-saved-tab recovery ([ADR 0026](docs/adr/0026-stable-scene-composition-and-active-document.md))
|
||||||
- [x] Editor lib/bin split + `EditorPluginGroup`; game EditorPlugin dogfood panel
|
- [x] Editor lib/bin split + `EditorPluginGroup`; game EditorPlugin dogfood panel
|
||||||
- [x] FBX/glTF model import + normalized `StaticMeshRenderer` placement; explicit scene-instance load via `bevy_ufbx` / `ModelRef`
|
- [x] FBX/glTF model import + normalized static/skinned renderer routing; explicit generic scene-instance load via `bevy_ufbx` / `ModelRef`
|
||||||
- [x] Asset browser model thumbnails (unified `assets/thumbnails/` pipeline; `ThumbnailState` cache; FBX via `FbxThumbnailSource`)
|
- [x] Asset browser model thumbnails (unified `assets/thumbnails/` pipeline; `ThumbnailState` cache; FBX via `FbxThumbnailSource`)
|
||||||
- [x] Material assets (`assets/materials/*.ron`, inspector picker, drag-drop to selection)
|
- [x] Shared Material/Material Instance assets, stable static/skinned renderer material slots, imported-source fallback, orphan preservation, and a persistence-excluded property-block schema; runtime block application/promotion remains tracked in [Gitea #53](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/53) ([ADR 0035](docs/adr/0035-shared-material-assets-and-renderer-slots.md), [material-system guide](docs/editor/material-system.md))
|
||||||
- [x] Prefab instance overrides v2 (transform/material/child visibility apply-revert groups)
|
- [x] Docked Material Library with cross-folder type/usage filters, resolved Material Instance thumbnails, shared guarded editors, and exact reversible viewport Material/Texture drops for renderer slots, primitives, and brush faces ([material-system guide](docs/editor/material-system.md); [Gitea #16](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/16), [Gitea #18](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/18))
|
||||||
|
- [x] Prefab v2 core: shared stable nested override paths, property/component/structural scopes, recursive graph validation, linked-root variants, conflict recovery, transactional source Apply, and undoable unpack/convert ([ADR 0027](docs/adr/0027-stable-prefab-ownership-and-variants.md))
|
||||||
|
- [x] Prefab v2 production acceptance: committed base/nested/variant fixtures pass workspace tests, recursive headless validation, packaged release startup, and live editor placement/inspection regression coverage ([Gitea #43](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/43))
|
||||||
|
- [x] Shared project validation: editor Diagnostics and `cargo validate-levels --json` use one owner-attributed dependency/finding report across project settings, registry/import artifacts, materials, shaders, scenes, prefabs, brushes, and colliders; valid/missing/cyclic/incompatible fixtures fail on blocking content errors ([ADR 0028](docs/adr/0028-authoritative-project-content-validation.md), [Gitea #45](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/45))
|
||||||
|
- [x] Validation-gated package foundation: versioned development/QA/release profiles, deterministic runtime exclusions, stable input snapshots, transactional staged publication, Cargo-reported artifacts, BLAKE3 metadata, authored default-scene startup, and a non-blocking editor Build panel with live logs/cancel/run/reveal ([ADR 0029](docs/adr/0029-validation-gated-build-profiles-and-packaging.md), [build guide](docs/editor/build-and-package.md), [Gitea #44](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/44))
|
||||||
- [x] Advanced rendering: `GiMode`, post-process volumes, Rendering panel, requested/effective render stack, Solari integration, emissive materials, post FX assets ([ADR 0013](docs/adr/0013-rendering-tiers-and-post-process-volumes.md), [ADR 0016](docs/adr/0016-unified-rendering-contract.md), [rendering guide](docs/editor/rendering.md))
|
- [x] Advanced rendering: `GiMode`, post-process volumes, Rendering panel, requested/effective render stack, Solari integration, emissive materials, post FX assets ([ADR 0013](docs/adr/0013-rendering-tiers-and-post-process-volumes.md), [ADR 0016](docs/adr/0016-unified-rendering-contract.md), [rendering guide](docs/editor/rendering.md))
|
||||||
|
- [x] Surface ABI v1 with shared raster/Solari evaluator dispatch, packed typed parameters/textures, exact cutout ray-candidate evaluation, last-good shader fallback, and explicit exclusion of skinned/morph-deformed Solari geometry ([ADR 0036](docs/adr/0036-surface-abi-and-solari-parity.md), [material-system guide](docs/editor/material-system.md))
|
||||||
- [x] Static mesh renderer component, generated normalized mesh artifacts, source/one-actor hierarchy placement, and inspector renderer slots ([ADR 0017](docs/adr/0017-normalized-static-mesh-assets.md))
|
- [x] Static mesh renderer component, generated normalized mesh artifacts, source/one-actor hierarchy placement, and inspector renderer slots ([ADR 0017](docs/adr/0017-normalized-static-mesh-assets.md))
|
||||||
|
- [x] Dedicated `SkinnedMeshRenderer`/`SkinnedMesh` actor path, skinned-part exclusion from static slots, dedicated runtime hierarchy hydration, and v2-to-v3 animated-scene migration ([ADR 0033](docs/adr/0033-dedicated-skinned-mesh-renderer.md))
|
||||||
- [x] Componentized actor inspector, unified component cards, thumbnail static mesh slots, imported asset Browse/Locate/Clear refs with inherited source defaults, collider split, shader-aware actor material data, and texture picker/drop refs ([ADR 0018](docs/adr/0018-componentized-actor-inspector-and-materials.md))
|
- [x] Componentized actor inspector, unified component cards, thumbnail static mesh slots, imported asset Browse/Locate/Clear refs with inherited source defaults, collider split, shader-aware actor material data, and texture picker/drop refs ([ADR 0018](docs/adr/0018-componentized-actor-inspector-and-materials.md))
|
||||||
|
- [x] Stable authoring component IDs, registry-built save filtering, reflected atomic add/remove/reset/copy/paste history, independent active state, static extension registration, and derived composable `ActorKind` hints ([ADR 0034](docs/adr/0034-registry-driven-authoring-components.md), [extensibility guide](docs/editor/extensibility.md))
|
||||||
- [x] Brush authoring schema MVP with `ActorKind::Brush`, cube `BrushDesc`, generated mesh hydration, scene migration, and inspector Add Component support ([ADR 0021](docs/adr/0021-brush-authoring-schema.md))
|
- [x] Brush authoring schema MVP with `ActorKind::Brush`, cube `BrushDesc`, generated mesh hydration, scene migration, and inspector Add Component support ([ADR 0021](docs/adr/0021-brush-authoring-schema.md))
|
||||||
|
- [x] Brush draw, vertex/edge/face gizmo editing, face material/UV authoring, clip, and bounds-based CSG preview/commit workflow ([brush guide](docs/editor/brushes.md))
|
||||||
|
- [x] Searchable command palette with human labels/stable IDs and a status bar that exposes scene I/O, tool, history, mode, and selection feedback
|
||||||
|
|
||||||
## Notes / Future Work
|
## Notes / Future Work
|
||||||
|
|
||||||
@@ -311,16 +483,32 @@ crates/
|
|||||||
- The editor asset browser is filesystem-backed with folder/tree navigation, grid/list views,
|
- The editor asset browser is filesystem-backed with folder/tree navigation, grid/list views,
|
||||||
texture and model thumbnails (glTF albedo fast-path; offscreen render studio for FBX and
|
texture and model thumbnails (glTF albedo fast-path; offscreen render studio for FBX and
|
||||||
untextured models), material sphere thumbnails, search/filter/sort controls, expandable model
|
untextured models), material sphere thumbnails, search/filter/sort controls, expandable model
|
||||||
subasset shelves, and a staged details pane. **File → Import Assets**
|
subasset shelves, and a staged details pane. **File -> Import Assets**
|
||||||
accepts glTF/GLB and **FBX** (binary; copies sibling `.fbm` texture folders when present).
|
accepts glTF/GLB and binary **FBX**. FBX import parses and transactionally preserves every safe
|
||||||
Model assets generate normalized static mesh manifests under `assets/meshes/generated/`; drag/drop
|
referenced sibling `textures/` or `.fbm/` file while rejecting traversal and external absolute
|
||||||
uses `StaticMeshRenderer` by default with imported asset refs and optional separate static mesh
|
paths before project content changes. Missing source textures appear once in validation and Asset
|
||||||
collider components. Expanded mesh subassets generate independent thumbnails and can be placed independently. Asset details can switch
|
Browser dependency status; **Authoring Override** deliberately permits an untextured model.
|
||||||
placement to **Scene Instance** for `ModelRef`/`SceneRoot` playback, shared material assets can be
|
Model assets generate normalized model manifests under `assets/meshes/generated/`; drag/drop uses
|
||||||
edited from the browser, and delete actions move files to `assets/.trash/`. Skeletal animation
|
**Renderable Asset (Auto)**. Unrigged sources use `StaticMeshRenderer` with imported asset refs
|
||||||
playback is not supported by the static mesh path yet.
|
and optional separate static mesh colliders. Skin-bound or animated sources and their subasset placement use
|
||||||
- Prefab instances use stable asset IDs (`PrefabInstance` + registry) with serialized `PrefabOverrides` (transform, material, per-child visibility by name). Inspector **Apply/Revert** per field group; **Unpack** removes the instance link.
|
`SkinnedMeshRenderer`, preserve the source joint hierarchy, and never create static slots or
|
||||||
- Material assets are RON files under `assets/materials/`; shader schemas live under `assets/shaders/`. `MaterialDesc` stores shader kind, typed parameters, texture bindings, and StandardMaterial fields. The Asset Browser material details editor can apply shader schemas, edit typed parameters/textures, and regenerate sphere thumbnails. Actor inspector material edits live on the actor `MaterialDesc`; static mesh source-material refs remain imported defaults and shared material assets are edited from the Asset Browser.
|
automatic triangle colliders. Expanded mesh subassets generate independent thumbnails. Asset details can switch
|
||||||
|
placement to **Scene Instance** for generic `ModelRef`/`WorldAssetRoot` scenes, shared material assets can be
|
||||||
|
edited from the browser, and delete actions move files to `assets/.trash/`. Animation authoring
|
||||||
|
supports glTF/GLB rig and clip manifests, stable controller refs, clip drag assignment/placement,
|
||||||
|
inspector preview, PIE/runtime playback, and headless compatibility diagnostics. Animated or
|
||||||
|
skinned FBX remains blocked until the loader can build hierarchy, Bevy skinned meshes, and clips.
|
||||||
|
See the [animation authoring guide](docs/editor/animation-authoring.md).
|
||||||
|
- Prefab instances use stable asset IDs and shared versioned override data keyed by nested
|
||||||
|
`PrefabActorPath` identity. Generated source members are excluded from owner save/export, while
|
||||||
|
property/component edits and same-layer remove/reparent operations persist as overrides. Revert
|
||||||
|
stays instance-local; explicit **Apply to source** validates and atomically patches the appropriate
|
||||||
|
source layer, with exact-file undo/redo guards against external edits. Source health exposes
|
||||||
|
changed, semantic-conflict, broken, and malformed states with keep/take/retry/relink recovery.
|
||||||
|
**Unpack Layer** preserves nested links; **Convert to Local** recursively removes them. Current
|
||||||
|
authoring UI coverage and production-acceptance gaps are tracked in
|
||||||
|
[prefab-authoring.md](docs/editor/prefab-authoring.md).
|
||||||
|
- Material and direct-base Material Instance assets live under `assets/materials/`; shader schemas live under `assets/shaders/`. **Window > Material Library** provides cross-folder creation, editing, usage filters, and drag sources. Viewport Material drops target one exact renderer slot, primitive, or brush face and use reversible preview plus one-step history; loose Textures target primitives/brush faces and are rejected on renderer slots. Shared edits propagate through live-updated handles without reloading skinned geometry. Custom Surface evaluators share one constrained ABI between raster and Solari-eligible non-deformed geometry. Runtime property-block application/promotion is tracked in [#53](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/53); dynamic skinned/morph Solari geometry is tracked in [#54](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/54). See the [material-system guide](docs/editor/material-system.md).
|
||||||
- Per-field reflect undo for all components remains future work; typed `shared` inspectors cover the common authoring path.
|
- Per-field reflect undo for all components remains future work; typed `shared` inspectors cover the common authoring path.
|
||||||
- The authoring/hydration layer is intentionally small so richer asset workflows (terrain,
|
- The authoring/hydration layer is intentionally small so richer asset workflows (terrain,
|
||||||
material graphs, lighting profiles) can be added without changing the scene format foundation.
|
material graphs, lighting profiles) can be added without changing the scene format foundation.
|
||||||
|
|||||||
+579
-82
@@ -1,9 +1,9 @@
|
|||||||
[
|
[
|
||||||
(
|
(
|
||||||
id: ("31963299-d4c1-45dc-8f67-2f469ca1ad6d"),
|
id: ("04a4e00e-4732-43db-8e99-9cd99b94667b"),
|
||||||
path: "assets/post_fx/chromatic_aberration.ron",
|
path: "assets/animations/generated/113f74df-e39c-41d4-9b5b-e48efe541f7f.animation.ron",
|
||||||
label: "chromatic_aberration",
|
label: "113f74df-e39c-41d4-9b5b-e48efe541f7f.animation",
|
||||||
kind_tag: "PostProcessEffect",
|
kind_tag: "Level",
|
||||||
import_settings: (
|
import_settings: (
|
||||||
scale: 1.0,
|
scale: 1.0,
|
||||||
generate_collider: true,
|
generate_collider: true,
|
||||||
@@ -12,14 +12,16 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
id: ("e14a9bc3-9a4e-47b0-901f-b31c004e1836"),
|
id: ("4937e63f-923b-4270-bdfc-298d63bcb814"),
|
||||||
path: "assets/post_fx/vignette.ron",
|
path: "assets/animations/generated/3f63f359-45eb-4cb2-8970-71921cbd7bd0.animation.ron",
|
||||||
label: "vignette",
|
label: "3f63f359-45eb-4cb2-8970-71921cbd7bd0.animation",
|
||||||
kind_tag: "PostProcessEffect",
|
kind_tag: "Level",
|
||||||
import_settings: (
|
import_settings: (
|
||||||
scale: 1.0,
|
scale: 1.0,
|
||||||
generate_collider: true,
|
generate_collider: true,
|
||||||
@@ -28,51 +30,16 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
id: ("b98ef565-3500-49e7-9935-f685fa9b2594"),
|
id: ("28f1df44-6d24-4722-bf75-6969879995a4"),
|
||||||
path: "assets/models/painted_wooden_chair_02_2k.fbx",
|
path: "assets/animations/generated/b98ef565-3500-49e7-9935-f685fa9b2594.animation.ron",
|
||||||
label: "painted_wooden_chair_02_2k",
|
label: "b98ef565-3500-49e7-9935-f685fa9b2594.animation",
|
||||||
kind_tag: "Model",
|
kind_tag: "Level",
|
||||||
import_settings: (
|
|
||||||
scale: 1.0,
|
|
||||||
generate_collider: true,
|
|
||||||
lod0_only: true,
|
|
||||||
placement_mode: StaticAsset,
|
|
||||||
hierarchy_mode: SingleActor,
|
|
||||||
material_policy: SourceMaterials,
|
|
||||||
static_mesh_manifest_path: Some("assets/meshes/generated/b98ef565-3500-49e7-9935-f685fa9b2594.static_mesh.ron"),
|
|
||||||
),
|
|
||||||
dependencies: [],
|
|
||||||
),
|
|
||||||
(
|
|
||||||
id: ("71071fc3-7a7f-454d-b9ab-93ebf0feccbe"),
|
|
||||||
path: "assets/models/metal_stool_01_2k.gltf",
|
|
||||||
label: "metal_stool_01_2k",
|
|
||||||
kind_tag: "Model",
|
|
||||||
import_settings: (
|
|
||||||
scale: 1.0,
|
|
||||||
generate_collider: true,
|
|
||||||
lod0_only: true,
|
|
||||||
placement_mode: SceneInstance,
|
|
||||||
hierarchy_mode: SingleActor,
|
|
||||||
material_policy: SourceMaterials,
|
|
||||||
static_mesh_manifest_path: Some("assets/meshes/generated/71071fc3-7a7f-454d-b9ab-93ebf0feccbe.static_mesh.ron"),
|
|
||||||
),
|
|
||||||
dependencies: [
|
|
||||||
"assets/models/metal_stool_01.bin",
|
|
||||||
"assets/models/textures/metal_stool_01_arm_2k.jpg",
|
|
||||||
"assets/models/textures/metal_stool_01_diff_2k.jpg",
|
|
||||||
"assets/models/textures/metal_stool_01_nor_gl_2k.jpg",
|
|
||||||
],
|
|
||||||
),
|
|
||||||
(
|
|
||||||
id: ("c4abe41c-ac88-4aec-8168-27e8a7c90583"),
|
|
||||||
path: "assets/textures/metal_stool_01_nor_gl_2k.jpg",
|
|
||||||
label: "metal_stool_01_nor_gl_2k",
|
|
||||||
kind_tag: "Texture",
|
|
||||||
import_settings: (
|
import_settings: (
|
||||||
scale: 1.0,
|
scale: 1.0,
|
||||||
generate_collider: true,
|
generate_collider: true,
|
||||||
@@ -81,14 +48,20 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
id: ("0496e62e-1837-4940-a9c9-b2b4ffe9ed90"),
|
id: ("fe40db93-181f-4c79-86e6-26bd97464c4b"),
|
||||||
path: "assets/textures/metal_stool_01_arm_2k.jpg",
|
path: "assets/audio/Puzzle Lobby.mp3",
|
||||||
label: "metal_stool_01_arm_2k",
|
label: "Puzzle Lobby",
|
||||||
kind_tag: "Texture",
|
kind_tag: "AudioClip",
|
||||||
|
source_fingerprint: Some((
|
||||||
|
byte_len: 1680820,
|
||||||
|
content_hash: "3b5a401dbaccfdbda540c60070ce259fb506d7da548f45008eb2b3fa720b4b57",
|
||||||
|
)),
|
||||||
import_settings: (
|
import_settings: (
|
||||||
scale: 1.0,
|
scale: 1.0,
|
||||||
generate_collider: true,
|
generate_collider: true,
|
||||||
@@ -97,14 +70,20 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
id: ("bddaa4d4-5097-42bf-8d51-dd9a3580442a"),
|
id: ("c0a7d10e-53c1-4de0-b0dc-34a66f44ba77"),
|
||||||
path: "assets/textures/metal_stool_01_diff_2k.jpg",
|
path: "assets/audio/editor_audition_tone.ogg",
|
||||||
label: "metal_stool_01_diff_2k",
|
label: "editor_audition_tone",
|
||||||
kind_tag: "Texture",
|
kind_tag: "AudioClip",
|
||||||
|
source_fingerprint: Some((
|
||||||
|
byte_len: 4450,
|
||||||
|
content_hash: "8ef56184ab5b5cd135e45df152f8a95737023420947f3d08c9b3e3605e55a349",
|
||||||
|
)),
|
||||||
import_settings: (
|
import_settings: (
|
||||||
scale: 1.0,
|
scale: 1.0,
|
||||||
generate_collider: true,
|
generate_collider: true,
|
||||||
@@ -113,14 +92,16 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
id: ("61802b85-fda9-4aff-94d9-fe5f0860c516"),
|
id: ("9213efe6-12c7-45a8-8b64-9e1699f76ba3"),
|
||||||
path: "assets/levels/rendering_showcase.scn.ron",
|
path: "assets/build_profiles/development.ron",
|
||||||
label: "rendering_showcase.scn",
|
label: "development",
|
||||||
kind_tag: "Prefab",
|
kind_tag: "Level",
|
||||||
import_settings: (
|
import_settings: (
|
||||||
scale: 1.0,
|
scale: 1.0,
|
||||||
generate_collider: true,
|
generate_collider: true,
|
||||||
@@ -129,14 +110,16 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
id: ("48bcef13-e6a6-4260-bb1b-c29787bd8c70"),
|
id: ("64fea29e-c123-4987-92dc-ca25f4dc7dea"),
|
||||||
path: "assets/levels/editor_scene 3.scn.ron",
|
path: "assets/build_profiles/qa.ron",
|
||||||
label: "editor_scene 3.scn",
|
label: "qa",
|
||||||
kind_tag: "Prefab",
|
kind_tag: "Level",
|
||||||
import_settings: (
|
import_settings: (
|
||||||
scale: 1.0,
|
scale: 1.0,
|
||||||
generate_collider: true,
|
generate_collider: true,
|
||||||
@@ -145,14 +128,16 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
id: ("5a2307d0-48e5-40d3-a5c9-527c0cfd30f4"),
|
id: ("de76f1c9-f05d-48d3-bb69-6b7ce05f29d8"),
|
||||||
path: "assets/levels/editor_scene.scn.ron",
|
path: "assets/build_profiles/release.ron",
|
||||||
label: "editor_scene.scn",
|
label: "release",
|
||||||
kind_tag: "Prefab",
|
kind_tag: "Level",
|
||||||
import_settings: (
|
import_settings: (
|
||||||
scale: 1.0,
|
scale: 1.0,
|
||||||
generate_collider: true,
|
generate_collider: true,
|
||||||
@@ -161,6 +146,44 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("f3dfcd11-aa5b-4fd4-872b-06832b865c99"),
|
||||||
|
path: "assets/levels/audio_authoring_showcase.scn.ron",
|
||||||
|
label: "audio_authoring_showcase.scn",
|
||||||
|
kind_tag: "Level",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("a7ef65b4-24d6-4c3a-b637-5bb52d8e9a26"),
|
||||||
|
path: "assets/levels/collider_diagnostics_showcase.scn.ron",
|
||||||
|
label: "collider_diagnostics_showcase.scn",
|
||||||
|
kind_tag: "Level",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
@@ -168,7 +191,7 @@
|
|||||||
id: ("dc13ce01-c7ce-43c5-974c-0e659ae49ab9"),
|
id: ("dc13ce01-c7ce-43c5-974c-0e659ae49ab9"),
|
||||||
path: "assets/levels/editor_scene 2.scn.ron",
|
path: "assets/levels/editor_scene 2.scn.ron",
|
||||||
label: "editor_scene 2.scn",
|
label: "editor_scene 2.scn",
|
||||||
kind_tag: "Prefab",
|
kind_tag: "Level",
|
||||||
import_settings: (
|
import_settings: (
|
||||||
scale: 1.0,
|
scale: 1.0,
|
||||||
generate_collider: true,
|
generate_collider: true,
|
||||||
@@ -177,14 +200,16 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
id: ("802471df-8295-4997-80e2-db4191850fc9"),
|
id: ("48bcef13-e6a6-4260-bb1b-c29787bd8c70"),
|
||||||
path: "assets/rendering_profiles/outdoor_haze.ron",
|
path: "assets/levels/editor_scene 3.scn.ron",
|
||||||
label: "outdoor_haze",
|
label: "editor_scene 3.scn",
|
||||||
kind_tag: "RenderingProfile",
|
kind_tag: "Level",
|
||||||
import_settings: (
|
import_settings: (
|
||||||
scale: 1.0,
|
scale: 1.0,
|
||||||
generate_collider: true,
|
generate_collider: true,
|
||||||
@@ -193,14 +218,16 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
id: ("2c4a9866-17b5-4797-9a8f-726b2ffacdb9"),
|
id: ("5a2307d0-48e5-40d3-a5c9-527c0cfd30f4"),
|
||||||
path: "assets/rendering_profiles/cave_dark.ron",
|
path: "assets/levels/editor_scene.scn.ron",
|
||||||
label: "cave_dark",
|
label: "editor_scene.scn",
|
||||||
kind_tag: "RenderingProfile",
|
kind_tag: "Level",
|
||||||
import_settings: (
|
import_settings: (
|
||||||
scale: 1.0,
|
scale: 1.0,
|
||||||
generate_collider: true,
|
generate_collider: true,
|
||||||
@@ -209,6 +236,116 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("706e604e-1a63-4e97-b35d-eeb1d88fe3a9"),
|
||||||
|
path: "assets/levels/navigation_authoring_showcase.scn.ron",
|
||||||
|
label: "navigation_authoring_showcase.scn",
|
||||||
|
kind_tag: "Level",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("78c6850b-5a76-4a4f-b48e-7fb00f6dd1ed"),
|
||||||
|
path: "assets/levels/physics_placement_showcase.scn.ron",
|
||||||
|
label: "physics_placement_showcase.scn",
|
||||||
|
kind_tag: "Level",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("61802b85-fda9-4aff-94d9-fe5f0860c516"),
|
||||||
|
path: "assets/levels/rendering_showcase.scn.ron",
|
||||||
|
label: "rendering_showcase.scn",
|
||||||
|
kind_tag: "Level",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("bca13177-afa9-4691-9b40-288059c7a57e"),
|
||||||
|
path: "assets/levels/samples/brush_blockout.scn.ron",
|
||||||
|
label: "brush_blockout.scn",
|
||||||
|
kind_tag: "Level",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("607864bf-fa77-4f9e-acc9-2c0906d34163"),
|
||||||
|
path: "assets/levels/samples/material_lab.scn.ron",
|
||||||
|
label: "material_lab.scn",
|
||||||
|
kind_tag: "Level",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("1b25d451-7b54-41d6-af00-d2e6950f502d"),
|
||||||
|
path: "assets/levels/terrain_authoring_showcase.scn.ron",
|
||||||
|
label: "terrain_authoring_showcase.scn",
|
||||||
|
kind_tag: "Level",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
@@ -225,6 +362,8 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
@@ -241,14 +380,16 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
id: ("7b143cfb-a9e9-45d4-8f01-cfaa66fa9811"),
|
id: ("d6cb4151-7124-4237-aaf9-f7f8abd5fb76"),
|
||||||
path: "assets/shaders/unlit.shader.ron",
|
path: "assets/materials/surface_tint.ron",
|
||||||
label: "unlit.shader",
|
label: "surface_tint",
|
||||||
kind_tag: "ShaderSchema",
|
kind_tag: "Material",
|
||||||
import_settings: (
|
import_settings: (
|
||||||
scale: 1.0,
|
scale: 1.0,
|
||||||
generate_collider: true,
|
generate_collider: true,
|
||||||
@@ -257,6 +398,258 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("cc2769da-c9a5-4cb3-866a-cc81d0688ee2"),
|
||||||
|
path: "assets/materials/surface_tint_instance.ron",
|
||||||
|
label: "surface_tint_instance",
|
||||||
|
kind_tag: "Material",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("113f74df-e39c-41d4-9b5b-e48efe541f7f"),
|
||||||
|
path: "assets/models/RobotExpressive.glb",
|
||||||
|
label: "RobotExpressive",
|
||||||
|
kind_tag: "Model",
|
||||||
|
source_fingerprint: Some((
|
||||||
|
byte_len: 463988,
|
||||||
|
content_hash: "5869cb813e6a6093eda7af2824a9c13a582750e0443e88ce7c991a1f83415521",
|
||||||
|
)),
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: SceneInstance,
|
||||||
|
hierarchy_mode: SourceHierarchy,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: Some("assets/meshes/generated/113f74df-e39c-41d4-9b5b-e48efe541f7f.static_mesh.ron"),
|
||||||
|
animation_manifest_path: Some("assets/animations/generated/113f74df-e39c-41d4-9b5b-e48efe541f7f.animation.ron"),
|
||||||
|
default_animation_clip_id: Some("animation:clip:8:standing"),
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("b98ef565-3500-49e7-9935-f685fa9b2594"),
|
||||||
|
path: "assets/models/painted_wooden_chair_02_2k.fbx",
|
||||||
|
label: "painted_wooden_chair_02_2k",
|
||||||
|
kind_tag: "Model",
|
||||||
|
source_fingerprint: Some((
|
||||||
|
byte_len: 59964,
|
||||||
|
content_hash: "b12973a62dcb44589e380ea833eade726ae98a86c81084c842ee3801866d6a46",
|
||||||
|
)),
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: AuthoringOverride,
|
||||||
|
static_mesh_manifest_path: Some("assets/meshes/generated/b98ef565-3500-49e7-9935-f685fa9b2594.static_mesh.ron"),
|
||||||
|
animation_manifest_path: Some("assets/animations/generated/b98ef565-3500-49e7-9935-f685fa9b2594.animation.ron"),
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [
|
||||||
|
"assets/models/textures/painted_wooden_chair_02_diff_2k.jpg",
|
||||||
|
"assets/models/textures/painted_wooden_chair_02_nor_gl_2k.exr",
|
||||||
|
"assets/models/textures/painted_wooden_chair_02_rough_2k.exr",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("3f63f359-45eb-4cb2-8970-71921cbd7bd0"),
|
||||||
|
path: "assets/models/robot_expressive.glb",
|
||||||
|
label: "robot_expressive",
|
||||||
|
kind_tag: "Model",
|
||||||
|
source_fingerprint: Some((
|
||||||
|
byte_len: 463988,
|
||||||
|
content_hash: "5869cb813e6a6093eda7af2824a9c13a582750e0443e88ce7c991a1f83415521",
|
||||||
|
)),
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: Some("assets/meshes/generated/3f63f359-45eb-4cb2-8970-71921cbd7bd0.static_mesh.ron"),
|
||||||
|
animation_manifest_path: Some("assets/animations/generated/3f63f359-45eb-4cb2-8970-71921cbd7bd0.animation.ron"),
|
||||||
|
default_animation_clip_id: Some("animation:clip:8:standing"),
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("264e2010-0693-4d74-8440-99373c2cedb3"),
|
||||||
|
path: "assets/navigation/generated/navigation_showcase_humanoid.nav.ron",
|
||||||
|
label: "navigation_showcase_humanoid.nav",
|
||||||
|
kind_tag: "Level",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("31963299-d4c1-45dc-8f67-2f469ca1ad6d"),
|
||||||
|
path: "assets/post_fx/chromatic_aberration.ron",
|
||||||
|
label: "chromatic_aberration",
|
||||||
|
kind_tag: "PostProcessEffect",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("e14a9bc3-9a4e-47b0-901f-b31c004e1836"),
|
||||||
|
path: "assets/post_fx/vignette.ron",
|
||||||
|
label: "vignette",
|
||||||
|
kind_tag: "PostProcessEffect",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("862530b2-8111-4ebb-9078-29723c002e08"),
|
||||||
|
path: "assets/prefabs/example_base.scn.ron",
|
||||||
|
label: "example_base.scn",
|
||||||
|
kind_tag: "Prefab",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("682191d6-59cd-46a1-9560-6cf7bc1583b2"),
|
||||||
|
path: "assets/prefabs/example_nested.scn.ron",
|
||||||
|
label: "example_nested.scn",
|
||||||
|
kind_tag: "Prefab",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("c14f6240-5654-4e80-9edb-2b4c44cf8d61"),
|
||||||
|
path: "assets/prefabs/example_variant.scn.ron",
|
||||||
|
label: "example_variant.scn",
|
||||||
|
kind_tag: "Prefab",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("2c4a9866-17b5-4797-9a8f-726b2ffacdb9"),
|
||||||
|
path: "assets/rendering_profiles/cave_dark.ron",
|
||||||
|
label: "cave_dark",
|
||||||
|
kind_tag: "RenderingProfile",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("802471df-8295-4997-80e2-db4191850fc9"),
|
||||||
|
path: "assets/rendering_profiles/outdoor_haze.ron",
|
||||||
|
label: "outdoor_haze",
|
||||||
|
kind_tag: "RenderingProfile",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("e42185de-cda2-4a9e-9df0-df67ccd86123"),
|
||||||
|
path: "assets/samples/editor_samples.ron",
|
||||||
|
label: "editor_samples",
|
||||||
|
kind_tag: "Level",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
@@ -273,6 +666,110 @@
|
|||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: SourceMaterials,
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("a72943d6-3e9d-4629-8887-5c02d99d4f92"),
|
||||||
|
path: "assets/shaders/surface_tint.shader.ron",
|
||||||
|
label: "surface_tint.shader",
|
||||||
|
kind_tag: "ShaderSchema",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("7b143cfb-a9e9-45d4-8f01-cfaa66fa9811"),
|
||||||
|
path: "assets/shaders/unlit.shader.ron",
|
||||||
|
label: "unlit.shader",
|
||||||
|
kind_tag: "ShaderSchema",
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("0496e62e-1837-4940-a9c9-b2b4ffe9ed90"),
|
||||||
|
path: "assets/textures/metal_stool_01_arm_2k.jpg",
|
||||||
|
label: "metal_stool_01_arm_2k",
|
||||||
|
kind_tag: "Texture",
|
||||||
|
source_fingerprint: Some((
|
||||||
|
byte_len: 3152060,
|
||||||
|
content_hash: "31b2249ed7b50d3a021312a1e299167897513710ee8ded75c5c5e56aad592e10",
|
||||||
|
)),
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("bddaa4d4-5097-42bf-8d51-dd9a3580442a"),
|
||||||
|
path: "assets/textures/metal_stool_01_diff_2k.jpg",
|
||||||
|
label: "metal_stool_01_diff_2k",
|
||||||
|
kind_tag: "Texture",
|
||||||
|
source_fingerprint: Some((
|
||||||
|
byte_len: 2603921,
|
||||||
|
content_hash: "e0b9dee5b09f1968e7c6ea82eb9a157d303c25d0600913b8b9c809adf50b73c8",
|
||||||
|
)),
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("c4abe41c-ac88-4aec-8168-27e8a7c90583"),
|
||||||
|
path: "assets/textures/metal_stool_01_nor_gl_2k.jpg",
|
||||||
|
label: "metal_stool_01_nor_gl_2k",
|
||||||
|
kind_tag: "Texture",
|
||||||
|
source_fingerprint: Some((
|
||||||
|
byte_len: 2779150,
|
||||||
|
content_hash: "8c0aa4cf4270c9bf7217fba40b2b48878972ee59cff851cb8dfa57a90f4f373b",
|
||||||
|
)),
|
||||||
|
import_settings: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -0,0 +1,236 @@
|
|||||||
|
(
|
||||||
|
schema_version: 3,
|
||||||
|
asset_id: "113f74df-e39c-41d4-9b5b-e48efe541f7f",
|
||||||
|
label: "RobotExpressive",
|
||||||
|
default_animation_clip_id: Some("animation:clip:8:standing"),
|
||||||
|
source: (
|
||||||
|
path: "assets/models/RobotExpressive.glb",
|
||||||
|
format: "glb",
|
||||||
|
fingerprint: (
|
||||||
|
byte_len: 463988,
|
||||||
|
modified_unix_secs: 1783799272,
|
||||||
|
content_hash: "5869cb813e6a6093eda7af2824a9c13a582750e0443e88ce7c991a1f83415521",
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
runtime_supported: true,
|
||||||
|
skeletons: [
|
||||||
|
(
|
||||||
|
id: "animation:skeleton:0:skeleton_0",
|
||||||
|
label: "Skeleton 0",
|
||||||
|
source_index: 0,
|
||||||
|
signature: ("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b"),
|
||||||
|
joint_paths: [
|
||||||
|
"RootNode/RobotArmature/Bone",
|
||||||
|
"RootNode/RobotArmature/Bone/Foot.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Neck",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Neck/Head",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm2.L/Middle1.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm2.L/Middle1.L/Middle2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Thumb.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Thumb.L/Thumb2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm1.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm1.L/Index.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm1.L/Index.L/Index2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm3.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm3.L/Ring1.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm3.L/Ring1.L/Ring2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm2.R/Middle1.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm2.R/Middle1.R/Middle2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Thumb.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Thumb.R/Thumb2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm1.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm1.R/Index.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm1.R/Index.R/Index2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm3.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm3.R/Ring1.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm3.R/Ring1.R/Ring2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.L/LowerLeg.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.R/LowerLeg.R",
|
||||||
|
"RootNode/RobotArmature/Bone/PoleTarget.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Foot.R",
|
||||||
|
"RootNode/RobotArmature/Bone/PoleTarget.R",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:skeleton:1:skeleton_1",
|
||||||
|
label: "Skeleton 1",
|
||||||
|
source_index: 1,
|
||||||
|
signature: ("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b"),
|
||||||
|
joint_paths: [
|
||||||
|
"RootNode/RobotArmature/Bone",
|
||||||
|
"RootNode/RobotArmature/Bone/Foot.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Neck",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Neck/Head",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm2.L/Middle1.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm2.L/Middle1.L/Middle2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Thumb.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Thumb.L/Thumb2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm1.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm1.L/Index.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm1.L/Index.L/Index2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm3.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm3.L/Ring1.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm3.L/Ring1.L/Ring2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm2.R/Middle1.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm2.R/Middle1.R/Middle2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Thumb.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Thumb.R/Thumb2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm1.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm1.R/Index.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm1.R/Index.R/Index2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm3.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm3.R/Ring1.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm3.R/Ring1.R/Ring2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.L/LowerLeg.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.R/LowerLeg.R",
|
||||||
|
"RootNode/RobotArmature/Bone/PoleTarget.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Foot.R",
|
||||||
|
"RootNode/RobotArmature/Bone/PoleTarget.R",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
clips: [
|
||||||
|
(
|
||||||
|
id: "animation:clip:0:dance",
|
||||||
|
label: "Dance",
|
||||||
|
source_index: 0,
|
||||||
|
duration_seconds: 3.3333333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:1:death",
|
||||||
|
label: "Death",
|
||||||
|
source_index: 1,
|
||||||
|
duration_seconds: 0.9583333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:2:idle",
|
||||||
|
label: "Idle",
|
||||||
|
source_index: 2,
|
||||||
|
duration_seconds: 3.3333333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:3:jump",
|
||||||
|
label: "Jump",
|
||||||
|
source_index: 3,
|
||||||
|
duration_seconds: 0.7083333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:4:no",
|
||||||
|
label: "No",
|
||||||
|
source_index: 4,
|
||||||
|
duration_seconds: 1.6666666,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:5:punch",
|
||||||
|
label: "Punch",
|
||||||
|
source_index: 5,
|
||||||
|
duration_seconds: 0.8333333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:6:running",
|
||||||
|
label: "Running",
|
||||||
|
source_index: 6,
|
||||||
|
duration_seconds: 0.9583333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:7:sitting",
|
||||||
|
label: "Sitting",
|
||||||
|
source_index: 7,
|
||||||
|
duration_seconds: 0.41666666,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:8:standing",
|
||||||
|
label: "Standing",
|
||||||
|
source_index: 8,
|
||||||
|
duration_seconds: 0.41666666,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:9:thumbsup",
|
||||||
|
label: "ThumbsUp",
|
||||||
|
source_index: 9,
|
||||||
|
duration_seconds: 1.5833334,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:10:walking",
|
||||||
|
label: "Walking",
|
||||||
|
source_index: 10,
|
||||||
|
duration_seconds: 0.9583333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:11:walkjump",
|
||||||
|
label: "WalkJump",
|
||||||
|
source_index: 11,
|
||||||
|
duration_seconds: 0.8333333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:12:wave",
|
||||||
|
label: "Wave",
|
||||||
|
source_index: 12,
|
||||||
|
duration_seconds: 1.8333334,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:13:yes",
|
||||||
|
label: "Yes",
|
||||||
|
source_index: 13,
|
||||||
|
duration_seconds: 1.6666666,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
diagnostics: [],
|
||||||
|
)
|
||||||
@@ -0,0 +1,236 @@
|
|||||||
|
(
|
||||||
|
schema_version: 3,
|
||||||
|
asset_id: "3f63f359-45eb-4cb2-8970-71921cbd7bd0",
|
||||||
|
label: "robot_expressive",
|
||||||
|
default_animation_clip_id: Some("animation:clip:8:standing"),
|
||||||
|
source: (
|
||||||
|
path: "assets/models/robot_expressive.glb",
|
||||||
|
format: "glb",
|
||||||
|
fingerprint: (
|
||||||
|
byte_len: 463988,
|
||||||
|
modified_unix_secs: 1783750957,
|
||||||
|
content_hash: "5869cb813e6a6093eda7af2824a9c13a582750e0443e88ce7c991a1f83415521",
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
runtime_supported: true,
|
||||||
|
skeletons: [
|
||||||
|
(
|
||||||
|
id: "animation:skeleton:0:skeleton_0",
|
||||||
|
label: "Skeleton 0",
|
||||||
|
source_index: 0,
|
||||||
|
signature: ("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b"),
|
||||||
|
joint_paths: [
|
||||||
|
"RootNode/RobotArmature/Bone",
|
||||||
|
"RootNode/RobotArmature/Bone/Foot.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Neck",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Neck/Head",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm2.L/Middle1.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm2.L/Middle1.L/Middle2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Thumb.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Thumb.L/Thumb2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm1.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm1.L/Index.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm1.L/Index.L/Index2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm3.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm3.L/Ring1.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm3.L/Ring1.L/Ring2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm2.R/Middle1.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm2.R/Middle1.R/Middle2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Thumb.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Thumb.R/Thumb2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm1.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm1.R/Index.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm1.R/Index.R/Index2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm3.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm3.R/Ring1.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm3.R/Ring1.R/Ring2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.L/LowerLeg.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.R/LowerLeg.R",
|
||||||
|
"RootNode/RobotArmature/Bone/PoleTarget.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Foot.R",
|
||||||
|
"RootNode/RobotArmature/Bone/PoleTarget.R",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:skeleton:1:skeleton_1",
|
||||||
|
label: "Skeleton 1",
|
||||||
|
source_index: 1,
|
||||||
|
signature: ("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b"),
|
||||||
|
joint_paths: [
|
||||||
|
"RootNode/RobotArmature/Bone",
|
||||||
|
"RootNode/RobotArmature/Bone/Foot.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Neck",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Neck/Head",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm2.L/Middle1.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm2.L/Middle1.L/Middle2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Thumb.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Thumb.L/Thumb2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm1.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm1.L/Index.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm1.L/Index.L/Index2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm3.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm3.L/Ring1.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/LowerArm.L/Palm3.L/Ring1.L/Ring2.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm2.R/Middle1.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm2.R/Middle1.R/Middle2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Thumb.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Thumb.R/Thumb2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm1.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm1.R/Index.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm1.R/Index.R/Index2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm3.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm3.R/Ring1.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/LowerArm.R/Palm3.R/Ring1.R/Ring2.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.L/LowerLeg.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.R",
|
||||||
|
"RootNode/RobotArmature/Bone/Body/UpperLeg.R/LowerLeg.R",
|
||||||
|
"RootNode/RobotArmature/Bone/PoleTarget.L",
|
||||||
|
"RootNode/RobotArmature/Bone/Foot.R",
|
||||||
|
"RootNode/RobotArmature/Bone/PoleTarget.R",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
clips: [
|
||||||
|
(
|
||||||
|
id: "animation:clip:0:dance",
|
||||||
|
label: "Dance",
|
||||||
|
source_index: 0,
|
||||||
|
duration_seconds: 3.3333333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:1:death",
|
||||||
|
label: "Death",
|
||||||
|
source_index: 1,
|
||||||
|
duration_seconds: 0.9583333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:2:idle",
|
||||||
|
label: "Idle",
|
||||||
|
source_index: 2,
|
||||||
|
duration_seconds: 3.3333333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:3:jump",
|
||||||
|
label: "Jump",
|
||||||
|
source_index: 3,
|
||||||
|
duration_seconds: 0.7083333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:4:no",
|
||||||
|
label: "No",
|
||||||
|
source_index: 4,
|
||||||
|
duration_seconds: 1.6666666,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:5:punch",
|
||||||
|
label: "Punch",
|
||||||
|
source_index: 5,
|
||||||
|
duration_seconds: 0.8333333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:6:running",
|
||||||
|
label: "Running",
|
||||||
|
source_index: 6,
|
||||||
|
duration_seconds: 0.9583333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:7:sitting",
|
||||||
|
label: "Sitting",
|
||||||
|
source_index: 7,
|
||||||
|
duration_seconds: 0.41666666,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:8:standing",
|
||||||
|
label: "Standing",
|
||||||
|
source_index: 8,
|
||||||
|
duration_seconds: 0.41666666,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:9:thumbsup",
|
||||||
|
label: "ThumbsUp",
|
||||||
|
source_index: 9,
|
||||||
|
duration_seconds: 1.5833334,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:10:walking",
|
||||||
|
label: "Walking",
|
||||||
|
source_index: 10,
|
||||||
|
duration_seconds: 0.9583333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:11:walkjump",
|
||||||
|
label: "WalkJump",
|
||||||
|
source_index: 11,
|
||||||
|
duration_seconds: 0.8333333,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:12:wave",
|
||||||
|
label: "Wave",
|
||||||
|
source_index: 12,
|
||||||
|
duration_seconds: 1.8333334,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "animation:clip:13:yes",
|
||||||
|
label: "Yes",
|
||||||
|
source_index: 13,
|
||||||
|
duration_seconds: 1.6666666,
|
||||||
|
target_skeleton_signature: Some(("e9761f2a198d6a280afd0fc2aca6e8783dc6237bd85c90b8bc07a2e11271dc2b")),
|
||||||
|
events: [],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
diagnostics: [],
|
||||||
|
)
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
(
|
||||||
|
schema_version: 3,
|
||||||
|
asset_id: "b98ef565-3500-49e7-9935-f685fa9b2594",
|
||||||
|
label: "painted_wooden_chair_02_2k",
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
source: (
|
||||||
|
path: "assets/models/painted_wooden_chair_02_2k.fbx",
|
||||||
|
format: "fbx",
|
||||||
|
fingerprint: (
|
||||||
|
byte_len: 59964,
|
||||||
|
modified_unix_secs: 1780713434,
|
||||||
|
content_hash: "b12973a62dcb44589e380ea833eade726ae98a86c81084c842ee3801866d6a46",
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
runtime_supported: false,
|
||||||
|
skeletons: [],
|
||||||
|
clips: [],
|
||||||
|
diagnostics: [],
|
||||||
|
)
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,10 @@
|
|||||||
|
(
|
||||||
|
version: 1,
|
||||||
|
name: "Development",
|
||||||
|
cargo_profile: Development,
|
||||||
|
target: None,
|
||||||
|
features: [],
|
||||||
|
rendering_tier: "development",
|
||||||
|
default_scene: Some("assets/levels/editor_scene.scn.ron"),
|
||||||
|
output_dir: "dist/development",
|
||||||
|
)
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
(
|
||||||
|
version: 1,
|
||||||
|
name: "QA",
|
||||||
|
cargo_profile: Qa,
|
||||||
|
target: None,
|
||||||
|
features: [],
|
||||||
|
rendering_tier: "representative",
|
||||||
|
default_scene: Some("assets/levels/editor_scene.scn.ron"),
|
||||||
|
output_dir: "dist/qa",
|
||||||
|
)
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
(
|
||||||
|
version: 1,
|
||||||
|
name: "Release",
|
||||||
|
cargo_profile: Release,
|
||||||
|
target: None,
|
||||||
|
features: [],
|
||||||
|
rendering_tier: "shipping",
|
||||||
|
default_scene: Some("assets/levels/editor_scene.scn.ron"),
|
||||||
|
output_dir: "dist/release",
|
||||||
|
)
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
(schema_version: 4,resources: {
|
||||||
|
},
|
||||||
|
entities: {
|
||||||
|
4294969001: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Audition Tone Source",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 1.5, -4.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("audio-showcase-source"),
|
||||||
|
"shared::components::ActorKind": AudioSource,
|
||||||
|
"shared::components::AudioSourceDesc": (
|
||||||
|
clip: Some((
|
||||||
|
asset_id: "c0a7d10e-53c1-4de0-b0dc-34a66f44ba77",
|
||||||
|
sub_asset_id: "audio:source",
|
||||||
|
label: "Editor Audition Tone",
|
||||||
|
source_path: Some("assets/audio/editor_audition_tone.ogg"),
|
||||||
|
)),
|
||||||
|
gain_db: -6.0,
|
||||||
|
pitch: 1.0,
|
||||||
|
looping: false,
|
||||||
|
autoplay: true,
|
||||||
|
spatial_blend: 1.0,
|
||||||
|
attenuation: (
|
||||||
|
min_distance: 1.0,
|
||||||
|
max_distance: 18.0,
|
||||||
|
rolloff: Inverse,
|
||||||
|
rolloff_factor: 1.0,
|
||||||
|
),
|
||||||
|
bus: "sfx",
|
||||||
|
),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
}),
|
||||||
|
4294969002: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Showcase Listener",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 1.7, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("audio-showcase-listener"),
|
||||||
|
"shared::components::ActorKind": AudioListener,
|
||||||
|
"shared::components::AudioListenerDesc": (
|
||||||
|
enabled: true,
|
||||||
|
priority: 100,
|
||||||
|
ear_gap: 0.2,
|
||||||
|
),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
)
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
(schema_version: 4, resources: {}, entities: {
|
||||||
|
1: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Valid Box Collider",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (-4.5, 1.0, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("collider-showcase-box"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (0),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.18, g: 0.62, b: 0.36, a: 1.0),
|
||||||
|
metallic: 0.05, roughness: 0.55,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0), emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None, emissive_texture: None, normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None, material_asset_path: None, parameters: [], textures: [],
|
||||||
|
),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (1.8, 2.0, 1.8)),
|
||||||
|
"shared::components::RigidBodyDesc": (body: Static),
|
||||||
|
"shared::components::ColliderDesc": (
|
||||||
|
enabled: true, is_trigger: false,
|
||||||
|
shape: Cuboid(x_length: 1.8, y_length: 2.0, z_length: 1.8),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
2: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Valid Sphere Collider",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (-2.25, 1.0, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.35, 0.8),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("collider-showcase-sphere"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (1),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.16, g: 0.52, b: 0.78, a: 1.0),
|
||||||
|
metallic: 0.08, roughness: 0.42,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0), emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None, emissive_texture: None, normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None, material_asset_path: None, parameters: [], textures: [],
|
||||||
|
),
|
||||||
|
"shared::components::Primitive": (shape: Sphere, size: (2.0, 2.0, 2.0)),
|
||||||
|
"shared::components::RigidBodyDesc": (body: Static),
|
||||||
|
"shared::components::ColliderDesc": (
|
||||||
|
enabled: true, is_trigger: false, shape: Sphere(radius: 1.0),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
3: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Valid Capsule Collider",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 1.4, 0.0),
|
||||||
|
rotation: (0.0, 0.1950903, 0.0, 0.9807853),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("collider-showcase-capsule"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (2),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.58, g: 0.34, b: 0.78, a: 1.0),
|
||||||
|
metallic: 0.06, roughness: 0.48,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0), emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None, emissive_texture: None, normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None, material_asset_path: None, parameters: [], textures: [],
|
||||||
|
),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (1.4, 2.8, 1.4)),
|
||||||
|
"shared::components::RigidBodyDesc": (body: Static),
|
||||||
|
"shared::components::ColliderDesc": (
|
||||||
|
enabled: true, is_trigger: false, shape: Capsule(radius: 0.7, height: 2.8),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
4: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Trigger Collider",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (2.25, 1.0, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("collider-showcase-trigger"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (3),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.12, g: 0.68, b: 0.82, a: 1.0),
|
||||||
|
metallic: 0.03, roughness: 0.4,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0), emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None, emissive_texture: None, normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None, material_asset_path: None, parameters: [], textures: [],
|
||||||
|
),
|
||||||
|
"shared::components::Primitive": (shape: Sphere, size: (2.0, 2.0, 2.0)),
|
||||||
|
"shared::components::RigidBodyDesc": (body: Static),
|
||||||
|
"shared::components::ColliderDesc": (
|
||||||
|
enabled: true, is_trigger: true, shape: Sphere(radius: 1.0),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
5: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Disabled Collider",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (4.5, 1.0, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("collider-showcase-disabled"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (4),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.38, g: 0.40, b: 0.46, a: 1.0),
|
||||||
|
metallic: 0.02, roughness: 0.68,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0), emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None, emissive_texture: None, normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None, material_asset_path: None, parameters: [], textures: [],
|
||||||
|
),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (1.8, 2.0, 1.8)),
|
||||||
|
"shared::components::RigidBodyDesc": (body: Static),
|
||||||
|
"shared::components::ColliderDesc": (
|
||||||
|
enabled: false, is_trigger: false,
|
||||||
|
shape: Cuboid(x_length: 1.8, y_length: 2.0, z_length: 1.8),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
6: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Missing Collider",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 1.0, -3.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("collider-showcase-missing"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (5),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.78, g: 0.16, b: 0.20, a: 1.0),
|
||||||
|
metallic: 0.02, roughness: 0.58,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0), emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None, emissive_texture: None, normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None, material_asset_path: None, parameters: [], textures: [],
|
||||||
|
),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (1.8, 2.0, 1.8)),
|
||||||
|
"shared::components::RigidBodyDesc": (body: Static),
|
||||||
|
}),
|
||||||
|
7: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Collider Showcase Sun",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 8.0, 4.0),
|
||||||
|
rotation: (-0.3826834, 0.0, 0.0, 0.9238795),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("collider-showcase-sun"),
|
||||||
|
"shared::components::ActorKind": Light,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (6),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::LightDesc": (
|
||||||
|
kind: Directional, color: (r: 1.0, g: 0.95, b: 0.88, a: 1.0),
|
||||||
|
intensity: 100000.0, range: 0.0, shadows: true,
|
||||||
|
inner_angle_deg: 25.0, outer_angle_deg: 35.0,
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
})
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
(schema_version: 2,
|
(schema_version: 4,resources: {
|
||||||
resources: {},
|
},
|
||||||
entities: {
|
entities: {
|
||||||
4294967126: (
|
4294967126: (components: {
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Pillar Copy",
|
"bevy_ecs::name::Name": "Pillar Copy",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (3.7178926, 3.5, -11.932255),
|
translation: (3.7178926, 3.5, -11.932255),
|
||||||
@@ -41,10 +40,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.2, 7.0, 1.2),
|
size: (1.2, 7.0, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
4294967158: (components: {
|
||||||
4294967158: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Scene Sun",
|
"bevy_ecs::name::Name": "Scene Sun",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (0.0, 5.316672, 0.0),
|
translation: (0.0, 5.316672, 0.0),
|
||||||
@@ -71,10 +68,8 @@
|
|||||||
inner_angle_deg: 25.0,
|
inner_angle_deg: 25.0,
|
||||||
outer_angle_deg: 35.0,
|
outer_angle_deg: 35.0,
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
4294967159: (components: {
|
||||||
4294967159: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Ground",
|
"bevy_ecs::name::Name": "Ground",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (0.0, -0.5, 0.0),
|
translation: (0.0, -0.5, 0.0),
|
||||||
@@ -113,10 +108,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (200.0, 1.0, 200.0),
|
size: (200.0, 1.0, 200.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934420: (components: {
|
||||||
8589934420: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Pillar Copy",
|
"bevy_ecs::name::Name": "Pillar Copy",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-12.079595, 3.5, -13.098544),
|
translation: (-12.079595, 3.5, -13.098544),
|
||||||
@@ -155,10 +148,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.2, 7.0, 1.2),
|
size: (1.2, 7.0, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934456: (components: {
|
||||||
8589934456: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Player Start",
|
"bevy_ecs::name::Name": "Player Start",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (0.0, 0.9900649, 12.46175),
|
translation: (0.0, 0.9900649, 12.46175),
|
||||||
@@ -172,10 +163,8 @@
|
|||||||
"shared::components::HierarchySiblingIndex": (2),
|
"shared::components::HierarchySiblingIndex": (2),
|
||||||
"shared::components::LevelObject": (),
|
"shared::components::LevelObject": (),
|
||||||
"shared::components::PlayerSpawn": (),
|
"shared::components::PlayerSpawn": (),
|
||||||
},
|
}),
|
||||||
),
|
8589934457: (components: {
|
||||||
8589934457: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "ShowcaseSphere",
|
"bevy_ecs::name::Name": "ShowcaseSphere",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-1.3999996, 0.6, 4.0),
|
translation: (-1.3999996, 0.6, 4.0),
|
||||||
@@ -212,10 +201,8 @@
|
|||||||
shape: Sphere,
|
shape: Sphere,
|
||||||
size: (1.2, 1.2, 1.2),
|
size: (1.2, 1.2, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934458: (components: {
|
||||||
8589934458: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "ShowcaseSphere",
|
"bevy_ecs::name::Name": "ShowcaseSphere",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-3.6, 0.6, 4.0),
|
translation: (-3.6, 0.6, 4.0),
|
||||||
@@ -252,10 +239,8 @@
|
|||||||
shape: Sphere,
|
shape: Sphere,
|
||||||
size: (1.2, 1.2, 1.2),
|
size: (1.2, 1.2, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934459: (components: {
|
||||||
8589934459: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "ShowcaseSphere",
|
"bevy_ecs::name::Name": "ShowcaseSphere",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-5.8, 0.6, 4.0),
|
translation: (-5.8, 0.6, 4.0),
|
||||||
@@ -292,10 +277,8 @@
|
|||||||
shape: Sphere,
|
shape: Sphere,
|
||||||
size: (1.2, 1.2, 1.2),
|
size: (1.2, 1.2, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934460: (components: {
|
||||||
8589934460: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "ShowcaseSphere",
|
"bevy_ecs::name::Name": "ShowcaseSphere",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-8.0, 0.6, 4.0),
|
translation: (-8.0, 0.6, 4.0),
|
||||||
@@ -332,10 +315,8 @@
|
|||||||
shape: Sphere,
|
shape: Sphere,
|
||||||
size: (1.2, 1.2, 1.2),
|
size: (1.2, 1.2, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934461: (components: {
|
||||||
8589934461: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.90000004, 9.5),
|
translation: (12.0, 0.90000004, 9.5),
|
||||||
@@ -374,10 +355,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 1.8000001, 0.5),
|
size: (5.0, 1.8000001, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934462: (components: {
|
||||||
8589934462: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.81000006, 10.0),
|
translation: (12.0, 0.81000006, 10.0),
|
||||||
@@ -416,10 +395,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 1.6200001, 0.5),
|
size: (5.0, 1.6200001, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934463: (components: {
|
||||||
8589934463: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.72, 10.5),
|
translation: (12.0, 0.72, 10.5),
|
||||||
@@ -458,10 +435,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 1.44, 0.5),
|
size: (5.0, 1.44, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934464: (components: {
|
||||||
8589934464: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.63, 11.0),
|
translation: (12.0, 0.63, 11.0),
|
||||||
@@ -500,10 +475,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 1.26, 0.5),
|
size: (5.0, 1.26, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934465: (components: {
|
||||||
8589934465: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.54, 11.5),
|
translation: (12.0, 0.54, 11.5),
|
||||||
@@ -542,10 +515,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 1.08, 0.5),
|
size: (5.0, 1.08, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934466: (components: {
|
||||||
8589934466: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.45000002, 12.0),
|
translation: (12.0, 0.45000002, 12.0),
|
||||||
@@ -584,10 +555,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 0.90000004, 0.5),
|
size: (5.0, 0.90000004, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934467: (components: {
|
||||||
8589934467: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.36, 12.5),
|
translation: (12.0, 0.36, 12.5),
|
||||||
@@ -626,10 +595,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 0.72, 0.5),
|
size: (5.0, 0.72, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934468: (components: {
|
||||||
8589934468: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.27, 13.0),
|
translation: (12.0, 0.27, 13.0),
|
||||||
@@ -668,10 +635,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 0.54, 0.5),
|
size: (5.0, 0.54, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934469: (components: {
|
||||||
8589934469: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.18, 13.5),
|
translation: (12.0, 0.18, 13.5),
|
||||||
@@ -710,10 +675,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 0.36, 0.5),
|
size: (5.0, 0.36, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934470: (components: {
|
||||||
8589934470: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.09, 14.0),
|
translation: (12.0, 0.09, 14.0),
|
||||||
@@ -752,10 +715,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 0.18, 0.5),
|
size: (5.0, 0.18, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934471: (components: {
|
||||||
8589934471: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Ramp",
|
"bevy_ecs::name::Name": "Ramp",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-14.0, 1.6, 0.0),
|
translation: (-14.0, 1.6, 0.0),
|
||||||
@@ -794,10 +755,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 0.4, 9.0),
|
size: (5.0, 0.4, 9.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934472: (components: {
|
||||||
8589934472: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Crate",
|
"bevy_ecs::name::Name": "Crate",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (5.4, 0.5, 2.4),
|
translation: (5.4, 0.5, 2.4),
|
||||||
@@ -836,10 +795,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.0, 1.0, 1.0),
|
size: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934473: (components: {
|
||||||
8589934473: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Crate",
|
"bevy_ecs::name::Name": "Crate",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (4.0, 0.75, 2.0),
|
translation: (4.0, 0.75, 2.0),
|
||||||
@@ -878,10 +835,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.5, 1.5, 1.5),
|
size: (1.5, 1.5, 1.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934474: (components: {
|
||||||
8589934474: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Crate",
|
"bevy_ecs::name::Name": "Crate",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-2.3, 0.5, -3.1),
|
translation: (-2.3, 0.5, -3.1),
|
||||||
@@ -920,10 +875,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.0, 1.0, 1.0),
|
size: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934475: (components: {
|
||||||
8589934475: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Crate",
|
"bevy_ecs::name::Name": "Crate",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-1.6, 0.5, -3.2),
|
translation: (-1.6, 0.5, -3.2),
|
||||||
@@ -962,10 +915,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.0, 1.0, 1.0),
|
size: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934476: (components: {
|
||||||
8589934476: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Crate",
|
"bevy_ecs::name::Name": "Crate",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-3.0, 0.5, -3.0),
|
translation: (-3.0, 0.5, -3.0),
|
||||||
@@ -1004,10 +955,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.0, 1.0, 1.0),
|
size: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934477: (components: {
|
||||||
8589934477: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Pillar",
|
"bevy_ecs::name::Name": "Pillar",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (8.0, 3.5, 6.0),
|
translation: (8.0, 3.5, 6.0),
|
||||||
@@ -1046,10 +995,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.2, 7.0, 1.2),
|
size: (1.2, 7.0, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934478: (components: {
|
||||||
8589934478: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Pillar",
|
"bevy_ecs::name::Name": "Pillar",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-8.0, 3.5, 6.0),
|
translation: (-8.0, 3.5, 6.0),
|
||||||
@@ -1088,10 +1035,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.2, 7.0, 1.2),
|
size: (1.2, 7.0, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934479: (components: {
|
||||||
8589934479: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Pillar",
|
"bevy_ecs::name::Name": "Pillar",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (8.0, 3.5, -6.0),
|
translation: (8.0, 3.5, -6.0),
|
||||||
@@ -1130,10 +1075,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.2, 7.0, 1.2),
|
size: (1.2, 7.0, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934480: (components: {
|
||||||
8589934480: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Pillar",
|
"bevy_ecs::name::Name": "Pillar",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-8.0, 3.5, -6.0),
|
translation: (-8.0, 3.5, -6.0),
|
||||||
@@ -1172,7 +1115,6 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.2, 7.0, 1.2),
|
size: (1.2, 7.0, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
(schema_version: 2,
|
(schema_version: 4,resources: {
|
||||||
resources: {},
|
},
|
||||||
entities: {
|
entities: {
|
||||||
4294967124: (
|
4294967124: (components: {
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Cube",
|
"bevy_ecs::name::Name": "Cube",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-14.0, 0.66941494, -1.9732417),
|
translation: (-14.0, 0.66941494, -1.9732417),
|
||||||
@@ -49,10 +48,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.0, 1.0, 1.0),
|
size: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
4294967126: (components: {
|
||||||
4294967126: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Cube",
|
"bevy_ecs::name::Name": "Cube",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-13.0, 0.5, 2.0),
|
translation: (-13.0, 0.5, 2.0),
|
||||||
@@ -99,10 +96,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.0, 1.0, 1.0),
|
size: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
4294967128: (components: {
|
||||||
4294967128: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Point Light",
|
"bevy_ecs::name::Name": "Point Light",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-10.83656, 1.680895, -1.0713063),
|
translation: (-10.83656, 1.680895, -1.0713063),
|
||||||
@@ -129,10 +124,8 @@
|
|||||||
inner_angle_deg: 25.0,
|
inner_angle_deg: 25.0,
|
||||||
outer_angle_deg: 35.0,
|
outer_angle_deg: 35.0,
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
4294967158: (components: {
|
||||||
4294967158: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Scene Sun",
|
"bevy_ecs::name::Name": "Scene Sun",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (0.0, 5.316672, 0.0),
|
translation: (0.0, 5.316672, 0.0),
|
||||||
@@ -159,10 +152,8 @@
|
|||||||
inner_angle_deg: 25.0,
|
inner_angle_deg: 25.0,
|
||||||
outer_angle_deg: 35.0,
|
outer_angle_deg: 35.0,
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
4294967159: (components: {
|
||||||
4294967159: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Ground",
|
"bevy_ecs::name::Name": "Ground",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (0.0, -0.5, 0.0),
|
translation: (0.0, -0.5, 0.0),
|
||||||
@@ -209,10 +200,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (200.0, 1.0, 200.0),
|
size: (200.0, 1.0, 200.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934417: (components: {
|
||||||
8589934417: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Spot Light",
|
"bevy_ecs::name::Name": "Spot Light",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-13.387727, 0.9319196, -5.454666),
|
translation: (-13.387727, 0.9319196, -5.454666),
|
||||||
@@ -239,10 +228,8 @@
|
|||||||
inner_angle_deg: 25.0,
|
inner_angle_deg: 25.0,
|
||||||
outer_angle_deg: 35.0,
|
outer_angle_deg: 35.0,
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934456: (components: {
|
||||||
8589934456: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Player Start",
|
"bevy_ecs::name::Name": "Player Start",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (0.0, 0.9900649, 12.46175),
|
translation: (0.0, 0.9900649, 12.46175),
|
||||||
@@ -256,10 +243,8 @@
|
|||||||
"shared::components::HierarchySiblingIndex": (2),
|
"shared::components::HierarchySiblingIndex": (2),
|
||||||
"shared::components::LevelObject": (),
|
"shared::components::LevelObject": (),
|
||||||
"shared::components::PlayerSpawn": (),
|
"shared::components::PlayerSpawn": (),
|
||||||
},
|
}),
|
||||||
),
|
8589934457: (components: {
|
||||||
8589934457: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "ShowcaseSphere",
|
"bevy_ecs::name::Name": "ShowcaseSphere",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-1.3999996, 0.6, 4.0),
|
translation: (-1.3999996, 0.6, 4.0),
|
||||||
@@ -304,10 +289,8 @@
|
|||||||
shape: Sphere,
|
shape: Sphere,
|
||||||
size: (1.2, 1.2, 1.2),
|
size: (1.2, 1.2, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934458: (components: {
|
||||||
8589934458: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "ShowcaseSphere",
|
"bevy_ecs::name::Name": "ShowcaseSphere",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-3.6, 0.6, 4.0),
|
translation: (-3.6, 0.6, 4.0),
|
||||||
@@ -352,10 +335,8 @@
|
|||||||
shape: Sphere,
|
shape: Sphere,
|
||||||
size: (1.2, 1.2, 1.2),
|
size: (1.2, 1.2, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934459: (components: {
|
||||||
8589934459: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "ShowcaseSphere",
|
"bevy_ecs::name::Name": "ShowcaseSphere",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-5.8, 0.6, 4.0),
|
translation: (-5.8, 0.6, 4.0),
|
||||||
@@ -400,10 +381,8 @@
|
|||||||
shape: Sphere,
|
shape: Sphere,
|
||||||
size: (1.2, 1.2, 1.2),
|
size: (1.2, 1.2, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934460: (components: {
|
||||||
8589934460: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "ShowcaseSphere",
|
"bevy_ecs::name::Name": "ShowcaseSphere",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-8.0, 0.6, 4.0),
|
translation: (-8.0, 0.6, 4.0),
|
||||||
@@ -448,10 +427,8 @@
|
|||||||
shape: Sphere,
|
shape: Sphere,
|
||||||
size: (1.2, 1.2, 1.2),
|
size: (1.2, 1.2, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934461: (components: {
|
||||||
8589934461: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.90000004, 9.5),
|
translation: (12.0, 0.90000004, 9.5),
|
||||||
@@ -498,10 +475,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 1.8000001, 0.5),
|
size: (5.0, 1.8000001, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934462: (components: {
|
||||||
8589934462: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.81000006, 10.0),
|
translation: (12.0, 0.81000006, 10.0),
|
||||||
@@ -548,10 +523,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 1.6200001, 0.5),
|
size: (5.0, 1.6200001, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934463: (components: {
|
||||||
8589934463: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.72, 10.5),
|
translation: (12.0, 0.72, 10.5),
|
||||||
@@ -598,10 +571,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 1.44, 0.5),
|
size: (5.0, 1.44, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934464: (components: {
|
||||||
8589934464: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.63, 11.0),
|
translation: (12.0, 0.63, 11.0),
|
||||||
@@ -648,10 +619,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 1.26, 0.5),
|
size: (5.0, 1.26, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934465: (components: {
|
||||||
8589934465: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.54, 11.5),
|
translation: (12.0, 0.54, 11.5),
|
||||||
@@ -698,10 +667,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 1.08, 0.5),
|
size: (5.0, 1.08, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934466: (components: {
|
||||||
8589934466: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.45000002, 12.0),
|
translation: (12.0, 0.45000002, 12.0),
|
||||||
@@ -748,10 +715,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 0.90000004, 0.5),
|
size: (5.0, 0.90000004, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934467: (components: {
|
||||||
8589934467: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.36, 12.5),
|
translation: (12.0, 0.36, 12.5),
|
||||||
@@ -798,10 +763,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 0.72, 0.5),
|
size: (5.0, 0.72, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934468: (components: {
|
||||||
8589934468: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.27, 13.0),
|
translation: (12.0, 0.27, 13.0),
|
||||||
@@ -848,10 +811,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 0.54, 0.5),
|
size: (5.0, 0.54, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934469: (components: {
|
||||||
8589934469: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.18, 13.5),
|
translation: (12.0, 0.18, 13.5),
|
||||||
@@ -898,10 +859,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 0.36, 0.5),
|
size: (5.0, 0.36, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934470: (components: {
|
||||||
8589934470: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Stair",
|
"bevy_ecs::name::Name": "Stair",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (12.0, 0.09, 14.0),
|
translation: (12.0, 0.09, 14.0),
|
||||||
@@ -948,10 +907,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 0.18, 0.5),
|
size: (5.0, 0.18, 0.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934471: (components: {
|
||||||
8589934471: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Ramp",
|
"bevy_ecs::name::Name": "Ramp",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-14.0, 2.292737, 0.0),
|
translation: (-14.0, 2.292737, 0.0),
|
||||||
@@ -998,10 +955,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (5.0, 0.4, 9.0),
|
size: (5.0, 0.4, 9.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934472: (components: {
|
||||||
8589934472: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Crate",
|
"bevy_ecs::name::Name": "Crate",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (5.4, 0.5, 2.4),
|
translation: (5.4, 0.5, 2.4),
|
||||||
@@ -1048,10 +1003,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.0, 1.0, 1.0),
|
size: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934473: (components: {
|
||||||
8589934473: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Crate",
|
"bevy_ecs::name::Name": "Crate",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (4.0, 0.75, 2.0),
|
translation: (4.0, 0.75, 2.0),
|
||||||
@@ -1098,10 +1051,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.5, 1.5, 1.5),
|
size: (1.5, 1.5, 1.5),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934474: (components: {
|
||||||
8589934474: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Crate",
|
"bevy_ecs::name::Name": "Crate",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-2.3, 0.5, -3.1),
|
translation: (-2.3, 0.5, -3.1),
|
||||||
@@ -1148,10 +1099,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.0, 1.0, 1.0),
|
size: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934475: (components: {
|
||||||
8589934475: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Crate",
|
"bevy_ecs::name::Name": "Crate",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-1.6, 0.5, -3.2),
|
translation: (-1.6, 0.5, -3.2),
|
||||||
@@ -1198,10 +1147,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.0, 1.0, 1.0),
|
size: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934476: (components: {
|
||||||
8589934476: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Crate",
|
"bevy_ecs::name::Name": "Crate",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-3.0, 0.5, -3.0),
|
translation: (-3.0, 0.5, -3.0),
|
||||||
@@ -1248,10 +1195,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.0, 1.0, 1.0),
|
size: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934477: (components: {
|
||||||
8589934477: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Pillar",
|
"bevy_ecs::name::Name": "Pillar",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (8.0, 3.5, 6.0),
|
translation: (8.0, 3.5, 6.0),
|
||||||
@@ -1298,10 +1243,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.2, 7.0, 1.2),
|
size: (1.2, 7.0, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934478: (components: {
|
||||||
8589934478: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Pillar",
|
"bevy_ecs::name::Name": "Pillar",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-8.0, 3.5, 6.0),
|
translation: (-8.0, 3.5, 6.0),
|
||||||
@@ -1348,10 +1291,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.2, 7.0, 1.2),
|
size: (1.2, 7.0, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934479: (components: {
|
||||||
8589934479: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Pillar",
|
"bevy_ecs::name::Name": "Pillar",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (8.0, 3.5, -6.0),
|
translation: (8.0, 3.5, -6.0),
|
||||||
@@ -1398,10 +1339,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.2, 7.0, 1.2),
|
size: (1.2, 7.0, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8589934480: (components: {
|
||||||
8589934480: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Pillar",
|
"bevy_ecs::name::Name": "Pillar",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-8.0, 3.5, -6.0),
|
translation: (-8.0, 3.5, -6.0),
|
||||||
@@ -1448,10 +1387,8 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.2, 7.0, 1.2),
|
size: (1.2, 7.0, 1.2),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
12884901711: (components: {
|
||||||
12884901711: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Cube",
|
"bevy_ecs::name::Name": "Cube",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-13.391208, 0.5, -6.673126),
|
translation: (-13.391208, 0.5, -6.673126),
|
||||||
@@ -1498,7 +1435,6 @@
|
|||||||
shape: Box,
|
shape: Box,
|
||||||
size: (1.0, 1.0, 1.0),
|
size: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
+1798
-582
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,73 @@
|
|||||||
|
(schema_version: 4,resources: {
|
||||||
|
},
|
||||||
|
entities: {
|
||||||
|
1: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Navigation Bounds",
|
||||||
|
"bevy_transform::components::transform::Transform": (translation: (0.0, 0.0, 0.0), rotation: (0.0, 0.0, 0.0, 1.0), scale: (1.0, 1.0, 1.0)),
|
||||||
|
"shared::components::ActorId": ("navigation-bounds-main"),
|
||||||
|
"shared::components::ActorKind": Navigation,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (0),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::navigation::NavigationBounds": (
|
||||||
|
half_extents: (8.0, 2.0, 8.0),
|
||||||
|
agent: (
|
||||||
|
id: "humanoid",
|
||||||
|
radius: 0.35,
|
||||||
|
height: 1.8,
|
||||||
|
max_climb: 0.45,
|
||||||
|
max_slope_deg: 45.0,
|
||||||
|
cell_size_fraction: 3.0,
|
||||||
|
cell_height_fraction: 6.0,
|
||||||
|
min_region_size: 1,
|
||||||
|
merge_region_size: 2,
|
||||||
|
),
|
||||||
|
artifact_path: "assets/navigation/generated/navigation_showcase_humanoid.nav.ron",
|
||||||
|
auto_bake: false,
|
||||||
|
validation_samples: [
|
||||||
|
(id: "around-center-obstacle", start: (-6.0, 0.0, -5.0), end: (6.0, 0.0, -5.0), enabled: true),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
2: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Center Obstacle",
|
||||||
|
"bevy_transform::components::transform::Transform": (translation: (0.0, 0.5, 0.0), rotation: (0.0, 0.0, 0.0, 1.0), scale: (1.0, 1.0, 1.0)),
|
||||||
|
"shared::components::ActorId": ("navigation-obstacle-center"),
|
||||||
|
"shared::components::ActorKind": Navigation,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (1),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::navigation::NavigationObstacle": (half_extents: (1.0, 1.0, 2.5), dynamic: false),
|
||||||
|
}),
|
||||||
|
3: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Slow Area",
|
||||||
|
"bevy_transform::components::transform::Transform": (translation: (-4.0, 0.5, -4.0), rotation: (0.0, 0.0, 0.0, 1.0), scale: (1.0, 1.0, 1.0)),
|
||||||
|
"shared::components::ActorId": ("navigation-area-slow"),
|
||||||
|
"shared::components::ActorKind": Navigation,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (2),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::navigation::NavigationArea": (id: "slow", half_extents: (1.5, 1.0, 1.5), cost: 1.5, walkable: true),
|
||||||
|
}),
|
||||||
|
4: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Obstacle Link",
|
||||||
|
"bevy_transform::components::transform::Transform": (translation: (0.0, 0.0, 0.0), rotation: (0.0, 0.0, 0.0, 1.0), scale: (1.0, 1.0, 1.0)),
|
||||||
|
"shared::components::ActorId": ("navigation-link-center"),
|
||||||
|
"shared::components::ActorKind": Navigation,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (3),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::navigation::NavigationLink": (start: (-1.5, 0.0, 0.0), end: (1.5, 0.0, 0.0), bidirectional: true, cost: 1.2, enabled: true),
|
||||||
|
}),
|
||||||
|
5: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Walkable Floor Geometry",
|
||||||
|
"bevy_transform::components::transform::Transform": (translation: (0.0, -0.25, 0.0), rotation: (0.0, 0.0, 0.0, 1.0), scale: (1.0, 1.0, 1.0)),
|
||||||
|
"shared::components::ActorId": ("navigation-floor-geometry"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (4),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (16.0, 0.5, 16.0)),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
)
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
(schema_version: 4, resources: {}, entities: {
|
||||||
|
1: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Placement Floor",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, -0.25, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("physics-placement-floor"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (0),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.12, g: 0.14, b: 0.16, a: 1.0),
|
||||||
|
metallic: 0.05,
|
||||||
|
roughness: 0.72,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0),
|
||||||
|
emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: None,
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (14.0, 0.5, 10.0)),
|
||||||
|
"shared::components::RigidBodyDesc": (body: Static),
|
||||||
|
"shared::components::ColliderDesc": (
|
||||||
|
enabled: true,
|
||||||
|
is_trigger: false,
|
||||||
|
shape: Cuboid(x_length: 14.0, y_length: 0.5, z_length: 10.0),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
2: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Placement Cuboid",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (-2.0, 3.0, 0.0),
|
||||||
|
rotation: (0.1305262, 0.0, 0.0, 0.9914449),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("physics-placement-prop-a"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (1),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.88, g: 0.48, b: 0.12, a: 1.0),
|
||||||
|
metallic: 0.1,
|
||||||
|
roughness: 0.42,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0),
|
||||||
|
emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: None,
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (1.2, 1.2, 1.2)),
|
||||||
|
"shared::components::RigidBodyDesc": (body: Static),
|
||||||
|
"shared::components::ColliderDesc": (
|
||||||
|
enabled: true,
|
||||||
|
is_trigger: false,
|
||||||
|
shape: Cuboid(x_length: 1.2, y_length: 1.2, z_length: 1.2),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
3: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Placement Sphere",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 5.0, 0.0),
|
||||||
|
rotation: (0.0, 0.2164396, 0.0, 0.976296),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("physics-placement-prop-b"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (2),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.10, g: 0.58, b: 0.72, a: 1.0),
|
||||||
|
metallic: 0.15,
|
||||||
|
roughness: 0.35,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0),
|
||||||
|
emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: None,
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
"shared::components::Primitive": (shape: Sphere, size: (1.6, 1.6, 1.6)),
|
||||||
|
"shared::components::RigidBodyDesc": (body: Static),
|
||||||
|
"shared::components::ColliderDesc": (
|
||||||
|
enabled: true,
|
||||||
|
is_trigger: false,
|
||||||
|
shape: Sphere(radius: 0.8),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
4: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Placement Capsule",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (2.0, 7.0, 0.0),
|
||||||
|
rotation: (0.092296, 0.092296, -0.008077, 0.991405),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("physics-placement-prop-c"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (3),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.62, g: 0.24, b: 0.56, a: 1.0),
|
||||||
|
metallic: 0.08,
|
||||||
|
roughness: 0.5,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0),
|
||||||
|
emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: None,
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (0.9, 1.8, 0.9)),
|
||||||
|
"shared::components::RigidBodyDesc": (body: Static),
|
||||||
|
"shared::components::ColliderDesc": (
|
||||||
|
enabled: true,
|
||||||
|
is_trigger: false,
|
||||||
|
shape: Capsule(radius: 0.45, height: 1.8),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
5: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Placement Sun",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 8.0, 2.0),
|
||||||
|
rotation: (-0.3826834, 0.0, 0.0, 0.9238795),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("physics-placement-sun"),
|
||||||
|
"shared::components::ActorKind": Light,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (4),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::LightDesc": (
|
||||||
|
kind: Directional,
|
||||||
|
color: (r: 1.0, g: 0.95, b: 0.85, a: 1.0),
|
||||||
|
intensity: 100000.0,
|
||||||
|
range: 0.0,
|
||||||
|
shadows: true,
|
||||||
|
inner_angle_deg: 25.0,
|
||||||
|
outer_angle_deg: 35.0,
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
})
|
||||||
@@ -1,16 +1,161 @@
|
|||||||
(schema_version: 2,
|
(schema_version: 4, resources: {}, entities: {
|
||||||
resources: {},
|
1: (components: {
|
||||||
entities: {
|
"bevy_ecs::name::Name": "Rendering Lab Floor",
|
||||||
4294968001: (
|
"bevy_transform::components::transform::Transform": (
|
||||||
components: {
|
translation: (1.0, -0.25, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("rendering-showcase-floor"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (0),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (38.0, 0.5, 12.0)),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.12, g: 0.14, b: 0.16, a: 1.0),
|
||||||
|
metallic: 0.05,
|
||||||
|
roughness: 0.72,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0),
|
||||||
|
emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: None,
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
2: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Vignette Anchor",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (-12.0, 1.2, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("rendering-showcase-vignette-anchor"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (1),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::Primitive": (shape: Sphere, size: (2.4, 2.4, 2.4)),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.82, g: 0.18, b: 0.2, a: 1.0),
|
||||||
|
metallic: 0.08,
|
||||||
|
roughness: 0.38,
|
||||||
|
emissive_color: (r: 1.0, g: 0.2, b: 0.2, a: 1.0),
|
||||||
|
emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: None,
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
3: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Fog Anchor",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 1.4, 0.0),
|
||||||
|
rotation: (0.0, 0.258819, 0.0, 0.9659258),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("rendering-showcase-fog-anchor"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (2),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (2.8, 2.8, 2.8)),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.1, g: 0.58, b: 0.72, a: 1.0),
|
||||||
|
metallic: 0.15,
|
||||||
|
roughness: 0.35,
|
||||||
|
emissive_color: (r: 0.1, g: 0.58, b: 0.72, a: 1.0),
|
||||||
|
emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: None,
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
4: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Exposure Anchor",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (14.0, 1.3, 0.0),
|
||||||
|
rotation: (0.0, -0.1736482, 0.0, 0.9848078),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("rendering-showcase-exposure-anchor"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (3),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (3.0, 2.6, 3.0)),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.92, g: 0.62, b: 0.12, a: 1.0),
|
||||||
|
metallic: 0.12,
|
||||||
|
roughness: 0.32,
|
||||||
|
emissive_color: (r: 1.0, g: 0.65, b: 0.12, a: 1.0),
|
||||||
|
emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: None,
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
5: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Emissive Comparison Panel",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 2.6, -4.8),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("rendering-showcase-emissive-panel"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (4),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (26.0, 1.2, 0.25)),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.15, g: 0.22, b: 0.28, a: 1.0),
|
||||||
|
metallic: 0.0,
|
||||||
|
roughness: 0.35,
|
||||||
|
emissive_color: (r: 0.55, g: 0.85, b: 1.0, a: 1.0),
|
||||||
|
emissive_intensity: 2500.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: Some("assets/materials/emissive_panel.ron"),
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
6: (components: {
|
||||||
"bevy_ecs::name::Name": "Fog Volume",
|
"bevy_ecs::name::Name": "Fog Volume",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (0.0, 2.0, 0.0),
|
translation: (0.0, 2.0, 0.0),
|
||||||
rotation: (0.0, 0.0, 0.0, 1.0),
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
scale: (1.0, 1.0, 1.0),
|
scale: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
"shared::components::LevelObject": (),
|
"shared::components::ActorId": ("rendering-showcase-fog-volume"),
|
||||||
"shared::components::ActorKind": PostProcessVolume,
|
"shared::components::ActorKind": PostProcessVolume,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (5),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
"shared::components::PostProcessVolumeDesc": (
|
"shared::components::PostProcessVolumeDesc": (
|
||||||
half_extents: (6.0, 3.0, 6.0),
|
half_extents: (6.0, 3.0, 6.0),
|
||||||
priority: 0,
|
priority: 0,
|
||||||
@@ -23,18 +168,19 @@
|
|||||||
profile: None,
|
profile: None,
|
||||||
label: Some("Foggy courtyard"),
|
label: Some("Foggy courtyard"),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
7: (components: {
|
||||||
4294968002: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Dark Exposure Volume",
|
"bevy_ecs::name::Name": "Dark Exposure Volume",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (14.0, 2.0, 0.0),
|
translation: (14.0, 2.0, 0.0),
|
||||||
rotation: (0.0, 0.0, 0.0, 1.0),
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
scale: (1.0, 1.0, 1.0),
|
scale: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
"shared::components::LevelObject": (),
|
"shared::components::ActorId": ("rendering-showcase-exposure-volume"),
|
||||||
"shared::components::ActorKind": PostProcessVolume,
|
"shared::components::ActorKind": PostProcessVolume,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (6),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
"shared::components::PostProcessVolumeDesc": (
|
"shared::components::PostProcessVolumeDesc": (
|
||||||
half_extents: (4.0, 2.5, 4.0),
|
half_extents: (4.0, 2.5, 4.0),
|
||||||
priority: 5,
|
priority: 5,
|
||||||
@@ -47,18 +193,19 @@
|
|||||||
profile: Some("assets/rendering_profiles/cave_dark.ron"),
|
profile: Some("assets/rendering_profiles/cave_dark.ron"),
|
||||||
label: Some("Cave mouth"),
|
label: Some("Cave mouth"),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
),
|
8: (components: {
|
||||||
4294968003: (
|
|
||||||
components: {
|
|
||||||
"bevy_ecs::name::Name": "Vignette FX Volume",
|
"bevy_ecs::name::Name": "Vignette FX Volume",
|
||||||
"bevy_transform::components::transform::Transform": (
|
"bevy_transform::components::transform::Transform": (
|
||||||
translation: (-12.0, 2.0, 0.0),
|
translation: (-12.0, 2.0, 0.0),
|
||||||
rotation: (0.0, 0.0, 0.0, 1.0),
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
scale: (1.0, 1.0, 1.0),
|
scale: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
"shared::components::LevelObject": (),
|
"shared::components::ActorId": ("rendering-showcase-vignette-volume"),
|
||||||
"shared::components::ActorKind": PostProcessVolume,
|
"shared::components::ActorKind": PostProcessVolume,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (7),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
"shared::components::PostProcessVolumeDesc": (
|
"shared::components::PostProcessVolumeDesc": (
|
||||||
half_extents: (5.0, 2.0, 5.0),
|
half_extents: (5.0, 2.0, 5.0),
|
||||||
priority: 2,
|
priority: 2,
|
||||||
@@ -68,7 +215,27 @@
|
|||||||
profile: None,
|
profile: None,
|
||||||
label: Some("Vignette demo"),
|
label: Some("Vignette demo"),
|
||||||
),
|
),
|
||||||
},
|
}),
|
||||||
|
9: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Rendering Lab Sun",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 10.0, 5.0),
|
||||||
|
rotation: (-0.3826834, 0.0, 0.0, 0.9238795),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
),
|
),
|
||||||
},
|
"shared::components::ActorId": ("rendering-showcase-sun"),
|
||||||
)
|
"shared::components::ActorKind": Light,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (8),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::LightDesc": (
|
||||||
|
kind: Directional,
|
||||||
|
color: (r: 1.0, g: 0.95, b: 0.85, a: 1.0),
|
||||||
|
intensity: 100000.0,
|
||||||
|
range: 0.0,
|
||||||
|
shadows: true,
|
||||||
|
inner_angle_deg: 25.0,
|
||||||
|
outer_angle_deg: 35.0,
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
})
|
||||||
@@ -0,0 +1,332 @@
|
|||||||
|
(schema_version: 4, resources: {}, entities: {
|
||||||
|
1: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Foundation Brush",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 0.5, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("sample-brush-foundation"),
|
||||||
|
"shared::components::ActorKind": Brush,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (0),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.55, g: 0.54, b: 0.52, a: 1.0),
|
||||||
|
metallic: 0.0,
|
||||||
|
roughness: 0.85,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0),
|
||||||
|
emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: Some("assets/materials/concrete.ron"),
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
"shared::components::BrushDesc": (
|
||||||
|
kind: Additive,
|
||||||
|
faces: [
|
||||||
|
(
|
||||||
|
id: ("face:+x"),
|
||||||
|
plane: (normal: (1.0, 0.0, 0.0), distance: 5.0),
|
||||||
|
vertices: [(5.0, -0.5, -4.0), (5.0, 0.5, -4.0), (5.0, 0.5, 4.0), (5.0, -0.5, 4.0)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:-x"),
|
||||||
|
plane: (normal: (-1.0, 0.0, 0.0), distance: 5.0),
|
||||||
|
vertices: [(-5.0, -0.5, 4.0), (-5.0, 0.5, 4.0), (-5.0, 0.5, -4.0), (-5.0, -0.5, -4.0)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:+y"),
|
||||||
|
plane: (normal: (0.0, 1.0, 0.0), distance: 0.5),
|
||||||
|
vertices: [(-5.0, 0.5, -4.0), (-5.0, 0.5, 4.0), (5.0, 0.5, 4.0), (5.0, 0.5, -4.0)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:-y"),
|
||||||
|
plane: (normal: (0.0, -1.0, 0.0), distance: 0.5),
|
||||||
|
vertices: [(-5.0, -0.5, 4.0), (-5.0, -0.5, -4.0), (5.0, -0.5, -4.0), (5.0, -0.5, 4.0)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:+z"),
|
||||||
|
plane: (normal: (0.0, 0.0, 1.0), distance: 4.0),
|
||||||
|
vertices: [(5.0, -0.5, 4.0), (5.0, 0.5, 4.0), (-5.0, 0.5, 4.0), (-5.0, -0.5, 4.0)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:-z"),
|
||||||
|
plane: (normal: (0.0, 0.0, -1.0), distance: 4.0),
|
||||||
|
vertices: [(-5.0, -0.5, -4.0), (-5.0, 0.5, -4.0), (5.0, 0.5, -4.0), (5.0, -0.5, -4.0)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
cast_shadows: true,
|
||||||
|
receive_shadows: true,
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
2: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Material Face Tower",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (-2.5, 3.0, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("sample-brush-material-tower"),
|
||||||
|
"shared::components::ActorKind": Brush,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (1),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.55, g: 0.54, b: 0.52, a: 1.0),
|
||||||
|
metallic: 0.0,
|
||||||
|
roughness: 0.85,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0),
|
||||||
|
emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: Some("assets/materials/concrete.ron"),
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
"shared::components::BrushDesc": (
|
||||||
|
kind: Additive,
|
||||||
|
faces: [
|
||||||
|
(
|
||||||
|
id: ("face:+x"),
|
||||||
|
plane: (normal: (1.0, 0.0, 0.0), distance: 1.25),
|
||||||
|
vertices: [(1.25, -2.0, -1.25), (1.25, 2.0, -1.25), (1.25, 2.0, 1.25), (1.25, -2.0, 1.25)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:-x"),
|
||||||
|
plane: (normal: (-1.0, 0.0, 0.0), distance: 1.25),
|
||||||
|
vertices: [(-1.25, -2.0, 1.25), (-1.25, 2.0, 1.25), (-1.25, 2.0, -1.25), (-1.25, -2.0, -1.25)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:+y"),
|
||||||
|
plane: (normal: (0.0, 1.0, 0.0), distance: 2.0),
|
||||||
|
vertices: [(-1.25, 2.0, -1.25), (-1.25, 2.0, 1.25), (1.25, 2.0, 1.25), (1.25, 2.0, -1.25)],
|
||||||
|
material: Some((
|
||||||
|
asset_id: "cc2769da-c9a5-4cb3-866a-cc81d0688ee2",
|
||||||
|
sub_asset_id: "material:instance",
|
||||||
|
label: "surface_tint_instance",
|
||||||
|
source_path: Some("assets/materials/surface_tint_instance.ron"),
|
||||||
|
)),
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:-y"),
|
||||||
|
plane: (normal: (0.0, -1.0, 0.0), distance: 2.0),
|
||||||
|
vertices: [(-1.25, -2.0, 1.25), (-1.25, -2.0, -1.25), (1.25, -2.0, -1.25), (1.25, -2.0, 1.25)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:+z"),
|
||||||
|
plane: (normal: (0.0, 0.0, 1.0), distance: 1.25),
|
||||||
|
vertices: [(1.25, -2.0, 1.25), (1.25, 2.0, 1.25), (-1.25, 2.0, 1.25), (-1.25, -2.0, 1.25)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:-z"),
|
||||||
|
plane: (normal: (0.0, 0.0, -1.0), distance: 1.25),
|
||||||
|
vertices: [(-1.25, -2.0, -1.25), (-1.25, 2.0, -1.25), (1.25, 2.0, -1.25), (1.25, -2.0, -1.25)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
cast_shadows: true,
|
||||||
|
receive_shadows: true,
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
3: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Subtractive Marker",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (2.5, 2.0, 0.0),
|
||||||
|
rotation: (0.0, 0.258819, 0.0, 0.9659258),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("sample-brush-subtractive-marker"),
|
||||||
|
"shared::components::ActorKind": Brush,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (2),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.72, g: 0.14, b: 0.16, a: 1.0),
|
||||||
|
metallic: 0.05,
|
||||||
|
roughness: 0.4,
|
||||||
|
emissive_color: (r: 1.0, g: 0.25, b: 0.2, a: 1.0),
|
||||||
|
emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: None,
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
"shared::components::BrushDesc": (
|
||||||
|
kind: SubtractiveMarker,
|
||||||
|
faces: [
|
||||||
|
(
|
||||||
|
id: ("face:+x"),
|
||||||
|
plane: (normal: (1.0, 0.0, 0.0), distance: 1.0),
|
||||||
|
vertices: [(1.0, -1.0, -1.0), (1.0, 1.0, -1.0), (1.0, 1.0, 1.0), (1.0, -1.0, 1.0)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:-x"),
|
||||||
|
plane: (normal: (-1.0, 0.0, 0.0), distance: 1.0),
|
||||||
|
vertices: [(-1.0, -1.0, 1.0), (-1.0, 1.0, 1.0), (-1.0, 1.0, -1.0), (-1.0, -1.0, -1.0)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:+y"),
|
||||||
|
plane: (normal: (0.0, 1.0, 0.0), distance: 1.0),
|
||||||
|
vertices: [(-1.0, 1.0, -1.0), (-1.0, 1.0, 1.0), (1.0, 1.0, 1.0), (1.0, 1.0, -1.0)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:-y"),
|
||||||
|
plane: (normal: (0.0, -1.0, 0.0), distance: 1.0),
|
||||||
|
vertices: [(-1.0, -1.0, 1.0), (-1.0, -1.0, -1.0), (1.0, -1.0, -1.0), (1.0, -1.0, 1.0)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:+z"),
|
||||||
|
plane: (normal: (0.0, 0.0, 1.0), distance: 1.0),
|
||||||
|
vertices: [(1.0, -1.0, 1.0), (1.0, 1.0, 1.0), (-1.0, 1.0, 1.0), (-1.0, -1.0, 1.0)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: ("face:-z"),
|
||||||
|
plane: (normal: (0.0, 0.0, -1.0), distance: 1.0),
|
||||||
|
vertices: [(-1.0, -1.0, -1.0), (-1.0, 1.0, -1.0), (1.0, 1.0, -1.0), (1.0, -1.0, -1.0)],
|
||||||
|
material: None,
|
||||||
|
texture: None,
|
||||||
|
uv_offset: (0.0, 0.0),
|
||||||
|
uv_scale: (1.0, 1.0),
|
||||||
|
uv_rotation: 0.0,
|
||||||
|
smoothing_group: 0,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
cast_shadows: true,
|
||||||
|
receive_shadows: true,
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
4: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Brush Lab Sun",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 8.0, 4.0),
|
||||||
|
rotation: (-0.3826834, 0.0, 0.0, 0.9238795),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("sample-brush-sun"),
|
||||||
|
"shared::components::ActorKind": Light,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (3),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::LightDesc": (
|
||||||
|
kind: Directional,
|
||||||
|
color: (r: 1.0, g: 0.95, b: 0.85, a: 1.0),
|
||||||
|
intensity: 100000.0,
|
||||||
|
range: 0.0,
|
||||||
|
shadows: true,
|
||||||
|
inner_angle_deg: 25.0,
|
||||||
|
outer_angle_deg: 35.0,
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
})
|
||||||
@@ -0,0 +1,189 @@
|
|||||||
|
(schema_version: 4, resources: {}, entities: {
|
||||||
|
1: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Material Lab Floor",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, -0.2, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("sample-material-floor"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (0),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (14.0, 0.4, 8.0)),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.55, g: 0.54, b: 0.52, a: 1.0),
|
||||||
|
metallic: 0.0,
|
||||||
|
roughness: 0.85,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0),
|
||||||
|
emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: Some("assets/materials/concrete.ron"),
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
2: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Concrete Reference",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (-4.0, 1.0, 0.0),
|
||||||
|
rotation: (0.0, 0.2164396, 0.0, 0.976296),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("sample-material-concrete"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (1),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (2.0, 2.0, 2.0)),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.55, g: 0.54, b: 0.52, a: 1.0),
|
||||||
|
metallic: 0.0,
|
||||||
|
roughness: 0.85,
|
||||||
|
emissive_color: (r: 1.0, g: 1.0, b: 1.0, a: 1.0),
|
||||||
|
emissive_intensity: 0.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: Some("assets/materials/concrete.ron"),
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
3: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Custom Surface Reference",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 1.2, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("sample-material-custom-surface"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (2),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::Primitive": (shape: Sphere, size: (2.4, 2.4, 2.4)),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (
|
||||||
|
kind: Custom,
|
||||||
|
schema_path: Some("assets/shaders/surface_tint.shader.ron"),
|
||||||
|
shader_path: Some("assets/shaders/surface_tint.wgsl"),
|
||||||
|
),
|
||||||
|
base_color: (r: 0.12, g: 0.42, b: 0.95, a: 1.0),
|
||||||
|
metallic: 0.15,
|
||||||
|
roughness: 0.28,
|
||||||
|
emissive_color: (r: 0.02, g: 0.08, b: 0.25, a: 1.0),
|
||||||
|
emissive_intensity: 3.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: Some("assets/materials/surface_tint.ron"),
|
||||||
|
parameters: [
|
||||||
|
(name: "tint", value: Color((r: 0.12, g: 0.42, b: 0.95, a: 1.0))),
|
||||||
|
(name: "roughness", value: Float(0.28)),
|
||||||
|
(name: "metallic", value: Float(0.15)),
|
||||||
|
(name: "emissive", value: Color((r: 0.02, g: 0.08, b: 0.25, a: 1.0))),
|
||||||
|
(name: "emissive_intensity", value: Float(3.0)),
|
||||||
|
],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
4: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Material Instance Reference",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (4.0, 1.0, 0.0),
|
||||||
|
rotation: (0.0, -0.1305262, 0.0, 0.9914449),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("sample-material-instance"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (3),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (2.6, 2.0, 2.6)),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (
|
||||||
|
kind: Custom,
|
||||||
|
schema_path: Some("assets/shaders/surface_tint.shader.ron"),
|
||||||
|
shader_path: Some("assets/shaders/surface_tint.wgsl"),
|
||||||
|
),
|
||||||
|
base_color: (r: 0.12, g: 0.42, b: 0.95, a: 1.0),
|
||||||
|
metallic: 0.15,
|
||||||
|
roughness: 0.28,
|
||||||
|
emissive_color: (r: 0.02, g: 0.08, b: 0.25, a: 1.0),
|
||||||
|
emissive_intensity: 3.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: Some("assets/materials/surface_tint_instance.ron"),
|
||||||
|
parameters: [
|
||||||
|
(name: "tint", value: Color((r: 0.12, g: 0.42, b: 0.95, a: 1.0))),
|
||||||
|
(name: "roughness", value: Float(0.28)),
|
||||||
|
(name: "metallic", value: Float(0.15)),
|
||||||
|
(name: "emissive", value: Color((r: 0.02, g: 0.08, b: 0.25, a: 1.0))),
|
||||||
|
(name: "emissive_intensity", value: Float(3.0)),
|
||||||
|
],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
5: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Emissive Reference Panel",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 2.3, -3.6),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("sample-material-emissive-panel"),
|
||||||
|
"shared::components::ActorKind": StaticMesh,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (4),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::Primitive": (shape: Box, size: (9.0, 3.0, 0.25)),
|
||||||
|
"shared::components::MaterialDesc": (
|
||||||
|
shader: (kind: StandardLit, schema_path: None, shader_path: None),
|
||||||
|
base_color: (r: 0.15, g: 0.22, b: 0.28, a: 1.0),
|
||||||
|
metallic: 0.0,
|
||||||
|
roughness: 0.35,
|
||||||
|
emissive_color: (r: 0.55, g: 0.85, b: 1.0, a: 1.0),
|
||||||
|
emissive_intensity: 2500.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: Some("assets/materials/emissive_panel.ron"),
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
6: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Material Lab Sun",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 8.0, 4.0),
|
||||||
|
rotation: (-0.3826834, 0.0, 0.0, 0.9238795),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("sample-material-sun"),
|
||||||
|
"shared::components::ActorKind": Light,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (5),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::LightDesc": (
|
||||||
|
kind: Directional,
|
||||||
|
color: (r: 1.0, g: 0.95, b: 0.85, a: 1.0),
|
||||||
|
intensity: 100000.0,
|
||||||
|
range: 0.0,
|
||||||
|
shadows: true,
|
||||||
|
inner_angle_deg: 25.0,
|
||||||
|
outer_angle_deg: 35.0,
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
})
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
(schema_version: 4, resources: {}, entities: {
|
||||||
|
1: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Terrain Showcase",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 0.0, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("terrain-showcase-main"),
|
||||||
|
"shared::components::ActorKind": Terrain,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (0),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::TerrainDesc": (
|
||||||
|
schema_version: 1,
|
||||||
|
resolution: 5,
|
||||||
|
heights: [
|
||||||
|
0.00, 0.00, 0.05, 0.00, 0.00,
|
||||||
|
0.00, 0.15, 0.30, 0.10, 0.00,
|
||||||
|
0.05, 0.35, 0.80, 0.25, 0.05,
|
||||||
|
0.00, 0.20, 0.40, 0.15, 0.00,
|
||||||
|
0.00, 0.00, 0.05, 0.00, 0.00,
|
||||||
|
],
|
||||||
|
sample_spacing: 2.0,
|
||||||
|
height_scale: 3.0,
|
||||||
|
chunk_quads: 2,
|
||||||
|
base_material: Some((
|
||||||
|
asset_id: "cc2769da-c9a5-4cb3-866a-cc81d0688ee2",
|
||||||
|
sub_asset_id: "material:instance",
|
||||||
|
label: "surface_tint_instance",
|
||||||
|
source_path: Some("assets/materials/surface_tint_instance.ron"),
|
||||||
|
)),
|
||||||
|
material_layers: [
|
||||||
|
(
|
||||||
|
material: Some((
|
||||||
|
asset_id: "a57f2891-8536-47b8-b476-01c08b36ac43",
|
||||||
|
sub_asset_id: "material:source",
|
||||||
|
label: "Concrete",
|
||||||
|
source_path: Some("assets/materials/concrete.ron"),
|
||||||
|
)),
|
||||||
|
uv_scale: 6.0,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
material: Some((
|
||||||
|
asset_id: "d6cb4151-7124-4237-aaf9-f7f8abd5fb76",
|
||||||
|
sub_asset_id: "material:source",
|
||||||
|
label: "Surface Tint",
|
||||||
|
source_path: Some("assets/materials/surface_tint.ron"),
|
||||||
|
)),
|
||||||
|
uv_scale: 10.0,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
material_weights: [
|
||||||
|
(255, 0, 0, 0), (255, 0, 0, 0), (224, 31, 0, 0), (255, 0, 0, 0), (255, 0, 0, 0),
|
||||||
|
(255, 0, 0, 0), (192, 63, 0, 0), (128, 127, 0, 0), (192, 63, 0, 0), (255, 0, 0, 0),
|
||||||
|
(224, 31, 0, 0), (128, 127, 0, 0), (0, 255, 0, 0), (128, 127, 0, 0), (224, 31, 0, 0),
|
||||||
|
(255, 0, 0, 0), (192, 63, 0, 0), (128, 127, 0, 0), (192, 63, 0, 0), (255, 0, 0, 0),
|
||||||
|
(255, 0, 0, 0), (255, 0, 0, 0), (224, 31, 0, 0), (255, 0, 0, 0), (255, 0, 0, 0),
|
||||||
|
],
|
||||||
|
generate_colliders: true,
|
||||||
|
cast_shadows: true,
|
||||||
|
receive_shadows: true,
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
2: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Terrain Sun",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 8.0, 0.0),
|
||||||
|
rotation: (-0.3826834, 0.0, 0.0, 0.9238795),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("terrain-showcase-sun"),
|
||||||
|
"shared::components::ActorKind": Light,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::HierarchySiblingIndex": (1),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::LightDesc": (
|
||||||
|
kind: Directional,
|
||||||
|
color: (r: 1.0, g: 0.95, b: 0.85, a: 1.0),
|
||||||
|
intensity: 100000.0,
|
||||||
|
range: 0.0,
|
||||||
|
shadows: true,
|
||||||
|
inner_angle_deg: 25.0,
|
||||||
|
outer_angle_deg: 35.0,
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
})
|
||||||
@@ -1,12 +1,40 @@
|
|||||||
(
|
(
|
||||||
|
schema_version: 1,
|
||||||
label: "Concrete",
|
label: "Concrete",
|
||||||
|
shader: None,
|
||||||
|
shader_ref: None,
|
||||||
|
render_state: (
|
||||||
|
alpha_mode: Opaque,
|
||||||
|
alpha_cutoff: 0.5,
|
||||||
|
double_sided: false,
|
||||||
|
),
|
||||||
material: (
|
material: (
|
||||||
base_color: (r: 0.55, g: 0.54, b: 0.52, a: 1.0),
|
shader: (
|
||||||
|
kind: StandardLit,
|
||||||
|
schema_path: None,
|
||||||
|
shader_path: None,
|
||||||
|
),
|
||||||
|
base_color: (
|
||||||
|
r: 0.55,
|
||||||
|
g: 0.54,
|
||||||
|
b: 0.52,
|
||||||
|
a: 1.0,
|
||||||
|
),
|
||||||
metallic: 0.0,
|
metallic: 0.0,
|
||||||
roughness: 0.85,
|
roughness: 0.85,
|
||||||
|
emissive_color: (
|
||||||
|
r: 1.0,
|
||||||
|
g: 1.0,
|
||||||
|
b: 1.0,
|
||||||
|
a: 1.0,
|
||||||
|
),
|
||||||
|
emissive_intensity: 0.0,
|
||||||
base_color_texture: None,
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
normal_map_texture: None,
|
normal_map_texture: None,
|
||||||
metallic_roughness_texture: None,
|
metallic_roughness_texture: None,
|
||||||
material_asset_path: None,
|
material_asset_path: None,
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -1,15 +1,40 @@
|
|||||||
(
|
(
|
||||||
|
schema_version: 1,
|
||||||
label: "Emissive Panel",
|
label: "Emissive Panel",
|
||||||
|
shader: None,
|
||||||
|
shader_ref: None,
|
||||||
|
render_state: (
|
||||||
|
alpha_mode: Opaque,
|
||||||
|
alpha_cutoff: 0.5,
|
||||||
|
double_sided: false,
|
||||||
|
),
|
||||||
material: (
|
material: (
|
||||||
base_color: (r: 0.15, g: 0.22, b: 0.28, a: 1.0),
|
shader: (
|
||||||
|
kind: StandardLit,
|
||||||
|
schema_path: None,
|
||||||
|
shader_path: None,
|
||||||
|
),
|
||||||
|
base_color: (
|
||||||
|
r: 0.15,
|
||||||
|
g: 0.22,
|
||||||
|
b: 0.28,
|
||||||
|
a: 1.0,
|
||||||
|
),
|
||||||
metallic: 0.0,
|
metallic: 0.0,
|
||||||
roughness: 0.35,
|
roughness: 0.35,
|
||||||
emissive_color: (r: 0.55, g: 0.85, b: 1.0, a: 1.0),
|
emissive_color: (
|
||||||
|
r: 0.55,
|
||||||
|
g: 0.85,
|
||||||
|
b: 1.0,
|
||||||
|
a: 1.0,
|
||||||
|
),
|
||||||
emissive_intensity: 2500.0,
|
emissive_intensity: 2500.0,
|
||||||
base_color_texture: None,
|
base_color_texture: None,
|
||||||
emissive_texture: None,
|
emissive_texture: None,
|
||||||
normal_map_texture: None,
|
normal_map_texture: None,
|
||||||
metallic_roughness_texture: None,
|
metallic_roughness_texture: None,
|
||||||
material_asset_path: None,
|
material_asset_path: None,
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
(
|
||||||
|
schema_version: 1,
|
||||||
|
label: "Surface Tint",
|
||||||
|
shader: Some("assets/shaders/surface_tint.shader.ron"),
|
||||||
|
shader_ref: None,
|
||||||
|
render_state: (
|
||||||
|
alpha_mode: Opaque,
|
||||||
|
alpha_cutoff: 0.5,
|
||||||
|
double_sided: false,
|
||||||
|
),
|
||||||
|
material: (
|
||||||
|
shader: (
|
||||||
|
kind: Custom,
|
||||||
|
schema_path: Some("assets/shaders/surface_tint.shader.ron"),
|
||||||
|
shader_path: Some("assets/shaders/surface_tint.wgsl"),
|
||||||
|
),
|
||||||
|
base_color: (
|
||||||
|
r: 0.12,
|
||||||
|
g: 0.42,
|
||||||
|
b: 0.95,
|
||||||
|
a: 1.0,
|
||||||
|
),
|
||||||
|
metallic: 0.15,
|
||||||
|
roughness: 0.28,
|
||||||
|
emissive_color: (
|
||||||
|
r: 0.02,
|
||||||
|
g: 0.08,
|
||||||
|
b: 0.25,
|
||||||
|
a: 1.0,
|
||||||
|
),
|
||||||
|
emissive_intensity: 3.0,
|
||||||
|
base_color_texture: None,
|
||||||
|
emissive_texture: None,
|
||||||
|
normal_map_texture: None,
|
||||||
|
metallic_roughness_texture: None,
|
||||||
|
material_asset_path: None,
|
||||||
|
parameters: [
|
||||||
|
(
|
||||||
|
name: "tint",
|
||||||
|
value: Color((
|
||||||
|
r: 0.12,
|
||||||
|
g: 0.42,
|
||||||
|
b: 0.95,
|
||||||
|
a: 1.0,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "roughness",
|
||||||
|
value: Float(0.28),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "metallic",
|
||||||
|
value: Float(0.15),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "emissive",
|
||||||
|
value: Color((
|
||||||
|
r: 0.02,
|
||||||
|
g: 0.08,
|
||||||
|
b: 0.25,
|
||||||
|
a: 1.0,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "emissive_intensity",
|
||||||
|
value: Float(3.0),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
textures: [],
|
||||||
|
),
|
||||||
|
)
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
(
|
||||||
|
schema_version: 1,
|
||||||
|
label: "surface_tint Instance",
|
||||||
|
base: ((
|
||||||
|
asset_id: "d6cb4151-7124-4237-aaf9-f7f8abd5fb76",
|
||||||
|
sub_asset_id: "material:source",
|
||||||
|
label: "surface_tint",
|
||||||
|
source_path: Some("assets/materials/surface_tint.ron"),
|
||||||
|
)),
|
||||||
|
parameters: [],
|
||||||
|
textures: [],
|
||||||
|
)
|
||||||
@@ -0,0 +1,360 @@
|
|||||||
|
(
|
||||||
|
schema_version: 4,
|
||||||
|
asset_id: "113f74df-e39c-41d4-9b5b-e48efe541f7f",
|
||||||
|
label: "RobotExpressive",
|
||||||
|
source: (
|
||||||
|
path: "assets/models/RobotExpressive.glb",
|
||||||
|
format: "glb",
|
||||||
|
fingerprint: (
|
||||||
|
byte_len: 463988,
|
||||||
|
content_hash: "5869cb813e6a6093eda7af2824a9c13a582750e0443e88ce7c991a1f83415521",
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
import: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: SceneInstance,
|
||||||
|
hierarchy_mode: SourceHierarchy,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
),
|
||||||
|
metadata: (
|
||||||
|
mesh_count: 14,
|
||||||
|
material_count: 3,
|
||||||
|
node_count: 74,
|
||||||
|
animation_count: 14,
|
||||||
|
skin_count: 2,
|
||||||
|
light_count: 0,
|
||||||
|
camera_count: 0,
|
||||||
|
),
|
||||||
|
parts: [
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node4:mesh0:primitive0",
|
||||||
|
name: "Foot.L / Primitive 0",
|
||||||
|
mesh_label: "Mesh0/Primitive0",
|
||||||
|
material_id: Some("material:material0"),
|
||||||
|
material_slot_name: "Grey",
|
||||||
|
material_label: Some("Material0"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (0.62405795, 0.39766362, 0.19111444),
|
||||||
|
rotation: (0.7071068, 0.00000005228401, 0.000000015504241, -0.70710665),
|
||||||
|
scale: (100.0, 99.999985, 100.0),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Foot.L/Foot.L"),
|
||||||
|
source_mesh: Some("Mesh0"),
|
||||||
|
source_material: Some("Grey"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node7:mesh1:primitive0",
|
||||||
|
name: "Torso / Primitive 0",
|
||||||
|
mesh_label: "Mesh1/Primitive0",
|
||||||
|
material_id: Some("material:material0"),
|
||||||
|
material_slot_name: "Grey",
|
||||||
|
material_label: Some("Material0"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.0027156367, 2.1737509, -0.019581214),
|
||||||
|
rotation: (0.70710677, 0.000000000000031351603, 0.000000000000055267226, -0.7071067),
|
||||||
|
scale: (100.0, 99.99998, 99.99998),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Torso"),
|
||||||
|
source_mesh: Some("Mesh1"),
|
||||||
|
source_material: Some("Grey"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node7:mesh1:primitive1",
|
||||||
|
name: "Torso / Primitive 1",
|
||||||
|
mesh_label: "Mesh1/Primitive1",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.0027156367, 2.1737509, -0.019581214),
|
||||||
|
rotation: (0.70710677, 0.000000000000031351603, 0.000000000000055267226, -0.7071067),
|
||||||
|
scale: (100.0, 99.99998, 99.99998),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Torso"),
|
||||||
|
source_mesh: Some("Mesh1"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node61:mesh10:primitive0",
|
||||||
|
name: "Leg.R / Primitive 0",
|
||||||
|
mesh_label: "Mesh10/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.6746981, 1.1586236, 0.046261936),
|
||||||
|
rotation: (0.7693698, 0.080835514, 0.110868365, -0.6238942),
|
||||||
|
scale: (99.99999, 99.99886, 100.00024),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/UpperLeg.R/Leg.R"),
|
||||||
|
source_mesh: Some("Mesh10"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node63:mesh11:primitive0",
|
||||||
|
name: "LowerLeg.R / Primitive 0",
|
||||||
|
mesh_label: "Mesh11/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.73626167, 0.34982973, 0.22594015),
|
||||||
|
rotation: (-0.65091395, -0.099058665, -0.09436109, 0.7467224),
|
||||||
|
scale: (99.99999, 99.998604, 100.00058),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/UpperLeg.R/LowerLeg.R/LowerLeg.R"),
|
||||||
|
source_mesh: Some("Mesh11"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node72:mesh12:primitive0",
|
||||||
|
name: "Hand.R / Primitive 0",
|
||||||
|
mesh_label: "Mesh12/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.002715637, 2.3702974, -0.020994147),
|
||||||
|
rotation: (0.70710677, 0.0, 0.0, -0.7071067),
|
||||||
|
scale: (100.0, 99.99999, 99.99999),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/Hand.R"),
|
||||||
|
source_mesh: Some("Mesh12"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node72:mesh12:primitive1",
|
||||||
|
name: "Hand.R / Primitive 1",
|
||||||
|
mesh_label: "Mesh12/Primitive1",
|
||||||
|
material_id: Some("material:material0"),
|
||||||
|
material_slot_name: "Grey",
|
||||||
|
material_label: Some("Material0"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.002715637, 2.3702974, -0.020994147),
|
||||||
|
rotation: (0.70710677, 0.0, 0.0, -0.7071067),
|
||||||
|
scale: (100.0, 99.99999, 99.99999),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/Hand.R"),
|
||||||
|
source_mesh: Some("Mesh12"),
|
||||||
|
source_material: Some("Grey"),
|
||||||
|
skinned: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node73:mesh13:primitive0",
|
||||||
|
name: "Hand.L / Primitive 0",
|
||||||
|
mesh_label: "Mesh13/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.002715637, 2.3702974, -0.020994147),
|
||||||
|
rotation: (0.70710677, 0.0, 0.0, -0.7071067),
|
||||||
|
scale: (100.0, 99.99999, 99.99999),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/Hand.L"),
|
||||||
|
source_mesh: Some("Mesh13"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node73:mesh13:primitive1",
|
||||||
|
name: "Hand.L / Primitive 1",
|
||||||
|
mesh_label: "Mesh13/Primitive1",
|
||||||
|
material_id: Some("material:material0"),
|
||||||
|
material_slot_name: "Grey",
|
||||||
|
material_label: Some("Material0"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.002715637, 2.3702974, -0.020994147),
|
||||||
|
rotation: (0.70710677, 0.0, 0.0, -0.7071067),
|
||||||
|
scale: (100.0, 99.99999, 99.99999),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/Hand.L"),
|
||||||
|
source_mesh: Some("Mesh13"),
|
||||||
|
source_material: Some("Grey"),
|
||||||
|
skinned: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node13:mesh2:primitive0",
|
||||||
|
name: "Head / Primitive 0",
|
||||||
|
mesh_label: "Mesh2/Primitive0",
|
||||||
|
material_id: Some("material:material0"),
|
||||||
|
material_slot_name: "Grey",
|
||||||
|
material_label: Some("Material0"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.05334633, 3.6175368, -0.0068152454),
|
||||||
|
rotation: (0.7249889, 0.0852804, 0.05460569, -0.6812757),
|
||||||
|
scale: (99.99997, 99.99996, 99.99997),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Neck/Head/Head"),
|
||||||
|
source_mesh: Some("Mesh2"),
|
||||||
|
source_material: Some("Grey"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node13:mesh2:primitive1",
|
||||||
|
name: "Head / Primitive 1",
|
||||||
|
mesh_label: "Mesh2/Primitive1",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.05334633, 3.6175368, -0.0068152454),
|
||||||
|
rotation: (0.7249889, 0.0852804, 0.05460569, -0.6812757),
|
||||||
|
scale: (99.99997, 99.99996, 99.99997),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Neck/Head/Head"),
|
||||||
|
source_mesh: Some("Mesh2"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node13:mesh2:primitive2",
|
||||||
|
name: "Head / Primitive 2",
|
||||||
|
mesh_label: "Mesh2/Primitive2",
|
||||||
|
material_id: Some("material:material2"),
|
||||||
|
material_slot_name: "Black",
|
||||||
|
material_label: Some("Material2"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.05334633, 3.6175368, -0.0068152454),
|
||||||
|
rotation: (0.7249889, 0.0852804, 0.05460569, -0.6812757),
|
||||||
|
scale: (99.99997, 99.99996, 99.99997),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Neck/Head/Head"),
|
||||||
|
source_mesh: Some("Mesh2"),
|
||||||
|
source_material: Some("Black"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node68:mesh3:primitive0",
|
||||||
|
name: "Foot.R / Primitive 0",
|
||||||
|
mesh_label: "Mesh3/Primitive0",
|
||||||
|
material_id: Some("material:material0"),
|
||||||
|
material_slot_name: "Grey",
|
||||||
|
material_label: Some("Material0"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.637997, 0.3976636, 0.19111452),
|
||||||
|
rotation: (0.70710677, 0.00000005201811, 0.000000015770217, -0.7071067),
|
||||||
|
scale: (100.0, 99.999985, 100.0),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Foot.R/Foot.R"),
|
||||||
|
source_mesh: Some("Mesh3"),
|
||||||
|
source_material: Some("Grey"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node16:mesh4:primitive0",
|
||||||
|
name: "Shoulder.L / Primitive 0",
|
||||||
|
mesh_label: "Mesh4/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (0.58268076, 2.3724597, -0.020994142),
|
||||||
|
rotation: (-0.59886926, 0.37597278, -0.37597266, 0.59886944),
|
||||||
|
scale: (99.99996, 99.999954, 99.99997),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/Shoulder.L"),
|
||||||
|
source_mesh: Some("Mesh4"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node18:mesh5:primitive0",
|
||||||
|
name: "Arm.L / Primitive 0",
|
||||||
|
mesh_label: "Mesh5/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (0.26500192, 2.8489676, 0.13069445),
|
||||||
|
rotation: (-0.5164575, 0.4218856, -0.32294926, 0.67155623),
|
||||||
|
scale: (99.99994, 99.99994, 99.99999),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/Arm.L"),
|
||||||
|
source_mesh: Some("Mesh5"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node36:mesh6:primitive0",
|
||||||
|
name: "Shoulder.R / Primitive 0",
|
||||||
|
mesh_label: "Mesh6/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.6369861, 2.3718858, -0.020994166),
|
||||||
|
rotation: (0.6017577, 0.37133226, -0.37133226, -0.6017577),
|
||||||
|
scale: (99.999954, 99.99997, 99.99994),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/Shoulder.R"),
|
||||||
|
source_mesh: Some("Mesh6"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node38:mesh7:primitive0",
|
||||||
|
name: "Arm.R / Primitive 0",
|
||||||
|
mesh_label: "Mesh7/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.82568955, 1.9825263, 0.040243305),
|
||||||
|
rotation: (0.6276481, 0.35463694, -0.3873087, -0.5747021),
|
||||||
|
scale: (22.70405, 22.704054, 22.704046),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/Arm.R"),
|
||||||
|
source_mesh: Some("Mesh7"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node56:mesh8:primitive0",
|
||||||
|
name: "Leg.L / Primitive 0",
|
||||||
|
mesh_label: "Mesh8/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (0.6488191, 1.1620699, 0.057466835),
|
||||||
|
rotation: (0.76387787, -0.05410902, -0.070370995, -0.6392268),
|
||||||
|
scale: (99.99999, 100.00079, 100.00024),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/UpperLeg.L/Leg.L"),
|
||||||
|
source_mesh: Some("Mesh8"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node58:mesh9:primitive0",
|
||||||
|
name: "LowerLeg.L / Primitive 0",
|
||||||
|
mesh_label: "Mesh9/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (0.68805873, 0.3497491, 0.23465614),
|
||||||
|
rotation: (-0.6547612, 0.06408298, 0.061960325, 0.7505613),
|
||||||
|
scale: (100.000015, 100.0006, 100.000496),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/UpperLeg.L/LowerLeg.L/LowerLeg.L"),
|
||||||
|
source_mesh: Some("Mesh9"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
warnings: [
|
||||||
|
"Animations are recorded as metadata; animated placement uses SkinnedMeshRenderer.",
|
||||||
|
"Skinned primitives are excluded from StaticMeshRenderer and use SkinnedMeshRenderer.",
|
||||||
|
],
|
||||||
|
)
|
||||||
@@ -0,0 +1,360 @@
|
|||||||
|
(
|
||||||
|
schema_version: 4,
|
||||||
|
asset_id: "3f63f359-45eb-4cb2-8970-71921cbd7bd0",
|
||||||
|
label: "robot_expressive",
|
||||||
|
source: (
|
||||||
|
path: "assets/models/robot_expressive.glb",
|
||||||
|
format: "glb",
|
||||||
|
fingerprint: (
|
||||||
|
byte_len: 463988,
|
||||||
|
content_hash: "5869cb813e6a6093eda7af2824a9c13a582750e0443e88ce7c991a1f83415521",
|
||||||
|
),
|
||||||
|
dependencies: [],
|
||||||
|
),
|
||||||
|
import: (
|
||||||
|
scale: 1.0,
|
||||||
|
generate_collider: true,
|
||||||
|
lod0_only: true,
|
||||||
|
placement_mode: StaticAsset,
|
||||||
|
hierarchy_mode: SingleActor,
|
||||||
|
material_policy: SourceMaterials,
|
||||||
|
),
|
||||||
|
metadata: (
|
||||||
|
mesh_count: 14,
|
||||||
|
material_count: 3,
|
||||||
|
node_count: 74,
|
||||||
|
animation_count: 14,
|
||||||
|
skin_count: 2,
|
||||||
|
light_count: 0,
|
||||||
|
camera_count: 0,
|
||||||
|
),
|
||||||
|
parts: [
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node4:mesh0:primitive0",
|
||||||
|
name: "Foot.L / Primitive 0",
|
||||||
|
mesh_label: "Mesh0/Primitive0",
|
||||||
|
material_id: Some("material:material0"),
|
||||||
|
material_slot_name: "Grey",
|
||||||
|
material_label: Some("Material0"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (0.62405795, 0.39766362, 0.19111444),
|
||||||
|
rotation: (0.7071068, 0.00000005228401, 0.000000015504241, -0.70710665),
|
||||||
|
scale: (100.0, 99.999985, 100.0),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Foot.L/Foot.L"),
|
||||||
|
source_mesh: Some("Mesh0"),
|
||||||
|
source_material: Some("Grey"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node7:mesh1:primitive0",
|
||||||
|
name: "Torso / Primitive 0",
|
||||||
|
mesh_label: "Mesh1/Primitive0",
|
||||||
|
material_id: Some("material:material0"),
|
||||||
|
material_slot_name: "Grey",
|
||||||
|
material_label: Some("Material0"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.0027156367, 2.1737509, -0.019581214),
|
||||||
|
rotation: (0.70710677, 0.000000000000031351603, 0.000000000000055267226, -0.7071067),
|
||||||
|
scale: (100.0, 99.99998, 99.99998),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Torso"),
|
||||||
|
source_mesh: Some("Mesh1"),
|
||||||
|
source_material: Some("Grey"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node7:mesh1:primitive1",
|
||||||
|
name: "Torso / Primitive 1",
|
||||||
|
mesh_label: "Mesh1/Primitive1",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.0027156367, 2.1737509, -0.019581214),
|
||||||
|
rotation: (0.70710677, 0.000000000000031351603, 0.000000000000055267226, -0.7071067),
|
||||||
|
scale: (100.0, 99.99998, 99.99998),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Torso"),
|
||||||
|
source_mesh: Some("Mesh1"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node61:mesh10:primitive0",
|
||||||
|
name: "Leg.R / Primitive 0",
|
||||||
|
mesh_label: "Mesh10/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.6746981, 1.1586236, 0.046261936),
|
||||||
|
rotation: (0.7693698, 0.080835514, 0.110868365, -0.6238942),
|
||||||
|
scale: (99.99999, 99.99886, 100.00024),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/UpperLeg.R/Leg.R"),
|
||||||
|
source_mesh: Some("Mesh10"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node63:mesh11:primitive0",
|
||||||
|
name: "LowerLeg.R / Primitive 0",
|
||||||
|
mesh_label: "Mesh11/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.73626167, 0.34982973, 0.22594015),
|
||||||
|
rotation: (-0.65091395, -0.099058665, -0.09436109, 0.7467224),
|
||||||
|
scale: (99.99999, 99.998604, 100.00058),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/UpperLeg.R/LowerLeg.R/LowerLeg.R"),
|
||||||
|
source_mesh: Some("Mesh11"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node72:mesh12:primitive0",
|
||||||
|
name: "Hand.R / Primitive 0",
|
||||||
|
mesh_label: "Mesh12/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.002715637, 2.3702974, -0.020994147),
|
||||||
|
rotation: (0.70710677, 0.0, 0.0, -0.7071067),
|
||||||
|
scale: (100.0, 99.99999, 99.99999),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/Hand.R"),
|
||||||
|
source_mesh: Some("Mesh12"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node72:mesh12:primitive1",
|
||||||
|
name: "Hand.R / Primitive 1",
|
||||||
|
mesh_label: "Mesh12/Primitive1",
|
||||||
|
material_id: Some("material:material0"),
|
||||||
|
material_slot_name: "Grey",
|
||||||
|
material_label: Some("Material0"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.002715637, 2.3702974, -0.020994147),
|
||||||
|
rotation: (0.70710677, 0.0, 0.0, -0.7071067),
|
||||||
|
scale: (100.0, 99.99999, 99.99999),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/Hand.R"),
|
||||||
|
source_mesh: Some("Mesh12"),
|
||||||
|
source_material: Some("Grey"),
|
||||||
|
skinned: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node73:mesh13:primitive0",
|
||||||
|
name: "Hand.L / Primitive 0",
|
||||||
|
mesh_label: "Mesh13/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.002715637, 2.3702974, -0.020994147),
|
||||||
|
rotation: (0.70710677, 0.0, 0.0, -0.7071067),
|
||||||
|
scale: (100.0, 99.99999, 99.99999),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/Hand.L"),
|
||||||
|
source_mesh: Some("Mesh13"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node73:mesh13:primitive1",
|
||||||
|
name: "Hand.L / Primitive 1",
|
||||||
|
mesh_label: "Mesh13/Primitive1",
|
||||||
|
material_id: Some("material:material0"),
|
||||||
|
material_slot_name: "Grey",
|
||||||
|
material_label: Some("Material0"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.002715637, 2.3702974, -0.020994147),
|
||||||
|
rotation: (0.70710677, 0.0, 0.0, -0.7071067),
|
||||||
|
scale: (100.0, 99.99999, 99.99999),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/Hand.L"),
|
||||||
|
source_mesh: Some("Mesh13"),
|
||||||
|
source_material: Some("Grey"),
|
||||||
|
skinned: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node13:mesh2:primitive0",
|
||||||
|
name: "Head / Primitive 0",
|
||||||
|
mesh_label: "Mesh2/Primitive0",
|
||||||
|
material_id: Some("material:material0"),
|
||||||
|
material_slot_name: "Grey",
|
||||||
|
material_label: Some("Material0"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.05334633, 3.6175368, -0.0068152454),
|
||||||
|
rotation: (0.7249889, 0.0852804, 0.05460569, -0.6812757),
|
||||||
|
scale: (99.99997, 99.99996, 99.99997),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Neck/Head/Head"),
|
||||||
|
source_mesh: Some("Mesh2"),
|
||||||
|
source_material: Some("Grey"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node13:mesh2:primitive1",
|
||||||
|
name: "Head / Primitive 1",
|
||||||
|
mesh_label: "Mesh2/Primitive1",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.05334633, 3.6175368, -0.0068152454),
|
||||||
|
rotation: (0.7249889, 0.0852804, 0.05460569, -0.6812757),
|
||||||
|
scale: (99.99997, 99.99996, 99.99997),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Neck/Head/Head"),
|
||||||
|
source_mesh: Some("Mesh2"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node13:mesh2:primitive2",
|
||||||
|
name: "Head / Primitive 2",
|
||||||
|
mesh_label: "Mesh2/Primitive2",
|
||||||
|
material_id: Some("material:material2"),
|
||||||
|
material_slot_name: "Black",
|
||||||
|
material_label: Some("Material2"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.05334633, 3.6175368, -0.0068152454),
|
||||||
|
rotation: (0.7249889, 0.0852804, 0.05460569, -0.6812757),
|
||||||
|
scale: (99.99997, 99.99996, 99.99997),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Neck/Head/Head"),
|
||||||
|
source_mesh: Some("Mesh2"),
|
||||||
|
source_material: Some("Black"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node68:mesh3:primitive0",
|
||||||
|
name: "Foot.R / Primitive 0",
|
||||||
|
mesh_label: "Mesh3/Primitive0",
|
||||||
|
material_id: Some("material:material0"),
|
||||||
|
material_slot_name: "Grey",
|
||||||
|
material_label: Some("Material0"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.637997, 0.3976636, 0.19111452),
|
||||||
|
rotation: (0.70710677, 0.00000005201811, 0.000000015770217, -0.7071067),
|
||||||
|
scale: (100.0, 99.999985, 100.0),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Foot.R/Foot.R"),
|
||||||
|
source_mesh: Some("Mesh3"),
|
||||||
|
source_material: Some("Grey"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node16:mesh4:primitive0",
|
||||||
|
name: "Shoulder.L / Primitive 0",
|
||||||
|
mesh_label: "Mesh4/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (0.58268076, 2.3724597, -0.020994142),
|
||||||
|
rotation: (-0.59886926, 0.37597278, -0.37597266, 0.59886944),
|
||||||
|
scale: (99.99996, 99.999954, 99.99997),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/Shoulder.L"),
|
||||||
|
source_mesh: Some("Mesh4"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node18:mesh5:primitive0",
|
||||||
|
name: "Arm.L / Primitive 0",
|
||||||
|
mesh_label: "Mesh5/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (0.26500192, 2.8489676, 0.13069445),
|
||||||
|
rotation: (-0.5164575, 0.4218856, -0.32294926, 0.67155623),
|
||||||
|
scale: (99.99994, 99.99994, 99.99999),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.L/UpperArm.L/Arm.L"),
|
||||||
|
source_mesh: Some("Mesh5"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node36:mesh6:primitive0",
|
||||||
|
name: "Shoulder.R / Primitive 0",
|
||||||
|
mesh_label: "Mesh6/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.6369861, 2.3718858, -0.020994166),
|
||||||
|
rotation: (0.6017577, 0.37133226, -0.37133226, -0.6017577),
|
||||||
|
scale: (99.999954, 99.99997, 99.99994),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/Shoulder.R"),
|
||||||
|
source_mesh: Some("Mesh6"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node38:mesh7:primitive0",
|
||||||
|
name: "Arm.R / Primitive 0",
|
||||||
|
mesh_label: "Mesh7/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (-0.82568955, 1.9825263, 0.040243305),
|
||||||
|
rotation: (0.6276481, 0.35463694, -0.3873087, -0.5747021),
|
||||||
|
scale: (22.70405, 22.704054, 22.704046),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/Hips/Abdomen/Torso/Shoulder.R/UpperArm.R/Arm.R"),
|
||||||
|
source_mesh: Some("Mesh7"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node56:mesh8:primitive0",
|
||||||
|
name: "Leg.L / Primitive 0",
|
||||||
|
mesh_label: "Mesh8/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (0.6488191, 1.1620699, 0.057466835),
|
||||||
|
rotation: (0.76387787, -0.05410902, -0.070370995, -0.6392268),
|
||||||
|
scale: (99.99999, 100.00079, 100.00024),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/UpperLeg.L/Leg.L"),
|
||||||
|
source_mesh: Some("Mesh8"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "draw:scene0:node58:mesh9:primitive0",
|
||||||
|
name: "LowerLeg.L / Primitive 0",
|
||||||
|
mesh_label: "Mesh9/Primitive0",
|
||||||
|
material_id: Some("material:material1"),
|
||||||
|
material_slot_name: "Main",
|
||||||
|
material_label: Some("Material1"),
|
||||||
|
local_transform: (
|
||||||
|
translation: (0.68805873, 0.3497491, 0.23465614),
|
||||||
|
rotation: (-0.6547612, 0.06408298, 0.061960325, 0.7505613),
|
||||||
|
scale: (100.000015, 100.0006, 100.000496),
|
||||||
|
),
|
||||||
|
source_node: Some("RootNode/RobotArmature/Bone/Body/UpperLeg.L/LowerLeg.L/LowerLeg.L"),
|
||||||
|
source_mesh: Some("Mesh9"),
|
||||||
|
source_material: Some("Main"),
|
||||||
|
skinned: false,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
warnings: [
|
||||||
|
"Animations are recorded as metadata; animated placement uses SkinnedMeshRenderer.",
|
||||||
|
"Skinned primitives are excluded from StaticMeshRenderer and use SkinnedMeshRenderer.",
|
||||||
|
],
|
||||||
|
)
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
(
|
|
||||||
schema_version: 1,
|
|
||||||
asset_id: "71071fc3-7a7f-454d-b9ab-93ebf0feccbe",
|
|
||||||
label: "metal_stool_01_2k",
|
|
||||||
source: (
|
|
||||||
path: "assets/models/metal_stool_01_2k.gltf",
|
|
||||||
format: "gltf",
|
|
||||||
fingerprint: (
|
|
||||||
byte_len: 2790,
|
|
||||||
modified_unix_secs: 1780712587,
|
|
||||||
),
|
|
||||||
dependencies: [
|
|
||||||
"assets/models/metal_stool_01.bin",
|
|
||||||
"assets/models/textures/metal_stool_01_arm_2k.jpg",
|
|
||||||
"assets/models/textures/metal_stool_01_diff_2k.jpg",
|
|
||||||
"assets/models/textures/metal_stool_01_nor_gl_2k.jpg",
|
|
||||||
],
|
|
||||||
),
|
|
||||||
import: (
|
|
||||||
scale: 1.0,
|
|
||||||
generate_collider: true,
|
|
||||||
lod0_only: true,
|
|
||||||
placement_mode: SceneInstance,
|
|
||||||
hierarchy_mode: SingleActor,
|
|
||||||
material_policy: SourceMaterials,
|
|
||||||
),
|
|
||||||
metadata: (
|
|
||||||
mesh_count: 1,
|
|
||||||
material_count: 1,
|
|
||||||
node_count: 1,
|
|
||||||
animation_count: 0,
|
|
||||||
skin_count: 0,
|
|
||||||
light_count: 0,
|
|
||||||
camera_count: 0,
|
|
||||||
),
|
|
||||||
parts: [
|
|
||||||
(
|
|
||||||
id: "mesh:mesh0_primitive0",
|
|
||||||
name: "metal_stool_01 / Primitive 0",
|
|
||||||
mesh_label: "Mesh0/Primitive0",
|
|
||||||
material_id: Some("material:material0"),
|
|
||||||
material_slot_name: "metal_stool_01",
|
|
||||||
material_label: Some("Material0"),
|
|
||||||
local_transform: (
|
|
||||||
translation: (0.0, 0.0, 0.0),
|
|
||||||
rotation: (0.0, 0.0, 0.0, 1.0),
|
|
||||||
scale: (1.0, 1.0, 1.0),
|
|
||||||
),
|
|
||||||
source_node: Some("Node0"),
|
|
||||||
source_mesh: Some("Mesh0"),
|
|
||||||
source_material: Some("metal_stool_01"),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
warnings: [],
|
|
||||||
)
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
(
|
(
|
||||||
schema_version: 1,
|
schema_version: 4,
|
||||||
asset_id: "b98ef565-3500-49e7-9935-f685fa9b2594",
|
asset_id: "b98ef565-3500-49e7-9935-f685fa9b2594",
|
||||||
label: "painted_wooden_chair_02_2k",
|
label: "painted_wooden_chair_02_2k",
|
||||||
source: (
|
source: (
|
||||||
@@ -7,9 +7,13 @@
|
|||||||
format: "fbx",
|
format: "fbx",
|
||||||
fingerprint: (
|
fingerprint: (
|
||||||
byte_len: 59964,
|
byte_len: 59964,
|
||||||
modified_unix_secs: 1780713434,
|
content_hash: "b12973a62dcb44589e380ea833eade726ae98a86c81084c842ee3801866d6a46",
|
||||||
),
|
),
|
||||||
dependencies: [],
|
dependencies: [
|
||||||
|
"assets/models/textures/painted_wooden_chair_02_diff_2k.jpg",
|
||||||
|
"assets/models/textures/painted_wooden_chair_02_nor_gl_2k.exr",
|
||||||
|
"assets/models/textures/painted_wooden_chair_02_rough_2k.exr",
|
||||||
|
],
|
||||||
),
|
),
|
||||||
import: (
|
import: (
|
||||||
scale: 1.0,
|
scale: 1.0,
|
||||||
@@ -17,7 +21,7 @@
|
|||||||
lod0_only: true,
|
lod0_only: true,
|
||||||
placement_mode: StaticAsset,
|
placement_mode: StaticAsset,
|
||||||
hierarchy_mode: SingleActor,
|
hierarchy_mode: SingleActor,
|
||||||
material_policy: SourceMaterials,
|
material_policy: AuthoringOverride,
|
||||||
),
|
),
|
||||||
metadata: (
|
metadata: (
|
||||||
mesh_count: 1,
|
mesh_count: 1,
|
||||||
@@ -30,7 +34,7 @@
|
|||||||
),
|
),
|
||||||
parts: [
|
parts: [
|
||||||
(
|
(
|
||||||
id: "mesh:mesh1000",
|
id: "draw:scene0:node1:material0",
|
||||||
name: "painted_wooden_chair_02 / Material 0",
|
name: "painted_wooden_chair_02 / Material 0",
|
||||||
mesh_label: "Mesh1000",
|
mesh_label: "Mesh1000",
|
||||||
material_id: Some("material:material0"),
|
material_id: Some("material:material0"),
|
||||||
@@ -44,6 +48,7 @@
|
|||||||
source_node: Some("Node1"),
|
source_node: Some("Node1"),
|
||||||
source_mesh: Some("Mesh1"),
|
source_mesh: Some("Mesh1"),
|
||||||
source_material: Some("painted_wooden_chair_02"),
|
source_material: Some("painted_wooden_chair_02"),
|
||||||
|
skinned: false,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
warnings: [],
|
warnings: [],
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,12 @@
|
|||||||
|
# RobotExpressive License And Attribution
|
||||||
|
|
||||||
|
`robot_expressive.glb` is the RobotExpressive model from the Three.js example assets.
|
||||||
|
|
||||||
|
- Model: Tomas Laulhe (Quaternius)
|
||||||
|
- Modifications and glTF conversion: Don McCurdy
|
||||||
|
- License: CC0 1.0 Universal
|
||||||
|
- Source: https://github.com/mrdoob/three.js/tree/dev/examples/models/gltf/RobotExpressive
|
||||||
|
- Imported source SHA-256: `047f5e5fb3bb6d378bd1df16ca6137f2a596c99b3a1b5690b4020c05aaf6f319`
|
||||||
|
|
||||||
|
The upstream modifications add facial-expression morph targets, convert the source with FBX2GLTF,
|
||||||
|
remove duplicate materials, and reduce material metalness.
|
||||||
Binary file not shown.
@@ -0,0 +1,977 @@
|
|||||||
|
(
|
||||||
|
schema_version: 2,
|
||||||
|
generator: "blacksite-nav-2/rerecast-0.3.2/polyanya-0.16.1/glam-0.30.10",
|
||||||
|
source_scene: "assets/levels/navigation_authoring_showcase.scn.ron",
|
||||||
|
source_fingerprint: "15649e3f7c8f22d642ea318ba1dafb5a3ada82e2713219cb60bbb518c5e45195",
|
||||||
|
payload_hash: "180b5a4698102e8185ae182bc30cf847466c4e9d65fe7834c315f6d1a03504c2",
|
||||||
|
bounds_actor_id: "navigation-bounds-main",
|
||||||
|
center: (0.0, 0.0, 0.0),
|
||||||
|
half_extents: (8.0, 2.0, 8.0),
|
||||||
|
agent: (
|
||||||
|
id: "humanoid",
|
||||||
|
radius: 0.35,
|
||||||
|
height: 1.8,
|
||||||
|
max_climb: 0.45,
|
||||||
|
max_slope_deg: 45.0,
|
||||||
|
cell_size_fraction: 3.0,
|
||||||
|
cell_height_fraction: 6.0,
|
||||||
|
min_region_size: 1,
|
||||||
|
merge_region_size: 2,
|
||||||
|
),
|
||||||
|
mesh: (
|
||||||
|
layers: [
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
(
|
||||||
|
coords: (-1.0, -2.516667),
|
||||||
|
polygons: [
|
||||||
|
0,
|
||||||
|
4294967295,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
2,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-0.3000002, -2.516667),
|
||||||
|
polygons: [
|
||||||
|
4,
|
||||||
|
4294967295,
|
||||||
|
0,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-0.41666698, -7.3),
|
||||||
|
polygons: [
|
||||||
|
5,
|
||||||
|
4,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-7.3, -1.5833335),
|
||||||
|
polygons: [
|
||||||
|
3,
|
||||||
|
1,
|
||||||
|
10,
|
||||||
|
12,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-1.0, -1.5833335),
|
||||||
|
polygons: [
|
||||||
|
10,
|
||||||
|
1,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-1.0, -2.516667),
|
||||||
|
polygons: [
|
||||||
|
0,
|
||||||
|
4294967295,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
2,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-1.0, -2.516667),
|
||||||
|
polygons: [
|
||||||
|
0,
|
||||||
|
4294967295,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
2,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-0.41666698, -7.3),
|
||||||
|
polygons: [
|
||||||
|
5,
|
||||||
|
4,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-7.3, -7.3),
|
||||||
|
polygons: [
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-7.3, -1.5833335),
|
||||||
|
polygons: [
|
||||||
|
3,
|
||||||
|
1,
|
||||||
|
10,
|
||||||
|
12,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-0.3000002, -2.516667),
|
||||||
|
polygons: [
|
||||||
|
4,
|
||||||
|
4294967295,
|
||||||
|
0,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.2833333, -2.516667),
|
||||||
|
polygons: [
|
||||||
|
6,
|
||||||
|
4294967295,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.39999962, -7.3),
|
||||||
|
polygons: [
|
||||||
|
8,
|
||||||
|
6,
|
||||||
|
5,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-0.41666698, -7.3),
|
||||||
|
polygons: [
|
||||||
|
5,
|
||||||
|
4,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.39999962, -7.3),
|
||||||
|
polygons: [
|
||||||
|
8,
|
||||||
|
6,
|
||||||
|
5,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.2833333, -2.516667),
|
||||||
|
polygons: [
|
||||||
|
6,
|
||||||
|
4294967295,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.9833336, -2.516667),
|
||||||
|
polygons: [
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
7,
|
||||||
|
4294967295,
|
||||||
|
6,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.9833336, -2.516667),
|
||||||
|
polygons: [
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
7,
|
||||||
|
4294967295,
|
||||||
|
6,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.9833336, -1.5833335),
|
||||||
|
polygons: [
|
||||||
|
7,
|
||||||
|
13,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (7.283333, -1.5833335),
|
||||||
|
polygons: [
|
||||||
|
15,
|
||||||
|
13,
|
||||||
|
7,
|
||||||
|
9,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.9833336, -2.516667),
|
||||||
|
polygons: [
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
7,
|
||||||
|
4294967295,
|
||||||
|
6,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (7.283333, -1.5833335),
|
||||||
|
polygons: [
|
||||||
|
15,
|
||||||
|
13,
|
||||||
|
7,
|
||||||
|
9,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (7.283333, -7.3),
|
||||||
|
polygons: [
|
||||||
|
9,
|
||||||
|
8,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.39999962, -7.3),
|
||||||
|
polygons: [
|
||||||
|
8,
|
||||||
|
6,
|
||||||
|
5,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-1.0, -0.0666666),
|
||||||
|
polygons: [
|
||||||
|
11,
|
||||||
|
12,
|
||||||
|
10,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-1.0, -1.5833335),
|
||||||
|
polygons: [
|
||||||
|
10,
|
||||||
|
1,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-7.3, -1.5833335),
|
||||||
|
polygons: [
|
||||||
|
3,
|
||||||
|
1,
|
||||||
|
10,
|
||||||
|
12,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-7.3, 1.5666666),
|
||||||
|
polygons: [
|
||||||
|
12,
|
||||||
|
11,
|
||||||
|
17,
|
||||||
|
19,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-1.0, 1.5666666),
|
||||||
|
polygons: [
|
||||||
|
17,
|
||||||
|
11,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-1.0, -0.0666666),
|
||||||
|
polygons: [
|
||||||
|
11,
|
||||||
|
12,
|
||||||
|
10,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-7.3, -1.5833335),
|
||||||
|
polygons: [
|
||||||
|
3,
|
||||||
|
1,
|
||||||
|
10,
|
||||||
|
12,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (7.283333, -1.5833335),
|
||||||
|
polygons: [
|
||||||
|
15,
|
||||||
|
13,
|
||||||
|
7,
|
||||||
|
9,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.9833336, -1.5833335),
|
||||||
|
polygons: [
|
||||||
|
7,
|
||||||
|
13,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.9833336, -0.0666666),
|
||||||
|
polygons: [
|
||||||
|
13,
|
||||||
|
15,
|
||||||
|
14,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (7.283333, 1.5666666),
|
||||||
|
polygons: [
|
||||||
|
23,
|
||||||
|
21,
|
||||||
|
14,
|
||||||
|
15,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (7.283333, -1.5833335),
|
||||||
|
polygons: [
|
||||||
|
15,
|
||||||
|
13,
|
||||||
|
7,
|
||||||
|
9,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.9833336, -0.0666666),
|
||||||
|
polygons: [
|
||||||
|
13,
|
||||||
|
15,
|
||||||
|
14,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.9833336, 1.5666666),
|
||||||
|
polygons: [
|
||||||
|
14,
|
||||||
|
21,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-0.41666698, 7.283333),
|
||||||
|
polygons: [
|
||||||
|
24,
|
||||||
|
25,
|
||||||
|
4294967295,
|
||||||
|
18,
|
||||||
|
16,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-0.3000002, 2.5),
|
||||||
|
polygons: [
|
||||||
|
24,
|
||||||
|
16,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-1.0, 2.5),
|
||||||
|
polygons: [
|
||||||
|
16,
|
||||||
|
18,
|
||||||
|
19,
|
||||||
|
17,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-1.0, 2.5),
|
||||||
|
polygons: [
|
||||||
|
16,
|
||||||
|
18,
|
||||||
|
19,
|
||||||
|
17,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-1.0, 1.5666666),
|
||||||
|
polygons: [
|
||||||
|
17,
|
||||||
|
11,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-7.3, 1.5666666),
|
||||||
|
polygons: [
|
||||||
|
12,
|
||||||
|
11,
|
||||||
|
17,
|
||||||
|
19,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-7.3, 7.283333),
|
||||||
|
polygons: [
|
||||||
|
19,
|
||||||
|
18,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-0.41666698, 7.283333),
|
||||||
|
polygons: [
|
||||||
|
24,
|
||||||
|
25,
|
||||||
|
4294967295,
|
||||||
|
18,
|
||||||
|
16,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-1.0, 2.5),
|
||||||
|
polygons: [
|
||||||
|
16,
|
||||||
|
18,
|
||||||
|
19,
|
||||||
|
17,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-7.3, 1.5666666),
|
||||||
|
polygons: [
|
||||||
|
12,
|
||||||
|
11,
|
||||||
|
17,
|
||||||
|
19,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.9833336, 2.5),
|
||||||
|
polygons: [
|
||||||
|
21,
|
||||||
|
23,
|
||||||
|
22,
|
||||||
|
20,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.2833333, 2.5),
|
||||||
|
polygons: [
|
||||||
|
20,
|
||||||
|
25,
|
||||||
|
24,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.39999962, 7.283333),
|
||||||
|
polygons: [
|
||||||
|
20,
|
||||||
|
22,
|
||||||
|
4294967295,
|
||||||
|
25,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (7.283333, 1.5666666),
|
||||||
|
polygons: [
|
||||||
|
23,
|
||||||
|
21,
|
||||||
|
14,
|
||||||
|
15,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.9833336, 1.5666666),
|
||||||
|
polygons: [
|
||||||
|
14,
|
||||||
|
21,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.9833336, 2.5),
|
||||||
|
polygons: [
|
||||||
|
21,
|
||||||
|
23,
|
||||||
|
22,
|
||||||
|
20,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.9833336, 2.5),
|
||||||
|
polygons: [
|
||||||
|
21,
|
||||||
|
23,
|
||||||
|
22,
|
||||||
|
20,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.39999962, 7.283333),
|
||||||
|
polygons: [
|
||||||
|
20,
|
||||||
|
22,
|
||||||
|
4294967295,
|
||||||
|
25,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (7.283333, 7.283333),
|
||||||
|
polygons: [
|
||||||
|
22,
|
||||||
|
23,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (7.283333, 1.5666666),
|
||||||
|
polygons: [
|
||||||
|
23,
|
||||||
|
21,
|
||||||
|
14,
|
||||||
|
15,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-0.41666698, 7.283333),
|
||||||
|
polygons: [
|
||||||
|
24,
|
||||||
|
25,
|
||||||
|
4294967295,
|
||||||
|
18,
|
||||||
|
16,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.39999962, 7.283333),
|
||||||
|
polygons: [
|
||||||
|
20,
|
||||||
|
22,
|
||||||
|
4294967295,
|
||||||
|
25,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (0.2833333, 2.5),
|
||||||
|
polygons: [
|
||||||
|
20,
|
||||||
|
25,
|
||||||
|
24,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
coords: (-0.3000002, 2.5),
|
||||||
|
polygons: [
|
||||||
|
24,
|
||||||
|
16,
|
||||||
|
4294967295,
|
||||||
|
],
|
||||||
|
is_corner: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
polygons: [
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
4,
|
||||||
|
3,
|
||||||
|
5,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
6,
|
||||||
|
8,
|
||||||
|
7,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
6,
|
||||||
|
9,
|
||||||
|
8,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
13,
|
||||||
|
11,
|
||||||
|
10,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
13,
|
||||||
|
12,
|
||||||
|
11,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
15,
|
||||||
|
14,
|
||||||
|
16,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
18,
|
||||||
|
17,
|
||||||
|
19,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
22,
|
||||||
|
20,
|
||||||
|
23,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
22,
|
||||||
|
21,
|
||||||
|
20,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
25,
|
||||||
|
24,
|
||||||
|
26,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
27,
|
||||||
|
29,
|
||||||
|
28,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
27,
|
||||||
|
30,
|
||||||
|
29,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
32,
|
||||||
|
31,
|
||||||
|
33,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
36,
|
||||||
|
34,
|
||||||
|
37,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
36,
|
||||||
|
35,
|
||||||
|
34,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
40,
|
||||||
|
39,
|
||||||
|
38,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
42,
|
||||||
|
41,
|
||||||
|
43,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
44,
|
||||||
|
46,
|
||||||
|
45,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
44,
|
||||||
|
47,
|
||||||
|
46,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
49,
|
||||||
|
48,
|
||||||
|
50,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
52,
|
||||||
|
51,
|
||||||
|
53,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
54,
|
||||||
|
56,
|
||||||
|
55,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
54,
|
||||||
|
57,
|
||||||
|
56,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
60,
|
||||||
|
58,
|
||||||
|
61,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
vertices: [
|
||||||
|
60,
|
||||||
|
59,
|
||||||
|
58,
|
||||||
|
],
|
||||||
|
is_one_way: false,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
offset: (0.0, 0.0),
|
||||||
|
baked_polygons: None,
|
||||||
|
islands: None,
|
||||||
|
height: [
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
0.10000008,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
search_delta: 0.1,
|
||||||
|
search_steps: 2,
|
||||||
|
),
|
||||||
|
links: [
|
||||||
|
(
|
||||||
|
actor_id: "navigation-link-center",
|
||||||
|
start: (-1.5, 0.0, 0.0),
|
||||||
|
end: (1.5, 0.0, 0.0),
|
||||||
|
bidirectional: true,
|
||||||
|
cost: 1.2,
|
||||||
|
enabled: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
areas: [
|
||||||
|
(
|
||||||
|
actor_id: "navigation-area-slow",
|
||||||
|
id: "slow",
|
||||||
|
center: (-4.0, 0.5, -4.0),
|
||||||
|
half_extents: (1.5, 1.0, 1.5),
|
||||||
|
cost: 1.5,
|
||||||
|
walkable: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
samples: [
|
||||||
|
(
|
||||||
|
id: "around-center-obstacle",
|
||||||
|
start: (-6.0, 0.0, -5.0),
|
||||||
|
end: (6.0, 0.0, -5.0),
|
||||||
|
enabled: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
diagnostics: (
|
||||||
|
polygon_count: 26,
|
||||||
|
island_count: 1,
|
||||||
|
effective_component_count: 1,
|
||||||
|
),
|
||||||
|
)
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# Prefab fixtures
|
||||||
|
|
||||||
|
The `example_base` -> `example_nested` -> `example_variant` chain is the production-format
|
||||||
|
fixture for linked prefab ownership, nested stable actor paths, and variant override layering.
|
||||||
|
The variant hides `base-mesh` through an `EditorVisibility` component override targeted as
|
||||||
|
`nested-link / base-link / base-mesh` when the variant is placed in a scene.
|
||||||
|
|
||||||
|
Keep these files loadable by the editor and valid under `cargo validate-levels`. Broken-source,
|
||||||
|
cycle, and conflict fixtures belong in temporary test projects so the shipped asset tree remains
|
||||||
|
healthy.
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
(schema_version: 4,resources: {
|
||||||
|
},
|
||||||
|
entities: {
|
||||||
|
1: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Example Base Mesh",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 0.0, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("base-mesh"),
|
||||||
|
"shared::components::ActorKind": Empty,
|
||||||
|
"shared::components::EditorVisibility": (visible: true),
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
)
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
(schema_version: 4,resources: {
|
||||||
|
},
|
||||||
|
entities: {
|
||||||
|
1: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Example Base Link",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 0.0, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("base-link"),
|
||||||
|
"shared::components::ActorKind": PrefabAnchor,
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::PrefabInstance": (
|
||||||
|
asset_id: "11111111-1111-4111-8111-111111111111",
|
||||||
|
source_path: "assets/prefabs/example_base.scn.ron",
|
||||||
|
overrides_ron: None,
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
)
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
(schema_version: 4,resources: {
|
||||||
|
},
|
||||||
|
entities: {
|
||||||
|
1: (components: {
|
||||||
|
"bevy_ecs::name::Name": "Example Nested Variant Link",
|
||||||
|
"bevy_transform::components::transform::Transform": (
|
||||||
|
translation: (0.0, 0.0, 0.0),
|
||||||
|
rotation: (0.0, 0.0, 0.0, 1.0),
|
||||||
|
scale: (1.0, 1.0, 1.0),
|
||||||
|
),
|
||||||
|
"shared::components::ActorId": ("nested-link"),
|
||||||
|
"shared::components::ActorKind": PrefabAnchor,
|
||||||
|
"shared::components::LevelObject": (),
|
||||||
|
"shared::components::PrefabInstance": (
|
||||||
|
asset_id: "22222222-2222-4222-8222-222222222222",
|
||||||
|
source_path: "assets/prefabs/example_nested.scn.ron",
|
||||||
|
overrides_ron: Some("(format_version:2,source_revision:None,transform:None,material:None,child_visibility:{},properties:[],components:[(target:(instance_chain:[\"base-link\"],actor_id:\"base-mesh\"),component_type:\"shared::components::EditorVisibility\",base_component_ron:Some(\"(visible:true)\"),value_component_ron:Some(\"(visible:false)\"))],structural:[])"),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
)
|
||||||
@@ -1,8 +1,13 @@
|
|||||||
(
|
(
|
||||||
version: 1,
|
version: 1,
|
||||||
|
project_id: "blacksite-foundation",
|
||||||
name: "Bevy FPS Foundation",
|
name: "Bevy FPS Foundation",
|
||||||
|
project_kind: Game,
|
||||||
|
template_version: 1,
|
||||||
|
capabilities: ["editor", "gameplay", "rendering", "audio", "solari"],
|
||||||
default_level: "assets/levels/editor_scene.scn.ron",
|
default_level: "assets/levels/editor_scene.scn.ron",
|
||||||
asset_roots: [
|
asset_roots: [
|
||||||
|
"assets/audio",
|
||||||
"assets/models",
|
"assets/models",
|
||||||
"assets/textures",
|
"assets/textures",
|
||||||
"assets/materials",
|
"assets/materials",
|
||||||
@@ -29,6 +34,31 @@
|
|||||||
shadow_first_cascade: 6.0,
|
shadow_first_cascade: 6.0,
|
||||||
shadow_max_distance: 220.0,
|
shadow_max_distance: 220.0,
|
||||||
),
|
),
|
||||||
|
audio: (
|
||||||
|
buses: [
|
||||||
|
(
|
||||||
|
id: "master",
|
||||||
|
label: "Master",
|
||||||
|
parent: None,
|
||||||
|
gain_db: 0.0,
|
||||||
|
muted: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "music",
|
||||||
|
label: "Music",
|
||||||
|
parent: Some("master"),
|
||||||
|
gain_db: 0.0,
|
||||||
|
muted: false,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "sfx",
|
||||||
|
label: "SFX",
|
||||||
|
parent: Some("master"),
|
||||||
|
gain_db: 0.0,
|
||||||
|
muted: false,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
physics: (
|
physics: (
|
||||||
player_radius: 0.4,
|
player_radius: 0.4,
|
||||||
player_length: 1.0,
|
player_length: 1.0,
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
(
|
||||||
|
schema_version: 1,
|
||||||
|
samples: [
|
||||||
|
(
|
||||||
|
id: "brush-blockout",
|
||||||
|
label: "Brush Blockout",
|
||||||
|
area: Brush,
|
||||||
|
scene: "assets/levels/samples/brush_blockout.scn.ron",
|
||||||
|
summary: "Convex additive brushes, a subtractive marker, and a shared face material for brush editing and CSG regression checks.",
|
||||||
|
checks: [
|
||||||
|
"valid authored BrushDesc geometry",
|
||||||
|
"shared brush-face material resolution",
|
||||||
|
"object, face, clip, and CSG selection targets",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "material-lab",
|
||||||
|
label: "Material Lab",
|
||||||
|
area: Material,
|
||||||
|
scene: "assets/levels/samples/material_lab.scn.ron",
|
||||||
|
summary: "A compact look-development stage for shared materials, material instances, custom surfaces, and emissive output.",
|
||||||
|
checks: [
|
||||||
|
"Material and Material Instance dependency resolution",
|
||||||
|
"standard, custom, and emissive surface hydration",
|
||||||
|
"primitive material assignment and targeted drops",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "terrain-authoring",
|
||||||
|
label: "Terrain Authoring",
|
||||||
|
area: Terrain,
|
||||||
|
scene: "assets/levels/terrain_authoring_showcase.scn.ron",
|
||||||
|
summary: "A deterministic height grid with shared material layers, normalized paint weights, chunks, and collision.",
|
||||||
|
checks: [
|
||||||
|
"TerrainDesc schema and normalized layer weights",
|
||||||
|
"shared terrain material dependency resolution",
|
||||||
|
"sculpt, paint, chunk, and collider hydration",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "physics-placement",
|
||||||
|
label: "Physics Placement",
|
||||||
|
area: PhysicsPlacement,
|
||||||
|
scene: "assets/levels/physics_placement_showcase.scn.ron",
|
||||||
|
summary: "Three visually distinct collider cases above a static floor for transactional multi-object settling.",
|
||||||
|
checks: [
|
||||||
|
"cuboid, sphere, and capsule collider diversity",
|
||||||
|
"multi-selection settle and grouped history",
|
||||||
|
"static floor collision and cancel restoration",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
id: "rendering-lab",
|
||||||
|
label: "Rendering Lab",
|
||||||
|
area: Rendering,
|
||||||
|
scene: "assets/levels/rendering_showcase.scn.ron",
|
||||||
|
summary: "Visible comparison anchors for fog, exposure, rendering profiles, fullscreen effects, and emissive lighting.",
|
||||||
|
checks: [
|
||||||
|
"stable post-process volume ownership",
|
||||||
|
"rendering profile and fullscreen effect dependency resolution",
|
||||||
|
"visible fog, exposure, vignette, and emissive comparison anchors",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
#import bevy_pbr::{
|
||||||
|
pbr_fragment::pbr_input_from_standard_material,
|
||||||
|
pbr_functions::alpha_discard,
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef PREPASS_PIPELINE
|
||||||
|
#import bevy_pbr::{
|
||||||
|
prepass_io::{VertexOutput, FragmentOutput},
|
||||||
|
pbr_deferred_functions::deferred_output,
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#import bevy_pbr::{
|
||||||
|
forward_io::{VertexOutput, FragmentOutput},
|
||||||
|
pbr_functions::{apply_pbr_lighting, main_pass_post_lighting_processing},
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct SurfaceUniform {
|
||||||
|
shader_id: u32,
|
||||||
|
flags: u32,
|
||||||
|
alpha_cutoff: f32,
|
||||||
|
abi_version: u32,
|
||||||
|
params: array<vec4<f32>, 16>,
|
||||||
|
uv_transforms: array<vec4<f32>, 8>,
|
||||||
|
}
|
||||||
|
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(100) var<uniform> surface_uniform: SurfaceUniform;
|
||||||
|
|
||||||
|
@fragment
|
||||||
|
fn fragment(in: VertexOutput, @builtin(front_facing) is_front: bool) -> FragmentOutput {
|
||||||
|
var pbr_input = pbr_input_from_standard_material(in, is_front);
|
||||||
|
pbr_input.material.base_color = alpha_discard(pbr_input.material, pbr_input.material.base_color);
|
||||||
|
#ifdef PREPASS_PIPELINE
|
||||||
|
return deferred_output(in, pbr_input);
|
||||||
|
#else
|
||||||
|
var out: FragmentOutput;
|
||||||
|
out.color = apply_pbr_lighting(pbr_input);
|
||||||
|
out.color = main_pass_post_lighting_processing(pbr_input, out.color);
|
||||||
|
return out;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,17 +1,72 @@
|
|||||||
(
|
(
|
||||||
|
schema_version: 1,
|
||||||
label: "Standard Lit",
|
label: "Standard Lit",
|
||||||
kind: StandardLit,
|
kind: StandardLit,
|
||||||
wgsl_path: None,
|
wgsl_path: None,
|
||||||
parameters: [
|
parameters: [
|
||||||
(name: "base_color", display_name: "Base Color", group: "Surface", property_type: Color),
|
(
|
||||||
(name: "metallic", display_name: "Metallic", group: "Surface", property_type: Float(min: Some(0.0), max: Some(1.0))),
|
name: "base_color",
|
||||||
(name: "roughness", display_name: "Roughness", group: "Surface", property_type: Float(min: Some(0.0), max: Some(1.0))),
|
display_name: "Base Color",
|
||||||
(name: "emissive_color", display_name: "Emissive Color", group: "Emission", property_type: Color),
|
group: "Surface",
|
||||||
(name: "emissive_intensity", display_name: "Emissive Nits", group: "Emission", property_type: Float(min: Some(0.0), max: Some(20000.0))),
|
property_type: Color,
|
||||||
(name: "base_color_texture", display_name: "Base Color Texture", group: "Textures", property_type: Texture),
|
),
|
||||||
(name: "normal_map_texture", display_name: "Normal Map", group: "Textures", property_type: Texture),
|
(
|
||||||
(name: "metallic_roughness_texture", display_name: "Metallic/Roughness Texture", group: "Textures", property_type: Texture),
|
name: "metallic",
|
||||||
(name: "emissive_texture", display_name: "Emissive Texture", group: "Textures", property_type: Texture),
|
display_name: "Metallic",
|
||||||
|
group: "Surface",
|
||||||
|
property_type: Float(
|
||||||
|
min: Some(0.0),
|
||||||
|
max: Some(1.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "roughness",
|
||||||
|
display_name: "Roughness",
|
||||||
|
group: "Surface",
|
||||||
|
property_type: Float(
|
||||||
|
min: Some(0.0),
|
||||||
|
max: Some(1.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "emissive_color",
|
||||||
|
display_name: "Emissive Color",
|
||||||
|
group: "Emission",
|
||||||
|
property_type: Color,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "emissive_intensity",
|
||||||
|
display_name: "Emissive Nits",
|
||||||
|
group: "Emission",
|
||||||
|
property_type: Float(
|
||||||
|
min: Some(0.0),
|
||||||
|
max: Some(20000.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "base_color_texture",
|
||||||
|
display_name: "Base Color Texture",
|
||||||
|
group: "Textures",
|
||||||
|
property_type: Texture,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "normal_map_texture",
|
||||||
|
display_name: "Normal Map",
|
||||||
|
group: "Textures",
|
||||||
|
property_type: Texture,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "metallic_roughness_texture",
|
||||||
|
display_name: "Metallic/Roughness Texture",
|
||||||
|
group: "Textures",
|
||||||
|
property_type: Texture,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "emissive_texture",
|
||||||
|
display_name: "Emissive Texture",
|
||||||
|
group: "Textures",
|
||||||
|
property_type: Texture,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
default_values: [],
|
default_values: [],
|
||||||
default_textures: [],
|
default_textures: [],
|
||||||
|
|||||||
@@ -0,0 +1,80 @@
|
|||||||
|
(
|
||||||
|
schema_version: 1,
|
||||||
|
label: "Surface Tint",
|
||||||
|
kind: Custom,
|
||||||
|
wgsl_path: Some("assets/shaders/surface_tint.wgsl"),
|
||||||
|
parameters: [
|
||||||
|
(
|
||||||
|
name: "tint",
|
||||||
|
display_name: "Tint",
|
||||||
|
group: "Surface",
|
||||||
|
property_type: Color,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "roughness",
|
||||||
|
display_name: "Roughness",
|
||||||
|
group: "Surface",
|
||||||
|
property_type: Float(
|
||||||
|
min: Some(0.001),
|
||||||
|
max: Some(1.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "metallic",
|
||||||
|
display_name: "Metallic",
|
||||||
|
group: "Surface",
|
||||||
|
property_type: Float(
|
||||||
|
min: Some(0.0),
|
||||||
|
max: Some(1.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "emissive",
|
||||||
|
display_name: "Emissive",
|
||||||
|
group: "Emission",
|
||||||
|
property_type: Color,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "emissive_intensity",
|
||||||
|
display_name: "Emissive Nits",
|
||||||
|
group: "Emission",
|
||||||
|
property_type: Float(
|
||||||
|
min: Some(0.0),
|
||||||
|
max: Some(20000.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
default_values: [
|
||||||
|
(
|
||||||
|
name: "tint",
|
||||||
|
value: Color((
|
||||||
|
r: 0.12,
|
||||||
|
g: 0.42,
|
||||||
|
b: 0.95,
|
||||||
|
a: 1.0,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "roughness",
|
||||||
|
value: Float(0.28),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "metallic",
|
||||||
|
value: Float(0.15),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "emissive",
|
||||||
|
value: Color((
|
||||||
|
r: 0.02,
|
||||||
|
g: 0.08,
|
||||||
|
b: 0.25,
|
||||||
|
a: 1.0,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "emissive_intensity",
|
||||||
|
value: Float(3.0),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
default_textures: [],
|
||||||
|
)
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
fn evaluate(
|
||||||
|
input: SurfaceInput,
|
||||||
|
params: SurfaceParams,
|
||||||
|
samples: SurfaceSamples,
|
||||||
|
) -> Surface {
|
||||||
|
var surface = surface_default();
|
||||||
|
surface.base_color = params.lanes[0];
|
||||||
|
surface.perceptual_roughness = params.lanes[1].x;
|
||||||
|
surface.metallic = params.lanes[2].x;
|
||||||
|
surface.emissive = params.lanes[3].rgb * params.lanes[4].x;
|
||||||
|
surface.reflectance = 0.5;
|
||||||
|
surface.occlusion = 1.0;
|
||||||
|
return surface;
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
#import bevy_pbr::{
|
||||||
|
pbr_fragment::pbr_input_from_standard_material,
|
||||||
|
pbr_functions::{alpha_discard, calculate_tbn_mikktspace},
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef PREPASS_PIPELINE
|
||||||
|
#import bevy_pbr::{
|
||||||
|
prepass_io::{VertexOutput, FragmentOutput},
|
||||||
|
pbr_deferred_functions::deferred_output,
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#import bevy_pbr::{
|
||||||
|
forward_io::{VertexOutput, FragmentOutput},
|
||||||
|
pbr_functions::{apply_pbr_lighting, main_pass_post_lighting_processing},
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct TerrainLayerUniform {
|
||||||
|
base_colors: array<vec4<f32>, 4>,
|
||||||
|
properties: array<vec4<f32>, 4>,
|
||||||
|
uv_scales: vec4<f32>,
|
||||||
|
base_texture_enabled: vec4<f32>,
|
||||||
|
}
|
||||||
|
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(100) var<uniform> terrain_layers: TerrainLayerUniform;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(101) var base_color0: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(102) var base_sampler0: sampler;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(103) var normal0: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(104) var normal_sampler0: sampler;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(105) var base_color1: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(106) var base_sampler1: sampler;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(107) var normal1: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(108) var normal_sampler1: sampler;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(109) var base_color2: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(110) var base_sampler2: sampler;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(111) var normal2: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(112) var normal_sampler2: sampler;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(113) var base_color3: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(114) var base_sampler3: sampler;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(115) var normal3: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(116) var normal_sampler3: sampler;
|
||||||
|
|
||||||
|
fn layer_base(index: u32, uv: vec2<f32>) -> vec4<f32> {
|
||||||
|
if index == 0u { return textureSample(base_color0, base_sampler0, uv); }
|
||||||
|
if index == 1u { return textureSample(base_color1, base_sampler1, uv); }
|
||||||
|
if index == 2u { return textureSample(base_color2, base_sampler2, uv); }
|
||||||
|
return textureSample(base_color3, base_sampler3, uv);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn layer_normal(index: u32, uv: vec2<f32>) -> vec3<f32> {
|
||||||
|
var sample = vec3<f32>(0.5, 0.5, 1.0);
|
||||||
|
if index == 0u { sample = textureSample(normal0, normal_sampler0, uv).xyz; }
|
||||||
|
if index == 1u { sample = textureSample(normal1, normal_sampler1, uv).xyz; }
|
||||||
|
if index == 2u { sample = textureSample(normal2, normal_sampler2, uv).xyz; }
|
||||||
|
if index == 3u { sample = textureSample(normal3, normal_sampler3, uv).xyz; }
|
||||||
|
return normalize(sample * 2.0 - 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@fragment
|
||||||
|
fn fragment(in: VertexOutput, @builtin(front_facing) is_front: bool) -> FragmentOutput {
|
||||||
|
var pbr_input = pbr_input_from_standard_material(in, is_front);
|
||||||
|
#ifdef VERTEX_UVS_A
|
||||||
|
let uv = in.uv;
|
||||||
|
#else
|
||||||
|
let uv = vec2<f32>(0.0);
|
||||||
|
#endif
|
||||||
|
#ifdef VERTEX_COLORS
|
||||||
|
var weights = max(in.color, vec4<f32>(0.0));
|
||||||
|
#else
|
||||||
|
var weights = vec4<f32>(1.0, 0.0, 0.0, 0.0);
|
||||||
|
#endif
|
||||||
|
let enabled = vec4<f32>(
|
||||||
|
terrain_layers.properties[0].w,
|
||||||
|
terrain_layers.properties[1].w,
|
||||||
|
terrain_layers.properties[2].w,
|
||||||
|
terrain_layers.properties[3].w,
|
||||||
|
);
|
||||||
|
weights *= enabled;
|
||||||
|
let total = dot(weights, vec4<f32>(1.0));
|
||||||
|
weights = select(vec4<f32>(1.0, 0.0, 0.0, 0.0), weights / total, total > 0.0001);
|
||||||
|
|
||||||
|
var color = vec4<f32>(0.0);
|
||||||
|
var normal_ts = vec3<f32>(0.0);
|
||||||
|
var metallic = 0.0;
|
||||||
|
var roughness = 0.0;
|
||||||
|
for (var index = 0u; index < 4u; index += 1u) {
|
||||||
|
let weight = weights[index];
|
||||||
|
let layer_uv = uv * terrain_layers.uv_scales[index];
|
||||||
|
let base_sample = mix(
|
||||||
|
vec4<f32>(1.0),
|
||||||
|
layer_base(index, layer_uv),
|
||||||
|
terrain_layers.base_texture_enabled[index],
|
||||||
|
);
|
||||||
|
color += base_sample * terrain_layers.base_colors[index] * weight;
|
||||||
|
let normal_enabled = terrain_layers.properties[index].z;
|
||||||
|
normal_ts += mix(vec3<f32>(0.0, 0.0, 1.0), layer_normal(index, layer_uv), normal_enabled) * weight;
|
||||||
|
metallic += terrain_layers.properties[index].x * weight;
|
||||||
|
roughness += terrain_layers.properties[index].y * weight;
|
||||||
|
}
|
||||||
|
pbr_input.material.base_color = alpha_discard(pbr_input.material, color);
|
||||||
|
pbr_input.material.metallic = clamp(metallic, 0.0, 1.0);
|
||||||
|
pbr_input.material.perceptual_roughness = clamp(roughness, 0.001, 1.0);
|
||||||
|
#ifdef VERTEX_TANGENTS
|
||||||
|
let tbn = calculate_tbn_mikktspace(pbr_input.world_normal, in.world_tangent);
|
||||||
|
let n = normalize(normal_ts);
|
||||||
|
pbr_input.N = normalize(n.x * tbn[0] + n.y * tbn[1] + n.z * tbn[2]);
|
||||||
|
#endif
|
||||||
|
#ifdef PREPASS_PIPELINE
|
||||||
|
return deferred_output(in, pbr_input);
|
||||||
|
#else
|
||||||
|
var out: FragmentOutput;
|
||||||
|
out.color = apply_pbr_lighting(pbr_input);
|
||||||
|
out.color = main_pass_post_lighting_processing(pbr_input, out.color);
|
||||||
|
return out;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
@@ -1,12 +1,36 @@
|
|||||||
(
|
(
|
||||||
|
schema_version: 1,
|
||||||
label: "Unlit",
|
label: "Unlit",
|
||||||
kind: Unlit,
|
kind: Unlit,
|
||||||
wgsl_path: None,
|
wgsl_path: None,
|
||||||
parameters: [
|
parameters: [
|
||||||
(name: "base_color", display_name: "Base Color", group: "Surface", property_type: Color),
|
(
|
||||||
(name: "base_color_texture", display_name: "Base Color Texture", group: "Textures", property_type: Texture),
|
name: "base_color",
|
||||||
(name: "emissive_color", display_name: "Emissive Color", group: "Emission", property_type: Color),
|
display_name: "Base Color",
|
||||||
(name: "emissive_intensity", display_name: "Emissive Nits", group: "Emission", property_type: Float(min: Some(0.0), max: Some(20000.0))),
|
group: "Surface",
|
||||||
|
property_type: Color,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "base_color_texture",
|
||||||
|
display_name: "Base Color Texture",
|
||||||
|
group: "Textures",
|
||||||
|
property_type: Texture,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "emissive_color",
|
||||||
|
display_name: "Emissive Color",
|
||||||
|
group: "Emission",
|
||||||
|
property_type: Color,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
name: "emissive_intensity",
|
||||||
|
display_name: "Emissive Nits",
|
||||||
|
group: "Emission",
|
||||||
|
property_type: Float(
|
||||||
|
min: Some(0.0),
|
||||||
|
max: Some(20000.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
default_values: [],
|
default_values: [],
|
||||||
default_textures: [],
|
default_textures: [],
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
[package]
|
||||||
|
name = "blacksite_surface"
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
description = "Blacksite raster and ray-tracing Surface ABI material runtime"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
bevy.workspace = true
|
||||||
|
naga = { version = "29", features = ["wgsl-in"] }
|
||||||
|
ron = "0.8"
|
||||||
|
shared.workspace = true
|
||||||
|
uuid = "1"
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,41 @@
|
|||||||
|
@fragment
|
||||||
|
fn fragment(in: VertexOutput, @builtin(front_facing) is_front: bool) -> FragmentOutput {
|
||||||
|
var pbr_input = pbr_input_from_standard_material(in, is_front);
|
||||||
|
#ifdef VERTEX_UVS_A
|
||||||
|
let uv0 = in.uv;
|
||||||
|
#else
|
||||||
|
let uv0 = vec2<f32>(0.0);
|
||||||
|
#endif
|
||||||
|
let input = SurfaceInput(uv0, pbr_input.world_position.xyz, pbr_input.N);
|
||||||
|
let params = SurfaceParams(surface_uniform.params);
|
||||||
|
let surface = evaluate(input, params, surface_samples(uv0));
|
||||||
|
pbr_input.material.base_color = surface.base_color;
|
||||||
|
pbr_input.material.emissive = vec4<f32>(surface.emissive, 1.0);
|
||||||
|
pbr_input.material.metallic = clamp(surface.metallic, 0.0, 1.0);
|
||||||
|
pbr_input.material.perceptual_roughness = clamp(surface.perceptual_roughness, 0.001, 1.0);
|
||||||
|
pbr_input.material.reflectance = vec3<f32>(clamp(surface.reflectance, 0.0, 1.0));
|
||||||
|
pbr_input.diffuse_occlusion = vec3<f32>(clamp(surface.occlusion, 0.0, 1.0));
|
||||||
|
#ifdef VERTEX_TANGENTS
|
||||||
|
let surface_tbn = calculate_tbn_mikktspace(pbr_input.world_normal, in.world_tangent);
|
||||||
|
let surface_nt = normalize(surface.normal_ts);
|
||||||
|
pbr_input.N = normalize(
|
||||||
|
surface_nt.x * surface_tbn[0]
|
||||||
|
+ surface_nt.y * surface_tbn[1]
|
||||||
|
+ surface_nt.z * surface_tbn[2]
|
||||||
|
);
|
||||||
|
#endif
|
||||||
|
if surface.model == BLACKSITE_SURFACE_UNLIT {
|
||||||
|
pbr_input.material.flags |= STANDARD_MATERIAL_FLAGS_UNLIT_BIT;
|
||||||
|
} else {
|
||||||
|
pbr_input.material.flags &= ~STANDARD_MATERIAL_FLAGS_UNLIT_BIT;
|
||||||
|
}
|
||||||
|
pbr_input.material.base_color = alpha_discard(pbr_input.material, pbr_input.material.base_color);
|
||||||
|
#ifdef PREPASS_PIPELINE
|
||||||
|
return deferred_output(in, pbr_input);
|
||||||
|
#else
|
||||||
|
var out: FragmentOutput;
|
||||||
|
out.color = apply_pbr_lighting(pbr_input);
|
||||||
|
out.color = main_pass_post_lighting_processing(pbr_input, out.color);
|
||||||
|
return out;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
#import bevy_pbr::{
|
||||||
|
pbr_fragment::pbr_input_from_standard_material,
|
||||||
|
pbr_functions::{alpha_discard, calculate_tbn_mikktspace},
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef PREPASS_PIPELINE
|
||||||
|
#import bevy_pbr::{
|
||||||
|
prepass_io::{VertexOutput, FragmentOutput},
|
||||||
|
pbr_deferred_functions::deferred_output,
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#import bevy_pbr::{
|
||||||
|
forward_io::{VertexOutput, FragmentOutput},
|
||||||
|
pbr_functions::{apply_pbr_lighting, main_pass_post_lighting_processing},
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const BLACKSITE_SURFACE_ABI_VERSION: u32 = 1u;
|
||||||
|
const BLACKSITE_SURFACE_UNLIT: u32 = 1u;
|
||||||
|
const STANDARD_MATERIAL_FLAGS_UNLIT_BIT: u32 = 1u << 5u;
|
||||||
|
|
||||||
|
struct SurfaceUniform {
|
||||||
|
shader_id: u32,
|
||||||
|
flags: u32,
|
||||||
|
alpha_cutoff: f32,
|
||||||
|
abi_version: u32,
|
||||||
|
params: array<vec4<f32>, 16>,
|
||||||
|
uv_transforms: array<vec4<f32>, 8>,
|
||||||
|
}
|
||||||
|
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(100) var<uniform> surface_uniform: SurfaceUniform;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(101) var surface_texture0: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(102) var surface_sampler0: sampler;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(103) var surface_texture1: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(104) var surface_sampler1: sampler;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(105) var surface_texture2: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(106) var surface_sampler2: sampler;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(107) var surface_texture3: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(108) var surface_sampler3: sampler;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(109) var surface_texture4: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(110) var surface_sampler4: sampler;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(111) var surface_texture5: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(112) var surface_sampler5: sampler;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(113) var surface_texture6: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(114) var surface_sampler6: sampler;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(115) var surface_texture7: texture_2d<f32>;
|
||||||
|
@group(#{MATERIAL_BIND_GROUP}) @binding(116) var surface_sampler7: sampler;
|
||||||
|
|
||||||
|
struct SurfaceInput {
|
||||||
|
uv0: vec2<f32>,
|
||||||
|
world_position: vec3<f32>,
|
||||||
|
world_normal: vec3<f32>,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SurfaceParams {
|
||||||
|
lanes: array<vec4<f32>, 16>,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SurfaceSamples {
|
||||||
|
values: array<vec4<f32>, 8>,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Surface {
|
||||||
|
base_color: vec4<f32>,
|
||||||
|
normal_ts: vec3<f32>,
|
||||||
|
emissive: vec3<f32>,
|
||||||
|
metallic: f32,
|
||||||
|
perceptual_roughness: f32,
|
||||||
|
reflectance: f32,
|
||||||
|
occlusion: f32,
|
||||||
|
model: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn surface_default() -> Surface {
|
||||||
|
var surface: Surface;
|
||||||
|
surface.base_color = vec4<f32>(1.0);
|
||||||
|
surface.normal_ts = vec3<f32>(0.0, 0.0, 1.0);
|
||||||
|
surface.emissive = vec3<f32>(0.0);
|
||||||
|
surface.metallic = 0.0;
|
||||||
|
surface.perceptual_roughness = 0.5;
|
||||||
|
surface.reflectance = 0.5;
|
||||||
|
surface.occlusion = 1.0;
|
||||||
|
surface.model = 0u;
|
||||||
|
return surface;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn surface_uv(index: u32, uv: vec2<f32>) -> vec2<f32> {
|
||||||
|
let transform = surface_uniform.uv_transforms[index];
|
||||||
|
return uv * transform.xy + transform.zw;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn surface_samples(uv: vec2<f32>) -> SurfaceSamples {
|
||||||
|
var samples: SurfaceSamples;
|
||||||
|
samples.values[0] = textureSample(surface_texture0, surface_sampler0, surface_uv(0u, uv));
|
||||||
|
samples.values[1] = textureSample(surface_texture1, surface_sampler1, surface_uv(1u, uv));
|
||||||
|
samples.values[2] = textureSample(surface_texture2, surface_sampler2, surface_uv(2u, uv));
|
||||||
|
samples.values[3] = textureSample(surface_texture3, surface_sampler3, surface_uv(3u, uv));
|
||||||
|
samples.values[4] = textureSample(surface_texture4, surface_sampler4, surface_uv(4u, uv));
|
||||||
|
samples.values[5] = textureSample(surface_texture5, surface_sampler5, surface_uv(5u, uv));
|
||||||
|
samples.values[6] = textureSample(surface_texture6, surface_sampler6, surface_uv(6u, uv));
|
||||||
|
samples.values[7] = textureSample(surface_texture7, surface_sampler7, surface_uv(7u, uv));
|
||||||
|
return samples;
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ version.workspace = true
|
|||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
description = "In-process level editor for the Bevy FPS foundation"
|
description = "In-process level editor for the Bevy FPS foundation"
|
||||||
|
default-run = "editor"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "editor"
|
name = "editor"
|
||||||
@@ -13,6 +14,10 @@ path = "src/lib.rs"
|
|||||||
name = "editor"
|
name = "editor"
|
||||||
path = "src/bin/main.rs"
|
path = "src/bin/main.rs"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "project_launcher"
|
||||||
|
path = "src/bin/project_launcher.rs"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
dev = ["bevy/dynamic_linking", "game/dev"]
|
dev = ["bevy/dynamic_linking", "game/dev"]
|
||||||
hot-reload = ["game/hot-reload", "dep:hot-lib-reloader", "dep:notify"]
|
hot-reload = ["game/hot-reload", "dep:hot-lib-reloader", "dep:notify"]
|
||||||
@@ -28,6 +33,7 @@ egui_phosphor_icons.workspace = true
|
|||||||
bevy_ufbx.workspace = true
|
bevy_ufbx.workspace = true
|
||||||
ufbx = "0.9"
|
ufbx = "0.9"
|
||||||
game.workspace = true
|
game.workspace = true
|
||||||
|
polyanya.workspace = true
|
||||||
game_hot.workspace = true
|
game_hot.workspace = true
|
||||||
hot-lib-reloader = { version = "0.8.2", optional = true }
|
hot-lib-reloader = { version = "0.8.2", optional = true }
|
||||||
notify = { version = "6.1", optional = true }
|
notify = { version = "6.1", optional = true }
|
||||||
@@ -37,9 +43,11 @@ sim.workspace = true
|
|||||||
settings.workspace = true
|
settings.workspace = true
|
||||||
scene.workspace = true
|
scene.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
|
serde_json = "1"
|
||||||
transform-gizmo-bevy.workspace = true
|
transform-gizmo-bevy.workspace = true
|
||||||
rfd = "0.17.2"
|
rfd = "0.17.2"
|
||||||
ron = "0.8"
|
ron = "0.8"
|
||||||
uuid = { version = "1", features = ["v4", "serde"] }
|
uuid = { version = "1", features = ["v4", "serde"] }
|
||||||
walkdir = "2.5"
|
walkdir = "2.5"
|
||||||
gltf = "1.4"
|
gltf = { version = "1.4", features = ["extras"] }
|
||||||
|
blake3 = "1"
|
||||||
@@ -0,0 +1,904 @@
|
|||||||
|
//! Generated animation artifacts for imported model sources.
|
||||||
|
|
||||||
|
use std::collections::BTreeSet;
|
||||||
|
use std::fs;
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
|
use serde::Deserialize;
|
||||||
|
use shared::{
|
||||||
|
animation_clip_sub_asset_id, animation_skeleton_sub_asset_id, AnimationClipRecord,
|
||||||
|
AnimationDiagnosticSeverity, AnimationEventDesc, AnimationImportDiagnostic, AnimationManifest,
|
||||||
|
AnimationManifestSource, AnimationSkeletonRecord, AnimationSkeletonSignature,
|
||||||
|
AnimationSourceFingerprint, ANIMATION_ARTIFACT_DIR, ANIMATION_MANIFEST_SCHEMA_VERSION,
|
||||||
|
};
|
||||||
|
|
||||||
|
use crate::asset_db::AssetRecord;
|
||||||
|
use crate::assets::fingerprint::write_pretty_ron_if_changed;
|
||||||
|
|
||||||
|
pub fn animation_manifest_path(asset_id: &str) -> String {
|
||||||
|
format!("{ANIMATION_ARTIFACT_DIR}/{asset_id}.animation.ron")
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn refresh_animation_artifact(record: &mut AssetRecord) -> Result<AnimationManifest, String> {
|
||||||
|
let mut manifest = build_animation_manifest(record)?;
|
||||||
|
manifest.source.dependencies.sort();
|
||||||
|
manifest.source.dependencies.dedup();
|
||||||
|
|
||||||
|
let path = animation_manifest_path(&record.id.as_string());
|
||||||
|
record.import_settings.animation_manifest_path = Some(path.clone());
|
||||||
|
record
|
||||||
|
.dependencies
|
||||||
|
.extend(manifest.source.dependencies.iter().cloned());
|
||||||
|
record.dependencies.sort();
|
||||||
|
record.dependencies.dedup();
|
||||||
|
|
||||||
|
if write_pretty_ron_if_changed(&path, &manifest)
|
||||||
|
.map_err(|error| format!("could not publish animation manifest {path}: {error}"))?
|
||||||
|
{
|
||||||
|
bevy::log::info!(
|
||||||
|
"Animation manifest refreshed: source={} artifact={} skeletons={} clips={} runtime_supported={}",
|
||||||
|
record.path,
|
||||||
|
path,
|
||||||
|
manifest.skeletons.len(),
|
||||||
|
manifest.clips.len(),
|
||||||
|
manifest.runtime_supported
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(manifest)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn load_animation_manifest(path: &str) -> Result<AnimationManifest, String> {
|
||||||
|
let text =
|
||||||
|
fs::read_to_string(path).map_err(|error| format!("could not read {path}: {error}"))?;
|
||||||
|
ron::from_str(&text).map_err(|error| format!("could not parse {path}: {error}"))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn build_animation_manifest(record: &AssetRecord) -> Result<AnimationManifest, String> {
|
||||||
|
let bytes = fs::read(&record.path)
|
||||||
|
.map_err(|error| format!("could not read {}: {error}", record.path))?;
|
||||||
|
let fingerprint = source_fingerprint(&bytes);
|
||||||
|
let format = source_format(&record.path)?;
|
||||||
|
match format.as_str() {
|
||||||
|
"gltf" | "glb" => build_gltf_manifest(record, format, fingerprint, &bytes),
|
||||||
|
"fbx" => build_fbx_manifest(record, format, fingerprint, &bytes),
|
||||||
|
_ => Err(format!("unsupported animation source format `{format}`")),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
struct SkeletonCandidate {
|
||||||
|
compatible_nodes: BTreeSet<usize>,
|
||||||
|
signature: AnimationSkeletonSignature,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn build_gltf_manifest(
|
||||||
|
record: &AssetRecord,
|
||||||
|
format: String,
|
||||||
|
fingerprint: AnimationSourceFingerprint,
|
||||||
|
bytes: &[u8],
|
||||||
|
) -> Result<AnimationManifest, String> {
|
||||||
|
let gltf = gltf::Gltf::from_slice(bytes)
|
||||||
|
.map_err(|error| format!("could not parse glTF {}: {error}", record.path))?;
|
||||||
|
let base = Path::new(&record.path).parent();
|
||||||
|
let buffers = gltf::import_buffers(&gltf.document, base, gltf.blob.clone())
|
||||||
|
.map_err(|error| format!("could not load glTF buffers for {}: {error}", record.path))?;
|
||||||
|
|
||||||
|
let mut dependencies = gltf
|
||||||
|
.document
|
||||||
|
.buffers()
|
||||||
|
.filter_map(|buffer| match buffer.source() {
|
||||||
|
gltf::buffer::Source::Uri(uri) if !uri.starts_with("data:") => {
|
||||||
|
Some(resolve_dependency(&record.path, uri))
|
||||||
|
}
|
||||||
|
_ => None,
|
||||||
|
})
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
dependencies.sort();
|
||||||
|
dependencies.dedup();
|
||||||
|
|
||||||
|
let node_identity_names = gltf
|
||||||
|
.document
|
||||||
|
.nodes()
|
||||||
|
.map(|node| bevy_node_segment(node.name(), node.index()))
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
let readable_node_names = gltf
|
||||||
|
.document
|
||||||
|
.nodes()
|
||||||
|
.map(|node| normalized_node_segment(node.name(), node.index()))
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
let mut parents = vec![None; node_identity_names.len()];
|
||||||
|
for node in gltf.document.nodes() {
|
||||||
|
for child in node.children() {
|
||||||
|
parents[child.index()] = Some(node.index());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut skeletons = Vec::new();
|
||||||
|
let mut candidates = Vec::new();
|
||||||
|
for skin in gltf.document.skins() {
|
||||||
|
let source_index = skin.index();
|
||||||
|
let label = skin
|
||||||
|
.name()
|
||||||
|
.filter(|name| !name.trim().is_empty())
|
||||||
|
.map(str::to_string)
|
||||||
|
.unwrap_or_else(|| format!("Skeleton {source_index}"));
|
||||||
|
let joint_indices = skin.joints().map(|joint| joint.index()).collect::<Vec<_>>();
|
||||||
|
let joint_identity_paths = joint_indices
|
||||||
|
.iter()
|
||||||
|
.map(|index| node_path_segments(*index, &node_identity_names, &parents))
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
let joint_paths = joint_indices
|
||||||
|
.iter()
|
||||||
|
.map(|index| node_path(*index, &readable_node_names, &parents))
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
let bind_poses = skin
|
||||||
|
.reader(|buffer| Some(buffers[buffer.index()].0.as_slice()))
|
||||||
|
.read_inverse_bind_matrices()
|
||||||
|
.map(|matrices| matrices.map(gltf_matrix_bytes).collect::<Vec<_>>())
|
||||||
|
.unwrap_or_else(|| vec![identity_matrix_bytes(); joint_paths.len()]);
|
||||||
|
let signature = skeleton_signature(&joint_identity_paths, &bind_poses);
|
||||||
|
let mut compatible_nodes = joint_indices.into_iter().collect::<BTreeSet<_>>();
|
||||||
|
if let Some(root) = skin.skeleton() {
|
||||||
|
compatible_nodes.insert(root.index());
|
||||||
|
}
|
||||||
|
candidates.push(SkeletonCandidate {
|
||||||
|
compatible_nodes,
|
||||||
|
signature: signature.clone(),
|
||||||
|
});
|
||||||
|
skeletons.push(AnimationSkeletonRecord {
|
||||||
|
id: animation_skeleton_sub_asset_id(source_index, &label),
|
||||||
|
label,
|
||||||
|
source_index,
|
||||||
|
signature,
|
||||||
|
joint_paths,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut diagnostics = Vec::new();
|
||||||
|
let mut clips = Vec::new();
|
||||||
|
let mut animation_roots = BTreeSet::new();
|
||||||
|
for animation in gltf.document.animations() {
|
||||||
|
let source_index = animation.index();
|
||||||
|
let label = animation
|
||||||
|
.name()
|
||||||
|
.filter(|name| !name.trim().is_empty())
|
||||||
|
.map(str::to_string)
|
||||||
|
.unwrap_or_else(|| format!("Animation {source_index}"));
|
||||||
|
let mut duration_seconds = 0.0_f32;
|
||||||
|
let mut target_nodes = BTreeSet::new();
|
||||||
|
for channel in animation.channels() {
|
||||||
|
let target_index = channel.target().node().index();
|
||||||
|
target_nodes.insert(target_index);
|
||||||
|
animation_roots.insert(top_level_node(target_index, &parents));
|
||||||
|
if let Some(inputs) = channel
|
||||||
|
.reader(|buffer| Some(buffers[buffer.index()].0.as_slice()))
|
||||||
|
.read_inputs()
|
||||||
|
{
|
||||||
|
for input in inputs {
|
||||||
|
if input.is_finite() {
|
||||||
|
duration_seconds = duration_seconds.max(input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let target_skeleton_signature = matching_skeleton_signature(&target_nodes, &candidates);
|
||||||
|
if !candidates.is_empty() && target_skeleton_signature.is_none() {
|
||||||
|
diagnostics.push(AnimationImportDiagnostic {
|
||||||
|
severity: AnimationDiagnosticSeverity::Warning,
|
||||||
|
code: "animation.clip_skeleton_unresolved".into(),
|
||||||
|
message: format!(
|
||||||
|
"clip `{label}` does not target a uniquely identifiable imported skeleton"
|
||||||
|
),
|
||||||
|
repair: "Export the clip with channels targeting one skeleton, or split unrelated rigs into separate glTF assets.".into(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let events = gltf_animation_events(&animation, duration_seconds, &label, &mut diagnostics);
|
||||||
|
clips.push(AnimationClipRecord {
|
||||||
|
id: animation_clip_sub_asset_id(source_index, &label),
|
||||||
|
label,
|
||||||
|
source_index,
|
||||||
|
duration_seconds,
|
||||||
|
target_skeleton_signature,
|
||||||
|
events,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let default_animation_clip_id = record.import_settings.default_animation_clip_id.clone();
|
||||||
|
validate_default_animation_clip(
|
||||||
|
default_animation_clip_id.as_deref(),
|
||||||
|
&clips,
|
||||||
|
&mut diagnostics,
|
||||||
|
);
|
||||||
|
|
||||||
|
let runtime_supported = animation_roots.len() <= 1;
|
||||||
|
if !runtime_supported {
|
||||||
|
let roots = animation_roots
|
||||||
|
.iter()
|
||||||
|
.map(|index| format!("`{}` (node {index})", node_identity_names[*index]))
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join(", ");
|
||||||
|
diagnostics.push(AnimationImportDiagnostic {
|
||||||
|
severity: AnimationDiagnosticSeverity::Error,
|
||||||
|
code: "animation.multiple_roots_unsupported".into(),
|
||||||
|
message: format!(
|
||||||
|
"animation channels target {} distinct top-level roots ({roots}); Bevy requires a separate AnimationPlayer for each root",
|
||||||
|
animation_roots.len()
|
||||||
|
),
|
||||||
|
repair: "Split the source into one animated rig per glTF asset, or export every clip under one common top-level root, then reimport.".into(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(AnimationManifest {
|
||||||
|
schema_version: ANIMATION_MANIFEST_SCHEMA_VERSION,
|
||||||
|
asset_id: record.id.as_string(),
|
||||||
|
label: record.label.clone(),
|
||||||
|
default_animation_clip_id,
|
||||||
|
source: AnimationManifestSource {
|
||||||
|
path: record.path.clone(),
|
||||||
|
format,
|
||||||
|
fingerprint,
|
||||||
|
dependencies,
|
||||||
|
},
|
||||||
|
runtime_supported,
|
||||||
|
skeletons,
|
||||||
|
clips,
|
||||||
|
diagnostics,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fn build_fbx_manifest(
|
||||||
|
record: &AssetRecord,
|
||||||
|
format: String,
|
||||||
|
fingerprint: AnimationSourceFingerprint,
|
||||||
|
bytes: &[u8],
|
||||||
|
) -> Result<AnimationManifest, String> {
|
||||||
|
let scene = ufbx::load_memory(
|
||||||
|
bytes,
|
||||||
|
ufbx::LoadOpts {
|
||||||
|
target_unit_meters: 1.0,
|
||||||
|
target_axes: ufbx::CoordinateAxes::right_handed_y_up(),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.map_err(|error| format!("could not parse FBX {}: {error:?}", record.path))?;
|
||||||
|
|
||||||
|
let mut skeletons = Vec::new();
|
||||||
|
for (source_index, skin) in scene.skin_deformers.as_ref().iter().enumerate() {
|
||||||
|
let label = if skin.element.name.is_empty() {
|
||||||
|
format!("Skeleton {source_index}")
|
||||||
|
} else {
|
||||||
|
skin.element.name.to_string()
|
||||||
|
};
|
||||||
|
let mut joint_identity_paths = Vec::new();
|
||||||
|
let mut joint_paths = Vec::new();
|
||||||
|
let mut bind_poses = Vec::new();
|
||||||
|
for cluster in skin.clusters.as_ref() {
|
||||||
|
let Some(bone) = cluster.bone_node.as_ref() else {
|
||||||
|
continue;
|
||||||
|
};
|
||||||
|
let segments = fbx_node_path_segments(bone.as_ref());
|
||||||
|
joint_paths.push(segments.join("/"));
|
||||||
|
joint_identity_paths.push(segments);
|
||||||
|
bind_poses.push(fbx_matrix_bytes(&cluster.bind_to_world));
|
||||||
|
}
|
||||||
|
let signature = skeleton_signature(&joint_identity_paths, &bind_poses);
|
||||||
|
skeletons.push(AnimationSkeletonRecord {
|
||||||
|
id: animation_skeleton_sub_asset_id(source_index, &label),
|
||||||
|
label,
|
||||||
|
source_index,
|
||||||
|
signature,
|
||||||
|
joint_paths,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let fallback_signature = (skeletons.len() == 1).then(|| skeletons[0].signature.clone());
|
||||||
|
let clips = scene
|
||||||
|
.anim_stacks
|
||||||
|
.as_ref()
|
||||||
|
.iter()
|
||||||
|
.enumerate()
|
||||||
|
.map(|(source_index, stack)| {
|
||||||
|
let label = if stack.element.name.is_empty() {
|
||||||
|
format!("Animation {source_index}")
|
||||||
|
} else {
|
||||||
|
stack.element.name.to_string()
|
||||||
|
};
|
||||||
|
AnimationClipRecord {
|
||||||
|
id: animation_clip_sub_asset_id(source_index, &label),
|
||||||
|
label,
|
||||||
|
source_index,
|
||||||
|
duration_seconds: (stack.time_end - stack.time_begin).max(0.0) as f32,
|
||||||
|
target_skeleton_signature: fallback_signature.clone(),
|
||||||
|
events: Vec::new(),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
let (runtime_supported, mut diagnostics) = fbx_runtime_support(
|
||||||
|
scene.anim_stacks.as_ref().len(),
|
||||||
|
scene.skin_deformers.as_ref().len(),
|
||||||
|
);
|
||||||
|
let default_animation_clip_id = record.import_settings.default_animation_clip_id.clone();
|
||||||
|
validate_default_animation_clip(
|
||||||
|
default_animation_clip_id.as_deref(),
|
||||||
|
&clips,
|
||||||
|
&mut diagnostics,
|
||||||
|
);
|
||||||
|
|
||||||
|
Ok(AnimationManifest {
|
||||||
|
schema_version: ANIMATION_MANIFEST_SCHEMA_VERSION,
|
||||||
|
asset_id: record.id.as_string(),
|
||||||
|
label: record.label.clone(),
|
||||||
|
default_animation_clip_id,
|
||||||
|
source: AnimationManifestSource {
|
||||||
|
path: record.path.clone(),
|
||||||
|
format,
|
||||||
|
fingerprint,
|
||||||
|
dependencies: Vec::new(),
|
||||||
|
},
|
||||||
|
runtime_supported,
|
||||||
|
skeletons,
|
||||||
|
clips,
|
||||||
|
diagnostics,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fn validate_default_animation_clip(
|
||||||
|
default_clip_id: Option<&str>,
|
||||||
|
clips: &[AnimationClipRecord],
|
||||||
|
diagnostics: &mut Vec<AnimationImportDiagnostic>,
|
||||||
|
) {
|
||||||
|
let Some(default_clip_id) = default_clip_id.filter(|id| !id.trim().is_empty()) else {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
if clips.iter().any(|clip| clip.id == default_clip_id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
diagnostics.push(AnimationImportDiagnostic {
|
||||||
|
severity: AnimationDiagnosticSeverity::Error,
|
||||||
|
code: "animation.default_clip_missing".into(),
|
||||||
|
message: format!(
|
||||||
|
"configured default animation clip `{default_clip_id}` no longer exists in the imported source"
|
||||||
|
),
|
||||||
|
repair: "Choose an existing Default animation in Model Import Settings, or select Imported rest pose, then reimport.".into(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
fn fbx_runtime_support(
|
||||||
|
animation_count: usize,
|
||||||
|
skin_count: usize,
|
||||||
|
) -> (bool, Vec<AnimationImportDiagnostic>) {
|
||||||
|
let mut diagnostics = Vec::new();
|
||||||
|
if animation_count > 0 || skin_count > 0 {
|
||||||
|
diagnostics.push(AnimationImportDiagnostic {
|
||||||
|
severity: AnimationDiagnosticSeverity::Error,
|
||||||
|
code: "animation.fbx_runtime_unsupported".into(),
|
||||||
|
message: format!(
|
||||||
|
"FBX contains {animation_count} animation stack(s) and {skin_count} skin deformer(s), but Blacksite's current FBX loader cannot build a runtime skeleton or clips"
|
||||||
|
),
|
||||||
|
repair: "Export the animated source as glTF 2.0 (.glb or .gltf). Keep FBX only for static mesh import until hierarchy, SkinnedMesh, and AnimationClip conversion are implemented.".into(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
(false, diagnostics)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Default, Deserialize)]
|
||||||
|
struct GltfAnimationExtras {
|
||||||
|
#[serde(default)]
|
||||||
|
blacksite_events: Vec<GltfAnimationEvent>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Deserialize)]
|
||||||
|
struct GltfAnimationEvent {
|
||||||
|
id: String,
|
||||||
|
time_seconds: f32,
|
||||||
|
#[serde(default)]
|
||||||
|
payload: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn gltf_animation_events(
|
||||||
|
animation: &gltf::Animation<'_>,
|
||||||
|
duration_seconds: f32,
|
||||||
|
clip_label: &str,
|
||||||
|
diagnostics: &mut Vec<AnimationImportDiagnostic>,
|
||||||
|
) -> Vec<AnimationEventDesc> {
|
||||||
|
let Some(raw) = animation.extras().as_ref() else {
|
||||||
|
return Vec::new();
|
||||||
|
};
|
||||||
|
let extras = match serde_json::from_str::<GltfAnimationExtras>(raw.get()) {
|
||||||
|
Ok(extras) => extras,
|
||||||
|
Err(error) => {
|
||||||
|
diagnostics.push(AnimationImportDiagnostic {
|
||||||
|
severity: AnimationDiagnosticSeverity::Warning,
|
||||||
|
code: "animation.events_invalid".into(),
|
||||||
|
message: format!("clip `{clip_label}` has invalid animation event metadata: {error}"),
|
||||||
|
repair: "Use an animation extras object with `blacksite_events` entries containing `id`, `time_seconds`, and optional string `payload`.".into(),
|
||||||
|
});
|
||||||
|
return Vec::new();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let mut events = Vec::new();
|
||||||
|
for event in extras.blacksite_events {
|
||||||
|
let valid_time = event.time_seconds.is_finite()
|
||||||
|
&& event.time_seconds >= 0.0
|
||||||
|
&& event.time_seconds <= duration_seconds;
|
||||||
|
if event.id.trim().is_empty() || !valid_time {
|
||||||
|
diagnostics.push(AnimationImportDiagnostic {
|
||||||
|
severity: AnimationDiagnosticSeverity::Warning,
|
||||||
|
code: "animation.event_out_of_range".into(),
|
||||||
|
message: format!(
|
||||||
|
"clip `{clip_label}` contains an event with an empty ID or time outside 0..={duration_seconds:.3}s"
|
||||||
|
),
|
||||||
|
repair: "Give every event a stable non-empty ID and place it within the imported clip duration.".into(),
|
||||||
|
});
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
events.push(AnimationEventDesc {
|
||||||
|
id: event.id,
|
||||||
|
time_seconds: event.time_seconds,
|
||||||
|
payload: event.payload,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
events.sort_by(|left, right| {
|
||||||
|
left.time_seconds
|
||||||
|
.total_cmp(&right.time_seconds)
|
||||||
|
.then(left.id.cmp(&right.id))
|
||||||
|
.then(left.payload.cmp(&right.payload))
|
||||||
|
});
|
||||||
|
events
|
||||||
|
}
|
||||||
|
|
||||||
|
fn matching_skeleton_signature(
|
||||||
|
target_nodes: &BTreeSet<usize>,
|
||||||
|
candidates: &[SkeletonCandidate],
|
||||||
|
) -> Option<AnimationSkeletonSignature> {
|
||||||
|
let scored = candidates
|
||||||
|
.iter()
|
||||||
|
.map(|candidate| {
|
||||||
|
(
|
||||||
|
candidate
|
||||||
|
.compatible_nodes
|
||||||
|
.intersection(target_nodes)
|
||||||
|
.count(),
|
||||||
|
candidate,
|
||||||
|
)
|
||||||
|
})
|
||||||
|
.filter(|(score, _)| *score > 0)
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
let best_score = scored.iter().map(|(score, _)| *score).max()?;
|
||||||
|
let mut best = scored
|
||||||
|
.into_iter()
|
||||||
|
.filter(|(score, _)| *score == best_score)
|
||||||
|
.map(|(_, candidate)| candidate);
|
||||||
|
let candidate = best.next()?;
|
||||||
|
best.all(|other| other.signature == candidate.signature)
|
||||||
|
.then(|| candidate.signature.clone())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn node_path(index: usize, names: &[String], parents: &[Option<usize>]) -> String {
|
||||||
|
node_path_segments(index, names, parents).join("/")
|
||||||
|
}
|
||||||
|
|
||||||
|
fn node_path_segments(index: usize, names: &[String], parents: &[Option<usize>]) -> Vec<String> {
|
||||||
|
let mut segments = Vec::new();
|
||||||
|
let mut current = Some(index);
|
||||||
|
while let Some(node_index) = current {
|
||||||
|
segments.push(names[node_index].clone());
|
||||||
|
current = parents[node_index];
|
||||||
|
}
|
||||||
|
segments.reverse();
|
||||||
|
segments
|
||||||
|
}
|
||||||
|
|
||||||
|
fn top_level_node(index: usize, parents: &[Option<usize>]) -> usize {
|
||||||
|
let mut current = index;
|
||||||
|
while let Some(parent) = parents[current] {
|
||||||
|
current = parent;
|
||||||
|
}
|
||||||
|
current
|
||||||
|
}
|
||||||
|
|
||||||
|
fn bevy_node_segment(name: Option<&str>, index: usize) -> String {
|
||||||
|
name.map(str::to_string)
|
||||||
|
.unwrap_or_else(|| format!("GltfNode{index}"))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn normalized_node_segment(name: Option<&str>, index: usize) -> String {
|
||||||
|
name.map(str::trim)
|
||||||
|
.filter(|name| !name.is_empty())
|
||||||
|
.map(|name| name.replace(['/', '\\'], "_"))
|
||||||
|
.unwrap_or_else(|| format!("Node{index}"))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn fbx_node_path_segments(node: &ufbx::Node) -> Vec<String> {
|
||||||
|
let mut segments = Vec::new();
|
||||||
|
let mut current = Some(node);
|
||||||
|
while let Some(node) = current {
|
||||||
|
segments.push(normalized_node_segment(
|
||||||
|
(!node.element.name.is_empty()).then(|| node.element.name.as_ref()),
|
||||||
|
node.element.element_id as usize,
|
||||||
|
));
|
||||||
|
current = node.parent.as_ref().map(|parent| parent.as_ref());
|
||||||
|
}
|
||||||
|
segments.reverse();
|
||||||
|
segments
|
||||||
|
}
|
||||||
|
|
||||||
|
fn skeleton_signature(
|
||||||
|
joint_path_segments: &[Vec<String>],
|
||||||
|
bind_pose_bytes: &[Vec<u8>],
|
||||||
|
) -> AnimationSkeletonSignature {
|
||||||
|
let mut hasher = blake3::Hasher::new();
|
||||||
|
hasher.update(b"blacksite-animation-skeleton-v2\0");
|
||||||
|
hasher.update(&(joint_path_segments.len() as u64).to_le_bytes());
|
||||||
|
for path in joint_path_segments {
|
||||||
|
hasher.update(&(path.len() as u64).to_le_bytes());
|
||||||
|
for segment in path {
|
||||||
|
let bytes = segment.as_bytes();
|
||||||
|
hasher.update(&(bytes.len() as u64).to_le_bytes());
|
||||||
|
hasher.update(bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hasher.update(&(bind_pose_bytes.len() as u64).to_le_bytes());
|
||||||
|
for bytes in bind_pose_bytes {
|
||||||
|
hasher.update(&(bytes.len() as u64).to_le_bytes());
|
||||||
|
hasher.update(bytes);
|
||||||
|
}
|
||||||
|
AnimationSkeletonSignature::new(hasher.finalize().to_hex().to_string())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn gltf_matrix_bytes(matrix: [[f32; 4]; 4]) -> Vec<u8> {
|
||||||
|
matrix
|
||||||
|
.into_iter()
|
||||||
|
.flatten()
|
||||||
|
.flat_map(f32::to_le_bytes)
|
||||||
|
.collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn identity_matrix_bytes() -> Vec<u8> {
|
||||||
|
gltf_matrix_bytes([
|
||||||
|
[1.0, 0.0, 0.0, 0.0],
|
||||||
|
[0.0, 1.0, 0.0, 0.0],
|
||||||
|
[0.0, 0.0, 1.0, 0.0],
|
||||||
|
[0.0, 0.0, 0.0, 1.0],
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
fn fbx_matrix_bytes(matrix: &ufbx::Matrix) -> Vec<u8> {
|
||||||
|
[
|
||||||
|
matrix.m00, matrix.m10, matrix.m20, matrix.m01, matrix.m11, matrix.m21, matrix.m02,
|
||||||
|
matrix.m12, matrix.m22, matrix.m03, matrix.m13, matrix.m23,
|
||||||
|
]
|
||||||
|
.into_iter()
|
||||||
|
.flat_map(f64::to_le_bytes)
|
||||||
|
.collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn source_fingerprint(bytes: &[u8]) -> AnimationSourceFingerprint {
|
||||||
|
AnimationSourceFingerprint::from_bytes(bytes)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn source_format(path: &str) -> Result<String, String> {
|
||||||
|
Path::new(path)
|
||||||
|
.extension()
|
||||||
|
.and_then(|extension| extension.to_str())
|
||||||
|
.map(|extension| extension.to_ascii_lowercase())
|
||||||
|
.ok_or_else(|| format!("asset path `{path}` has no extension"))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn resolve_dependency(source_path: &str, uri: &str) -> String {
|
||||||
|
Path::new(source_path)
|
||||||
|
.parent()
|
||||||
|
.unwrap_or_else(|| Path::new(""))
|
||||||
|
.join(uri)
|
||||||
|
.to_string_lossy()
|
||||||
|
.replace('\\', "/")
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use crate::asset_db::{AssetId, ImportSettings};
|
||||||
|
use uuid::Uuid;
|
||||||
|
|
||||||
|
fn fixture_record(path: &Path) -> AssetRecord {
|
||||||
|
AssetRecord {
|
||||||
|
id: AssetId(Uuid::nil()),
|
||||||
|
path: path.to_string_lossy().replace('\\', "/"),
|
||||||
|
label: "Animated Hero".into(),
|
||||||
|
kind_tag: "Model".into(),
|
||||||
|
source_fingerprint: None,
|
||||||
|
import_settings: ImportSettings::default(),
|
||||||
|
dependencies: Vec::new(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write_animated_gltf(root: &Path) -> std::path::PathBuf {
|
||||||
|
fs::create_dir_all(root).unwrap();
|
||||||
|
let mut buffer = Vec::new();
|
||||||
|
for value in [0.0_f32, 1.25] {
|
||||||
|
buffer.extend_from_slice(&value.to_le_bytes());
|
||||||
|
}
|
||||||
|
for value in [0.0_f32, 0.0, 0.0, 1.0, 0.0, 0.38268343, 0.0, 0.9238795] {
|
||||||
|
buffer.extend_from_slice(&value.to_le_bytes());
|
||||||
|
}
|
||||||
|
fs::write(root.join("animated.bin"), buffer).unwrap();
|
||||||
|
let gltf = r#"{
|
||||||
|
"asset":{"version":"2.0"},
|
||||||
|
"scene":0,
|
||||||
|
"scenes":[{"nodes":[0]}],
|
||||||
|
"nodes":[{"name":"Armature","children":[1]},{"name":"Hip"}],
|
||||||
|
"skins":[{"name":"Hero Rig","skeleton":0,"joints":[1]}],
|
||||||
|
"buffers":[{"uri":"animated.bin","byteLength":40}],
|
||||||
|
"bufferViews":[
|
||||||
|
{"buffer":0,"byteOffset":0,"byteLength":8},
|
||||||
|
{"buffer":0,"byteOffset":8,"byteLength":32}
|
||||||
|
],
|
||||||
|
"accessors":[
|
||||||
|
{"bufferView":0,"componentType":5126,"count":2,"type":"SCALAR","min":[0.0],"max":[1.25]},
|
||||||
|
{"bufferView":1,"componentType":5126,"count":2,"type":"VEC4"}
|
||||||
|
],
|
||||||
|
"animations":[{
|
||||||
|
"name":"Idle Loop",
|
||||||
|
"samplers":[{"input":0,"output":1,"interpolation":"LINEAR"}],
|
||||||
|
"channels":[{"sampler":0,"target":{"node":1,"path":"rotation"}}],
|
||||||
|
"extras":{"blacksite_events":[{"id":"footstep.left","time_seconds":0.5,"payload":"stone"}]}
|
||||||
|
}]
|
||||||
|
}"#;
|
||||||
|
let path = root.join("animated.gltf");
|
||||||
|
fs::write(&path, gltf).unwrap();
|
||||||
|
path
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write_multi_root_animated_gltf(root: &Path) -> std::path::PathBuf {
|
||||||
|
fs::create_dir_all(root).unwrap();
|
||||||
|
let mut buffer = Vec::new();
|
||||||
|
for value in [0.0_f32, 1.0] {
|
||||||
|
buffer.extend_from_slice(&value.to_le_bytes());
|
||||||
|
}
|
||||||
|
for value in [0.0_f32, 0.0, 0.0, 1.0, 0.0, 0.38268343, 0.0, 0.9238795] {
|
||||||
|
buffer.extend_from_slice(&value.to_le_bytes());
|
||||||
|
}
|
||||||
|
fs::write(root.join("multi-root.bin"), buffer).unwrap();
|
||||||
|
let gltf = r#"{
|
||||||
|
"asset":{"version":"2.0"},
|
||||||
|
"scene":0,
|
||||||
|
"scenes":[{"nodes":[0,2]}],
|
||||||
|
"nodes":[
|
||||||
|
{"name":"Character A","children":[1]},
|
||||||
|
{"name":"Joint A"},
|
||||||
|
{"name":"Character B","children":[3]},
|
||||||
|
{"name":"Joint B"}
|
||||||
|
],
|
||||||
|
"buffers":[{"uri":"multi-root.bin","byteLength":40}],
|
||||||
|
"bufferViews":[
|
||||||
|
{"buffer":0,"byteOffset":0,"byteLength":8},
|
||||||
|
{"buffer":0,"byteOffset":8,"byteLength":32}
|
||||||
|
],
|
||||||
|
"accessors":[
|
||||||
|
{"bufferView":0,"componentType":5126,"count":2,"type":"SCALAR","min":[0.0],"max":[1.0]},
|
||||||
|
{"bufferView":1,"componentType":5126,"count":2,"type":"VEC4"}
|
||||||
|
],
|
||||||
|
"animations":[{
|
||||||
|
"name":"Two Players Required",
|
||||||
|
"samplers":[
|
||||||
|
{"input":0,"output":1,"interpolation":"LINEAR"},
|
||||||
|
{"input":0,"output":1,"interpolation":"LINEAR"}
|
||||||
|
],
|
||||||
|
"channels":[
|
||||||
|
{"sampler":0,"target":{"node":1,"path":"rotation"}},
|
||||||
|
{"sampler":1,"target":{"node":3,"path":"rotation"}}
|
||||||
|
]
|
||||||
|
}]
|
||||||
|
}"#;
|
||||||
|
let path = root.join("multi-root.gltf");
|
||||||
|
fs::write(&path, gltf).unwrap();
|
||||||
|
path
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn animation_manifest_path_uses_registry_uuid() {
|
||||||
|
assert_eq!(
|
||||||
|
animation_manifest_path("abc"),
|
||||||
|
"assets/animations/generated/abc.animation.ron"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn gltf_extraction_is_deterministic_and_preserves_duration_events_and_signature() {
|
||||||
|
let root = std::env::temp_dir().join(format!("blacksite-animation-{}", Uuid::new_v4()));
|
||||||
|
let path = write_animated_gltf(&root);
|
||||||
|
let record = fixture_record(&path);
|
||||||
|
|
||||||
|
let first = build_animation_manifest(&record).unwrap();
|
||||||
|
let second = build_animation_manifest(&record).unwrap();
|
||||||
|
|
||||||
|
assert_eq!(first, second);
|
||||||
|
assert_eq!(first.schema_version, ANIMATION_MANIFEST_SCHEMA_VERSION);
|
||||||
|
assert!(first.default_animation_clip_id.is_none());
|
||||||
|
assert!(first.runtime_supported);
|
||||||
|
assert_eq!(first.source.dependencies.len(), 1);
|
||||||
|
assert_eq!(first.skeletons.len(), 1);
|
||||||
|
assert_eq!(first.clips.len(), 1);
|
||||||
|
assert_eq!(first.skeletons[0].id, "animation:skeleton:0:hero_rig");
|
||||||
|
assert!(!first.skeletons[0].signature.is_empty());
|
||||||
|
assert_eq!(first.clips[0].id, "animation:clip:0:idle_loop");
|
||||||
|
assert_eq!(first.clips[0].duration_seconds, 1.25);
|
||||||
|
assert_eq!(
|
||||||
|
first.clips[0].target_skeleton_signature,
|
||||||
|
Some(first.skeletons[0].signature.clone())
|
||||||
|
);
|
||||||
|
assert_eq!(first.clips[0].events.len(), 1);
|
||||||
|
assert_eq!(first.clips[0].events[0].id, "footstep.left");
|
||||||
|
assert_eq!(first.clips[0].events[0].time_seconds, 0.5);
|
||||||
|
assert_eq!(first.diagnostics, Vec::new());
|
||||||
|
|
||||||
|
fs::remove_dir_all(root).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn legacy_mtime_metadata_does_not_rewrite_equivalent_animation_manifest() {
|
||||||
|
let root =
|
||||||
|
std::env::temp_dir().join(format!("blacksite-animation-legacy-{}", Uuid::new_v4()));
|
||||||
|
let path = write_animated_gltf(&root);
|
||||||
|
let manifest = build_animation_manifest(&fixture_record(&path)).unwrap();
|
||||||
|
let canonical =
|
||||||
|
ron::ser::to_string_pretty(&manifest, ron::ser::PrettyConfig::default()).unwrap();
|
||||||
|
let marker = format!("byte_len: {},", manifest.source.fingerprint.byte_len);
|
||||||
|
let legacy = canonical.replacen(
|
||||||
|
&marker,
|
||||||
|
&format!("{marker}\n modified_unix_secs: 123456,"),
|
||||||
|
1,
|
||||||
|
);
|
||||||
|
assert_ne!(legacy, canonical);
|
||||||
|
let artifact = root.join("legacy.animation.ron");
|
||||||
|
fs::write(&artifact, &legacy).unwrap();
|
||||||
|
|
||||||
|
assert!(!write_pretty_ron_if_changed(&artifact, &manifest).unwrap());
|
||||||
|
assert_eq!(fs::read_to_string(&artifact).unwrap(), legacy);
|
||||||
|
|
||||||
|
fs::remove_dir_all(root).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn explicit_default_clip_is_stable_and_stale_ids_are_diagnostic() {
|
||||||
|
let root =
|
||||||
|
std::env::temp_dir().join(format!("blacksite-animation-default-{}", Uuid::new_v4()));
|
||||||
|
let path = write_animated_gltf(&root);
|
||||||
|
let mut record = fixture_record(&path);
|
||||||
|
record.import_settings.default_animation_clip_id =
|
||||||
|
Some("animation:clip:0:idle_loop".into());
|
||||||
|
|
||||||
|
let manifest = build_animation_manifest(&record).unwrap();
|
||||||
|
assert_eq!(
|
||||||
|
manifest.default_animation_clip_id.as_deref(),
|
||||||
|
Some("animation:clip:0:idle_loop")
|
||||||
|
);
|
||||||
|
assert!(manifest.diagnostics.is_empty());
|
||||||
|
|
||||||
|
record.import_settings.default_animation_clip_id = Some("animation:clip:99:removed".into());
|
||||||
|
let stale = build_animation_manifest(&record).unwrap();
|
||||||
|
assert!(stale.diagnostics.iter().any(|diagnostic| {
|
||||||
|
diagnostic.code == "animation.default_clip_missing"
|
||||||
|
&& diagnostic.severity == AnimationDiagnosticSeverity::Error
|
||||||
|
}));
|
||||||
|
|
||||||
|
fs::remove_dir_all(root).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn exact_signature_changes_with_joint_path_or_bind_pose() {
|
||||||
|
let identity = identity_matrix_bytes();
|
||||||
|
let first = skeleton_signature(
|
||||||
|
&[vec!["Armature".into(), "Hip".into()]],
|
||||||
|
std::slice::from_ref(&identity),
|
||||||
|
);
|
||||||
|
let renamed = skeleton_signature(
|
||||||
|
&[vec!["Armature".into(), "Pelvis".into()]],
|
||||||
|
std::slice::from_ref(&identity),
|
||||||
|
);
|
||||||
|
let mut changed_pose = identity;
|
||||||
|
changed_pose[0] ^= 1;
|
||||||
|
let rebound = skeleton_signature(&[vec!["Armature".into(), "Hip".into()]], &[changed_pose]);
|
||||||
|
assert_ne!(first, renamed);
|
||||||
|
assert_ne!(first, rebound);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn exact_signature_preserves_bevy_node_bytes_and_segment_boundaries() {
|
||||||
|
let identity = identity_matrix_bytes();
|
||||||
|
let slash_in_name = vec![vec!["Armature".into(), "Hip/Joint".into()]];
|
||||||
|
let slash_as_boundary = vec![vec!["Armature/Hip".into(), "Joint".into()]];
|
||||||
|
|
||||||
|
assert_eq!(slash_in_name[0].join("/"), slash_as_boundary[0].join("/"));
|
||||||
|
assert_ne!(
|
||||||
|
skeleton_signature(&slash_in_name, std::slice::from_ref(&identity)),
|
||||||
|
skeleton_signature(&slash_as_boundary, std::slice::from_ref(&identity))
|
||||||
|
);
|
||||||
|
|
||||||
|
let backslash = vec![vec!["Armature".into(), "Hip\\Joint".into()]];
|
||||||
|
assert_eq!(
|
||||||
|
normalized_node_segment(Some("Hip/Joint"), 1),
|
||||||
|
normalized_node_segment(Some("Hip\\Joint"), 1)
|
||||||
|
);
|
||||||
|
assert_ne!(
|
||||||
|
skeleton_signature(&slash_in_name, std::slice::from_ref(&identity)),
|
||||||
|
skeleton_signature(&backslash, std::slice::from_ref(&identity))
|
||||||
|
);
|
||||||
|
assert_eq!(bevy_node_segment(Some(" /Joint "), 7), " /Joint ");
|
||||||
|
assert_eq!(bevy_node_segment(None, 7), "GltfNode7");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn gltf_with_multiple_animation_roots_is_runtime_unsupported() {
|
||||||
|
let root =
|
||||||
|
std::env::temp_dir().join(format!("blacksite-animation-multi-root-{}", Uuid::new_v4()));
|
||||||
|
let path = write_multi_root_animated_gltf(&root);
|
||||||
|
let manifest = build_animation_manifest(&fixture_record(&path)).unwrap();
|
||||||
|
|
||||||
|
assert!(!manifest.runtime_supported);
|
||||||
|
let diagnostic = manifest
|
||||||
|
.diagnostics
|
||||||
|
.iter()
|
||||||
|
.find(|diagnostic| diagnostic.code == "animation.multiple_roots_unsupported")
|
||||||
|
.expect("multi-root glTF should include an actionable blocking diagnostic");
|
||||||
|
assert_eq!(diagnostic.severity, AnimationDiagnosticSeverity::Error);
|
||||||
|
assert!(diagnostic.message.contains("2 distinct top-level roots"));
|
||||||
|
assert!(diagnostic.repair.contains("one common top-level root"));
|
||||||
|
|
||||||
|
fs::remove_dir_all(root).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn animated_or_skinned_fbx_is_runtime_unsupported_with_repair_guidance() {
|
||||||
|
let (supported, diagnostics) = fbx_runtime_support(2, 1);
|
||||||
|
assert!(!supported);
|
||||||
|
assert_eq!(diagnostics.len(), 1);
|
||||||
|
assert_eq!(diagnostics[0].severity, AnimationDiagnosticSeverity::Error);
|
||||||
|
assert_eq!(diagnostics[0].code, "animation.fbx_runtime_unsupported");
|
||||||
|
assert!(diagnostics[0].repair.contains("glTF 2.0"));
|
||||||
|
|
||||||
|
let (supported, diagnostics) = fbx_runtime_support(0, 0);
|
||||||
|
assert!(!supported);
|
||||||
|
assert!(diagnostics.is_empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn committed_robot_fixture_exposes_a_skin_and_multiple_named_states() {
|
||||||
|
let path =
|
||||||
|
Path::new(env!("CARGO_MANIFEST_DIR")).join("../../assets/models/robot_expressive.glb");
|
||||||
|
let manifest = build_animation_manifest(&fixture_record(&path)).unwrap();
|
||||||
|
|
||||||
|
assert!(manifest.runtime_supported);
|
||||||
|
assert_eq!(manifest.skeletons.len(), 2);
|
||||||
|
assert_eq!(manifest.skeletons[0].id, "animation:skeleton:0:skeleton_0");
|
||||||
|
assert_eq!(manifest.skeletons[1].id, "animation:skeleton:1:skeleton_1");
|
||||||
|
assert!(manifest
|
||||||
|
.skeletons
|
||||||
|
.iter()
|
||||||
|
.all(|skeleton| skeleton.joint_paths.len() == 43));
|
||||||
|
let signature = &manifest.skeletons[0].signature;
|
||||||
|
assert!(manifest
|
||||||
|
.skeletons
|
||||||
|
.iter()
|
||||||
|
.all(|skeleton| &skeleton.signature == signature));
|
||||||
|
assert_eq!(manifest.clips.len(), 14);
|
||||||
|
for expected in ["Idle", "Walking", "Running", "Jump", "Wave"] {
|
||||||
|
assert!(
|
||||||
|
manifest.clips.iter().any(|clip| clip.label == expected),
|
||||||
|
"missing expected fixture clip {expected}"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
assert!(manifest
|
||||||
|
.clips
|
||||||
|
.iter()
|
||||||
|
.all(|clip| clip.duration_seconds.is_finite() && clip.duration_seconds > 0.0));
|
||||||
|
assert!(manifest
|
||||||
|
.clips
|
||||||
|
.iter()
|
||||||
|
.all(|clip| { clip.target_skeleton_signature.as_ref() == Some(signature) }));
|
||||||
|
assert!(manifest.diagnostics.is_empty());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,9 +2,12 @@
|
|||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::collections::HashMap;
|
use shared::AssetSourceFingerprint;
|
||||||
|
use std::collections::{HashMap, HashSet};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
|
use crate::assets::fingerprint::{fingerprint_file, write_pretty_ron_if_changed};
|
||||||
|
|
||||||
/// Stable asset identity for dependency tracking and prefab references.
|
/// Stable asset identity for dependency tracking and prefab references.
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
|
||||||
pub struct AssetId(pub Uuid);
|
pub struct AssetId(pub Uuid);
|
||||||
@@ -25,42 +28,31 @@ impl Default for AssetId {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
pub enum ModelPlacementMode {
|
pub enum ModelPlacementMode {
|
||||||
|
/// Place renderable content through the appropriate normalized renderer. Imports containing
|
||||||
|
/// skins or animation route to `SkinnedMeshRenderer`; unrigged, non-animated content routes to
|
||||||
|
/// `StaticMeshRenderer`.
|
||||||
|
#[default]
|
||||||
StaticAsset,
|
StaticAsset,
|
||||||
|
/// Instantiate the complete source scene as a generic imported model.
|
||||||
SceneInstance,
|
SceneInstance,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for ModelPlacementMode {
|
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
fn default() -> Self {
|
|
||||||
Self::StaticAsset
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
|
|
||||||
pub enum ModelHierarchyMode {
|
pub enum ModelHierarchyMode {
|
||||||
|
#[default]
|
||||||
SingleActor,
|
SingleActor,
|
||||||
SourceHierarchy,
|
SourceHierarchy,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for ModelHierarchyMode {
|
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
fn default() -> Self {
|
|
||||||
Self::SingleActor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
|
|
||||||
pub enum MaterialImportPolicy {
|
pub enum MaterialImportPolicy {
|
||||||
|
#[default]
|
||||||
SourceMaterials,
|
SourceMaterials,
|
||||||
AuthoringOverride,
|
AuthoringOverride,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for MaterialImportPolicy {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self::SourceMaterials
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||||
pub struct ImportSettings {
|
pub struct ImportSettings {
|
||||||
pub scale: f32,
|
pub scale: f32,
|
||||||
@@ -74,6 +66,12 @@ pub struct ImportSettings {
|
|||||||
pub material_policy: MaterialImportPolicy,
|
pub material_policy: MaterialImportPolicy,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub static_mesh_manifest_path: Option<String>,
|
pub static_mesh_manifest_path: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub animation_manifest_path: Option<String>,
|
||||||
|
/// Stable animation clip sub-asset ID used as this model's edit-mode rest presentation.
|
||||||
|
/// `None` preserves the imported node pose and never guesses a clip.
|
||||||
|
#[serde(default)]
|
||||||
|
pub default_animation_clip_id: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for ImportSettings {
|
impl Default for ImportSettings {
|
||||||
@@ -86,6 +84,8 @@ impl Default for ImportSettings {
|
|||||||
hierarchy_mode: ModelHierarchyMode::default(),
|
hierarchy_mode: ModelHierarchyMode::default(),
|
||||||
material_policy: MaterialImportPolicy::default(),
|
material_policy: MaterialImportPolicy::default(),
|
||||||
static_mesh_manifest_path: None,
|
static_mesh_manifest_path: None,
|
||||||
|
animation_manifest_path: None,
|
||||||
|
default_animation_clip_id: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -96,6 +96,8 @@ pub struct AssetRecord {
|
|||||||
pub path: String,
|
pub path: String,
|
||||||
pub label: String,
|
pub label: String,
|
||||||
pub kind_tag: String,
|
pub kind_tag: String,
|
||||||
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
|
pub source_fingerprint: Option<AssetSourceFingerprint>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub import_settings: ImportSettings,
|
pub import_settings: ImportSettings,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
@@ -125,11 +127,17 @@ fn sync_registry_from_browser(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut existing: HashMap<String, AssetRecord> = registry
|
let previous_records = std::mem::take(&mut registry.records);
|
||||||
.records
|
let mut existing: HashMap<String, AssetRecord> = previous_records
|
||||||
.drain(..)
|
.iter()
|
||||||
|
.cloned()
|
||||||
.map(|record| (record.path.clone(), record))
|
.map(|record| (record.path.clone(), record))
|
||||||
.collect();
|
.collect();
|
||||||
|
let current_paths = assets
|
||||||
|
.assets
|
||||||
|
.iter()
|
||||||
|
.filter_map(|asset| asset.path.clone())
|
||||||
|
.collect::<HashSet<_>>();
|
||||||
|
|
||||||
let mut next_records = Vec::new();
|
let mut next_records = Vec::new();
|
||||||
let mut seen_paths = HashMap::new();
|
let mut seen_paths = HashMap::new();
|
||||||
@@ -144,24 +152,61 @@ fn sync_registry_from_browser(
|
|||||||
seen_paths.insert(path.clone(), ());
|
seen_paths.insert(path.clone(), ());
|
||||||
|
|
||||||
let kind_tag = format!("{:?}", asset.kind);
|
let kind_tag = format!("{:?}", asset.kind);
|
||||||
let mut record = if let Some(mut prior) = existing.remove(&path) {
|
let source_fingerprint = if imported_source_kind(&kind_tag) {
|
||||||
|
match fingerprint_file(&path) {
|
||||||
|
Ok(fingerprint) => Some(fingerprint),
|
||||||
|
Err(error) => {
|
||||||
|
warn!("Imported source fingerprint failed for {path}: {error}");
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
let mut record = if let Some(mut prior) = existing.remove(&path).or_else(|| {
|
||||||
|
source_fingerprint.as_ref().and_then(|fingerprint| {
|
||||||
|
take_uniquely_moved_import_record(
|
||||||
|
&mut existing,
|
||||||
|
¤t_paths,
|
||||||
|
&kind_tag,
|
||||||
|
fingerprint,
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}) {
|
||||||
|
if prior.path != path {
|
||||||
|
info!(
|
||||||
|
"Asset registry preserved imported source identity {} across move {} -> {}",
|
||||||
|
prior.id.as_string(),
|
||||||
|
prior.path,
|
||||||
|
path
|
||||||
|
);
|
||||||
|
prior.path = path.clone();
|
||||||
|
}
|
||||||
prior.label = asset.label.clone();
|
prior.label = asset.label.clone();
|
||||||
prior.kind_tag = kind_tag;
|
prior.kind_tag = kind_tag.clone();
|
||||||
prior
|
prior
|
||||||
} else {
|
} else {
|
||||||
AssetRecord {
|
AssetRecord {
|
||||||
id: AssetId::new(),
|
id: AssetId::new(),
|
||||||
path: path.clone(),
|
path: path.clone(),
|
||||||
label: asset.label.clone(),
|
label: asset.label.clone(),
|
||||||
kind_tag,
|
kind_tag: kind_tag.clone(),
|
||||||
|
source_fingerprint: None,
|
||||||
import_settings: ImportSettings::default(),
|
import_settings: ImportSettings::default(),
|
||||||
dependencies: Vec::new(),
|
dependencies: Vec::new(),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if imported_source_kind(&kind_tag) {
|
||||||
|
if let Some(source_fingerprint) = source_fingerprint {
|
||||||
|
record.source_fingerprint = Some(source_fingerprint);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
record.source_fingerprint = None;
|
||||||
|
}
|
||||||
if record.kind_tag == "Model" {
|
if record.kind_tag == "Model" {
|
||||||
if let Err(error) = super::static_mesh::refresh_static_mesh_artifact(&mut record) {
|
if let Err(error) = super::refresh_model_artifacts(&mut record) {
|
||||||
warn!(
|
warn!(
|
||||||
"Static mesh processor failed for {} (asset id {}): {error}",
|
"Model artifact refresh failed for {} (asset id {}): {error}",
|
||||||
record.path,
|
record.path,
|
||||||
record.id.as_string()
|
record.id.as_string()
|
||||||
);
|
);
|
||||||
@@ -170,7 +215,8 @@ fn sync_registry_from_browser(
|
|||||||
next_records.push(record);
|
next_records.push(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
let changed = registry.records != next_records;
|
sort_registry_records(&mut next_records);
|
||||||
|
let changed = previous_records != next_records;
|
||||||
registry.records = next_records;
|
registry.records = next_records;
|
||||||
if changed {
|
if changed {
|
||||||
registry.index_dirty = true;
|
registry.index_dirty = true;
|
||||||
@@ -185,6 +231,49 @@ fn sync_registry_from_browser(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn imported_source_kind(kind_tag: &str) -> bool {
|
||||||
|
matches!(kind_tag, "Model" | "Texture" | "AudioClip")
|
||||||
|
}
|
||||||
|
|
||||||
|
fn sort_registry_records(records: &mut [AssetRecord]) {
|
||||||
|
records.sort_by(|left, right| left.path.cmp(&right.path));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn take_uniquely_moved_import_record(
|
||||||
|
existing: &mut HashMap<String, AssetRecord>,
|
||||||
|
current_paths: &HashSet<String>,
|
||||||
|
kind_tag: &str,
|
||||||
|
fingerprint: &AssetSourceFingerprint,
|
||||||
|
) -> Option<AssetRecord> {
|
||||||
|
if !imported_source_kind(kind_tag) {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
let candidates = existing
|
||||||
|
.iter()
|
||||||
|
.filter_map(|(old_path, record)| {
|
||||||
|
if current_paths.contains(old_path) || record.kind_tag != kind_tag {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
recorded_source_fingerprint(record)
|
||||||
|
.is_some_and(|prior| prior == *fingerprint)
|
||||||
|
.then(|| old_path.clone())
|
||||||
|
})
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
if candidates.len() != 1 {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
existing.remove(&candidates[0])
|
||||||
|
}
|
||||||
|
|
||||||
|
fn recorded_source_fingerprint(record: &AssetRecord) -> Option<AssetSourceFingerprint> {
|
||||||
|
record.source_fingerprint.clone().or_else(|| {
|
||||||
|
let manifest_path = record.import_settings.animation_manifest_path.as_deref()?;
|
||||||
|
super::animation::load_animation_manifest(manifest_path)
|
||||||
|
.ok()
|
||||||
|
.map(|manifest| manifest.source.fingerprint)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
pub fn find_asset_by_path(registry: &AssetRegistry, path: &str) -> Option<AssetRecord> {
|
pub fn find_asset_by_path(registry: &AssetRegistry, path: &str) -> Option<AssetRecord> {
|
||||||
registry
|
registry
|
||||||
.records
|
.records
|
||||||
@@ -211,6 +300,39 @@ pub fn find_asset_mut_by_path<'a>(
|
|||||||
.find(|record| record.path == path)
|
.find(|record| record.path == path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn ensure_asset_record(
|
||||||
|
registry: &mut AssetRegistry,
|
||||||
|
path: impl Into<String>,
|
||||||
|
label: impl Into<String>,
|
||||||
|
kind_tag: impl Into<String>,
|
||||||
|
) -> Result<AssetRecord, String> {
|
||||||
|
let path = path.into();
|
||||||
|
if let Some(record) = find_asset_by_path(registry, &path) {
|
||||||
|
return Ok(record);
|
||||||
|
}
|
||||||
|
let kind_tag = kind_tag.into();
|
||||||
|
let source_fingerprint = imported_source_kind(&kind_tag)
|
||||||
|
.then(|| fingerprint_file(&path).ok())
|
||||||
|
.flatten();
|
||||||
|
let record = AssetRecord {
|
||||||
|
id: AssetId::new(),
|
||||||
|
path,
|
||||||
|
label: label.into(),
|
||||||
|
kind_tag,
|
||||||
|
source_fingerprint,
|
||||||
|
import_settings: ImportSettings::default(),
|
||||||
|
dependencies: Vec::new(),
|
||||||
|
};
|
||||||
|
registry.records.push(record.clone());
|
||||||
|
registry.index_dirty = true;
|
||||||
|
if let Err(error) = save_registry(registry) {
|
||||||
|
registry.records.pop();
|
||||||
|
return Err(error);
|
||||||
|
}
|
||||||
|
registry.index_dirty = false;
|
||||||
|
Ok(record)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn update_import_settings(
|
pub fn update_import_settings(
|
||||||
registry: &mut AssetRegistry,
|
registry: &mut AssetRegistry,
|
||||||
path: &str,
|
path: &str,
|
||||||
@@ -223,6 +345,9 @@ pub fn update_import_settings(
|
|||||||
else {
|
else {
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
if record.import_settings == settings {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
record.import_settings = settings;
|
record.import_settings = settings;
|
||||||
registry.index_dirty = true;
|
registry.index_dirty = true;
|
||||||
true
|
true
|
||||||
@@ -233,13 +358,7 @@ pub fn registry_index_path() -> &'static str {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn save_registry(registry: &AssetRegistry) -> Result<(), String> {
|
pub fn save_registry(registry: &AssetRegistry) -> Result<(), String> {
|
||||||
let path = registry_index_path();
|
write_pretty_ron_if_changed(registry_index_path(), ®istry.records).map(|_| ())
|
||||||
if let Some(parent) = std::path::Path::new(path).parent() {
|
|
||||||
std::fs::create_dir_all(parent).map_err(|e| e.to_string())?;
|
|
||||||
}
|
|
||||||
let text = ron::ser::to_string_pretty(®istry.records, ron::ser::PrettyConfig::default())
|
|
||||||
.map_err(|e| e.to_string())?;
|
|
||||||
std::fs::write(path, text).map_err(|e| e.to_string())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn load_registry() -> AssetRegistry {
|
pub fn load_registry() -> AssetRegistry {
|
||||||
@@ -255,3 +374,192 @@ pub fn load_registry() -> AssetRegistry {
|
|||||||
Err(_) => AssetRegistry::default(),
|
Err(_) => AssetRegistry::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use shared::{
|
||||||
|
AnimationManifest, AnimationManifestSource, AnimationSourceFingerprint,
|
||||||
|
ANIMATION_MANIFEST_SCHEMA_VERSION,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn imported_source_policy_covers_model_texture_and_audio_only() {
|
||||||
|
for kind in ["Model", "Texture", "AudioClip"] {
|
||||||
|
assert!(imported_source_kind(kind), "missing imported kind {kind}");
|
||||||
|
}
|
||||||
|
for kind in ["Material", "Level", "Prefab", "PostProcessEffect"] {
|
||||||
|
assert!(
|
||||||
|
!imported_source_kind(kind),
|
||||||
|
"authored kind {kind} was hashed"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn registry_publication_order_is_stable_across_discovery_orders() {
|
||||||
|
let records = [
|
||||||
|
("assets/textures/z.png", "Texture"),
|
||||||
|
("assets/audio/a.ogg", "AudioClip"),
|
||||||
|
("assets/models/m.glb", "Model"),
|
||||||
|
]
|
||||||
|
.into_iter()
|
||||||
|
.map(|(path, kind_tag)| AssetRecord {
|
||||||
|
id: AssetId::new(),
|
||||||
|
path: path.into(),
|
||||||
|
label: path.into(),
|
||||||
|
kind_tag: kind_tag.into(),
|
||||||
|
source_fingerprint: None,
|
||||||
|
import_settings: ImportSettings::default(),
|
||||||
|
dependencies: Vec::new(),
|
||||||
|
})
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
let mut forward = records.clone();
|
||||||
|
let mut reverse = records.into_iter().rev().collect::<Vec<_>>();
|
||||||
|
|
||||||
|
sort_registry_records(&mut forward);
|
||||||
|
sort_registry_records(&mut reverse);
|
||||||
|
|
||||||
|
assert_eq!(forward, reverse);
|
||||||
|
assert_eq!(
|
||||||
|
forward
|
||||||
|
.iter()
|
||||||
|
.map(|record| record.path.as_str())
|
||||||
|
.collect::<Vec<_>>(),
|
||||||
|
[
|
||||||
|
"assets/audio/a.ogg",
|
||||||
|
"assets/models/m.glb",
|
||||||
|
"assets/textures/z.png",
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn legacy_registry_record_loads_without_forcing_a_new_identity() {
|
||||||
|
let source = r#"(
|
||||||
|
id: ("00000000-0000-0000-0000-000000000000"),
|
||||||
|
path: "assets/textures/legacy.png",
|
||||||
|
label: "Legacy",
|
||||||
|
kind_tag: "Texture",
|
||||||
|
)"#;
|
||||||
|
let record: AssetRecord = ron::from_str(source).unwrap();
|
||||||
|
|
||||||
|
assert_eq!(record.id, AssetId(Uuid::nil()));
|
||||||
|
assert!(record.source_fingerprint.is_none());
|
||||||
|
assert_eq!(record.import_settings, ImportSettings::default());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn content_match_preserves_every_imported_source_kind_across_move() {
|
||||||
|
let fingerprint = AssetSourceFingerprint::from_bytes(b"stable imported bytes");
|
||||||
|
for kind in ["Model", "Texture", "AudioClip"] {
|
||||||
|
let record = AssetRecord {
|
||||||
|
id: AssetId::new(),
|
||||||
|
path: format!("assets/old/{kind}"),
|
||||||
|
label: kind.into(),
|
||||||
|
kind_tag: kind.into(),
|
||||||
|
source_fingerprint: Some(fingerprint.clone()),
|
||||||
|
import_settings: ImportSettings::default(),
|
||||||
|
dependencies: Vec::new(),
|
||||||
|
};
|
||||||
|
let expected_id = record.id.clone();
|
||||||
|
let mut existing = HashMap::from([(record.path.clone(), record)]);
|
||||||
|
|
||||||
|
let moved = take_uniquely_moved_import_record(
|
||||||
|
&mut existing,
|
||||||
|
&HashSet::new(),
|
||||||
|
kind,
|
||||||
|
&fingerprint,
|
||||||
|
)
|
||||||
|
.expect("unique content identity should preserve the record");
|
||||||
|
|
||||||
|
assert_eq!(moved.id, expected_id);
|
||||||
|
assert!(existing.is_empty());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn moved_model_fixture(bytes: &[u8]) -> (std::path::PathBuf, std::path::PathBuf, AssetRecord) {
|
||||||
|
let key = Uuid::new_v4();
|
||||||
|
let source_path = std::env::temp_dir().join(format!("blacksite-moved-model-{key}.glb"));
|
||||||
|
let manifest_path =
|
||||||
|
std::env::temp_dir().join(format!("blacksite-moved-model-{key}.animation.ron"));
|
||||||
|
std::fs::write(&source_path, bytes).unwrap();
|
||||||
|
let id = AssetId::new();
|
||||||
|
let old_path = format!("assets/models/old-{key}.glb");
|
||||||
|
let manifest = AnimationManifest {
|
||||||
|
schema_version: ANIMATION_MANIFEST_SCHEMA_VERSION,
|
||||||
|
asset_id: id.as_string(),
|
||||||
|
label: "Moved Model".into(),
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
source: AnimationManifestSource {
|
||||||
|
path: old_path.clone(),
|
||||||
|
format: "glb".into(),
|
||||||
|
fingerprint: AnimationSourceFingerprint {
|
||||||
|
byte_len: bytes.len() as u64,
|
||||||
|
content_hash: blake3::hash(bytes).to_hex().to_string(),
|
||||||
|
},
|
||||||
|
dependencies: Vec::new(),
|
||||||
|
},
|
||||||
|
runtime_supported: true,
|
||||||
|
skeletons: Vec::new(),
|
||||||
|
clips: Vec::new(),
|
||||||
|
diagnostics: Vec::new(),
|
||||||
|
};
|
||||||
|
std::fs::write(
|
||||||
|
&manifest_path,
|
||||||
|
ron::ser::to_string_pretty(&manifest, ron::ser::PrettyConfig::default()).unwrap(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
let record = AssetRecord {
|
||||||
|
id,
|
||||||
|
path: old_path,
|
||||||
|
label: "Moved Model".into(),
|
||||||
|
kind_tag: "Model".into(),
|
||||||
|
source_fingerprint: None,
|
||||||
|
import_settings: ImportSettings {
|
||||||
|
animation_manifest_path: Some(manifest_path.to_string_lossy().into_owned()),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
dependencies: Vec::new(),
|
||||||
|
};
|
||||||
|
(source_path, manifest_path, record)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn unique_content_match_preserves_model_record_across_move() {
|
||||||
|
let (source_path, manifest_path, record) = moved_model_fixture(b"stable model bytes");
|
||||||
|
let expected_id = record.id.clone();
|
||||||
|
let mut existing = HashMap::from([(record.path.clone(), record)]);
|
||||||
|
let fingerprint = fingerprint_file(&source_path).unwrap();
|
||||||
|
|
||||||
|
let moved = take_uniquely_moved_import_record(
|
||||||
|
&mut existing,
|
||||||
|
&HashSet::new(),
|
||||||
|
"Model",
|
||||||
|
&fingerprint,
|
||||||
|
)
|
||||||
|
.expect("unique moved model should retain its registry record");
|
||||||
|
|
||||||
|
assert_eq!(moved.id, expected_id);
|
||||||
|
assert!(existing.is_empty());
|
||||||
|
let _ = std::fs::remove_file(source_path);
|
||||||
|
let _ = std::fs::remove_file(manifest_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn existing_source_path_is_not_reconciled_as_a_copy_move() {
|
||||||
|
let (source_path, manifest_path, record) = moved_model_fixture(b"copied model bytes");
|
||||||
|
let old_path = record.path.clone();
|
||||||
|
let mut existing = HashMap::from([(old_path.clone(), record)]);
|
||||||
|
let current_paths = HashSet::from([old_path]);
|
||||||
|
let fingerprint = fingerprint_file(&source_path).unwrap();
|
||||||
|
|
||||||
|
let moved =
|
||||||
|
take_uniquely_moved_import_record(&mut existing, ¤t_paths, "Model", &fingerprint);
|
||||||
|
|
||||||
|
assert!(moved.is_none());
|
||||||
|
assert_eq!(existing.len(), 1);
|
||||||
|
let _ = std::fs::remove_file(source_path);
|
||||||
|
let _ = std::fs::remove_file(manifest_path);
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,114 @@
|
|||||||
|
use std::fs;
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
|
use serde::de::DeserializeOwned;
|
||||||
|
use serde::Serialize;
|
||||||
|
use shared::AssetSourceFingerprint;
|
||||||
|
|
||||||
|
pub(crate) fn fingerprint_file(path: impl AsRef<Path>) -> Result<AssetSourceFingerprint, String> {
|
||||||
|
let path = path.as_ref();
|
||||||
|
let bytes = fs::read(path)
|
||||||
|
.map_err(|error| format!("could not read imported source {}: {error}", path.display()))?;
|
||||||
|
Ok(AssetSourceFingerprint::from_bytes(&bytes))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Writes canonical pretty RON only when the parsed document changes semantically.
|
||||||
|
///
|
||||||
|
/// Equivalent existing bytes, including custom formatting and final-newline policy, stay intact.
|
||||||
|
pub(crate) fn write_pretty_ron_if_changed<T>(
|
||||||
|
path: impl AsRef<Path>,
|
||||||
|
value: &T,
|
||||||
|
) -> Result<bool, String>
|
||||||
|
where
|
||||||
|
T: DeserializeOwned + PartialEq + Serialize,
|
||||||
|
{
|
||||||
|
let path = path.as_ref();
|
||||||
|
if fs::read_to_string(path)
|
||||||
|
.ok()
|
||||||
|
.and_then(|text| ron::from_str::<T>(&text).ok())
|
||||||
|
.is_some_and(|existing| existing == *value)
|
||||||
|
{
|
||||||
|
return Ok(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
let text = ron::ser::to_string_pretty(value, ron::ser::PrettyConfig::default())
|
||||||
|
.map_err(|error| format!("could not serialize RON: {error}"))?;
|
||||||
|
if fs::read(path).ok().as_deref() == Some(text.as_bytes()) {
|
||||||
|
return Ok(false);
|
||||||
|
}
|
||||||
|
if let Some(parent) = path.parent() {
|
||||||
|
fs::create_dir_all(parent)
|
||||||
|
.map_err(|error| format!("could not create {}: {error}", parent.display()))?;
|
||||||
|
}
|
||||||
|
fs::write(path, text)
|
||||||
|
.map_err(|error| format!("could not write {}: {error}", path.display()))?;
|
||||||
|
Ok(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use serde::Deserialize;
|
||||||
|
use std::fs::{File, FileTimes};
|
||||||
|
use std::time::{Duration, SystemTime};
|
||||||
|
use uuid::Uuid;
|
||||||
|
|
||||||
|
#[derive(Debug, Deserialize, PartialEq, Serialize)]
|
||||||
|
struct Fixture {
|
||||||
|
count: u32,
|
||||||
|
label: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn fixture_path(name: &str) -> std::path::PathBuf {
|
||||||
|
std::env::temp_dir().join(format!(
|
||||||
|
"blacksite-fingerprint-{name}-{}.ron",
|
||||||
|
Uuid::new_v4()
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn metadata_only_drift_does_not_change_content_identity() {
|
||||||
|
let path = fixture_path("mtime");
|
||||||
|
fs::write(&path, b"stable source bytes").unwrap();
|
||||||
|
let before = fingerprint_file(&path).unwrap();
|
||||||
|
File::options()
|
||||||
|
.write(true)
|
||||||
|
.open(&path)
|
||||||
|
.unwrap()
|
||||||
|
.set_times(
|
||||||
|
FileTimes::new().set_modified(SystemTime::now() + Duration::from_secs(86_400)),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
assert_eq!(fingerprint_file(&path).unwrap(), before);
|
||||||
|
fs::remove_file(path).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn same_size_byte_change_updates_content_identity() {
|
||||||
|
let path = fixture_path("same-size");
|
||||||
|
fs::write(&path, b"source-a").unwrap();
|
||||||
|
let before = fingerprint_file(&path).unwrap();
|
||||||
|
fs::write(&path, b"source-b").unwrap();
|
||||||
|
let after = fingerprint_file(&path).unwrap();
|
||||||
|
|
||||||
|
assert_eq!(before.byte_len, after.byte_len);
|
||||||
|
assert_ne!(before.content_hash, after.content_hash);
|
||||||
|
fs::remove_file(path).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn equivalent_ron_preserves_exact_existing_bytes() {
|
||||||
|
let path = fixture_path("semantic");
|
||||||
|
let existing = b"( label: \"stable\", count: 7, )\n\n";
|
||||||
|
fs::write(&path, existing).unwrap();
|
||||||
|
let value = Fixture {
|
||||||
|
count: 7,
|
||||||
|
label: "stable".into(),
|
||||||
|
};
|
||||||
|
|
||||||
|
assert!(!write_pretty_ron_if_changed(&path, &value).unwrap());
|
||||||
|
assert_eq!(fs::read(&path).unwrap(), existing);
|
||||||
|
fs::remove_file(path).unwrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,71 +1,564 @@
|
|||||||
//! External asset import helpers (FBX sidecar folders, etc.).
|
//! External asset bundle inspection and transactional import.
|
||||||
|
|
||||||
|
use std::collections::BTreeMap;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Component, Path, PathBuf};
|
||||||
|
|
||||||
/// Copies an FBX file and its sibling `.fbm` embedded-texture folder when present.
|
use bevy_ufbx::texture::external_texture_paths;
|
||||||
pub fn copy_fbx_with_sidecar(source: &Path, dest_dir: &Path) -> Result<(), String> {
|
|
||||||
let Some(file_name) = source.file_name() else {
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
return Err("FBX import path has no file name".into());
|
pub(crate) struct FbxDependencyInspection {
|
||||||
};
|
pub relative_paths: Vec<String>,
|
||||||
fs::create_dir_all(dest_dir)
|
pub resolved_paths: Vec<PathBuf>,
|
||||||
.map_err(|err| format!("could not create {}: {err}", dest_dir.display()))?;
|
pub missing_paths: Vec<PathBuf>,
|
||||||
let dest = dest_dir.join(file_name);
|
}
|
||||||
fs::copy(source, &dest).map_err(|err| {
|
|
||||||
|
/// Parses every external FBX texture reference without loading it through Bevy.
|
||||||
|
pub(crate) fn inspect_fbx_dependencies(source: &Path) -> Result<FbxDependencyInspection, String> {
|
||||||
|
let bytes = fs::read(source)
|
||||||
|
.map_err(|error| format!("could not read FBX {}: {error}", source.display()))?;
|
||||||
|
let filename_hint = source.to_string_lossy();
|
||||||
|
let scene = ufbx::load_memory(
|
||||||
|
&bytes,
|
||||||
|
ufbx::LoadOpts {
|
||||||
|
target_unit_meters: 1.0,
|
||||||
|
target_axes: ufbx::CoordinateAxes::right_handed_y_up(),
|
||||||
|
filename: ufbx::StringOpt::Ref(&filename_hint),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.map_err(|error| format!("could not parse FBX {}: {error:?}", source.display()))?;
|
||||||
|
let relative_paths = external_texture_paths(&scene).map_err(|errors| {
|
||||||
format!(
|
format!(
|
||||||
"could not copy {} to {}: {err}",
|
"unsafe FBX texture reference(s) in {}: {}",
|
||||||
source.display(),
|
source.display(),
|
||||||
dest.display()
|
errors
|
||||||
|
.into_iter()
|
||||||
|
.map(|error| error.to_string())
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join("; ")
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
let source_root = source.parent().unwrap_or_else(|| Path::new(""));
|
||||||
if let Some(fbm_dir) = fbm_sidecar_dir(source) {
|
let canonical_root = fs::canonicalize(source_root).map_err(|error| {
|
||||||
if fbm_dir.is_dir() {
|
|
||||||
let dest_fbm = dest_dir.join(fbm_dir.file_name().unwrap_or_default());
|
|
||||||
copy_dir_recursive(&fbm_dir, &dest_fbm)?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn fbm_sidecar_dir(source: &Path) -> Option<PathBuf> {
|
|
||||||
let stem = source.file_stem()?.to_str()?;
|
|
||||||
let parent = source.parent()?;
|
|
||||||
Some(parent.join(format!("{stem}.fbm")))
|
|
||||||
}
|
|
||||||
|
|
||||||
fn copy_dir_recursive(source: &Path, dest: &Path) -> Result<(), String> {
|
|
||||||
fs::create_dir_all(dest)
|
|
||||||
.map_err(|err| format!("could not create {}: {err}", dest.display()))?;
|
|
||||||
for entry in fs::read_dir(source).map_err(|err| err.to_string())? {
|
|
||||||
let entry = entry.map_err(|err| err.to_string())?;
|
|
||||||
let src_path = entry.path();
|
|
||||||
let dest_path = dest.join(entry.file_name());
|
|
||||||
if src_path.is_dir() {
|
|
||||||
copy_dir_recursive(&src_path, &dest_path)?;
|
|
||||||
} else {
|
|
||||||
fs::copy(&src_path, &dest_path).map_err(|err| {
|
|
||||||
format!(
|
format!(
|
||||||
"could not copy {} to {}: {err}",
|
"could not resolve FBX source directory {}: {error}",
|
||||||
src_path.display(),
|
source_root.display()
|
||||||
dest_path.display()
|
)
|
||||||
|
})?;
|
||||||
|
let mut resolved_paths = Vec::new();
|
||||||
|
let mut missing_paths = Vec::new();
|
||||||
|
for relative_path in &relative_paths {
|
||||||
|
let resolved = source_root.join(relative_path);
|
||||||
|
if !resolved.is_file() {
|
||||||
|
missing_paths.push(resolved.clone());
|
||||||
|
resolved_paths.push(resolved);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
let canonical = fs::canonicalize(&resolved).map_err(|error| {
|
||||||
|
format!(
|
||||||
|
"could not resolve FBX dependency {}: {error}",
|
||||||
|
resolved.display()
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
if !canonical.starts_with(&canonical_root) {
|
||||||
|
return Err(format!(
|
||||||
|
"FBX dependency {} resolves outside source directory {}",
|
||||||
|
resolved.display(),
|
||||||
|
source_root.display()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
resolved_paths.push(resolved);
|
||||||
|
}
|
||||||
|
missing_paths.sort();
|
||||||
|
Ok(FbxDependencyInspection {
|
||||||
|
relative_paths,
|
||||||
|
resolved_paths,
|
||||||
|
missing_paths,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns one stable browser-facing error for all missing FBX source textures.
|
||||||
|
pub(crate) fn validate_fbx_dependencies(source: &Path) -> Result<(), String> {
|
||||||
|
let inspection = inspect_fbx_dependencies(source)?;
|
||||||
|
if inspection.missing_paths.is_empty() {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
Err(format!(
|
||||||
|
"missing {} FBX source texture(s): {}",
|
||||||
|
inspection.missing_paths.len(),
|
||||||
|
inspection
|
||||||
|
.missing_paths
|
||||||
|
.iter()
|
||||||
|
.map(|path| path.to_string_lossy().replace('\\', "/"))
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join(", ")
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Copies an FBX and every referenced external texture as one staged filesystem transaction.
|
||||||
|
pub fn copy_fbx_bundle(source: &Path, dest_dir: &Path) -> Result<(), String> {
|
||||||
|
let inspection = inspect_fbx_dependencies(source)?;
|
||||||
|
if !inspection.missing_paths.is_empty() {
|
||||||
|
return Err(format!(
|
||||||
|
"FBX import is missing {} required texture(s): {}",
|
||||||
|
inspection.missing_paths.len(),
|
||||||
|
inspection
|
||||||
|
.missing_paths
|
||||||
|
.iter()
|
||||||
|
.map(|path| path.display().to_string())
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join(", ")
|
||||||
|
));
|
||||||
|
}
|
||||||
|
let file_name = source
|
||||||
|
.file_name()
|
||||||
|
.ok_or_else(|| "FBX import path has no file name".to_string())?;
|
||||||
|
let mut entries = BTreeMap::new();
|
||||||
|
entries.insert(PathBuf::from(file_name), source.to_path_buf());
|
||||||
|
for (relative, resolved) in inspection
|
||||||
|
.relative_paths
|
||||||
|
.iter()
|
||||||
|
.zip(inspection.resolved_paths.iter())
|
||||||
|
{
|
||||||
|
let relative = PathBuf::from(relative);
|
||||||
|
if let Some(existing) = entries.insert(relative.clone(), resolved.clone()) {
|
||||||
|
if existing != *resolved {
|
||||||
|
return Err(format!(
|
||||||
|
"FBX import maps multiple source files to {}",
|
||||||
|
relative.display()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
copy_bundle_transactionally(&entries, dest_dir)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn copy_bundle_transactionally(
|
||||||
|
entries: &BTreeMap<PathBuf, PathBuf>,
|
||||||
|
dest_dir: &Path,
|
||||||
|
) -> Result<(), String> {
|
||||||
|
fs::create_dir_all(dest_dir)
|
||||||
|
.map_err(|error| format!("could not create {}: {error}", dest_dir.display()))?;
|
||||||
|
let canonical_dest_dir = fs::canonicalize(dest_dir).map_err(|error| {
|
||||||
|
format!(
|
||||||
|
"could not resolve FBX import destination {}: {error}",
|
||||||
|
dest_dir.display()
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
for relative in entries.keys() {
|
||||||
|
validate_bundle_relative_path(relative)?;
|
||||||
|
validate_existing_destination_parents(dest_dir, &canonical_dest_dir, relative)?;
|
||||||
|
let target = dest_dir.join(relative);
|
||||||
|
if target.is_dir() {
|
||||||
|
return Err(format!(
|
||||||
|
"FBX import target {} is an existing directory",
|
||||||
|
target.display()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let stage_root = dest_dir.join(format!(".blacksite-import-{}", uuid::Uuid::new_v4()));
|
||||||
|
let staged_root = stage_root.join("new");
|
||||||
|
let backup_root = stage_root.join("backup");
|
||||||
|
let stage_result = (|| {
|
||||||
|
for (relative, source) in entries {
|
||||||
|
let staged = staged_root.join(relative);
|
||||||
|
if let Some(parent) = staged.parent() {
|
||||||
|
fs::create_dir_all(parent).map_err(|error| {
|
||||||
|
format!(
|
||||||
|
"could not create import staging {}: {error}",
|
||||||
|
parent.display()
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
|
fs::copy(source, &staged).map_err(|error| {
|
||||||
|
format!(
|
||||||
|
"could not stage FBX bundle file {} as {}: {error}",
|
||||||
|
source.display(),
|
||||||
|
relative.display()
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
}
|
||||||
|
commit_staged_bundle(
|
||||||
|
entries,
|
||||||
|
dest_dir,
|
||||||
|
&canonical_dest_dir,
|
||||||
|
&staged_root,
|
||||||
|
&backup_root,
|
||||||
|
)
|
||||||
|
})();
|
||||||
|
let cleanup_result = fs::remove_dir_all(&stage_root);
|
||||||
|
match (stage_result, cleanup_result) {
|
||||||
|
(Err(error), _) => Err(error),
|
||||||
|
(Ok(()), Ok(())) => Ok(()),
|
||||||
|
(Ok(()), Err(error)) if error.kind() == std::io::ErrorKind::NotFound => Ok(()),
|
||||||
|
(Ok(()), Err(error)) => {
|
||||||
|
bevy::log::warn!(
|
||||||
|
"FBX bundle imported but staging cleanup failed for {}: {error}",
|
||||||
|
stage_root.display()
|
||||||
|
);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn validate_bundle_relative_path(relative: &Path) -> Result<(), String> {
|
||||||
|
if relative.as_os_str().is_empty()
|
||||||
|
|| !relative
|
||||||
|
.components()
|
||||||
|
.all(|component| matches!(component, Component::Normal(_)))
|
||||||
|
{
|
||||||
|
return Err(format!(
|
||||||
|
"FBX import target path {} is not a safe relative path",
|
||||||
|
relative.display()
|
||||||
|
));
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn validate_existing_destination_parents(
|
||||||
|
dest_dir: &Path,
|
||||||
|
canonical_dest_dir: &Path,
|
||||||
|
relative: &Path,
|
||||||
|
) -> Result<(), String> {
|
||||||
|
let mut current = dest_dir.to_path_buf();
|
||||||
|
let Some(parent) = relative.parent() else {
|
||||||
|
return Ok(());
|
||||||
|
};
|
||||||
|
for component in parent.components() {
|
||||||
|
let Component::Normal(segment) = component else {
|
||||||
|
return Err(format!(
|
||||||
|
"FBX import target path {} is not a safe relative path",
|
||||||
|
relative.display()
|
||||||
|
));
|
||||||
|
};
|
||||||
|
current.push(segment);
|
||||||
|
let metadata = match fs::symlink_metadata(¤t) {
|
||||||
|
Ok(metadata) => metadata,
|
||||||
|
Err(error) if error.kind() == std::io::ErrorKind::NotFound => break,
|
||||||
|
Err(error) => {
|
||||||
|
return Err(format!(
|
||||||
|
"could not inspect FBX import target {}: {error}",
|
||||||
|
current.display()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if metadata.file_type().is_symlink() {
|
||||||
|
return Err(format!(
|
||||||
|
"FBX import target parent {} is a symbolic link",
|
||||||
|
current.display()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
if !metadata.is_dir() {
|
||||||
|
return Err(format!(
|
||||||
|
"FBX import target parent {} is not a directory",
|
||||||
|
current.display()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
let canonical = fs::canonicalize(¤t).map_err(|error| {
|
||||||
|
format!(
|
||||||
|
"could not resolve FBX import target parent {}: {error}",
|
||||||
|
current.display()
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
if !canonical.starts_with(canonical_dest_dir) {
|
||||||
|
return Err(format!(
|
||||||
|
"FBX import target parent {} resolves outside destination {}",
|
||||||
|
current.display(),
|
||||||
|
dest_dir.display()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn commit_staged_bundle(
|
||||||
|
entries: &BTreeMap<PathBuf, PathBuf>,
|
||||||
|
dest_dir: &Path,
|
||||||
|
canonical_dest_dir: &Path,
|
||||||
|
staged_root: &Path,
|
||||||
|
backup_root: &Path,
|
||||||
|
) -> Result<(), String> {
|
||||||
|
let mut installed = Vec::new();
|
||||||
|
let mut backups = Vec::new();
|
||||||
|
for relative in entries.keys() {
|
||||||
|
let target = dest_dir.join(relative);
|
||||||
|
let staged = staged_root.join(relative);
|
||||||
|
if let Some(parent) = target.parent() {
|
||||||
|
if let Err(error) = fs::create_dir_all(parent) {
|
||||||
|
return rollback_bundle(
|
||||||
|
&installed,
|
||||||
|
&backups,
|
||||||
|
format!(
|
||||||
|
"could not create import target {}: {error}",
|
||||||
|
parent.display()
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
let canonical_parent = match fs::canonicalize(parent) {
|
||||||
|
Ok(canonical_parent) => canonical_parent,
|
||||||
|
Err(error) => {
|
||||||
|
return rollback_bundle(
|
||||||
|
&installed,
|
||||||
|
&backups,
|
||||||
|
format!(
|
||||||
|
"could not resolve import target {}: {error}",
|
||||||
|
parent.display()
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if !canonical_parent.starts_with(canonical_dest_dir) {
|
||||||
|
return rollback_bundle(
|
||||||
|
&installed,
|
||||||
|
&backups,
|
||||||
|
format!(
|
||||||
|
"FBX import target {} resolves outside destination {}",
|
||||||
|
parent.display(),
|
||||||
|
dest_dir.display()
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if target.exists() {
|
||||||
|
let backup = backup_root.join(relative);
|
||||||
|
if let Some(parent) = backup.parent() {
|
||||||
|
if let Err(error) = fs::create_dir_all(parent) {
|
||||||
|
return rollback_bundle(
|
||||||
|
&installed,
|
||||||
|
&backups,
|
||||||
|
format!(
|
||||||
|
"could not create import backup {}: {error}",
|
||||||
|
parent.display()
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if let Err(error) = fs::rename(&target, &backup) {
|
||||||
|
return rollback_bundle(
|
||||||
|
&installed,
|
||||||
|
&backups,
|
||||||
|
format!(
|
||||||
|
"could not back up import target {}: {error}",
|
||||||
|
target.display()
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
backups.push((backup, target.clone()));
|
||||||
|
}
|
||||||
|
if let Err(error) = fs::rename(&staged, &target) {
|
||||||
|
return rollback_bundle(
|
||||||
|
&installed,
|
||||||
|
&backups,
|
||||||
|
format!(
|
||||||
|
"could not publish import target {}: {error}",
|
||||||
|
target.display()
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
installed.push(target);
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn rollback_bundle(
|
||||||
|
installed: &[PathBuf],
|
||||||
|
backups: &[(PathBuf, PathBuf)],
|
||||||
|
cause: String,
|
||||||
|
) -> Result<(), String> {
|
||||||
|
let mut rollback_errors = Vec::new();
|
||||||
|
for target in installed.iter().rev() {
|
||||||
|
if let Err(error) = fs::remove_file(target) {
|
||||||
|
if error.kind() != std::io::ErrorKind::NotFound {
|
||||||
|
rollback_errors.push(format!("remove {}: {error}", target.display()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (backup, target) in backups.iter().rev() {
|
||||||
|
if let Err(error) = fs::rename(backup, target) {
|
||||||
|
rollback_errors.push(format!(
|
||||||
|
"restore {} to {}: {error}",
|
||||||
|
backup.display(),
|
||||||
|
target.display()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if rollback_errors.is_empty() {
|
||||||
|
Err(cause)
|
||||||
|
} else {
|
||||||
|
Err(format!(
|
||||||
|
"{cause}; rollback also failed: {}",
|
||||||
|
rollback_errors.join("; ")
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::fbm_sidecar_dir;
|
use super::*;
|
||||||
use std::path::Path;
|
|
||||||
|
fn temp_root(label: &str) -> PathBuf {
|
||||||
|
std::env::temp_dir().join(format!("blacksite-fbx-{label}-{}", uuid::Uuid::new_v4()))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn committed_chair_bytes() -> Vec<u8> {
|
||||||
|
fs::read(
|
||||||
|
Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||||
|
.join("../../assets/models/painted_wooden_chair_02_2k.fbx"),
|
||||||
|
)
|
||||||
|
.unwrap()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn replace_equal_length(bytes: &mut [u8], from: &[u8], to: &[u8]) -> usize {
|
||||||
|
assert_eq!(from.len(), to.len());
|
||||||
|
let mut count = 0;
|
||||||
|
let mut offset = 0;
|
||||||
|
while let Some(index) = bytes[offset..]
|
||||||
|
.windows(from.len())
|
||||||
|
.position(|window| window == from)
|
||||||
|
{
|
||||||
|
let start = offset + index;
|
||||||
|
bytes[start..start + from.len()].copy_from_slice(to);
|
||||||
|
offset = start + from.len();
|
||||||
|
count += 1;
|
||||||
|
}
|
||||||
|
count
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write_textures(root: &Path, folder: &str) {
|
||||||
|
let folder = root.join(folder);
|
||||||
|
fs::create_dir_all(&folder).unwrap();
|
||||||
|
for name in [
|
||||||
|
"painted_wooden_chair_02_diff_2k.jpg",
|
||||||
|
"painted_wooden_chair_02_nor_gl_2k.exr",
|
||||||
|
"painted_wooden_chair_02_rough_2k.exr",
|
||||||
|
] {
|
||||||
|
fs::write(folder.join(name), name.as_bytes()).unwrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn fbm_sidecar_path() {
|
fn committed_chair_reports_one_stable_missing_dependency_state() {
|
||||||
|
let path = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||||
|
.join("../../assets/models/painted_wooden_chair_02_2k.fbx");
|
||||||
|
|
||||||
|
let error = validate_fbx_dependencies(&path).unwrap_err();
|
||||||
|
|
||||||
|
assert!(error.starts_with("missing 3 FBX source texture(s):"));
|
||||||
|
assert_eq!(error.matches("painted_wooden_chair_02_").count(), 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn sibling_texture_bundle_is_copied_with_relative_layout() {
|
||||||
|
let root = temp_root("sibling");
|
||||||
|
let source_root = root.join("source");
|
||||||
|
let destination = root.join("destination");
|
||||||
|
fs::create_dir_all(&source_root).unwrap();
|
||||||
|
let source = source_root.join("chair.fbx");
|
||||||
|
fs::write(&source, committed_chair_bytes()).unwrap();
|
||||||
|
write_textures(&source_root, "textures");
|
||||||
|
|
||||||
|
copy_fbx_bundle(&source, &destination).unwrap();
|
||||||
|
|
||||||
|
assert!(destination.join("chair.fbx").is_file());
|
||||||
|
assert!(destination
|
||||||
|
.join("textures/painted_wooden_chair_02_diff_2k.jpg")
|
||||||
|
.is_file());
|
||||||
|
assert!(!destination.read_dir().unwrap().any(|entry| entry
|
||||||
|
.unwrap()
|
||||||
|
.file_name()
|
||||||
|
.to_string_lossy()
|
||||||
|
.starts_with(".blacksite-import-")));
|
||||||
|
fs::remove_dir_all(root).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fbm_texture_bundle_is_copied_with_relative_layout() {
|
||||||
|
let root = temp_root("fbm");
|
||||||
|
let source_root = root.join("source");
|
||||||
|
let destination = root.join("destination");
|
||||||
|
fs::create_dir_all(&source_root).unwrap();
|
||||||
|
let source = source_root.join("chair.fbx");
|
||||||
|
let mut bytes = committed_chair_bytes();
|
||||||
|
assert!(replace_equal_length(&mut bytes, b"textures/", b"test.fbm/") > 0);
|
||||||
|
fs::write(&source, bytes).unwrap();
|
||||||
|
write_textures(&source_root, "test.fbm");
|
||||||
|
|
||||||
|
copy_fbx_bundle(&source, &destination).unwrap();
|
||||||
|
|
||||||
|
assert!(destination
|
||||||
|
.join("test.fbm/painted_wooden_chair_02_diff_2k.jpg")
|
||||||
|
.is_file());
|
||||||
|
fs::remove_dir_all(root).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn traversal_reference_is_rejected_before_destination_changes() {
|
||||||
|
let root = temp_root("traversal");
|
||||||
|
let source_root = root.join("source");
|
||||||
|
let destination = root.join("destination");
|
||||||
|
fs::create_dir_all(&source_root).unwrap();
|
||||||
|
fs::create_dir_all(&destination).unwrap();
|
||||||
|
let source = source_root.join("chair.fbx");
|
||||||
|
let mut bytes = committed_chair_bytes();
|
||||||
|
assert!(replace_equal_length(&mut bytes, b"textures/", b"../evil//") > 0);
|
||||||
|
fs::write(&source, bytes).unwrap();
|
||||||
|
fs::write(destination.join("chair.fbx"), b"original").unwrap();
|
||||||
|
|
||||||
|
let error = copy_fbx_bundle(&source, &destination).unwrap_err();
|
||||||
|
|
||||||
|
assert!(error.contains("parent traversal"));
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
fbm_sidecar_dir(Path::new("/tmp/Character.fbx")),
|
fs::read(destination.join("chair.fbx")).unwrap(),
|
||||||
Some(Path::new("/tmp/Character.fbm").to_path_buf())
|
b"original"
|
||||||
);
|
);
|
||||||
|
fs::remove_dir_all(root).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn missing_bundle_preserves_existing_destination() {
|
||||||
|
let root = temp_root("missing");
|
||||||
|
let source_root = root.join("source");
|
||||||
|
let destination = root.join("destination");
|
||||||
|
fs::create_dir_all(&source_root).unwrap();
|
||||||
|
fs::create_dir_all(&destination).unwrap();
|
||||||
|
let source = source_root.join("chair.fbx");
|
||||||
|
fs::write(&source, committed_chair_bytes()).unwrap();
|
||||||
|
fs::write(destination.join("chair.fbx"), b"original").unwrap();
|
||||||
|
|
||||||
|
let error = copy_fbx_bundle(&source, &destination).unwrap_err();
|
||||||
|
|
||||||
|
assert!(error.contains("missing 3 required texture(s)"));
|
||||||
|
assert_eq!(
|
||||||
|
fs::read(destination.join("chair.fbx")).unwrap(),
|
||||||
|
b"original"
|
||||||
|
);
|
||||||
|
fs::remove_dir_all(root).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
|
#[test]
|
||||||
|
fn destination_symlink_escape_is_rejected_before_external_changes() {
|
||||||
|
use std::os::unix::fs::symlink;
|
||||||
|
|
||||||
|
let root = temp_root("destination-symlink");
|
||||||
|
let source_root = root.join("source");
|
||||||
|
let destination = root.join("destination");
|
||||||
|
let outside = root.join("outside");
|
||||||
|
fs::create_dir_all(&source_root).unwrap();
|
||||||
|
fs::create_dir_all(&destination).unwrap();
|
||||||
|
fs::create_dir_all(&outside).unwrap();
|
||||||
|
let source = source_root.join("chair.fbx");
|
||||||
|
fs::write(&source, committed_chair_bytes()).unwrap();
|
||||||
|
write_textures(&source_root, "textures");
|
||||||
|
symlink(&outside, destination.join("textures")).unwrap();
|
||||||
|
|
||||||
|
let error = copy_fbx_bundle(&source, &destination).unwrap_err();
|
||||||
|
|
||||||
|
assert!(error.contains("symbolic link"));
|
||||||
|
assert!(!destination.join("chair.fbx").exists());
|
||||||
|
assert!(!outside.join("painted_wooden_chair_02_diff_2k.jpg").exists());
|
||||||
|
fs::remove_dir_all(root).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,10 +2,13 @@
|
|||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy_egui::egui;
|
use bevy_egui::egui;
|
||||||
use shared::{LevelObject, MaterialAsset, MaterialDesc};
|
use shared::{
|
||||||
|
ComponentInstanceId, LevelObject, MaterialAsset, MaterialDesc, MaterialRef,
|
||||||
|
RendererMaterialSlot,
|
||||||
|
};
|
||||||
|
|
||||||
use crate::assets::{EditorAsset, EditorAssetKind, EditorAssets};
|
use crate::assets::{EditorAsset, EditorAssetKind, EditorAssets};
|
||||||
use crate::history::set_material_with_history;
|
use crate::history::{reflected_component_transaction, set_material_group_with_history};
|
||||||
use crate::ui::inspector::property_row;
|
use crate::ui::inspector::property_row;
|
||||||
|
|
||||||
pub fn load_material_asset(catalog_path: &str) -> Result<MaterialAsset, String> {
|
pub fn load_material_asset(catalog_path: &str) -> Result<MaterialAsset, String> {
|
||||||
@@ -13,38 +16,115 @@ pub fn load_material_asset(catalog_path: &str) -> Result<MaterialAsset, String>
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn material_desc_from_asset(catalog_path: &str) -> Result<MaterialDesc, String> {
|
pub fn material_desc_from_asset(catalog_path: &str) -> Result<MaterialDesc, String> {
|
||||||
let asset = load_material_asset(catalog_path)?;
|
shared::load_resolved_material_from_path(catalog_path).map(|(desc, _)| desc)
|
||||||
let mut desc = asset.material;
|
|
||||||
desc.material_asset_path = Some(catalog_path.to_string());
|
|
||||||
Ok(desc)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn apply_material_asset_to_selection(
|
pub fn apply_material_asset_to_selection(
|
||||||
world: &mut World,
|
world: &mut World,
|
||||||
asset: &EditorAsset,
|
asset: &EditorAsset,
|
||||||
selected: &bevy_inspector_egui::bevy_inspector::hierarchy::SelectedEntities,
|
selected: &bevy_inspector_egui::bevy_inspector::hierarchy::SelectedEntities,
|
||||||
) {
|
) -> Result<(), String> {
|
||||||
let Some(path) = asset.path.clone() else {
|
let path = asset
|
||||||
return;
|
.path
|
||||||
|
.clone()
|
||||||
|
.ok_or_else(|| format!("Material has no source path: {}", asset.label))?;
|
||||||
|
let record = world
|
||||||
|
.get_resource::<crate::asset_db::AssetRegistry>()
|
||||||
|
.and_then(|registry| crate::asset_db::find_asset_by_path(registry, &path))
|
||||||
|
.ok_or_else(|| format!("Material is missing from the asset registry: {path}"))?;
|
||||||
|
let sub_asset_id = if shared::MaterialInstanceAsset::load_from_path(&path).is_ok() {
|
||||||
|
"material:instance"
|
||||||
|
} else {
|
||||||
|
"material:source"
|
||||||
};
|
};
|
||||||
let desc = match material_desc_from_asset(&path) {
|
let material_ref = MaterialRef::new(
|
||||||
Ok(desc) => desc,
|
shared::EditorAssetRef::new(record.id.as_string(), sub_asset_id, asset.label.clone())
|
||||||
Err(err) => {
|
.with_source_path(path.clone()),
|
||||||
world.resource_mut::<crate::scene_io::SceneIo>().status = err;
|
);
|
||||||
return;
|
let desc = material_desc_from_asset(&path).ok();
|
||||||
}
|
let entities = crate::ui::helpers::selected_level_entities(world, selected);
|
||||||
};
|
let mut renderer_changes = 0usize;
|
||||||
for entity in crate::ui::helpers::selected_level_entities(world, selected) {
|
let mut legacy_changes = Vec::new();
|
||||||
|
for entity in entities {
|
||||||
if world.get::<LevelObject>(entity).is_none() {
|
if world.get::<LevelObject>(entity).is_none() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if world.get::<MaterialDesc>(entity).is_none() {
|
if let Some(mut renderer) = world.get::<shared::StaticMeshRenderer>(entity).cloned() {
|
||||||
world.entity_mut(entity).insert(desc.clone());
|
ensure_static_material_slots(&mut renderer);
|
||||||
|
for slot in &mut renderer.materials.slots {
|
||||||
|
slot.material = Some(material_ref.clone());
|
||||||
}
|
}
|
||||||
set_material_with_history(world, entity, desc.clone());
|
reflected_component_transaction(
|
||||||
|
world,
|
||||||
|
entity,
|
||||||
|
"Assign Material Slots",
|
||||||
|
shared::AUTHORING_COMPONENT_STATIC_MESH_RENDERER,
|
||||||
|
shared::COMPONENT_STATIC_MESH_RENDERER,
|
||||||
|
move |world, entity| {
|
||||||
|
world.entity_mut(entity).insert(renderer);
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
renderer_changes += 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if let Some(mut renderer) = world.get::<shared::SkinnedMeshRenderer>(entity).cloned() {
|
||||||
|
if renderer.materials.slots.is_empty() {
|
||||||
|
return Err(format!(
|
||||||
|
"Skinned renderer `{}` has no imported material slots; reimport its model",
|
||||||
|
renderer.path
|
||||||
|
));
|
||||||
|
}
|
||||||
|
for slot in &mut renderer.materials.slots {
|
||||||
|
slot.material = Some(material_ref.clone());
|
||||||
|
}
|
||||||
|
reflected_component_transaction(
|
||||||
|
world,
|
||||||
|
entity,
|
||||||
|
"Assign Material Slots",
|
||||||
|
shared::AUTHORING_COMPONENT_SKINNED_MESH_RENDERER,
|
||||||
|
shared::COMPONENT_SKINNED_MESH_RENDERER,
|
||||||
|
move |world, entity| {
|
||||||
|
world.entity_mut(entity).insert(renderer);
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
renderer_changes += 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if let Some(desc) = desc.as_ref() {
|
||||||
|
legacy_changes.push((entity, desc.clone()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !legacy_changes.is_empty() {
|
||||||
|
set_material_group_with_history(world, legacy_changes);
|
||||||
|
}
|
||||||
|
if renderer_changes == 0 && desc.is_none() {
|
||||||
|
return Err("No selected renderable actor accepts this material".into());
|
||||||
}
|
}
|
||||||
world.resource_mut::<crate::scene_io::SceneIo>().status =
|
world.resource_mut::<crate::scene_io::SceneIo>().status =
|
||||||
format!("Applied material {}", asset.label);
|
format!("Applied shared material {}", asset.label);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn ensure_static_material_slots(renderer: &mut shared::StaticMeshRenderer) {
|
||||||
|
for part in &mut renderer.slots {
|
||||||
|
if part.material_slot_id.0.trim().is_empty() {
|
||||||
|
part.material_slot_id = if part.id.0.trim().is_empty() {
|
||||||
|
ComponentInstanceId::new("slot:legacy")
|
||||||
|
} else {
|
||||||
|
ComponentInstanceId::new(format!("slot:{}", part.id.0))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if renderer.materials.slot(&part.material_slot_id).is_none() {
|
||||||
|
renderer.materials.slots.push(RendererMaterialSlot {
|
||||||
|
id: part.material_slot_id.clone(),
|
||||||
|
name: part.name.clone(),
|
||||||
|
source_material: part.material.clone().map(MaterialRef::new),
|
||||||
|
material: None,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn material_asset_picker_ui(
|
pub fn material_asset_picker_ui(
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
//! Asset catalog, database, thumbnails, materials, and prefab overrides.
|
//! Asset catalog, database, thumbnails, materials, and prefab overrides.
|
||||||
|
|
||||||
|
pub mod animation;
|
||||||
pub mod asset_db;
|
pub mod asset_db;
|
||||||
mod catalog;
|
mod catalog;
|
||||||
|
mod fingerprint;
|
||||||
mod import;
|
mod import;
|
||||||
pub mod materials;
|
pub mod materials;
|
||||||
pub mod operators;
|
pub mod operators;
|
||||||
@@ -11,6 +13,25 @@ pub mod thumbnails;
|
|||||||
|
|
||||||
pub use catalog::*;
|
pub use catalog::*;
|
||||||
pub use thumbnails::{
|
pub use thumbnails::{
|
||||||
draw_asset_cell_with, invalidate_on_catalog_refresh, kind_icon, prefetch_folder_thumbnails,
|
draw_asset_cell_with, gltf_skinned_primitive_labels, invalidate_on_catalog_refresh, kind_icon,
|
||||||
AssetThumbnailCache, ThumbnailCacheSnapshot, ThumbnailState, ThumbnailStudio, ThumbnailsPlugin,
|
prefetch_asset_thumbnails, prefetch_folder_thumbnails, AssetThumbnailCache,
|
||||||
|
ThumbnailCacheSnapshot, ThumbnailState, ThumbnailStudio, ThumbnailsPlugin,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Refreshes both generated contracts derived from one imported model source.
|
||||||
|
pub fn refresh_model_artifacts(
|
||||||
|
record: &mut asset_db::AssetRecord,
|
||||||
|
) -> Result<static_mesh::StaticMeshManifest, String> {
|
||||||
|
let static_mesh = static_mesh::refresh_static_mesh_artifact(record);
|
||||||
|
let animation = animation::refresh_animation_artifact(record);
|
||||||
|
match (static_mesh, animation) {
|
||||||
|
(Ok(static_mesh), Ok(_)) => Ok(static_mesh),
|
||||||
|
(Err(static_error), Ok(_)) => Err(format!("static mesh processor failed: {static_error}")),
|
||||||
|
(Ok(_), Err(animation_error)) => {
|
||||||
|
Err(format!("animation processor failed: {animation_error}"))
|
||||||
|
}
|
||||||
|
(Err(static_error), Err(animation_error)) => Err(format!(
|
||||||
|
"static mesh processor failed: {static_error}; animation processor failed: {animation_error}"
|
||||||
|
)),
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,7 +8,11 @@ use crate::ui::helpers::{
|
|||||||
apply_material_asset_to_selection, apply_texture_to_selection, selected_level_entities,
|
apply_material_asset_to_selection, apply_texture_to_selection, selected_level_entities,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{spawn_asset_at, spawn_subasset_at, AssetSelection, EditorAsset};
|
use super::{
|
||||||
|
animation_clip_authoring_data, animation_skeleton_signature_for_ref, audio_clip_ref_for_asset,
|
||||||
|
compatible_animation_skeleton_for_model, spawn_asset_at, spawn_subasset_at,
|
||||||
|
validate_prefab_asset, AssetSelection, EditorAsset,
|
||||||
|
};
|
||||||
|
|
||||||
fn selection_availability(world: &World, selected: &SelectedEntities) -> OperatorAvailability {
|
fn selection_availability(world: &World, selected: &SelectedEntities) -> OperatorAvailability {
|
||||||
if selected_level_entities(world, selected).is_empty() {
|
if selected_level_entities(world, selected).is_empty() {
|
||||||
@@ -26,6 +30,7 @@ pub fn place_asset_operator(world: &mut World, asset: EditorAsset, translation:
|
|||||||
&label,
|
&label,
|
||||||
OperatorAvailability::Ready,
|
OperatorAvailability::Ready,
|
||||||
move |world| {
|
move |world| {
|
||||||
|
validate_prefab_asset(world, &asset)?;
|
||||||
spawn_asset_at(world, &asset, translation)
|
spawn_asset_at(world, &asset, translation)
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
.ok_or_else(|| format!("Asset cannot be placed: {}", asset.label))
|
.ok_or_else(|| format!("Asset cannot be placed: {}", asset.label))
|
||||||
@@ -59,16 +64,12 @@ pub fn apply_texture_operator(
|
|||||||
) -> bool {
|
) -> bool {
|
||||||
let label = format!("Apply Texture {}", asset.label);
|
let label = format!("Apply Texture {}", asset.label);
|
||||||
let availability = selection_availability(world, selected);
|
let availability = selection_availability(world, selected);
|
||||||
let selected = selected;
|
|
||||||
run_immediate_operator(
|
run_immediate_operator(
|
||||||
world,
|
world,
|
||||||
"assets.apply_texture",
|
"assets.apply_texture",
|
||||||
&label,
|
&label,
|
||||||
availability,
|
availability,
|
||||||
move |world| {
|
move |world| apply_texture_to_selection(world, &asset, selected),
|
||||||
apply_texture_to_selection(world, &asset, &selected);
|
|
||||||
Ok(())
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,15 +80,594 @@ pub fn apply_material_operator(
|
|||||||
) -> bool {
|
) -> bool {
|
||||||
let label = format!("Apply Material {}", asset.label);
|
let label = format!("Apply Material {}", asset.label);
|
||||||
let availability = selection_availability(world, selected);
|
let availability = selection_availability(world, selected);
|
||||||
let selected = selected;
|
|
||||||
run_immediate_operator(
|
run_immediate_operator(
|
||||||
world,
|
world,
|
||||||
"assets.apply_material",
|
"assets.apply_material",
|
||||||
&label,
|
&label,
|
||||||
availability,
|
availability,
|
||||||
|
move |world| apply_material_asset_to_selection(world, &asset, selected),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn assign_audio_clip_operator(world: &mut World, asset: EditorAsset, entity: Entity) -> bool {
|
||||||
|
let availability = if world.get::<shared::AudioSourceDesc>(entity).is_some() {
|
||||||
|
OperatorAvailability::Ready
|
||||||
|
} else {
|
||||||
|
OperatorAvailability::Disabled("Select an authored audio source".to_string())
|
||||||
|
};
|
||||||
|
let label = format!("Assign Audio Clip {}", asset.label);
|
||||||
|
run_immediate_operator(
|
||||||
|
world,
|
||||||
|
"assets.assign_audio_clip",
|
||||||
|
&label,
|
||||||
|
availability,
|
||||||
move |world| {
|
move |world| {
|
||||||
apply_material_asset_to_selection(world, &asset, &selected);
|
let clip = audio_clip_ref_for_asset(world, &asset)?;
|
||||||
|
let mut source = world
|
||||||
|
.get::<shared::AudioSourceDesc>(entity)
|
||||||
|
.cloned()
|
||||||
|
.ok_or_else(|| "Selected actor is not an audio source".to_string())?;
|
||||||
|
source.clip = Some(clip);
|
||||||
|
crate::history::set_audio_source_with_history(world, entity, source);
|
||||||
Ok(())
|
Ok(())
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn assign_animation_clip_operator(
|
||||||
|
world: &mut World,
|
||||||
|
selection: AssetSelection,
|
||||||
|
entity: Entity,
|
||||||
|
) -> bool {
|
||||||
|
let availability = if world.get::<shared::SkinnedMeshRenderer>(entity).is_some() {
|
||||||
|
OperatorAvailability::Ready
|
||||||
|
} else {
|
||||||
|
OperatorAvailability::Disabled("Select an authored skinned-mesh actor".to_string())
|
||||||
|
};
|
||||||
|
let label = format!("Assign Animation Clip {}", selection.display_label());
|
||||||
|
run_immediate_operator(
|
||||||
|
world,
|
||||||
|
"assets.assign_animation_clip",
|
||||||
|
&label,
|
||||||
|
availability,
|
||||||
|
move |world| {
|
||||||
|
let authored = animation_clip_authoring_data(world, &selection)?;
|
||||||
|
let model = world
|
||||||
|
.get::<shared::SkinnedMeshRenderer>(entity)
|
||||||
|
.cloned()
|
||||||
|
.ok_or_else(|| "Selected actor has no SkinnedMeshRenderer".to_string())?;
|
||||||
|
let mut controller = world
|
||||||
|
.get::<shared::AnimationControllerDesc>(entity)
|
||||||
|
.cloned()
|
||||||
|
.unwrap_or_default();
|
||||||
|
|
||||||
|
let skeleton = match controller.skeleton.as_ref() {
|
||||||
|
Some(reference) => {
|
||||||
|
let existing_signature =
|
||||||
|
animation_skeleton_signature_for_ref(world, reference)?;
|
||||||
|
if existing_signature != authored.skeleton_signature {
|
||||||
|
return Err(format!(
|
||||||
|
"Clip `{}` targets rig `{}` but the actor uses `{}`. Animation v1 requires an exact skeleton match.",
|
||||||
|
authored.state.label,
|
||||||
|
authored.skeleton_signature.0,
|
||||||
|
existing_signature.0
|
||||||
|
));
|
||||||
|
}
|
||||||
|
reference.clone()
|
||||||
|
}
|
||||||
|
None => compatible_animation_skeleton_for_model(
|
||||||
|
world,
|
||||||
|
&model,
|
||||||
|
&authored.skeleton_signature,
|
||||||
|
)?,
|
||||||
|
};
|
||||||
|
|
||||||
|
if controller.states.iter().any(|state| {
|
||||||
|
state.clip.asset_id == authored.state.clip.asset_id
|
||||||
|
&& state.clip.sub_asset_id == authored.state.clip.sub_asset_id
|
||||||
|
}) {
|
||||||
|
return Err(format!(
|
||||||
|
"Animation controller already contains clip `{}`.",
|
||||||
|
authored.state.label
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut state = authored.state;
|
||||||
|
let base_id = state.id.clone();
|
||||||
|
let mut suffix = 2;
|
||||||
|
while controller.states.iter().any(|entry| entry.id == state.id) {
|
||||||
|
state.id = format!("{base_id}_{suffix}");
|
||||||
|
suffix += 1;
|
||||||
|
}
|
||||||
|
controller.skeleton = Some(skeleton);
|
||||||
|
if controller.default_state.trim().is_empty() {
|
||||||
|
controller.default_state = state.id.clone();
|
||||||
|
}
|
||||||
|
controller.states.push(state);
|
||||||
|
crate::history::set_animation_controller_with_history(world, entity, controller);
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use shared::{
|
||||||
|
animation_clip_sub_asset_id, animation_skeleton_sub_asset_id, ActorKind,
|
||||||
|
AnimationClipRecord, AnimationControllerDesc, AnimationManifest, AnimationManifestSource,
|
||||||
|
AnimationSkeletonRecord, AnimationSkeletonSignature, AnimationSourceFingerprint,
|
||||||
|
AudioSourceDesc, LevelObject, MaterialDesc, PrimitiveShape, SkinnedMeshRenderer,
|
||||||
|
ANIMATION_MANIFEST_SCHEMA_VERSION,
|
||||||
|
};
|
||||||
|
|
||||||
|
use crate::asset_db::{AssetId, AssetRecord, AssetRegistry, ImportSettings};
|
||||||
|
use crate::history::EditorHistory;
|
||||||
|
use crate::operators::test_harness::{assert_undo_redo_round_trip, OperatorInvariantHarness};
|
||||||
|
use crate::operators::ActiveOperator;
|
||||||
|
use crate::scene_io::SceneIo;
|
||||||
|
use crate::selection::SelectedEntity;
|
||||||
|
|
||||||
|
fn authored_count(world: &mut World) -> usize {
|
||||||
|
let mut query = world.query_filtered::<Entity, With<LevelObject>>();
|
||||||
|
query.iter(world).count()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn animation_fixture() -> (std::path::PathBuf, AssetRecord, AssetSelection) {
|
||||||
|
let model_path = "assets/models/operator_fixture.glb".to_string();
|
||||||
|
let asset_id = AssetId::new();
|
||||||
|
let skeleton_id = animation_skeleton_sub_asset_id(0, "Rig");
|
||||||
|
let clip_id = animation_clip_sub_asset_id(0, "Idle");
|
||||||
|
let manifest = AnimationManifest {
|
||||||
|
schema_version: ANIMATION_MANIFEST_SCHEMA_VERSION,
|
||||||
|
asset_id: asset_id.as_string(),
|
||||||
|
label: "Operator Fixture".into(),
|
||||||
|
default_animation_clip_id: None,
|
||||||
|
source: AnimationManifestSource {
|
||||||
|
path: model_path.clone(),
|
||||||
|
format: "glb".into(),
|
||||||
|
fingerprint: AnimationSourceFingerprint {
|
||||||
|
byte_len: 1,
|
||||||
|
content_hash: "fixture".into(),
|
||||||
|
},
|
||||||
|
dependencies: Vec::new(),
|
||||||
|
},
|
||||||
|
runtime_supported: true,
|
||||||
|
skeletons: vec![AnimationSkeletonRecord {
|
||||||
|
id: skeleton_id,
|
||||||
|
label: "Rig".into(),
|
||||||
|
source_index: 0,
|
||||||
|
signature: AnimationSkeletonSignature::new("exact-rig"),
|
||||||
|
joint_paths: vec!["Root".into()],
|
||||||
|
}],
|
||||||
|
clips: vec![AnimationClipRecord {
|
||||||
|
id: clip_id.clone(),
|
||||||
|
label: "Idle".into(),
|
||||||
|
source_index: 0,
|
||||||
|
duration_seconds: 1.0,
|
||||||
|
target_skeleton_signature: Some(AnimationSkeletonSignature::new("exact-rig")),
|
||||||
|
events: Vec::new(),
|
||||||
|
}],
|
||||||
|
diagnostics: Vec::new(),
|
||||||
|
};
|
||||||
|
let path = std::env::temp_dir().join(format!(
|
||||||
|
"blacksite-animation-operator-{}.animation.ron",
|
||||||
|
uuid::Uuid::new_v4()
|
||||||
|
));
|
||||||
|
std::fs::write(
|
||||||
|
&path,
|
||||||
|
ron::ser::to_string_pretty(&manifest, ron::ser::PrettyConfig::default()).unwrap(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
let record = AssetRecord {
|
||||||
|
id: asset_id,
|
||||||
|
path: model_path.clone(),
|
||||||
|
label: "Operator Fixture".into(),
|
||||||
|
kind_tag: "Model".into(),
|
||||||
|
source_fingerprint: None,
|
||||||
|
import_settings: ImportSettings {
|
||||||
|
animation_manifest_path: Some(path.to_string_lossy().into_owned()),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
dependencies: Vec::new(),
|
||||||
|
};
|
||||||
|
let selection = AssetSelection::SubAsset {
|
||||||
|
parent_path: model_path.clone(),
|
||||||
|
sub_asset_id: clip_id,
|
||||||
|
label: "Idle".into(),
|
||||||
|
kind: super::super::AssetSubAssetKind::AnimationClip,
|
||||||
|
source_path: Some(model_path),
|
||||||
|
};
|
||||||
|
(path, record, selection)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn asset_placement_commits_one_undo_group_and_round_trips() {
|
||||||
|
let mut world = World::new();
|
||||||
|
world.init_resource::<ActiveOperator>();
|
||||||
|
world.init_resource::<EditorHistory>();
|
||||||
|
world.init_resource::<SceneIo>();
|
||||||
|
world.init_resource::<SelectedEntity>();
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
let asset = EditorAsset {
|
||||||
|
label: "Cube".to_string(),
|
||||||
|
path: None,
|
||||||
|
folder_path: "Built-ins".to_string(),
|
||||||
|
kind: super::super::EditorAssetKind::Primitive(PrimitiveShape::Box),
|
||||||
|
};
|
||||||
|
|
||||||
|
assert!(place_asset_operator(&mut world, asset, Vec3::ZERO));
|
||||||
|
|
||||||
|
harness.assert_committed(&mut world, 1, 1);
|
||||||
|
assert_undo_redo_round_trip(&mut world, 0, 1, authored_count);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn animation_clip_placement_creates_only_the_skinned_renderer_path() {
|
||||||
|
let mut world = World::new();
|
||||||
|
world.init_resource::<ActiveOperator>();
|
||||||
|
world.init_resource::<EditorHistory>();
|
||||||
|
world.init_resource::<SceneIo>();
|
||||||
|
world.init_resource::<SelectedEntity>();
|
||||||
|
let (manifest_path, record, selection) = animation_fixture();
|
||||||
|
world.insert_resource(AssetRegistry {
|
||||||
|
records: vec![record],
|
||||||
|
index_dirty: false,
|
||||||
|
});
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
|
||||||
|
assert!(place_subasset_operator(
|
||||||
|
&mut world,
|
||||||
|
selection,
|
||||||
|
Vec3::new(1.0, 2.0, 3.0),
|
||||||
|
));
|
||||||
|
|
||||||
|
let entity = world
|
||||||
|
.query_filtered::<Entity, With<LevelObject>>()
|
||||||
|
.single(&world)
|
||||||
|
.unwrap();
|
||||||
|
assert_eq!(
|
||||||
|
world.get::<ActorKind>(entity),
|
||||||
|
Some(&ActorKind::SkinnedMesh)
|
||||||
|
);
|
||||||
|
assert!(world.get::<SkinnedMeshRenderer>(entity).is_some());
|
||||||
|
assert!(world.get::<AnimationControllerDesc>(entity).is_some());
|
||||||
|
assert!(world.get::<shared::ModelRef>(entity).is_none());
|
||||||
|
assert!(world.get::<shared::StaticMeshRenderer>(entity).is_none());
|
||||||
|
harness.assert_committed(&mut world, 1, 1);
|
||||||
|
assert_undo_redo_round_trip(&mut world, 0, 1, authored_count);
|
||||||
|
let _ = std::fs::remove_file(manifest_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn audio_clip_assignment_is_one_undoable_operator() {
|
||||||
|
let mut world = World::new();
|
||||||
|
world.init_resource::<ActiveOperator>();
|
||||||
|
world.init_resource::<EditorHistory>();
|
||||||
|
world.init_resource::<SceneIo>();
|
||||||
|
let path = "assets/audio/impact.ogg".to_string();
|
||||||
|
world.insert_resource(AssetRegistry {
|
||||||
|
records: vec![AssetRecord {
|
||||||
|
id: AssetId::new(),
|
||||||
|
path: path.clone(),
|
||||||
|
label: "Impact".into(),
|
||||||
|
kind_tag: "AudioClip".into(),
|
||||||
|
source_fingerprint: None,
|
||||||
|
import_settings: Default::default(),
|
||||||
|
dependencies: Vec::new(),
|
||||||
|
}],
|
||||||
|
index_dirty: false,
|
||||||
|
});
|
||||||
|
let entity = world
|
||||||
|
.spawn((
|
||||||
|
LevelObject,
|
||||||
|
ActorKind::AudioSource,
|
||||||
|
Transform::IDENTITY,
|
||||||
|
AudioSourceDesc::default(),
|
||||||
|
))
|
||||||
|
.id();
|
||||||
|
let asset = EditorAsset {
|
||||||
|
label: "Impact".into(),
|
||||||
|
path: Some(path.clone()),
|
||||||
|
folder_path: "assets/audio".into(),
|
||||||
|
kind: super::super::EditorAssetKind::AudioClip,
|
||||||
|
};
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
let read_clip = move |world: &mut World| {
|
||||||
|
world
|
||||||
|
.get::<AudioSourceDesc>(entity)
|
||||||
|
.and_then(|source| source.clip.clone())
|
||||||
|
};
|
||||||
|
|
||||||
|
assert!(assign_audio_clip_operator(&mut world, asset, entity));
|
||||||
|
|
||||||
|
let assigned = read_clip(&mut world).expect("clip assigned");
|
||||||
|
assert_eq!(assigned.source_path.as_deref(), Some(path.as_str()));
|
||||||
|
harness.assert_committed(&mut world, 1, 0);
|
||||||
|
assert_undo_redo_round_trip(&mut world, None, Some(assigned), read_clip);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn animation_clip_assignment_is_one_undoable_operator() {
|
||||||
|
let mut world = World::new();
|
||||||
|
world.init_resource::<ActiveOperator>();
|
||||||
|
world.init_resource::<EditorHistory>();
|
||||||
|
world.init_resource::<SceneIo>();
|
||||||
|
let (manifest_path, record, selection) = animation_fixture();
|
||||||
|
let model_path = record.path.clone();
|
||||||
|
world.insert_resource(AssetRegistry {
|
||||||
|
records: vec![record],
|
||||||
|
index_dirty: false,
|
||||||
|
});
|
||||||
|
let entity = world
|
||||||
|
.spawn((
|
||||||
|
LevelObject,
|
||||||
|
ActorKind::SkinnedMesh,
|
||||||
|
SkinnedMeshRenderer::new(model_path),
|
||||||
|
))
|
||||||
|
.id();
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
let read_controller =
|
||||||
|
move |world: &mut World| world.get::<AnimationControllerDesc>(entity).cloned();
|
||||||
|
|
||||||
|
assert!(assign_animation_clip_operator(
|
||||||
|
&mut world, selection, entity
|
||||||
|
));
|
||||||
|
|
||||||
|
let assigned = read_controller(&mut world).expect("controller assigned");
|
||||||
|
assert_eq!(assigned.default_state, "idle");
|
||||||
|
assert_eq!(assigned.states.len(), 1);
|
||||||
|
assert_eq!(assigned.states[0].id, "idle");
|
||||||
|
assert_eq!(
|
||||||
|
assigned.skeleton.as_ref().unwrap().sub_asset_id,
|
||||||
|
animation_skeleton_sub_asset_id(0, "Rig")
|
||||||
|
);
|
||||||
|
harness.assert_committed(&mut world, 1, 0);
|
||||||
|
assert_undo_redo_round_trip(&mut world, None, Some(assigned), read_controller);
|
||||||
|
let _ = std::fs::remove_file(manifest_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn multi_actor_texture_assignment_is_one_undo_group() {
|
||||||
|
let mut world = World::new();
|
||||||
|
world.init_resource::<ActiveOperator>();
|
||||||
|
world.init_resource::<EditorHistory>();
|
||||||
|
world.init_resource::<SceneIo>();
|
||||||
|
let first = world.spawn((LevelObject, MaterialDesc::default())).id();
|
||||||
|
let second = world.spawn((LevelObject, MaterialDesc::default())).id();
|
||||||
|
let mut selected = SelectedEntities::default();
|
||||||
|
selected.select_replace(first);
|
||||||
|
selected.select_maybe_add(second, true);
|
||||||
|
let asset = EditorAsset {
|
||||||
|
label: "Grid".to_string(),
|
||||||
|
path: Some("assets/textures/grid.png".to_string()),
|
||||||
|
folder_path: "assets/textures".to_string(),
|
||||||
|
kind: super::super::EditorAssetKind::Texture,
|
||||||
|
};
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
let read_textures = move |world: &mut World| {
|
||||||
|
[first, second]
|
||||||
|
.into_iter()
|
||||||
|
.map(|entity| {
|
||||||
|
world
|
||||||
|
.get::<MaterialDesc>(entity)
|
||||||
|
.and_then(|material| material.base_color_texture.clone())
|
||||||
|
})
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
};
|
||||||
|
|
||||||
|
assert!(apply_texture_operator(&mut world, asset, &selected));
|
||||||
|
|
||||||
|
harness.assert_committed(&mut world, 1, 0);
|
||||||
|
assert_undo_redo_round_trip(
|
||||||
|
&mut world,
|
||||||
|
vec![None, None],
|
||||||
|
vec![
|
||||||
|
Some("assets/textures/grid.png".to_string()),
|
||||||
|
Some("assets/textures/grid.png".to_string()),
|
||||||
|
],
|
||||||
|
read_textures,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn multi_actor_material_assignment_is_one_undo_group() {
|
||||||
|
let mut world = World::new();
|
||||||
|
world.init_resource::<ActiveOperator>();
|
||||||
|
world.init_resource::<EditorHistory>();
|
||||||
|
world.init_resource::<SceneIo>();
|
||||||
|
let material_path = std::env::temp_dir().join(format!(
|
||||||
|
"blacksite-material-operator-{}.material.ron",
|
||||||
|
uuid::Uuid::new_v4()
|
||||||
|
));
|
||||||
|
let fixture = shared::MaterialAsset {
|
||||||
|
schema_version: shared::MATERIAL_ASSET_SCHEMA_VERSION,
|
||||||
|
label: "Concrete".into(),
|
||||||
|
shader: None,
|
||||||
|
shader_ref: None,
|
||||||
|
render_state: Default::default(),
|
||||||
|
material: MaterialDesc {
|
||||||
|
roughness: 0.85,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
};
|
||||||
|
std::fs::write(
|
||||||
|
&material_path,
|
||||||
|
ron::ser::to_string_pretty(&fixture, ron::ser::PrettyConfig::default()).unwrap(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
let material_path = material_path.to_string_lossy().into_owned();
|
||||||
|
world.insert_resource(AssetRegistry {
|
||||||
|
records: vec![AssetRecord {
|
||||||
|
id: AssetId::new(),
|
||||||
|
path: material_path.clone(),
|
||||||
|
label: "Concrete".into(),
|
||||||
|
kind_tag: "Material".into(),
|
||||||
|
source_fingerprint: None,
|
||||||
|
import_settings: Default::default(),
|
||||||
|
dependencies: Vec::new(),
|
||||||
|
}],
|
||||||
|
index_dirty: false,
|
||||||
|
});
|
||||||
|
let first = world.spawn((LevelObject, MaterialDesc::default())).id();
|
||||||
|
let second = world.spawn((LevelObject, MaterialDesc::default())).id();
|
||||||
|
let mut selected = SelectedEntities::default();
|
||||||
|
selected.select_replace(first);
|
||||||
|
selected.select_maybe_add(second, true);
|
||||||
|
let asset = EditorAsset {
|
||||||
|
label: "Concrete".to_string(),
|
||||||
|
path: Some(material_path.clone()),
|
||||||
|
folder_path: "assets/materials".to_string(),
|
||||||
|
kind: super::super::EditorAssetKind::Material,
|
||||||
|
};
|
||||||
|
super::super::materials::material_desc_from_asset(&material_path)
|
||||||
|
.expect("committed material fixture should resolve");
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
let read_materials = move |world: &mut World| {
|
||||||
|
[first, second]
|
||||||
|
.into_iter()
|
||||||
|
.map(|entity| {
|
||||||
|
world
|
||||||
|
.get::<MaterialDesc>(entity)
|
||||||
|
.and_then(|material| material.material_asset_path.clone())
|
||||||
|
})
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
};
|
||||||
|
|
||||||
|
let applied = apply_material_operator(&mut world, asset, &selected);
|
||||||
|
assert!(
|
||||||
|
applied,
|
||||||
|
"material operator failed: {:?}",
|
||||||
|
world.resource::<ActiveOperator>().status
|
||||||
|
);
|
||||||
|
|
||||||
|
harness.assert_committed(&mut world, 1, 0);
|
||||||
|
assert_undo_redo_round_trip(
|
||||||
|
&mut world,
|
||||||
|
vec![None, None],
|
||||||
|
vec![Some(material_path.clone()), Some(material_path.clone())],
|
||||||
|
read_materials,
|
||||||
|
);
|
||||||
|
let _ = std::fs::remove_file(material_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn missing_subasset_commit_cancels_without_side_effects() {
|
||||||
|
let mut world = World::new();
|
||||||
|
world.init_resource::<ActiveOperator>();
|
||||||
|
world.init_resource::<EditorHistory>();
|
||||||
|
world.init_resource::<SceneIo>();
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
let selection = AssetSelection::SubAsset {
|
||||||
|
parent_path: "assets/models/missing.glb".to_string(),
|
||||||
|
sub_asset_id: "mesh:missing".to_string(),
|
||||||
|
label: "Missing Mesh".to_string(),
|
||||||
|
kind: super::super::AssetSubAssetKind::Mesh,
|
||||||
|
source_path: None,
|
||||||
|
};
|
||||||
|
|
||||||
|
assert!(!place_subasset_operator(&mut world, selection, Vec3::ZERO));
|
||||||
|
|
||||||
|
harness.assert_canceled(&mut world);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn missing_material_source_cancels_without_side_effects() {
|
||||||
|
let mut world = World::new();
|
||||||
|
world.init_resource::<ActiveOperator>();
|
||||||
|
world.init_resource::<EditorHistory>();
|
||||||
|
world.init_resource::<SceneIo>();
|
||||||
|
let entity = world.spawn(LevelObject).id();
|
||||||
|
let mut selected = SelectedEntities::default();
|
||||||
|
selected.select_replace(entity);
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
let asset = EditorAsset {
|
||||||
|
label: "Missing Material".to_string(),
|
||||||
|
path: Some("assets/materials/does-not-exist.material.ron".to_string()),
|
||||||
|
folder_path: "assets/materials".to_string(),
|
||||||
|
kind: super::super::EditorAssetKind::Material,
|
||||||
|
};
|
||||||
|
|
||||||
|
assert!(!apply_material_operator(&mut world, asset, &selected));
|
||||||
|
|
||||||
|
harness.assert_canceled(&mut world);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn texture_assignment_without_authored_selection_is_blocked() {
|
||||||
|
let mut world = World::new();
|
||||||
|
world.init_resource::<ActiveOperator>();
|
||||||
|
world.init_resource::<EditorHistory>();
|
||||||
|
world.init_resource::<SceneIo>();
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
let asset = EditorAsset {
|
||||||
|
label: "Grid".to_string(),
|
||||||
|
path: Some("assets/textures/grid.png".to_string()),
|
||||||
|
folder_path: "assets/textures".to_string(),
|
||||||
|
kind: super::super::EditorAssetKind::Texture,
|
||||||
|
};
|
||||||
|
|
||||||
|
assert!(!apply_texture_operator(
|
||||||
|
&mut world,
|
||||||
|
asset,
|
||||||
|
&SelectedEntities::default()
|
||||||
|
));
|
||||||
|
|
||||||
|
harness.assert_blocked(&mut world);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn material_assignment_without_authored_selection_is_blocked() {
|
||||||
|
let mut world = World::new();
|
||||||
|
world.init_resource::<ActiveOperator>();
|
||||||
|
world.init_resource::<EditorHistory>();
|
||||||
|
world.init_resource::<SceneIo>();
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
let asset = EditorAsset {
|
||||||
|
label: "Concrete".to_string(),
|
||||||
|
path: Some("assets/materials/concrete.ron".to_string()),
|
||||||
|
folder_path: "assets/materials".to_string(),
|
||||||
|
kind: super::super::EditorAssetKind::Material,
|
||||||
|
};
|
||||||
|
|
||||||
|
assert!(!apply_material_operator(
|
||||||
|
&mut world,
|
||||||
|
asset,
|
||||||
|
&SelectedEntities::default()
|
||||||
|
));
|
||||||
|
|
||||||
|
harness.assert_blocked(&mut world);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn audio_and_animation_assignment_reject_incompatible_actors() {
|
||||||
|
let mut world = World::new();
|
||||||
|
world.init_resource::<ActiveOperator>();
|
||||||
|
world.init_resource::<EditorHistory>();
|
||||||
|
world.init_resource::<SceneIo>();
|
||||||
|
let entity = world.spawn(LevelObject).id();
|
||||||
|
let audio = EditorAsset {
|
||||||
|
label: "Impact".into(),
|
||||||
|
path: Some("assets/audio/impact.ogg".into()),
|
||||||
|
folder_path: "assets/audio".into(),
|
||||||
|
kind: super::super::EditorAssetKind::AudioClip,
|
||||||
|
};
|
||||||
|
let audio_harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
|
||||||
|
assert!(!assign_audio_clip_operator(&mut world, audio, entity));
|
||||||
|
audio_harness.assert_blocked(&mut world);
|
||||||
|
|
||||||
|
let animation_harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
let selection = AssetSelection::SubAsset {
|
||||||
|
parent_path: "assets/models/missing.glb".into(),
|
||||||
|
sub_asset_id: "animation:missing".into(),
|
||||||
|
label: "Missing".into(),
|
||||||
|
kind: super::super::AssetSubAssetKind::AnimationClip,
|
||||||
|
source_path: None,
|
||||||
|
};
|
||||||
|
assert!(!assign_animation_clip_operator(
|
||||||
|
&mut world, selection, entity
|
||||||
|
));
|
||||||
|
animation_harness.assert_blocked(&mut world);
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -2,21 +2,26 @@
|
|||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::time::UNIX_EPOCH;
|
|
||||||
|
|
||||||
use bevy::gltf::GltfAssetLabel;
|
use bevy::gltf::GltfAssetLabel;
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy_ufbx::label::FbxAssetLabel;
|
use bevy_ufbx::label::FbxAssetLabel;
|
||||||
use bevy_ufbx::mesh::group_faces_by_material;
|
use bevy_ufbx::mesh::group_faces_by_material;
|
||||||
|
use bevy_ufbx::texture::external_texture_paths;
|
||||||
use bevy_ufbx::utils::convert_matrix;
|
use bevy_ufbx::utils::convert_matrix;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::asset_db::{
|
use crate::asset_db::{
|
||||||
AssetRecord, ImportSettings, MaterialImportPolicy, ModelHierarchyMode, ModelPlacementMode,
|
AssetRecord, ImportSettings, MaterialImportPolicy, ModelHierarchyMode, ModelPlacementMode,
|
||||||
};
|
};
|
||||||
use shared::{ComponentInstanceId, EditorAssetRef, StaticMeshRenderer, StaticMeshRendererEntry};
|
use shared::{
|
||||||
|
AssetSourceFingerprint, ComponentInstanceId, EditorAssetRef, MaterialRef, RendererMaterialSet,
|
||||||
|
RendererMaterialSlot, StaticMeshRenderer, StaticMeshRendererEntry,
|
||||||
|
};
|
||||||
|
|
||||||
pub const STATIC_MESH_MANIFEST_SCHEMA: u32 = 1;
|
use crate::assets::fingerprint::{fingerprint_file, write_pretty_ron_if_changed};
|
||||||
|
|
||||||
|
pub const STATIC_MESH_MANIFEST_SCHEMA: u32 = 4;
|
||||||
pub const STATIC_MESH_ARTIFACT_DIR: &str = "assets/meshes/generated";
|
pub const STATIC_MESH_ARTIFACT_DIR: &str = "assets/meshes/generated";
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||||
@@ -39,11 +44,7 @@ pub struct StaticMeshSource {
|
|||||||
pub dependencies: Vec<String>,
|
pub dependencies: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
pub type StaticMeshSourceFingerprint = AssetSourceFingerprint;
|
||||||
pub struct StaticMeshSourceFingerprint {
|
|
||||||
pub byte_len: u64,
|
|
||||||
pub modified_unix_secs: u64,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||||
pub struct StaticMeshImportSnapshot {
|
pub struct StaticMeshImportSnapshot {
|
||||||
@@ -80,6 +81,10 @@ pub struct StaticMeshPart {
|
|||||||
pub source_node: Option<String>,
|
pub source_node: Option<String>,
|
||||||
pub source_mesh: Option<String>,
|
pub source_mesh: Option<String>,
|
||||||
pub source_material: Option<String>,
|
pub source_material: Option<String>,
|
||||||
|
/// Whether the source primitive is bound to a skin and therefore must never become a static
|
||||||
|
/// renderer slot.
|
||||||
|
#[serde(default)]
|
||||||
|
pub skinned: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn static_mesh_manifest_path(asset_id: &str) -> String {
|
pub fn static_mesh_manifest_path(asset_id: &str) -> String {
|
||||||
@@ -94,6 +99,17 @@ pub fn material_id_from_label(label: &str) -> String {
|
|||||||
format!("material:{}", stable_sub_asset_slug(label))
|
format!("material:{}", stable_sub_asset_slug(label))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn gltf_draw_id(node_index: Option<usize>, mesh_index: usize, primitive_index: usize) -> String {
|
||||||
|
let node = node_index
|
||||||
|
.map(|index| index.to_string())
|
||||||
|
.unwrap_or_else(|| "unbound".into());
|
||||||
|
format!("draw:scene0:node{node}:mesh{mesh_index}:primitive{primitive_index}")
|
||||||
|
}
|
||||||
|
|
||||||
|
fn fbx_draw_id(node_index: usize, material_index: usize) -> String {
|
||||||
|
format!("draw:scene0:node{node_index}:material{material_index}")
|
||||||
|
}
|
||||||
|
|
||||||
fn stable_sub_asset_slug(label: &str) -> String {
|
fn stable_sub_asset_slug(label: &str) -> String {
|
||||||
let mut slug = String::new();
|
let mut slug = String::new();
|
||||||
for ch in label.chars() {
|
for ch in label.chars() {
|
||||||
@@ -116,16 +132,9 @@ pub fn refresh_static_mesh_artifact(
|
|||||||
manifest.source.dependencies.dedup();
|
manifest.source.dependencies.dedup();
|
||||||
record.dependencies = manifest.source.dependencies.clone();
|
record.dependencies = manifest.source.dependencies.clone();
|
||||||
|
|
||||||
let text = ron::ser::to_string_pretty(&manifest, ron::ser::PrettyConfig::default())
|
if write_pretty_ron_if_changed(&path, &manifest)
|
||||||
.map_err(|err| format!("could not serialize static mesh manifest: {err}"))?;
|
.map_err(|error| format!("could not publish static mesh manifest {path}: {error}"))?
|
||||||
if let Some(parent) = Path::new(&path).parent() {
|
{
|
||||||
fs::create_dir_all(parent)
|
|
||||||
.map_err(|err| format!("could not create {}: {err}", parent.display()))?;
|
|
||||||
}
|
|
||||||
let should_write = fs::read_to_string(&path).ok().as_deref() != Some(text.as_str());
|
|
||||||
if should_write {
|
|
||||||
fs::write(&path, text)
|
|
||||||
.map_err(|err| format!("could not write static mesh manifest {path}: {err}"))?;
|
|
||||||
info!(
|
info!(
|
||||||
"Static mesh manifest refreshed: source={} artifact={} parts={}",
|
"Static mesh manifest refreshed: source={} artifact={} parts={}",
|
||||||
record.path,
|
record.path,
|
||||||
@@ -151,10 +160,10 @@ pub fn renderer_from_manifest(
|
|||||||
MaterialImportPolicy::SourceMaterials
|
MaterialImportPolicy::SourceMaterials
|
||||||
);
|
);
|
||||||
|
|
||||||
StaticMeshRenderer {
|
let parts: Vec<_> = manifest
|
||||||
slots: manifest
|
|
||||||
.parts
|
.parts
|
||||||
.iter()
|
.iter()
|
||||||
|
.filter(|part| !part.skinned && manifest.metadata.animation_count == 0)
|
||||||
.map(|part| StaticMeshRendererEntry {
|
.map(|part| StaticMeshRendererEntry {
|
||||||
id: ComponentInstanceId::new(part_effective_id(part)),
|
id: ComponentInstanceId::new(part_effective_id(part)),
|
||||||
name: part.name.clone(),
|
name: part.name.clone(),
|
||||||
@@ -163,6 +172,7 @@ pub fn renderer_from_manifest(
|
|||||||
part_effective_id(part),
|
part_effective_id(part),
|
||||||
part.name.clone(),
|
part.name.clone(),
|
||||||
),
|
),
|
||||||
|
material_slot_id: ComponentInstanceId::new(material_slot_id(part)),
|
||||||
material: use_source_materials
|
material: use_source_materials
|
||||||
.then(|| {
|
.then(|| {
|
||||||
part_effective_material_id(part).map(|id| {
|
part_effective_material_id(part).map(|id| {
|
||||||
@@ -179,10 +189,77 @@ pub fn renderer_from_manifest(
|
|||||||
cast_shadows: true,
|
cast_shadows: true,
|
||||||
receive_shadows: true,
|
receive_shadows: true,
|
||||||
})
|
})
|
||||||
|
.collect();
|
||||||
|
let materials = RendererMaterialSet {
|
||||||
|
slots: manifest
|
||||||
|
.parts
|
||||||
|
.iter()
|
||||||
|
.filter(|part| !part.skinned && manifest.metadata.animation_count == 0)
|
||||||
|
.map(|part| RendererMaterialSlot {
|
||||||
|
id: ComponentInstanceId::new(material_slot_id(part)),
|
||||||
|
name: part.material_slot_name.clone(),
|
||||||
|
source_material: use_source_materials
|
||||||
|
.then(|| {
|
||||||
|
part_effective_material_id(part).map(|id| {
|
||||||
|
MaterialRef::new(EditorAssetRef::new(
|
||||||
|
manifest.asset_id.clone(),
|
||||||
|
id,
|
||||||
|
part.material_slot_name.clone(),
|
||||||
|
))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.flatten(),
|
||||||
|
material: None,
|
||||||
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
|
orphaned_assignments: Vec::new(),
|
||||||
|
};
|
||||||
|
|
||||||
|
StaticMeshRenderer {
|
||||||
|
slots: parts,
|
||||||
|
materials,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Builds the shared material slots for a full imported hierarchy. Unlike static renderer
|
||||||
|
/// construction this intentionally includes skin-bound and rigid animated draw bindings.
|
||||||
|
pub fn renderer_materials_from_manifest(
|
||||||
|
manifest: &StaticMeshManifest,
|
||||||
|
settings: &ImportSettings,
|
||||||
|
) -> RendererMaterialSet {
|
||||||
|
let use_source_materials = matches!(
|
||||||
|
settings.material_policy,
|
||||||
|
MaterialImportPolicy::SourceMaterials
|
||||||
|
);
|
||||||
|
RendererMaterialSet {
|
||||||
|
slots: manifest
|
||||||
|
.parts
|
||||||
|
.iter()
|
||||||
|
.map(|part| RendererMaterialSlot {
|
||||||
|
id: ComponentInstanceId::new(material_slot_id(part)),
|
||||||
|
name: part.material_slot_name.clone(),
|
||||||
|
source_material: use_source_materials
|
||||||
|
.then(|| {
|
||||||
|
part_effective_material_id(part).map(|id| {
|
||||||
|
MaterialRef::new(EditorAssetRef::new(
|
||||||
|
manifest.asset_id.clone(),
|
||||||
|
id,
|
||||||
|
part.material_slot_name.clone(),
|
||||||
|
))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.flatten(),
|
||||||
|
material: None,
|
||||||
|
})
|
||||||
|
.collect(),
|
||||||
|
orphaned_assignments: Vec::new(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn material_slot_id(part: &StaticMeshPart) -> String {
|
||||||
|
format!("slot:{}", part_effective_id(part))
|
||||||
|
}
|
||||||
|
|
||||||
fn part_effective_id(part: &StaticMeshPart) -> String {
|
fn part_effective_id(part: &StaticMeshPart) -> String {
|
||||||
if part.id.trim().is_empty() {
|
if part.id.trim().is_empty() {
|
||||||
part_id_from_label(&part.mesh_label)
|
part_id_from_label(&part.mesh_label)
|
||||||
@@ -201,14 +278,14 @@ fn part_effective_material_id(part: &StaticMeshPart) -> Option<String> {
|
|||||||
|
|
||||||
fn build_static_mesh_manifest(record: &AssetRecord) -> Result<StaticMeshManifest, String> {
|
fn build_static_mesh_manifest(record: &AssetRecord) -> Result<StaticMeshManifest, String> {
|
||||||
let format = source_format(&record.path)?;
|
let format = source_format(&record.path)?;
|
||||||
let fingerprint = source_fingerprint(&record.path)?;
|
let fingerprint = fingerprint_file(&record.path)?;
|
||||||
let import = StaticMeshImportSnapshot {
|
let import = StaticMeshImportSnapshot {
|
||||||
scale: record.import_settings.scale,
|
scale: record.import_settings.scale,
|
||||||
generate_collider: record.import_settings.generate_collider,
|
generate_collider: record.import_settings.generate_collider,
|
||||||
lod0_only: record.import_settings.lod0_only,
|
lod0_only: record.import_settings.lod0_only,
|
||||||
placement_mode: record.import_settings.placement_mode.clone(),
|
placement_mode: record.import_settings.placement_mode,
|
||||||
hierarchy_mode: record.import_settings.hierarchy_mode.clone(),
|
hierarchy_mode: record.import_settings.hierarchy_mode,
|
||||||
material_policy: record.import_settings.material_policy.clone(),
|
material_policy: record.import_settings.material_policy,
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut manifest = match format.as_str() {
|
let mut manifest = match format.as_str() {
|
||||||
@@ -255,23 +332,23 @@ fn build_gltf_manifest(
|
|||||||
.or_else(|| gltf.document.scenes().next())
|
.or_else(|| gltf.document.scenes().next())
|
||||||
{
|
{
|
||||||
for node in scene.nodes() {
|
for node in scene.nodes() {
|
||||||
collect_gltf_node_parts(node, Mat4::IDENTITY, &mut parts);
|
collect_gltf_node_parts(node, Mat4::IDENTITY, "", &mut parts);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for mesh in gltf.document.meshes() {
|
for mesh in gltf.document.meshes() {
|
||||||
collect_gltf_mesh_parts(None, None, mesh, Mat4::IDENTITY, &mut parts);
|
collect_gltf_mesh_parts(None, None, None, mesh, Mat4::IDENTITY, false, &mut parts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if gltf.document.animations().count() > 0 {
|
if gltf.document.animations().count() > 0 {
|
||||||
warnings.push(
|
warnings.push(
|
||||||
"Animations are recorded as metadata; use Scene Instance placement for playback."
|
"Animations are recorded as metadata; animated placement uses SkinnedMeshRenderer."
|
||||||
.into(),
|
.into(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if gltf.document.skins().count() > 0 {
|
if gltf.document.skins().count() > 0 {
|
||||||
warnings.push(
|
warnings.push(
|
||||||
"Skins are recorded as metadata; skinned playback stays on the Scene Instance path."
|
"Skinned primitives are excluded from StaticMeshRenderer and use SkinnedMeshRenderer."
|
||||||
.into(),
|
.into(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -306,29 +383,44 @@ fn build_gltf_manifest(
|
|||||||
fn collect_gltf_node_parts(
|
fn collect_gltf_node_parts(
|
||||||
node: gltf::Node<'_>,
|
node: gltf::Node<'_>,
|
||||||
parent_transform: Mat4,
|
parent_transform: Mat4,
|
||||||
|
parent_path: &str,
|
||||||
parts: &mut Vec<StaticMeshPart>,
|
parts: &mut Vec<StaticMeshPart>,
|
||||||
) {
|
) {
|
||||||
let local = Mat4::from_cols_array_2d(&node.transform().matrix());
|
let local = Mat4::from_cols_array_2d(&node.transform().matrix());
|
||||||
let world_transform = parent_transform * local;
|
let world_transform = parent_transform * local;
|
||||||
|
let segment = node
|
||||||
|
.name()
|
||||||
|
.map(str::to_string)
|
||||||
|
.unwrap_or_else(|| format!("Node{}", node.index()));
|
||||||
|
let node_path = if parent_path.is_empty() {
|
||||||
|
segment
|
||||||
|
} else {
|
||||||
|
format!("{parent_path}/{segment}")
|
||||||
|
};
|
||||||
|
let skinned = node.skin().is_some();
|
||||||
if let Some(mesh) = node.mesh() {
|
if let Some(mesh) = node.mesh() {
|
||||||
collect_gltf_mesh_parts(
|
collect_gltf_mesh_parts(
|
||||||
node.name().map(str::to_string),
|
node.name().map(str::to_string),
|
||||||
Some(node.index()),
|
Some(node.index()),
|
||||||
|
Some(node_path.clone()),
|
||||||
mesh,
|
mesh,
|
||||||
world_transform,
|
world_transform,
|
||||||
|
skinned,
|
||||||
parts,
|
parts,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
for child in node.children() {
|
for child in node.children() {
|
||||||
collect_gltf_node_parts(child, world_transform, parts);
|
collect_gltf_node_parts(child, world_transform, &node_path, parts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn collect_gltf_mesh_parts(
|
fn collect_gltf_mesh_parts(
|
||||||
node_name: Option<String>,
|
node_name: Option<String>,
|
||||||
node_index: Option<usize>,
|
node_index: Option<usize>,
|
||||||
|
node_path: Option<String>,
|
||||||
mesh: gltf::Mesh<'_>,
|
mesh: gltf::Mesh<'_>,
|
||||||
transform: Mat4,
|
transform: Mat4,
|
||||||
|
skinned: bool,
|
||||||
parts: &mut Vec<StaticMeshPart>,
|
parts: &mut Vec<StaticMeshPart>,
|
||||||
) {
|
) {
|
||||||
let mesh_index = mesh.index();
|
let mesh_index = mesh.index();
|
||||||
@@ -359,9 +451,11 @@ fn collect_gltf_mesh_parts(
|
|||||||
.clone()
|
.clone()
|
||||||
.or_else(|| mesh_name.clone())
|
.or_else(|| mesh_name.clone())
|
||||||
.unwrap_or_else(|| format!("Mesh {mesh_index}"));
|
.unwrap_or_else(|| format!("Mesh {mesh_index}"));
|
||||||
let source_node = node_index.map(|index| format!("Node{index}"));
|
let source_node = node_path
|
||||||
|
.clone()
|
||||||
|
.or_else(|| node_index.map(|index| format!("Node{index}")));
|
||||||
parts.push(StaticMeshPart {
|
parts.push(StaticMeshPart {
|
||||||
id: part_id_from_label(&mesh_label),
|
id: gltf_draw_id(node_index, mesh_index, primitive_index),
|
||||||
name: format!("{name} / Primitive {primitive_index}"),
|
name: format!("{name} / Primitive {primitive_index}"),
|
||||||
material_id: material_label
|
material_id: material_label
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@@ -373,6 +467,7 @@ fn collect_gltf_mesh_parts(
|
|||||||
source_node,
|
source_node,
|
||||||
source_mesh: Some(format!("Mesh{mesh_index}")),
|
source_mesh: Some(format!("Mesh{mesh_index}")),
|
||||||
source_material: Some(material_name),
|
source_material: Some(material_name),
|
||||||
|
skinned,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -390,6 +485,7 @@ fn build_fbx_manifest(
|
|||||||
ufbx::LoadOpts {
|
ufbx::LoadOpts {
|
||||||
target_unit_meters: 1.0,
|
target_unit_meters: 1.0,
|
||||||
target_axes: ufbx::CoordinateAxes::right_handed_y_up(),
|
target_axes: ufbx::CoordinateAxes::right_handed_y_up(),
|
||||||
|
filename: ufbx::StringOpt::Ref(&record.path),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -405,6 +501,7 @@ fn build_fbx_manifest(
|
|||||||
if mesh.num_vertices == 0 || mesh.faces.as_ref().is_empty() {
|
if mesh.num_vertices == 0 || mesh.faces.as_ref().is_empty() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
let skinned = !mesh.skin_deformers.as_ref().is_empty();
|
||||||
|
|
||||||
let mut groups: Vec<(usize, Vec<u32>)> =
|
let mut groups: Vec<(usize, Vec<u32>)> =
|
||||||
group_faces_by_material(mesh).into_iter().collect();
|
group_faces_by_material(mesh).into_iter().collect();
|
||||||
@@ -428,7 +525,7 @@ fn build_fbx_manifest(
|
|||||||
};
|
};
|
||||||
let mesh_label = FbxAssetLabel::Mesh(node_index * 1000 + material_index).to_string();
|
let mesh_label = FbxAssetLabel::Mesh(node_index * 1000 + material_index).to_string();
|
||||||
parts.push(StaticMeshPart {
|
parts.push(StaticMeshPart {
|
||||||
id: part_id_from_label(&mesh_label),
|
id: fbx_draw_id(node_index, material_index),
|
||||||
name: format!("{node_name} / Material {material_index}"),
|
name: format!("{node_name} / Material {material_index}"),
|
||||||
material_id: material_label
|
material_id: material_label
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@@ -440,19 +537,20 @@ fn build_fbx_manifest(
|
|||||||
source_node: Some(format!("Node{node_index}")),
|
source_node: Some(format!("Node{node_index}")),
|
||||||
source_mesh: Some(format!("Mesh{node_index}")),
|
source_mesh: Some(format!("Mesh{node_index}")),
|
||||||
source_material: Some(material_name),
|
source_material: Some(material_name),
|
||||||
|
skinned,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !scene.anim_stacks.as_ref().is_empty() {
|
if !scene.anim_stacks.as_ref().is_empty() {
|
||||||
warnings.push(
|
warnings.push(
|
||||||
"Animations are recorded as metadata; use Scene Instance placement for playback."
|
"Animations are recorded as metadata; animated placement uses SkinnedMeshRenderer."
|
||||||
.into(),
|
.into(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if !scene.skin_deformers.as_ref().is_empty() {
|
if !scene.skin_deformers.as_ref().is_empty() {
|
||||||
warnings.push(
|
warnings.push(
|
||||||
"Skins are recorded as metadata; skinned playback stays on the Scene Instance path."
|
"Skinned primitives are excluded from StaticMeshRenderer and use SkinnedMeshRenderer."
|
||||||
.into(),
|
.into(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -467,7 +565,7 @@ fn build_fbx_manifest(
|
|||||||
path: record.path.clone(),
|
path: record.path.clone(),
|
||||||
format,
|
format,
|
||||||
fingerprint,
|
fingerprint,
|
||||||
dependencies: fbx_dependencies(&record.path),
|
dependencies: fbx_dependencies(&record.path, &scene)?,
|
||||||
},
|
},
|
||||||
import,
|
import,
|
||||||
metadata: StaticMeshMetadata {
|
metadata: StaticMeshMetadata {
|
||||||
@@ -496,25 +594,26 @@ fn fbx_material_label(scene: &ufbx::Scene, element_id: u32) -> Option<String> {
|
|||||||
.map(|index| FbxAssetLabel::Material(index).to_string())
|
.map(|index| FbxAssetLabel::Material(index).to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fbx_dependencies(source_path: &str) -> Vec<String> {
|
fn fbx_dependencies(source_path: &str, scene: &ufbx::Scene) -> Result<Vec<String>, String> {
|
||||||
let path = Path::new(source_path);
|
let path = Path::new(source_path);
|
||||||
let Some(stem) = path.file_stem().and_then(|stem| stem.to_str()) else {
|
let parent = path.parent().unwrap_or_else(|| Path::new(""));
|
||||||
return Vec::new();
|
external_texture_paths(scene)
|
||||||
};
|
.map_err(|errors| {
|
||||||
let Some(parent) = path.parent() else {
|
format!(
|
||||||
return Vec::new();
|
"unsafe FBX texture reference(s) in {source_path}: {}",
|
||||||
};
|
errors
|
||||||
let sidecar = parent.join(format!("{stem}.fbm"));
|
|
||||||
if !sidecar.is_dir() {
|
|
||||||
return Vec::new();
|
|
||||||
}
|
|
||||||
walkdir::WalkDir::new(sidecar)
|
|
||||||
.follow_links(false)
|
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(Result::ok)
|
.map(|error| error.to_string())
|
||||||
.filter(|entry| entry.file_type().is_file())
|
.collect::<Vec<_>>()
|
||||||
.map(|entry| entry.path().to_string_lossy().replace('\\', "/"))
|
.join("; ")
|
||||||
|
)
|
||||||
|
})
|
||||||
|
.map(|paths| {
|
||||||
|
paths
|
||||||
|
.into_iter()
|
||||||
|
.map(|relative| parent.join(relative).to_string_lossy().replace('\\', "/"))
|
||||||
.collect()
|
.collect()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn source_format(path: &str) -> Result<String, String> {
|
fn source_format(path: &str) -> Result<String, String> {
|
||||||
@@ -525,20 +624,6 @@ fn source_format(path: &str) -> Result<String, String> {
|
|||||||
.ok_or_else(|| format!("asset path `{path}` has no extension"))
|
.ok_or_else(|| format!("asset path `{path}` has no extension"))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn source_fingerprint(path: &str) -> Result<StaticMeshSourceFingerprint, String> {
|
|
||||||
let metadata = fs::metadata(path).map_err(|err| format!("could not stat {path}: {err}"))?;
|
|
||||||
let modified_unix_secs = metadata
|
|
||||||
.modified()
|
|
||||||
.ok()
|
|
||||||
.and_then(|time| time.duration_since(UNIX_EPOCH).ok())
|
|
||||||
.map(|duration| duration.as_secs())
|
|
||||||
.unwrap_or_default();
|
|
||||||
Ok(StaticMeshSourceFingerprint {
|
|
||||||
byte_len: metadata.len(),
|
|
||||||
modified_unix_secs,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
fn resolve_dependency(source_path: &str, uri: &str) -> String {
|
fn resolve_dependency(source_path: &str, uri: &str) -> String {
|
||||||
if uri.starts_with("data:") || uri.contains("://") {
|
if uri.starts_with("data:") || uri.contains("://") {
|
||||||
return uri.to_string();
|
return uri.to_string();
|
||||||
@@ -554,6 +639,7 @@ fn resolve_dependency(source_path: &str, uri: &str) -> String {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use crate::asset_db::AssetId;
|
||||||
|
|
||||||
fn test_manifest() -> StaticMeshManifest {
|
fn test_manifest() -> StaticMeshManifest {
|
||||||
StaticMeshManifest {
|
StaticMeshManifest {
|
||||||
@@ -565,7 +651,7 @@ mod tests {
|
|||||||
format: "glb".into(),
|
format: "glb".into(),
|
||||||
fingerprint: StaticMeshSourceFingerprint {
|
fingerprint: StaticMeshSourceFingerprint {
|
||||||
byte_len: 42,
|
byte_len: 42,
|
||||||
modified_unix_secs: 10,
|
content_hash: "a".repeat(64),
|
||||||
},
|
},
|
||||||
dependencies: Vec::new(),
|
dependencies: Vec::new(),
|
||||||
},
|
},
|
||||||
@@ -597,6 +683,7 @@ mod tests {
|
|||||||
source_node: Some("Node0".into()),
|
source_node: Some("Node0".into()),
|
||||||
source_mesh: Some("Mesh0".into()),
|
source_mesh: Some("Mesh0".into()),
|
||||||
source_material: Some("Wood".into()),
|
source_material: Some("Wood".into()),
|
||||||
|
skinned: false,
|
||||||
}],
|
}],
|
||||||
warnings: Vec::new(),
|
warnings: Vec::new(),
|
||||||
}
|
}
|
||||||
@@ -633,6 +720,55 @@ mod tests {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn schema_v3_manifest_without_hash_migrates_to_content_fingerprint() {
|
||||||
|
let root = std::env::temp_dir().join(format!(
|
||||||
|
"blacksite-static-mesh-legacy-{}",
|
||||||
|
uuid::Uuid::new_v4()
|
||||||
|
));
|
||||||
|
fs::create_dir_all(&root).unwrap();
|
||||||
|
let path = root.join("legacy.static_mesh.ron");
|
||||||
|
let expected = test_manifest();
|
||||||
|
let canonical =
|
||||||
|
ron::ser::to_string_pretty(&expected, ron::ser::PrettyConfig::default()).unwrap();
|
||||||
|
let legacy = canonical
|
||||||
|
.replacen("schema_version: 4", "schema_version: 3", 1)
|
||||||
|
.lines()
|
||||||
|
.filter(|line| !line.contains("content_hash:"))
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join("\n");
|
||||||
|
fs::write(&path, legacy).unwrap();
|
||||||
|
|
||||||
|
assert!(write_pretty_ron_if_changed(&path, &expected).unwrap());
|
||||||
|
assert_eq!(
|
||||||
|
load_static_mesh_manifest(&path.to_string_lossy()).unwrap(),
|
||||||
|
expected
|
||||||
|
);
|
||||||
|
|
||||||
|
fs::remove_dir_all(root).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn equivalent_static_manifest_preserves_existing_formatting_and_newline() {
|
||||||
|
let root = std::env::temp_dir().join(format!(
|
||||||
|
"blacksite-static-mesh-semantic-{}",
|
||||||
|
uuid::Uuid::new_v4()
|
||||||
|
));
|
||||||
|
fs::create_dir_all(&root).unwrap();
|
||||||
|
let path = root.join("stable.static_mesh.ron");
|
||||||
|
let manifest = test_manifest();
|
||||||
|
let exact = format!(
|
||||||
|
"{}\n\n",
|
||||||
|
ron::ser::to_string_pretty(&manifest, ron::ser::PrettyConfig::default()).unwrap()
|
||||||
|
);
|
||||||
|
fs::write(&path, &exact).unwrap();
|
||||||
|
|
||||||
|
assert!(!write_pretty_ron_if_changed(&path, &manifest).unwrap());
|
||||||
|
assert_eq!(fs::read_to_string(&path).unwrap(), exact);
|
||||||
|
|
||||||
|
fs::remove_dir_all(root).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn renderer_from_manifest_can_ignore_source_materials() {
|
fn renderer_from_manifest_can_ignore_source_materials() {
|
||||||
let manifest = test_manifest();
|
let manifest = test_manifest();
|
||||||
@@ -645,4 +781,75 @@ mod tests {
|
|||||||
|
|
||||||
assert!(renderer.slots[0].material.is_none());
|
assert!(renderer.slots[0].material.is_none());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn renderer_from_manifest_excludes_skinned_primitives() {
|
||||||
|
let mut manifest = test_manifest();
|
||||||
|
manifest.parts[0].skinned = true;
|
||||||
|
|
||||||
|
let renderer = renderer_from_manifest(&manifest, &ImportSettings::default());
|
||||||
|
|
||||||
|
assert!(renderer.slots.is_empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn renderer_from_manifest_excludes_node_animated_geometry() {
|
||||||
|
let mut manifest = test_manifest();
|
||||||
|
manifest.metadata.animation_count = 1;
|
||||||
|
|
||||||
|
let renderer = renderer_from_manifest(&manifest, &ImportSettings::default());
|
||||||
|
|
||||||
|
assert!(renderer.slots.is_empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn committed_rigged_fixture_never_builds_static_renderer_slots() {
|
||||||
|
let path = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||||
|
.join("../../assets/models/robot_expressive.glb")
|
||||||
|
.to_string_lossy()
|
||||||
|
.into_owned();
|
||||||
|
let record = AssetRecord {
|
||||||
|
id: AssetId::new(),
|
||||||
|
path,
|
||||||
|
label: "Robot Expressive".into(),
|
||||||
|
kind_tag: "Model".into(),
|
||||||
|
source_fingerprint: None,
|
||||||
|
import_settings: ImportSettings::default(),
|
||||||
|
dependencies: Vec::new(),
|
||||||
|
};
|
||||||
|
|
||||||
|
let manifest = build_static_mesh_manifest(&record).unwrap();
|
||||||
|
let renderer = renderer_from_manifest(&manifest, &record.import_settings);
|
||||||
|
|
||||||
|
assert!(manifest.metadata.skin_count > 0);
|
||||||
|
assert!(manifest.metadata.animation_count > 0);
|
||||||
|
assert!(manifest.parts.iter().any(|part| part.skinned));
|
||||||
|
assert!(renderer.slots.is_empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn committed_fbx_records_sibling_texture_dependencies() {
|
||||||
|
let path = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||||
|
.join("../../assets/models/painted_wooden_chair_02_2k.fbx")
|
||||||
|
.to_string_lossy()
|
||||||
|
.into_owned();
|
||||||
|
let record = AssetRecord {
|
||||||
|
id: AssetId::new(),
|
||||||
|
path,
|
||||||
|
label: "Painted Chair".into(),
|
||||||
|
kind_tag: "Model".into(),
|
||||||
|
source_fingerprint: None,
|
||||||
|
import_settings: ImportSettings::default(),
|
||||||
|
dependencies: Vec::new(),
|
||||||
|
};
|
||||||
|
|
||||||
|
let manifest = build_static_mesh_manifest(&record).unwrap();
|
||||||
|
|
||||||
|
assert_eq!(manifest.source.dependencies.len(), 3);
|
||||||
|
assert!(manifest
|
||||||
|
.source
|
||||||
|
.dependencies
|
||||||
|
.iter()
|
||||||
|
.all(|path| path.contains("assets/models/textures/painted_wooden_chair_02_")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,14 @@
|
|||||||
//! Thumbnail cache for asset browser grid cells.
|
//! Thumbnail cache for asset browser grid cells.
|
||||||
|
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
|
use bevy::asset::LoadState;
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy_egui::{egui, EguiPrimaryContextPass, EguiTextureHandle, EguiUserTextures};
|
use bevy_egui::{egui, EguiPrimaryContextPass, EguiTextureHandle, EguiUserTextures};
|
||||||
use egui_phosphor_icons::icons;
|
use egui_phosphor_icons::icons;
|
||||||
|
|
||||||
use super::sources::gltf::gltf_base_color_texture_path;
|
use super::sources::gltf::{gltf_base_color_texture_path, validate_gltf_dependencies};
|
||||||
use super::studio::{model_file_exists, ThumbnailStudio};
|
use super::studio::{model_file_exists, ThumbnailStudio};
|
||||||
use super::ThumbnailJobSource;
|
use super::ThumbnailJobSource;
|
||||||
use crate::assets::{
|
use crate::assets::{
|
||||||
@@ -79,6 +81,9 @@ impl AssetThumbnailCache {
|
|||||||
if self.failed.contains_key(&key) {
|
if self.failed.contains_key(&key) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if !self.texture_source_ready(&key, &path) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let handle: Handle<Image> = asset_server.load(asset_server_path(&path));
|
let handle: Handle<Image> = asset_server.load(asset_server_path(&path));
|
||||||
self.pending.insert(key, handle);
|
self.pending.insert(key, handle);
|
||||||
}
|
}
|
||||||
@@ -100,13 +105,12 @@ impl AssetThumbnailCache {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(texture_path) = gltf_base_color_texture_path(&model_path) {
|
if !self.model_source_ready(&key, &model_path) {
|
||||||
self.request_texture(key, texture_path, asset_server);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if !model_file_exists(&model_path) {
|
if let Some(texture_path) = gltf_base_color_texture_path(&model_path) {
|
||||||
self.mark_studio_failed(&key, "file not found", false);
|
self.request_texture(key, texture_path, asset_server);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,6 +125,7 @@ impl AssetThumbnailCache {
|
|||||||
model_path: String,
|
model_path: String,
|
||||||
mesh_label: String,
|
mesh_label: String,
|
||||||
material_label: Option<String>,
|
material_label: Option<String>,
|
||||||
|
requires_scene_instance: bool,
|
||||||
studio: &mut ThumbnailStudio,
|
studio: &mut ThumbnailStudio,
|
||||||
) {
|
) {
|
||||||
if matches!(
|
if matches!(
|
||||||
@@ -130,18 +135,19 @@ impl AssetThumbnailCache {
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if !model_file_exists(&model_path) {
|
if !self.model_source_ready(&key, &model_path) {
|
||||||
self.mark_studio_failed(&key, "file not found", false);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if studio.enqueue_source(
|
let source = if requires_scene_instance {
|
||||||
key.clone(),
|
ThumbnailJobSource::Model { model_path }
|
||||||
|
} else {
|
||||||
ThumbnailJobSource::MeshSubAsset {
|
ThumbnailJobSource::MeshSubAsset {
|
||||||
model_path,
|
model_path,
|
||||||
mesh_label,
|
mesh_label,
|
||||||
material_label,
|
material_label,
|
||||||
},
|
}
|
||||||
) {
|
};
|
||||||
|
if studio.enqueue_source(key.clone(), source) {
|
||||||
self.studio_pending.insert(key);
|
self.studio_pending.insert(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,8 +166,7 @@ impl AssetThumbnailCache {
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if !model_file_exists(&model_path) {
|
if !self.source_material_ready(&key, &model_path) {
|
||||||
self.mark_studio_failed(&key, "file not found", false);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if studio.enqueue_source(
|
if studio.enqueue_source(
|
||||||
@@ -188,24 +193,68 @@ impl AssetThumbnailCache {
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let material = match shared::MaterialAsset::load_from_path(&path) {
|
let material = match shared::load_resolved_material_from_path(&path) {
|
||||||
Ok(asset) => asset,
|
Ok((material, _)) => material,
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
self.mark_studio_failed(&key, &error, true);
|
self.mark_studio_failed(&key, &error, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
let label = shared::MaterialAsset::load_from_path(&path)
|
||||||
|
.map(|asset| asset.label)
|
||||||
|
.or_else(|_| {
|
||||||
|
shared::MaterialInstanceAsset::load_from_path(&path).map(|asset| asset.label)
|
||||||
|
})
|
||||||
|
.unwrap_or_else(|_| "Material".into());
|
||||||
if studio.enqueue_source(
|
if studio.enqueue_source(
|
||||||
key.clone(),
|
key.clone(),
|
||||||
ThumbnailJobSource::MaterialAsset {
|
ThumbnailJobSource::MaterialAsset {
|
||||||
label: material.label.clone(),
|
label,
|
||||||
material: material.material,
|
material: Box::new(material),
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
self.studio_pending.insert(key);
|
self.studio_pending.insert(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn model_source_ready(&mut self, key: &str, model_path: &str) -> bool {
|
||||||
|
if !model_file_exists(model_path) {
|
||||||
|
self.mark_studio_failed(key, "file not found", false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if let Err(reason) = validate_gltf_dependencies(model_path) {
|
||||||
|
self.mark_studio_failed(key, &reason, false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
fn texture_source_ready(&mut self, key: &str, texture_path: &str) -> bool {
|
||||||
|
if Path::new(texture_path).is_file() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
self.mark_studio_failed(key, &format!("missing texture: {texture_path}"), false);
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
fn source_material_ready(&mut self, key: &str, model_path: &str) -> bool {
|
||||||
|
if !self.model_source_ready(key, model_path) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if model_path
|
||||||
|
.rsplit_once('.')
|
||||||
|
.is_some_and(|(_, extension)| extension.eq_ignore_ascii_case("fbx"))
|
||||||
|
{
|
||||||
|
if let Err(reason) =
|
||||||
|
crate::assets::import::validate_fbx_dependencies(std::path::Path::new(model_path))
|
||||||
|
{
|
||||||
|
self.mark_studio_failed(key, &reason, false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) fn complete_studio_thumbnail(
|
pub(crate) fn complete_studio_thumbnail(
|
||||||
&mut self,
|
&mut self,
|
||||||
key: &str,
|
key: &str,
|
||||||
@@ -250,6 +299,11 @@ impl AssetThumbnailCache {
|
|||||||
.cloned()
|
.cloned()
|
||||||
.collect(),
|
.collect(),
|
||||||
failed_keys: self.failed.keys().cloned().collect(),
|
failed_keys: self.failed.keys().cloned().collect(),
|
||||||
|
failure_reasons: self
|
||||||
|
.failed
|
||||||
|
.iter()
|
||||||
|
.map(|(key, failure)| (key.clone(), failure.reason.clone()))
|
||||||
|
.collect(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -259,6 +313,14 @@ fn register_loaded_thumbnails(
|
|||||||
mut cache: ResMut<AssetThumbnailCache>,
|
mut cache: ResMut<AssetThumbnailCache>,
|
||||||
mut textures: ResMut<EguiUserTextures>,
|
mut textures: ResMut<EguiUserTextures>,
|
||||||
) {
|
) {
|
||||||
|
let failed: Vec<(String, String)> = cache
|
||||||
|
.pending
|
||||||
|
.iter()
|
||||||
|
.filter_map(|(key, handle)| match asset_server.load_state(handle.id()) {
|
||||||
|
LoadState::Failed(error) => Some((key.clone(), error.to_string())),
|
||||||
|
_ => None,
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
let ready: Vec<(String, Handle<Image>)> = cache
|
let ready: Vec<(String, Handle<Image>)> = cache
|
||||||
.pending
|
.pending
|
||||||
.iter()
|
.iter()
|
||||||
@@ -266,6 +328,10 @@ fn register_loaded_thumbnails(
|
|||||||
.map(|(key, handle)| (key.clone(), handle.clone()))
|
.map(|(key, handle)| (key.clone(), handle.clone()))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
for (key, error) in failed {
|
||||||
|
cache.mark_studio_failed(&key, &format!("texture load failed: {error}"), false);
|
||||||
|
}
|
||||||
|
|
||||||
for (key, handle) in ready {
|
for (key, handle) in ready {
|
||||||
cache.pending.remove(&key);
|
cache.pending.remove(&key);
|
||||||
cache.failed.remove(&key);
|
cache.failed.remove(&key);
|
||||||
@@ -283,6 +349,7 @@ pub fn kind_icon(kind: &EditorAssetKind) -> egui_phosphor_icons::Icon {
|
|||||||
EditorAssetKind::Model => icons::CUBE_TRANSPARENT,
|
EditorAssetKind::Model => icons::CUBE_TRANSPARENT,
|
||||||
EditorAssetKind::Texture => icons::IMAGE,
|
EditorAssetKind::Texture => icons::IMAGE,
|
||||||
EditorAssetKind::Material => icons::PAINT_BRUSH,
|
EditorAssetKind::Material => icons::PAINT_BRUSH,
|
||||||
|
EditorAssetKind::AudioClip => icons::WAVEFORM,
|
||||||
EditorAssetKind::Level => icons::MAP_TRIFOLD,
|
EditorAssetKind::Level => icons::MAP_TRIFOLD,
|
||||||
EditorAssetKind::Prefab => icons::PACKAGE,
|
EditorAssetKind::Prefab => icons::PACKAGE,
|
||||||
EditorAssetKind::PostProcessVolume => icons::CAMERA,
|
EditorAssetKind::PostProcessVolume => icons::CAMERA,
|
||||||
@@ -378,14 +445,19 @@ pub fn draw_asset_cell_with(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if let Some(reason) = failed {
|
||||||
|
response.on_hover_text(reason)
|
||||||
|
} else {
|
||||||
response
|
response
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct ThumbnailCacheSnapshot {
|
pub struct ThumbnailCacheSnapshot {
|
||||||
pub texture_ids: HashMap<String, egui::TextureId>,
|
pub texture_ids: HashMap<String, egui::TextureId>,
|
||||||
pub pending_keys: Vec<String>,
|
pub pending_keys: Vec<String>,
|
||||||
pub failed_keys: Vec<String>,
|
pub failed_keys: Vec<String>,
|
||||||
|
pub failure_reasons: HashMap<String, String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ThumbnailCacheSnapshot {
|
impl ThumbnailCacheSnapshot {
|
||||||
@@ -401,6 +473,10 @@ impl ThumbnailCacheSnapshot {
|
|||||||
self.failed_keys.iter().any(|failed| failed == key)
|
self.failed_keys.iter().any(|failed| failed == key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn failure_reason_for_key(&self, key: &str) -> Option<&str> {
|
||||||
|
self.failure_reasons.get(key).map(String::as_str)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn texture_for(&self, asset: &EditorAsset) -> Option<egui::TextureId> {
|
pub fn texture_for(&self, asset: &EditorAsset) -> Option<egui::TextureId> {
|
||||||
self.texture_ids.get(&asset_cache_key(asset)).copied()
|
self.texture_ids.get(&asset_cache_key(asset)).copied()
|
||||||
}
|
}
|
||||||
@@ -416,6 +492,10 @@ impl ThumbnailCacheSnapshot {
|
|||||||
.iter()
|
.iter()
|
||||||
.any(|key| key == &asset_cache_key(asset))
|
.any(|key| key == &asset_cache_key(asset))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn failure_reason(&self, asset: &EditorAsset) -> Option<&str> {
|
||||||
|
self.failure_reason_for_key(&asset_cache_key(asset))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn prefetch_folder_thumbnails(world: &mut World, folder: &str) {
|
pub fn prefetch_folder_thumbnails(world: &mut World, folder: &str) {
|
||||||
@@ -469,6 +549,37 @@ pub fn prefetch_folder_thumbnails(world: &mut World, folder: &str) {
|
|||||||
.prefetched_folder = Some(folder.to_string());
|
.prefetched_folder = Some(folder.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Requests thumbnails for an explicit cross-folder asset set.
|
||||||
|
pub fn prefetch_asset_thumbnails(world: &mut World, assets: &[EditorAsset]) {
|
||||||
|
let requests = assets
|
||||||
|
.iter()
|
||||||
|
.filter_map(|asset| {
|
||||||
|
Some((
|
||||||
|
asset_cache_key(asset),
|
||||||
|
asset.path.clone()?,
|
||||||
|
asset.kind.clone(),
|
||||||
|
))
|
||||||
|
})
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
let asset_server = world.resource::<AssetServer>().clone();
|
||||||
|
world.resource_scope(|world, mut cache: Mut<AssetThumbnailCache>| {
|
||||||
|
world.resource_scope(|_world, mut studio: Mut<ThumbnailStudio>| {
|
||||||
|
for (key, path, kind) in requests {
|
||||||
|
match kind {
|
||||||
|
EditorAssetKind::Texture => cache.request_texture(key, path, &asset_server),
|
||||||
|
EditorAssetKind::Model => {
|
||||||
|
cache.request_model(key, path, &asset_server, &mut studio)
|
||||||
|
}
|
||||||
|
EditorAssetKind::Material => {
|
||||||
|
cache.request_material_asset(key, path, &mut studio)
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
pub fn invalidate_on_catalog_refresh(world: &mut World) {
|
pub fn invalidate_on_catalog_refresh(world: &mut World) {
|
||||||
world.resource_mut::<AssetThumbnailCache>().invalidate_all();
|
world.resource_mut::<AssetThumbnailCache>().invalidate_all();
|
||||||
if !world.contains_resource::<ThumbnailStudio>() {
|
if !world.contains_resource::<ThumbnailStudio>() {
|
||||||
@@ -484,3 +595,53 @@ pub fn invalidate_on_catalog_refresh(world: &mut World) {
|
|||||||
world.commands().entity(root).despawn();
|
world.commands().entity(root).despawn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn missing_fbx_material_dependencies_are_one_stable_non_retryable_state() {
|
||||||
|
let model_path = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||||
|
.join("../../assets/models/painted_wooden_chair_02_2k.fbx")
|
||||||
|
.to_string_lossy()
|
||||||
|
.into_owned();
|
||||||
|
let mut cache = AssetThumbnailCache::default();
|
||||||
|
|
||||||
|
assert!(cache.model_source_ready("model", &model_path));
|
||||||
|
assert!(!cache.source_material_ready("material", &model_path));
|
||||||
|
let first = cache.state("material");
|
||||||
|
assert!(!cache.source_material_ready("material", &model_path));
|
||||||
|
|
||||||
|
assert_eq!(cache.state("material"), first);
|
||||||
|
let Some(ThumbnailState::Failed { reason, retryable }) = first else {
|
||||||
|
panic!("missing FBX textures should produce one stable failure");
|
||||||
|
};
|
||||||
|
assert!(!retryable);
|
||||||
|
assert!(reason.starts_with("missing 3 FBX source texture(s):"));
|
||||||
|
assert!(cache.studio_pending.is_empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn missing_texture_is_one_stable_non_retryable_state() {
|
||||||
|
let path = std::env::temp_dir().join(format!(
|
||||||
|
"blacksite-missing-thumbnail-{}-{}.png",
|
||||||
|
std::process::id(),
|
||||||
|
std::thread::current().name().unwrap_or("test")
|
||||||
|
));
|
||||||
|
let path = path.to_string_lossy().into_owned();
|
||||||
|
let mut cache = AssetThumbnailCache::default();
|
||||||
|
|
||||||
|
assert!(!cache.texture_source_ready("texture", &path));
|
||||||
|
let first = cache.state("texture");
|
||||||
|
assert!(!cache.texture_source_ready("texture", &path));
|
||||||
|
|
||||||
|
assert_eq!(cache.state("texture"), first);
|
||||||
|
let Some(ThumbnailState::Failed { reason, retryable }) = first else {
|
||||||
|
panic!("missing texture should produce one stable failure");
|
||||||
|
};
|
||||||
|
assert!(!retryable);
|
||||||
|
assert_eq!(reason, format!("missing texture: {path}"));
|
||||||
|
assert!(cache.pending.is_empty());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,7 +24,7 @@ pub enum ThumbnailJobSource {
|
|||||||
},
|
},
|
||||||
MaterialAsset {
|
MaterialAsset {
|
||||||
label: String,
|
label: String,
|
||||||
material: MaterialDesc,
|
material: Box<MaterialDesc>,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,11 +8,14 @@ mod sources;
|
|||||||
mod studio;
|
mod studio;
|
||||||
|
|
||||||
pub use cache::{
|
pub use cache::{
|
||||||
draw_asset_cell_with, invalidate_on_catalog_refresh, kind_icon, prefetch_folder_thumbnails,
|
draw_asset_cell_with, invalidate_on_catalog_refresh, kind_icon, prefetch_asset_thumbnails,
|
||||||
AssetThumbnailCache, AssetThumbnailsPlugin, ThumbnailCacheSnapshot, ThumbnailState,
|
prefetch_folder_thumbnails, AssetThumbnailCache, AssetThumbnailsPlugin, ThumbnailCacheSnapshot,
|
||||||
|
ThumbnailState,
|
||||||
};
|
};
|
||||||
pub use job::{ThumbnailJob, ThumbnailJobSource};
|
pub use job::{ThumbnailJob, ThumbnailJobSource};
|
||||||
pub use sources::{FbxThumbnailSource, GltfThumbnailSource, ThumbnailModelSource};
|
pub use sources::{
|
||||||
|
gltf_skinned_primitive_labels, FbxThumbnailSource, GltfThumbnailSource, ThumbnailModelSource,
|
||||||
|
};
|
||||||
pub use studio::{
|
pub use studio::{
|
||||||
model_file_exists, model_scene_asset_path, ThumbnailStudio, ThumbnailStudioPlugin,
|
model_file_exists, model_scene_asset_path, ThumbnailStudio, ThumbnailStudioPlugin,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -83,6 +83,72 @@ impl ThumbnailModelSource for FbxThumbnailSource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn spawn_fbx_mesh_subasset_preview(
|
||||||
|
commands: &mut Commands,
|
||||||
|
meshes: &mut Assets<Mesh>,
|
||||||
|
materials: &mut Assets<StandardMaterial>,
|
||||||
|
root: Entity,
|
||||||
|
catalog_path: &str,
|
||||||
|
mesh_label: &str,
|
||||||
|
) -> bool {
|
||||||
|
let Some(encoded_index) = mesh_label
|
||||||
|
.strip_prefix("Mesh")
|
||||||
|
.and_then(|index| index.parse::<usize>().ok())
|
||||||
|
else {
|
||||||
|
warn!("FBX thumbnail: unsupported mesh label {mesh_label}");
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
let node_index = encoded_index / 1000;
|
||||||
|
let material_index = encoded_index % 1000;
|
||||||
|
let Ok(bytes) = std::fs::read(catalog_path) else {
|
||||||
|
warn!("FBX thumbnail: could not read {catalog_path}");
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
let Ok(scene) = ufbx::load_memory(
|
||||||
|
&bytes,
|
||||||
|
ufbx::LoadOpts {
|
||||||
|
target_unit_meters: 1.0,
|
||||||
|
target_axes: ufbx::CoordinateAxes::right_handed_y_up(),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
) else {
|
||||||
|
warn!("FBX thumbnail: failed to parse {catalog_path}");
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
let Some(node) = scene.nodes.as_ref().get(node_index) else {
|
||||||
|
warn!("FBX thumbnail: mesh label {mesh_label} has no source node");
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
let Some(mesh_ref) = node.mesh.as_ref() else {
|
||||||
|
warn!("FBX thumbnail: mesh label {mesh_label} has no source mesh");
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
let Some(indices) = group_faces_by_material(mesh_ref.as_ref()).remove(&material_index) else {
|
||||||
|
warn!("FBX thumbnail: mesh label {mesh_label} has no material group");
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
if indices.is_empty() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mesh = meshes.add(build_mesh(mesh_ref.as_ref(), &indices));
|
||||||
|
let material = materials.add(StandardMaterial {
|
||||||
|
base_color: Color::srgb(0.72, 0.72, 0.75),
|
||||||
|
perceptual_roughness: 0.65,
|
||||||
|
..default()
|
||||||
|
});
|
||||||
|
let transform = Transform::from_matrix(convert_matrix(&node.geometry_to_world));
|
||||||
|
commands.entity(root).with_children(|parent| {
|
||||||
|
parent.spawn((
|
||||||
|
RenderLayers::layer(THUMBNAIL_LAYER),
|
||||||
|
Mesh3d(mesh),
|
||||||
|
MeshMaterial3d(material),
|
||||||
|
transform,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
fn build_mesh(ufbx_mesh: &ufbx::Mesh, indices: &[u32]) -> Mesh {
|
fn build_mesh(ufbx_mesh: &ufbx::Mesh, indices: &[u32]) -> Mesh {
|
||||||
let mut mesh = Mesh::new(
|
let mut mesh = Mesh::new(
|
||||||
PrimitiveTopology::TriangleList,
|
PrimitiveTopology::TriangleList,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
//! glTF/GLB fast-path texture extraction for asset browser thumbnails.
|
//! glTF/GLB fast-path texture extraction for asset browser thumbnails.
|
||||||
|
|
||||||
|
use std::collections::HashSet;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
/// Returns an asset-server path for the first base-color texture referenced by a glTF/GLB file.
|
/// Returns an asset-server path for the first base-color texture referenced by a glTF/GLB file.
|
||||||
@@ -29,6 +30,67 @@ pub fn gltf_base_color_texture_path(model_asset_path: &str) -> Option<String> {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Verifies local external buffers and images before Bevy starts an async glTF load.
|
||||||
|
pub fn validate_gltf_dependencies(model_asset_path: &str) -> Result<(), String> {
|
||||||
|
let model_path = Path::new(model_asset_path);
|
||||||
|
if !is_gltf_path(model_path) {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
let gltf = gltf::Gltf::open(model_path).map_err(|error| format!("invalid glTF: {error}"))?;
|
||||||
|
let mut uris = Vec::new();
|
||||||
|
for buffer in gltf.buffers() {
|
||||||
|
if let gltf::buffer::Source::Uri(uri) = buffer.source() {
|
||||||
|
uris.push(uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for image in gltf.images() {
|
||||||
|
if let gltf::image::Source::Uri { uri, .. } = image.source() {
|
||||||
|
uris.push(uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let model_dir = model_path.parent().unwrap_or_else(|| Path::new(""));
|
||||||
|
for uri in uris {
|
||||||
|
if uri.starts_with("data:") || uri.contains("://") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
let dependency = model_dir.join(uri);
|
||||||
|
if !dependency.is_file() {
|
||||||
|
let display = normalize_asset_path(&dependency)
|
||||||
|
.unwrap_or_else(|| dependency.to_string_lossy().replace('\\', "/"));
|
||||||
|
return Err(format!("missing dependency: {display}"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns primitive labels that cannot be rendered without their source skin hierarchy.
|
||||||
|
pub fn gltf_skinned_primitive_labels(model_asset_path: &str) -> HashSet<String> {
|
||||||
|
let model_path = Path::new(model_asset_path);
|
||||||
|
if !is_gltf_path(model_path) {
|
||||||
|
return HashSet::new();
|
||||||
|
}
|
||||||
|
let Ok(gltf) = gltf::Gltf::open(model_path) else {
|
||||||
|
return HashSet::new();
|
||||||
|
};
|
||||||
|
gltf.meshes()
|
||||||
|
.flat_map(|mesh| {
|
||||||
|
let mesh_index = mesh.index();
|
||||||
|
mesh.primitives()
|
||||||
|
.filter(|primitive| {
|
||||||
|
primitive.attributes().any(|(semantic, _)| {
|
||||||
|
matches!(
|
||||||
|
semantic,
|
||||||
|
gltf::Semantic::Joints(_) | gltf::Semantic::Weights(_)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.map(move |primitive| format!("Mesh{mesh_index}/Primitive{}", primitive.index()))
|
||||||
|
})
|
||||||
|
.collect()
|
||||||
|
}
|
||||||
|
|
||||||
pub struct GltfThumbnailSource;
|
pub struct GltfThumbnailSource;
|
||||||
|
|
||||||
fn is_gltf_path(path: &Path) -> bool {
|
fn is_gltf_path(path: &Path) -> bool {
|
||||||
@@ -61,7 +123,9 @@ fn normalize_asset_path(path: &Path) -> Option<String> {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use std::fs;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn normalize_asset_path_keeps_assets_prefix() {
|
fn normalize_asset_path_keeps_assets_prefix() {
|
||||||
@@ -79,4 +143,37 @@ mod tests {
|
|||||||
Some("assets/models/textures/chair_albedo.png".into())
|
Some("assets/models/textures/chair_albedo.png".into())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn dependency_validation_reports_missing_external_buffer() {
|
||||||
|
let nonce = SystemTime::now()
|
||||||
|
.duration_since(UNIX_EPOCH)
|
||||||
|
.unwrap()
|
||||||
|
.as_nanos();
|
||||||
|
let directory = std::env::temp_dir().join(format!("blacksite-gltf-{nonce}"));
|
||||||
|
fs::create_dir_all(&directory).unwrap();
|
||||||
|
let model = directory.join("missing-buffer.gltf");
|
||||||
|
fs::write(
|
||||||
|
&model,
|
||||||
|
r#"{"asset":{"version":"2.0"},"buffers":[{"uri":"missing.bin","byteLength":4}]}"#,
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let error = validate_gltf_dependencies(model.to_str().unwrap()).unwrap_err();
|
||||||
|
assert!(error.contains("missing.bin"));
|
||||||
|
|
||||||
|
fs::remove_dir_all(directory).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn committed_robot_fixture_identifies_skinned_primitives() {
|
||||||
|
let path =
|
||||||
|
Path::new(env!("CARGO_MANIFEST_DIR")).join("../../assets/models/robot_expressive.glb");
|
||||||
|
let labels = gltf_skinned_primitive_labels(path.to_str().unwrap());
|
||||||
|
|
||||||
|
assert!(labels.contains("Mesh12/Primitive0"));
|
||||||
|
assert!(labels.contains("Mesh13/Primitive0"));
|
||||||
|
assert!(!labels.contains("Mesh0/Primitive0"));
|
||||||
|
assert!(!labels.contains("Mesh999/Primitive0"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -3,8 +3,9 @@
|
|||||||
mod fbx;
|
mod fbx;
|
||||||
pub(crate) mod gltf;
|
pub(crate) mod gltf;
|
||||||
|
|
||||||
|
pub(crate) use fbx::spawn_fbx_mesh_subasset_preview;
|
||||||
pub use fbx::FbxThumbnailSource;
|
pub use fbx::FbxThumbnailSource;
|
||||||
pub use gltf::GltfThumbnailSource;
|
pub use gltf::{gltf_skinned_primitive_labels, GltfThumbnailSource};
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
|
||||||
|
|||||||
@@ -10,20 +10,24 @@ use bevy::math::bounding::Aabb3d;
|
|||||||
use bevy::mesh::VertexAttributeValues;
|
use bevy::mesh::VertexAttributeValues;
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy::render::render_resource::TextureFormat;
|
use bevy::render::render_resource::TextureFormat;
|
||||||
use bevy::scene::SceneRoot;
|
|
||||||
use bevy_egui::EguiUserTextures;
|
use bevy_egui::EguiUserTextures;
|
||||||
use shared::{material_from_desc, ModelRef};
|
use shared::{material_from_desc, standard_material_asset_path, ModelRef};
|
||||||
|
|
||||||
use super::cache::AssetThumbnailCache;
|
use super::cache::AssetThumbnailCache;
|
||||||
use super::job::{ThumbnailJob, ThumbnailJobSource};
|
use super::job::{ThumbnailJob, ThumbnailJobSource};
|
||||||
use super::sources::{source_for_extension, uses_scene_root};
|
use super::sources::{source_for_extension, spawn_fbx_mesh_subasset_preview, uses_scene_root};
|
||||||
use crate::assets::asset_server_path;
|
use crate::assets::asset_server_path;
|
||||||
use crate::infra::EditorOnly;
|
use crate::infra::EditorOnly;
|
||||||
|
|
||||||
pub(crate) const THUMB_SIZE: u32 = 128;
|
pub(crate) const THUMB_SIZE: u32 = 128;
|
||||||
pub(crate) const THUMBNAIL_LAYER: usize = 31;
|
pub(crate) const THUMBNAIL_LAYER: usize = 31;
|
||||||
|
const THUMBNAIL_VERTICAL_FOV: f32 = 40.0_f32.to_radians();
|
||||||
|
const THUMBNAIL_HALF_VERTICAL_FOV: f32 = THUMBNAIL_VERTICAL_FOV * 0.5;
|
||||||
|
const SCENE_FRAME_PADDING: f32 = 1.35;
|
||||||
|
const MATERIAL_SPHERE_FRAME_PADDING: f32 = 1.28;
|
||||||
const MESH_WARMUP_FRAMES: u8 = 12;
|
const MESH_WARMUP_FRAMES: u8 = 12;
|
||||||
const POST_ATTACH_FRAMES: u8 = 8;
|
const POST_ATTACH_FRAMES: u8 = 8;
|
||||||
|
const FIRST_RENDER_WARMUP_FRAMES: u8 = 120;
|
||||||
const RENDER_FRAMES: u8 = 3;
|
const RENDER_FRAMES: u8 = 3;
|
||||||
const COOLDOWN_FRAMES: u8 = 2;
|
const COOLDOWN_FRAMES: u8 = 2;
|
||||||
const LOAD_TIMEOUT_FRAMES: u32 = 240;
|
const LOAD_TIMEOUT_FRAMES: u32 = 240;
|
||||||
@@ -48,6 +52,7 @@ pub struct ThumbnailStudio {
|
|||||||
queue: VecDeque<ThumbnailJob>,
|
queue: VecDeque<ThumbnailJob>,
|
||||||
active: Option<ActiveModelThumbnail>,
|
active: Option<ActiveModelThumbnail>,
|
||||||
cooldown_frames: u8,
|
cooldown_frames: u8,
|
||||||
|
render_pipeline_warmed: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ActiveModelThumbnail {
|
struct ActiveModelThumbnail {
|
||||||
@@ -62,6 +67,25 @@ struct ActiveModelThumbnail {
|
|||||||
framed: bool,
|
framed: bool,
|
||||||
frames_remaining: u8,
|
frames_remaining: u8,
|
||||||
wait_frames: u32,
|
wait_frames: u32,
|
||||||
|
framing: ThumbnailFraming,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
|
enum ThumbnailFraming {
|
||||||
|
SceneBounds,
|
||||||
|
MaterialSphere,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ThumbnailFraming {
|
||||||
|
fn for_source(source: &ThumbnailJobSource) -> Self {
|
||||||
|
match source {
|
||||||
|
ThumbnailJobSource::SourceMaterial { .. }
|
||||||
|
| ThumbnailJobSource::MaterialAsset { .. } => Self::MaterialSphere,
|
||||||
|
ThumbnailJobSource::Model { .. } | ThumbnailJobSource::MeshSubAsset { .. } => {
|
||||||
|
Self::SceneBounds
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct ThumbnailStudioPlugin;
|
pub struct ThumbnailStudioPlugin;
|
||||||
@@ -134,6 +158,7 @@ fn setup_thumbnail_studio(mut commands: Commands, mut images: ResMut<Assets<Imag
|
|||||||
ThumbnailStudioLayer,
|
ThumbnailStudioLayer,
|
||||||
RenderLayers::layer(THUMBNAIL_LAYER),
|
RenderLayers::layer(THUMBNAIL_LAYER),
|
||||||
Camera3d::default(),
|
Camera3d::default(),
|
||||||
|
Msaa::Off,
|
||||||
Camera {
|
Camera {
|
||||||
is_active: false,
|
is_active: false,
|
||||||
order: -50,
|
order: -50,
|
||||||
@@ -143,7 +168,7 @@ fn setup_thumbnail_studio(mut commands: Commands, mut images: ResMut<Assets<Imag
|
|||||||
RenderTarget::Image(render_image.clone().into()),
|
RenderTarget::Image(render_image.clone().into()),
|
||||||
Transform::from_xyz(2.0, 1.4, 2.0).looking_at(Vec3::new(0.0, 0.5, 0.0), Vec3::Y),
|
Transform::from_xyz(2.0, 1.4, 2.0).looking_at(Vec3::new(0.0, 0.5, 0.0), Vec3::Y),
|
||||||
Projection::Perspective(PerspectiveProjection {
|
Projection::Perspective(PerspectiveProjection {
|
||||||
fov: 40.0_f32.to_radians(),
|
fov: THUMBNAIL_VERTICAL_FOV,
|
||||||
..default()
|
..default()
|
||||||
}),
|
}),
|
||||||
))
|
))
|
||||||
@@ -157,7 +182,7 @@ fn setup_thumbnail_studio(mut commands: Commands, mut images: ResMut<Assets<Imag
|
|||||||
RenderLayers::layer(THUMBNAIL_LAYER),
|
RenderLayers::layer(THUMBNAIL_LAYER),
|
||||||
DirectionalLight {
|
DirectionalLight {
|
||||||
illuminance: 12_000.0,
|
illuminance: 12_000.0,
|
||||||
shadows_enabled: false,
|
shadow_maps_enabled: false,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, -0.8, 0.9, 0.0)),
|
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, -0.8, 0.9, 0.0)),
|
||||||
@@ -172,7 +197,7 @@ fn setup_thumbnail_studio(mut commands: Commands, mut images: ResMut<Assets<Imag
|
|||||||
RenderLayers::layer(THUMBNAIL_LAYER),
|
RenderLayers::layer(THUMBNAIL_LAYER),
|
||||||
DirectionalLight {
|
DirectionalLight {
|
||||||
illuminance: 3_500.0,
|
illuminance: 3_500.0,
|
||||||
shadows_enabled: false,
|
shadow_maps_enabled: false,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, -0.4, -2.2, 0.0)),
|
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, -0.4, -2.2, 0.0)),
|
||||||
@@ -186,6 +211,7 @@ fn setup_thumbnail_studio(mut commands: Commands, mut images: ResMut<Assets<Imag
|
|||||||
queue: VecDeque::new(),
|
queue: VecDeque::new(),
|
||||||
active: None,
|
active: None,
|
||||||
cooldown_frames: 0,
|
cooldown_frames: 0,
|
||||||
|
render_pipeline_warmed: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,6 +255,7 @@ fn process_thumbnail_studio(
|
|||||||
&mesh3d,
|
&mesh3d,
|
||||||
&mesh_storage,
|
&mesh_storage,
|
||||||
&mut camera_transforms,
|
&mut camera_transforms,
|
||||||
|
active.framing,
|
||||||
) {
|
) {
|
||||||
active.framed = true;
|
active.framed = true;
|
||||||
active.post_attach_frames = 0;
|
active.post_attach_frames = 0;
|
||||||
@@ -264,7 +291,7 @@ fn process_thumbnail_studio(
|
|||||||
camera.is_active = true;
|
camera.is_active = true;
|
||||||
}
|
}
|
||||||
active.camera_active = true;
|
active.camera_active = true;
|
||||||
active.frames_remaining = RENDER_FRAMES;
|
active.frames_remaining = capture_frames(studio.render_pipeline_warmed);
|
||||||
}
|
}
|
||||||
studio.active = Some(active);
|
studio.active = Some(active);
|
||||||
return;
|
return;
|
||||||
@@ -275,6 +302,7 @@ fn process_thumbnail_studio(
|
|||||||
active.frames_remaining -= 1;
|
active.frames_remaining -= 1;
|
||||||
studio.active = Some(active);
|
studio.active = Some(active);
|
||||||
} else {
|
} else {
|
||||||
|
studio.render_pipeline_warmed = true;
|
||||||
cache.complete_studio_thumbnail(
|
cache.complete_studio_thumbnail(
|
||||||
&active.cache_key,
|
&active.cache_key,
|
||||||
active.render_image.clone(),
|
active.render_image.clone(),
|
||||||
@@ -315,10 +343,14 @@ fn process_thumbnail_studio(
|
|||||||
ThumbnailStudioLayer,
|
ThumbnailStudioLayer,
|
||||||
RenderLayers::layer(THUMBNAIL_LAYER),
|
RenderLayers::layer(THUMBNAIL_LAYER),
|
||||||
Transform::default(),
|
Transform::default(),
|
||||||
|
Visibility::Visible,
|
||||||
|
InheritedVisibility::default(),
|
||||||
|
ViewVisibility::default(),
|
||||||
))
|
))
|
||||||
.id();
|
.id();
|
||||||
|
|
||||||
let label = job.source.label().to_string();
|
let label = job.source.label().to_string();
|
||||||
|
let framing = ThumbnailFraming::for_source(&job.source);
|
||||||
let content_spawned = spawn_thumbnail_job_content(
|
let content_spawned = spawn_thumbnail_job_content(
|
||||||
&mut commands,
|
&mut commands,
|
||||||
&mut mesh_storage,
|
&mut mesh_storage,
|
||||||
@@ -347,6 +379,7 @@ fn process_thumbnail_studio(
|
|||||||
framed: false,
|
framed: false,
|
||||||
frames_remaining: 0,
|
frames_remaining: 0,
|
||||||
wait_frames: 0,
|
wait_frames: 0,
|
||||||
|
framing,
|
||||||
},
|
},
|
||||||
"no renderable meshes",
|
"no renderable meshes",
|
||||||
true,
|
true,
|
||||||
@@ -366,6 +399,7 @@ fn process_thumbnail_studio(
|
|||||||
framed: false,
|
framed: false,
|
||||||
frames_remaining: 0,
|
frames_remaining: 0,
|
||||||
wait_frames: 0,
|
wait_frames: 0,
|
||||||
|
framing,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,7 +414,7 @@ fn spawn_thumbnail_job_content(
|
|||||||
match source {
|
match source {
|
||||||
ThumbnailJobSource::Model { model_path } => {
|
ThumbnailJobSource::Model { model_path } => {
|
||||||
if uses_scene_root(model_path) {
|
if uses_scene_root(model_path) {
|
||||||
commands.entity(root).insert(SceneRoot(
|
commands.entity(root).insert(WorldAssetRoot(
|
||||||
asset_server.load(model_scene_asset_path(model_path, 0)),
|
asset_server.load(model_scene_asset_path(model_path, 0)),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -396,12 +430,15 @@ fn spawn_thumbnail_job_content(
|
|||||||
material_label,
|
material_label,
|
||||||
} => spawn_mesh_subasset_preview(
|
} => spawn_mesh_subasset_preview(
|
||||||
commands,
|
commands,
|
||||||
|
mesh_storage,
|
||||||
materials,
|
materials,
|
||||||
asset_server,
|
asset_server,
|
||||||
root,
|
root,
|
||||||
|
MeshSubassetPreviewSpec {
|
||||||
model_path,
|
model_path,
|
||||||
mesh_label,
|
mesh_label,
|
||||||
material_label.as_deref(),
|
material_label: material_label.as_deref(),
|
||||||
|
},
|
||||||
),
|
),
|
||||||
ThumbnailJobSource::SourceMaterial {
|
ThumbnailJobSource::SourceMaterial {
|
||||||
model_path,
|
model_path,
|
||||||
@@ -410,7 +447,7 @@ fn spawn_thumbnail_job_content(
|
|||||||
commands,
|
commands,
|
||||||
mesh_storage,
|
mesh_storage,
|
||||||
root,
|
root,
|
||||||
asset_server.load(labeled_asset_path(
|
asset_server.load(standard_material_asset_path(
|
||||||
&asset_server_path(model_path),
|
&asset_server_path(model_path),
|
||||||
material_label,
|
material_label,
|
||||||
)),
|
)),
|
||||||
@@ -422,19 +459,39 @@ fn spawn_thumbnail_job_content(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct MeshSubassetPreviewSpec<'a> {
|
||||||
|
model_path: &'a str,
|
||||||
|
mesh_label: &'a str,
|
||||||
|
material_label: Option<&'a str>,
|
||||||
|
}
|
||||||
|
|
||||||
fn spawn_mesh_subasset_preview(
|
fn spawn_mesh_subasset_preview(
|
||||||
commands: &mut Commands,
|
commands: &mut Commands,
|
||||||
|
mesh_storage: &mut Assets<Mesh>,
|
||||||
materials: &mut Assets<StandardMaterial>,
|
materials: &mut Assets<StandardMaterial>,
|
||||||
asset_server: &AssetServer,
|
asset_server: &AssetServer,
|
||||||
root: Entity,
|
root: Entity,
|
||||||
model_path: &str,
|
preview: MeshSubassetPreviewSpec<'_>,
|
||||||
mesh_label: &str,
|
|
||||||
material_label: Option<&str>,
|
|
||||||
) -> bool {
|
) -> bool {
|
||||||
let source_path = asset_server_path(model_path);
|
if preview
|
||||||
let mesh: Handle<Mesh> = asset_server.load(labeled_asset_path(&source_path, mesh_label));
|
.model_path
|
||||||
let material = if let Some(material_label) = material_label {
|
.rsplit_once('.')
|
||||||
asset_server.load(labeled_asset_path(&source_path, material_label))
|
.is_some_and(|(_, extension)| extension.eq_ignore_ascii_case("fbx"))
|
||||||
|
{
|
||||||
|
return spawn_fbx_mesh_subasset_preview(
|
||||||
|
commands,
|
||||||
|
mesh_storage,
|
||||||
|
materials,
|
||||||
|
root,
|
||||||
|
preview.model_path,
|
||||||
|
preview.mesh_label,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
let source_path = asset_server_path(preview.model_path);
|
||||||
|
let mesh: Handle<Mesh> =
|
||||||
|
asset_server.load(labeled_asset_path(&source_path, preview.mesh_label));
|
||||||
|
let material = if let Some(material_label) = preview.material_label {
|
||||||
|
asset_server.load(standard_material_asset_path(&source_path, material_label))
|
||||||
} else {
|
} else {
|
||||||
materials.add(StandardMaterial {
|
materials.add(StandardMaterial {
|
||||||
base_color: Color::srgb(0.72, 0.72, 0.75),
|
base_color: Color::srgb(0.72, 0.72, 0.75),
|
||||||
@@ -479,6 +536,14 @@ fn studio_render_image() -> Image {
|
|||||||
Image::new_target_texture(THUMB_SIZE, THUMB_SIZE, TextureFormat::Rgba16Float, None)
|
Image::new_target_texture(THUMB_SIZE, THUMB_SIZE, TextureFormat::Rgba16Float, None)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn capture_frames(render_pipeline_warmed: bool) -> u8 {
|
||||||
|
if render_pipeline_warmed {
|
||||||
|
RENDER_FRAMES
|
||||||
|
} else {
|
||||||
|
FIRST_RENDER_WARMUP_FRAMES
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn finish_active_thumbnail(
|
fn finish_active_thumbnail(
|
||||||
commands: &mut Commands,
|
commands: &mut Commands,
|
||||||
studio: &mut ThumbnailStudio,
|
studio: &mut ThumbnailStudio,
|
||||||
@@ -494,6 +559,10 @@ fn finish_active_thumbnail(
|
|||||||
studio.cooldown_frames = COOLDOWN_FRAMES;
|
studio.cooldown_frames = COOLDOWN_FRAMES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[expect(
|
||||||
|
clippy::too_many_arguments,
|
||||||
|
reason = "thumbnail failure coordinates the job, cache, render target, and camera state"
|
||||||
|
)]
|
||||||
fn fail_active_thumbnail(
|
fn fail_active_thumbnail(
|
||||||
commands: &mut Commands,
|
commands: &mut Commands,
|
||||||
studio: &mut ThumbnailStudio,
|
studio: &mut ThumbnailStudio,
|
||||||
@@ -581,6 +650,7 @@ fn frame_thumbnail_scene(
|
|||||||
meshes: &Query<&Mesh3d>,
|
meshes: &Query<&Mesh3d>,
|
||||||
mesh_assets: &Assets<Mesh>,
|
mesh_assets: &Assets<Mesh>,
|
||||||
camera_transforms: &mut Query<&mut Transform, With<ThumbnailStudioCamera>>,
|
camera_transforms: &mut Query<&mut Transform, With<ThumbnailStudioCamera>>,
|
||||||
|
framing: ThumbnailFraming,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
let mut entities = Vec::new();
|
let mut entities = Vec::new();
|
||||||
collect_descendants(root, children, &mut entities);
|
collect_descendants(root, children, &mut entities);
|
||||||
@@ -626,8 +696,7 @@ fn frame_thumbnail_scene(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let center = (min + max) * 0.5;
|
let center = (min + max) * 0.5;
|
||||||
let radius = (max - min).length().max(0.25) * 0.5;
|
let distance = thumbnail_camera_distance(min, max, framing);
|
||||||
let distance = radius / (20.0_f32.to_radians()).tan() * 1.35;
|
|
||||||
let eye = center + Vec3::new(1.0, 0.75, 1.0).normalize() * distance;
|
let eye = center + Vec3::new(1.0, 0.75, 1.0).normalize() * distance;
|
||||||
|
|
||||||
if let Ok(mut transform) = camera_transforms.single_mut() {
|
if let Ok(mut transform) = camera_transforms.single_mut() {
|
||||||
@@ -637,6 +706,20 @@ fn frame_thumbnail_scene(
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn thumbnail_camera_distance(min: Vec3, max: Vec3, framing: ThumbnailFraming) -> f32 {
|
||||||
|
let bounds_size = max - min;
|
||||||
|
let (radius, padding) = match framing {
|
||||||
|
ThumbnailFraming::SceneBounds => {
|
||||||
|
(bounds_size.length().max(0.25) * 0.5, SCENE_FRAME_PADDING)
|
||||||
|
}
|
||||||
|
ThumbnailFraming::MaterialSphere => (
|
||||||
|
bounds_size.max_element().max(0.5) * 0.5,
|
||||||
|
MATERIAL_SPHERE_FRAME_PADDING,
|
||||||
|
),
|
||||||
|
};
|
||||||
|
radius / THUMBNAIL_HALF_VERTICAL_FOV.tan() * padding
|
||||||
|
}
|
||||||
|
|
||||||
fn collect_descendants(entity: Entity, children: &Query<&Children>, out: &mut Vec<Entity>) {
|
fn collect_descendants(entity: Entity, children: &Query<&Children>, out: &mut Vec<Entity>) {
|
||||||
out.push(entity);
|
out.push(entity);
|
||||||
let Ok(child_list) = children.get(entity) else {
|
let Ok(child_list) = children.get(entity) else {
|
||||||
@@ -666,3 +749,30 @@ fn aabb_corners(aabb: &Aabb3d) -> [Vec3; 8] {
|
|||||||
pub fn model_file_exists(catalog_path: &str) -> bool {
|
pub fn model_file_exists(catalog_path: &str) -> bool {
|
||||||
Path::new(catalog_path).is_file()
|
Path::new(catalog_path).is_file()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn material_sphere_framing_fills_more_of_the_thumbnail_with_padding() {
|
||||||
|
let sphere_radius = 0.65;
|
||||||
|
let min = Vec3::splat(-sphere_radius);
|
||||||
|
let max = Vec3::splat(sphere_radius);
|
||||||
|
|
||||||
|
let scene_distance = thumbnail_camera_distance(min, max, ThumbnailFraming::SceneBounds);
|
||||||
|
let material_distance =
|
||||||
|
thumbnail_camera_distance(min, max, ThumbnailFraming::MaterialSphere);
|
||||||
|
let projected_radius_fraction =
|
||||||
|
sphere_radius / (material_distance * THUMBNAIL_HALF_VERTICAL_FOV.tan());
|
||||||
|
|
||||||
|
assert!(material_distance < scene_distance * 0.6);
|
||||||
|
assert!((0.75..0.82).contains(&projected_radius_fraction));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn first_capture_keeps_camera_active_for_render_pipeline_warmup() {
|
||||||
|
assert_eq!(capture_frames(true), RENDER_FRAMES);
|
||||||
|
assert!(capture_frames(false) > capture_frames(true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,27 @@
|
|||||||
//! In-process editor binary entry point.
|
//! In-process editor binary entry point.
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
let startup = match editor::launcher::parse_startup_arguments(std::env::args().skip(1)) {
|
||||||
|
Ok(startup) => startup,
|
||||||
|
Err(error) => {
|
||||||
|
eprintln!(
|
||||||
|
"Blacksite Editor: {error}\n\n{}",
|
||||||
|
editor::launcher::command_line_help()
|
||||||
|
);
|
||||||
|
std::process::exit(2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if startup.help {
|
||||||
|
println!("{}", editor::launcher::command_line_help());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if let Some(root) = startup.project {
|
||||||
|
if let Err(error) = editor::launcher::activate_project_root(&root) {
|
||||||
|
eprintln!("Blacksite Editor: {error}");
|
||||||
|
std::process::exit(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if std::env::var_os("WGPU_VALIDATION").is_none() {
|
if std::env::var_os("WGPU_VALIDATION").is_none() {
|
||||||
// SAFETY: called before any threads or GPU init.
|
// SAFETY: called before any threads or GPU init.
|
||||||
unsafe { std::env::set_var("WGPU_VALIDATION", "0") };
|
unsafe { std::env::set_var("WGPU_VALIDATION", "0") };
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
//! Dedicated pre-engine Blacksite project browser.
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
if std::env::var_os("WGPU_VALIDATION").is_none() {
|
||||||
|
// SAFETY: called before Bevy starts worker threads or initializes the renderer.
|
||||||
|
unsafe { std::env::set_var("WGPU_VALIDATION", "0") };
|
||||||
|
}
|
||||||
|
editor::launcher::run_project_launcher();
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@ use bevy::prelude::*;
|
|||||||
use bevy_egui::{egui, EguiContexts, EguiPrimaryContextPass};
|
use bevy_egui::{egui, EguiContexts, EguiPrimaryContextPass};
|
||||||
|
|
||||||
use crate::history::group_selection_with_history;
|
use crate::history::group_selection_with_history;
|
||||||
use crate::operators::{run_immediate_operator, OperatorAvailability};
|
use crate::operators::{run_operator_action, OperatorAction, OperatorAvailability};
|
||||||
use crate::state::{EditorMode, PlayPossession};
|
use crate::state::{EditorMode, PlayPossession};
|
||||||
use crate::ui::helpers::{
|
use crate::ui::helpers::{
|
||||||
reset_scene_lighting_to_project_defaults, toggle_play_mode, toggle_play_paused,
|
reset_scene_lighting_to_project_defaults, toggle_play_mode, toggle_play_paused,
|
||||||
@@ -27,7 +27,7 @@ pub trait EditorCommand: Send + Sync {
|
|||||||
fn disabled_reason(&self, _world: &World) -> Option<String> {
|
fn disabled_reason(&self, _world: &World) -> Option<String> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
fn execute(&self, world: &mut World);
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Resource, Default)]
|
#[derive(Resource, Default)]
|
||||||
@@ -35,6 +35,12 @@ pub struct EditorCommandRegistry {
|
|||||||
commands: Vec<Box<dyn EditorCommand>>,
|
commands: Vec<Box<dyn EditorCommand>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
|
pub struct EditorCommandEntry {
|
||||||
|
pub name: String,
|
||||||
|
pub label: String,
|
||||||
|
}
|
||||||
|
|
||||||
impl EditorCommandRegistry {
|
impl EditorCommandRegistry {
|
||||||
pub fn register(&mut self, command: Box<dyn EditorCommand>) {
|
pub fn register(&mut self, command: Box<dyn EditorCommand>) {
|
||||||
self.commands.push(command);
|
self.commands.push(command);
|
||||||
@@ -47,6 +53,16 @@ impl EditorCommandRegistry {
|
|||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn entries(&self) -> Vec<EditorCommandEntry> {
|
||||||
|
self.commands
|
||||||
|
.iter()
|
||||||
|
.map(|command| EditorCommandEntry {
|
||||||
|
name: command.name().to_string(),
|
||||||
|
label: command.label().to_string(),
|
||||||
|
})
|
||||||
|
.collect()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn command_state(&self, world: &World, name: &str) -> Option<(String, Option<String>)> {
|
pub fn command_state(&self, world: &World, name: &str) -> Option<(String, Option<String>)> {
|
||||||
self.commands
|
self.commands
|
||||||
.iter()
|
.iter()
|
||||||
@@ -54,17 +70,20 @@ impl EditorCommandRegistry {
|
|||||||
.map(|cmd| (cmd.label().to_string(), cmd.disabled_reason(world)))
|
.map(|cmd| (cmd.label().to_string(), cmd.disabled_reason(world)))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run(&self, world: &mut World, name: &str) -> bool {
|
pub fn run(&self, world: &mut World, name: &str) -> Option<Result<OperatorAction, String>> {
|
||||||
if let Some(command) = self.commands.iter().find(|cmd| cmd.name() == name) {
|
self.commands
|
||||||
command.execute(world);
|
.iter()
|
||||||
true
|
.find(|command| command.name() == name)
|
||||||
} else {
|
.map(|command| command.execute(world))
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Custom inspector body for level objects (game crates register via [`register_actor_inspector_section`]).
|
/// Custom inspector body for level objects (game crates register via
|
||||||
|
/// [`register_actor_inspector_section`]). Synchronous [`Self::ui`] callbacks run while
|
||||||
|
/// [`UiState`] is scoped out of `World`; implementations must not request that resource. Keep
|
||||||
|
/// extension-owned transient state in independently registered resources, use
|
||||||
|
/// [`crate::ui::request_ui_selection`] and [`crate::ui::request_editor_tab`] for host UI changes,
|
||||||
|
/// or defer other cross-panel work through extension-owned commands or events.
|
||||||
pub trait ActorInspectorSection: Send + Sync {
|
pub trait ActorInspectorSection: Send + Sync {
|
||||||
fn id(&self) -> &str;
|
fn id(&self) -> &str;
|
||||||
fn title(&self) -> &str;
|
fn title(&self) -> &str;
|
||||||
@@ -175,6 +194,10 @@ pub fn register_editor_plugin(app: &mut App, plugin: Box<dyn EditorPlugin>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn register_builtin_commands(mut registry: ResMut<EditorCommandRegistry>) {
|
fn register_builtin_commands(mut registry: ResMut<EditorCommandRegistry>) {
|
||||||
|
populate_builtin_commands(&mut registry);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn populate_builtin_commands(registry: &mut EditorCommandRegistry) {
|
||||||
registry.register(Box::new(TogglePlayCommand));
|
registry.register(Box::new(TogglePlayCommand));
|
||||||
registry.register(Box::new(TogglePlayPausedCommand));
|
registry.register(Box::new(TogglePlayPausedCommand));
|
||||||
registry.register(Box::new(TogglePossessionCommand));
|
registry.register(Box::new(TogglePossessionCommand));
|
||||||
@@ -219,7 +242,7 @@ fn dispatch_editor_command(world: &mut World, name: &str) {
|
|||||||
let name_for_commit = name.to_string();
|
let name_for_commit = name.to_string();
|
||||||
let name_for_status = name.to_string();
|
let name_for_status = name.to_string();
|
||||||
let label_for_commit = label.clone();
|
let label_for_commit = label.clone();
|
||||||
run_immediate_operator(
|
run_operator_action(
|
||||||
world,
|
world,
|
||||||
&name_for_status,
|
&name_for_status,
|
||||||
&label,
|
&label,
|
||||||
@@ -228,14 +251,10 @@ fn dispatch_editor_command(world: &mut World, name: &str) {
|
|||||||
None => OperatorAvailability::Ready,
|
None => OperatorAvailability::Ready,
|
||||||
},
|
},
|
||||||
move |world| {
|
move |world| {
|
||||||
let ran = world.resource_scope(|world, registry: Mut<EditorCommandRegistry>| {
|
let result = world.resource_scope(|world, registry: Mut<EditorCommandRegistry>| {
|
||||||
registry.run(world, &name_for_commit)
|
registry.run(world, &name_for_commit)
|
||||||
});
|
});
|
||||||
if ran {
|
result.unwrap_or_else(|| Err(format!("Unknown editor command: {name_for_commit}")))
|
||||||
Ok(())
|
|
||||||
} else {
|
|
||||||
Err(format!("Unknown editor command: {name_for_commit}"))
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -249,8 +268,13 @@ impl EditorCommand for TogglePlayCommand {
|
|||||||
"play.toggle"
|
"play.toggle"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, world: &mut World) {
|
fn label(&self) -> &str {
|
||||||
|
"Toggle Play / Edit"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String> {
|
||||||
toggle_play_mode(world);
|
toggle_play_mode(world);
|
||||||
|
Ok(OperatorAction::Commit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,8 +285,18 @@ impl EditorCommand for TogglePlayPausedCommand {
|
|||||||
"play.toggle_pause"
|
"play.toggle_pause"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, world: &mut World) {
|
fn label(&self) -> &str {
|
||||||
|
"Pause / Resume Simulation"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn disabled_reason(&self, world: &World) -> Option<String> {
|
||||||
|
(*world.resource::<State<EditorMode>>().get() != EditorMode::Playing)
|
||||||
|
.then(|| "Enter Play mode before pausing the simulation".to_string())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String> {
|
||||||
toggle_play_paused(world);
|
toggle_play_paused(world);
|
||||||
|
Ok(OperatorAction::Commit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,17 +307,22 @@ impl EditorCommand for TogglePossessionCommand {
|
|||||||
"play.toggle_possession"
|
"play.toggle_possession"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn label(&self) -> &str {
|
||||||
|
"Possess / Eject Player"
|
||||||
|
}
|
||||||
|
|
||||||
fn disabled_reason(&self, world: &World) -> Option<String> {
|
fn disabled_reason(&self, world: &World) -> Option<String> {
|
||||||
(*world.resource::<State<EditorMode>>().get() != EditorMode::Playing)
|
(*world.resource::<State<EditorMode>>().get() != EditorMode::Playing)
|
||||||
.then(|| "Enter Play mode before toggling possession".to_string())
|
.then(|| "Enter Play mode before toggling possession".to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, world: &mut World) {
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String> {
|
||||||
let next = match *world.resource::<PlayPossession>() {
|
let next = match *world.resource::<PlayPossession>() {
|
||||||
PlayPossession::Possessed => PlayPossession::Ejected,
|
PlayPossession::Possessed => PlayPossession::Ejected,
|
||||||
PlayPossession::Ejected => PlayPossession::Possessed,
|
PlayPossession::Ejected => PlayPossession::Possessed,
|
||||||
};
|
};
|
||||||
*world.resource_mut::<PlayPossession>() = next;
|
*world.resource_mut::<PlayPossession>() = next;
|
||||||
|
Ok(OperatorAction::Commit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,8 +333,13 @@ impl EditorCommand for ResetLightingCommand {
|
|||||||
"scene.reset_lighting"
|
"scene.reset_lighting"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, world: &mut World) {
|
fn label(&self) -> &str {
|
||||||
|
"Reset Scene Lighting"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String> {
|
||||||
reset_scene_lighting_to_project_defaults(world);
|
reset_scene_lighting_to_project_defaults(world);
|
||||||
|
Ok(OperatorAction::Commit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,13 +350,27 @@ impl EditorCommand for GroupSelectionCommand {
|
|||||||
"selection.group"
|
"selection.group"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, world: &mut World) {
|
fn label(&self) -> &str {
|
||||||
|
"Group Selection"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn disabled_reason(&self, world: &World) -> Option<String> {
|
||||||
|
world
|
||||||
|
.resource::<UiState>()
|
||||||
|
.selected_entities
|
||||||
|
.as_slice()
|
||||||
|
.is_empty()
|
||||||
|
.then(|| "Select at least one actor to group".to_string())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String> {
|
||||||
let selected: Vec<Entity> = world
|
let selected: Vec<Entity> = world
|
||||||
.resource::<UiState>()
|
.resource::<UiState>()
|
||||||
.selected_entities
|
.selected_entities
|
||||||
.iter()
|
.iter()
|
||||||
.collect();
|
.collect();
|
||||||
group_selection_with_history(world, &selected);
|
group_selection_with_history(world, &selected);
|
||||||
|
Ok(OperatorAction::Commit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -323,8 +381,13 @@ impl EditorCommand for FocusSelectionCommand {
|
|||||||
"selection.focus"
|
"selection.focus"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, world: &mut World) {
|
fn label(&self) -> &str {
|
||||||
|
"Focus Selection"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String> {
|
||||||
focus_editor_camera_on_selection(world);
|
focus_editor_camera_on_selection(world);
|
||||||
|
Ok(OperatorAction::Commit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,8 +398,13 @@ impl EditorCommand for ResetSelectionTransformCommand {
|
|||||||
"selection.reset_transform"
|
"selection.reset_transform"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, world: &mut World) {
|
fn label(&self) -> &str {
|
||||||
|
"Reset Selection Transform"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String> {
|
||||||
reset_selected_transforms(world);
|
reset_selected_transforms(world);
|
||||||
|
Ok(OperatorAction::Commit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,8 +424,9 @@ impl EditorCommand for DrawBrushCommand {
|
|||||||
.then(|| "Enter Edit mode before drawing brushes".to_string())
|
.then(|| "Enter Edit mode before drawing brushes".to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, world: &mut World) {
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String> {
|
||||||
start_draw_brush_tool(world);
|
start_draw_brush_tool(world);
|
||||||
|
Ok(OperatorAction::ContinuePreview)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,8 +445,9 @@ impl EditorCommand for IntersectBrushesCommand {
|
|||||||
(selected_brush_count(world) < 2).then(|| "Select at least two brushes".to_string())
|
(selected_brush_count(world) < 2).then(|| "Select at least two brushes".to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, world: &mut World) {
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String> {
|
||||||
intersect_selected_brushes(world);
|
intersect_selected_brushes(world)?;
|
||||||
|
Ok(OperatorAction::ContinuePreview)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,8 +466,9 @@ impl EditorCommand for MergeBrushesCommand {
|
|||||||
(selected_brush_count(world) < 2).then(|| "Select at least two brushes".to_string())
|
(selected_brush_count(world) < 2).then(|| "Select at least two brushes".to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, world: &mut World) {
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String> {
|
||||||
merge_selected_brushes(world);
|
merge_selected_brushes(world)?;
|
||||||
|
Ok(OperatorAction::ContinuePreview)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,8 +487,9 @@ impl EditorCommand for SubtractBrushesCommand {
|
|||||||
(selected_brush_count(world) < 2).then(|| "Select at least two brushes".to_string())
|
(selected_brush_count(world) < 2).then(|| "Select at least two brushes".to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, world: &mut World) {
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String> {
|
||||||
subtract_selected_brushes(world);
|
subtract_selected_brushes(world)?;
|
||||||
|
Ok(OperatorAction::ContinuePreview)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -428,8 +500,13 @@ impl EditorCommand for CreatePostProcessVolumeCommand {
|
|||||||
"rendering.create_volume"
|
"rendering.create_volume"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, world: &mut World) {
|
fn label(&self) -> &str {
|
||||||
|
"Create Post-process Volume"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String> {
|
||||||
crate::rendering_diagnostics::spawn_post_process_volume_at_camera(world);
|
crate::rendering_diagnostics::spawn_post_process_volume_at_camera(world);
|
||||||
|
Ok(OperatorAction::Commit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -440,9 +517,14 @@ impl EditorCommand for FocusActiveVolumesCommand {
|
|||||||
"rendering.focus_active_volumes"
|
"rendering.focus_active_volumes"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, world: &mut World) {
|
fn label(&self) -> &str {
|
||||||
|
"Focus Active Post-process Volumes"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String> {
|
||||||
crate::rendering_diagnostics::select_volumes_at_camera(world);
|
crate::rendering_diagnostics::select_volumes_at_camera(world);
|
||||||
focus_editor_camera_on_selection(world);
|
focus_editor_camera_on_selection(world);
|
||||||
|
Ok(OperatorAction::Commit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -453,8 +535,13 @@ impl EditorCommand for SelectVolumesAtCameraCommand {
|
|||||||
"rendering.select_volumes_at_camera"
|
"rendering.select_volumes_at_camera"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self, world: &mut World) {
|
fn label(&self) -> &str {
|
||||||
|
"Select Volumes at Camera"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn execute(&self, world: &mut World) -> Result<OperatorAction, String> {
|
||||||
crate::rendering_diagnostics::select_volumes_at_camera(world);
|
crate::rendering_diagnostics::select_volumes_at_camera(world);
|
||||||
|
Ok(OperatorAction::Commit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -471,6 +558,7 @@ fn command_palette_ui(
|
|||||||
|
|
||||||
if ctx.input(|input| input.modifiers.command && input.key_pressed(egui::Key::P)) {
|
if ctx.input(|input| input.modifiers.command && input.key_pressed(egui::Key::P)) {
|
||||||
palette.open = true;
|
palette.open = true;
|
||||||
|
palette.filter.clear();
|
||||||
palette.focus_filter = true;
|
palette.focus_filter = true;
|
||||||
palette.selected_index = 0;
|
palette.selected_index = 0;
|
||||||
}
|
}
|
||||||
@@ -480,19 +568,21 @@ fn command_palette_ui(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut open = palette.open;
|
let mut open = palette.open;
|
||||||
|
let mut dismiss_requested = false;
|
||||||
|
let palette_width = (ctx.content_rect().width() - 32.0).clamp(320.0, 520.0);
|
||||||
egui::Window::new("Command Palette")
|
egui::Window::new("Command Palette")
|
||||||
.open(&mut open)
|
.open(&mut open)
|
||||||
.default_width(400.0)
|
.anchor(egui::Align2::CENTER_TOP, egui::vec2(0.0, 64.0))
|
||||||
.frame(egui::Frame::window(&ctx.style()).fill(PANEL_BG))
|
.collapsible(false)
|
||||||
|
.resizable(false)
|
||||||
|
.default_width(palette_width)
|
||||||
|
.min_width(palette_width)
|
||||||
|
.max_width(palette_width)
|
||||||
|
.frame(egui::Frame::window(&ctx.global_style()).fill(PANEL_BG))
|
||||||
.show(ctx, |ui| {
|
.show(ctx, |ui| {
|
||||||
ui.label(
|
|
||||||
egui::RichText::new("Ctrl+P — filter and run commands")
|
|
||||||
.color(TEXT_DIM)
|
|
||||||
.small(),
|
|
||||||
);
|
|
||||||
let filter_response = ui.add(
|
let filter_response = ui.add(
|
||||||
egui::TextEdit::singleline(&mut palette.filter)
|
egui::TextEdit::singleline(&mut palette.filter)
|
||||||
.hint_text("Type to filter...")
|
.hint_text("Search commands...")
|
||||||
.desired_width(f32::INFINITY),
|
.desired_width(f32::INFINITY),
|
||||||
);
|
);
|
||||||
if palette.focus_filter {
|
if palette.focus_filter {
|
||||||
@@ -503,65 +593,407 @@ fn command_palette_ui(
|
|||||||
palette.selected_index = 0;
|
palette.selected_index = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
let filter = palette.filter.to_lowercase();
|
let filtered_entries = filtered_command_entries(®istry, &palette.filter);
|
||||||
let filtered_names: Vec<String> = registry
|
if !filtered_entries.is_empty() {
|
||||||
.names()
|
palette.selected_index = palette.selected_index.min(filtered_entries.len() - 1);
|
||||||
.into_iter()
|
|
||||||
.filter(|name| filter.is_empty() || name.to_lowercase().contains(&filter))
|
|
||||||
.collect();
|
|
||||||
if !filtered_names.is_empty() {
|
|
||||||
palette.selected_index = palette.selected_index.min(filtered_names.len() - 1);
|
|
||||||
} else {
|
} else {
|
||||||
palette.selected_index = 0;
|
palette.selected_index = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ui.input_mut(|input| input.consume_key(egui::Modifiers::NONE, egui::Key::ArrowDown))
|
if ui.input_mut(|input| input.consume_key(egui::Modifiers::NONE, egui::Key::ArrowDown))
|
||||||
&& !filtered_names.is_empty()
|
&& !filtered_entries.is_empty()
|
||||||
{
|
{
|
||||||
palette.selected_index = (palette.selected_index + 1) % filtered_names.len();
|
palette.selected_index = (palette.selected_index + 1) % filtered_entries.len();
|
||||||
}
|
}
|
||||||
if ui.input_mut(|input| input.consume_key(egui::Modifiers::NONE, egui::Key::ArrowUp))
|
if ui.input_mut(|input| input.consume_key(egui::Modifiers::NONE, egui::Key::ArrowUp))
|
||||||
&& !filtered_names.is_empty()
|
&& !filtered_entries.is_empty()
|
||||||
{
|
{
|
||||||
palette.selected_index = if palette.selected_index == 0 {
|
palette.selected_index = if palette.selected_index == 0 {
|
||||||
filtered_names.len() - 1
|
filtered_entries.len() - 1
|
||||||
} else {
|
} else {
|
||||||
palette.selected_index - 1
|
palette.selected_index - 1
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if ui.input_mut(|input| input.consume_key(egui::Modifiers::NONE, egui::Key::Enter)) {
|
if ui.input_mut(|input| input.consume_key(egui::Modifiers::NONE, egui::Key::Enter)) {
|
||||||
if let Some(name) = filtered_names.get(palette.selected_index) {
|
if let Some(entry) = filtered_entries.get(palette.selected_index) {
|
||||||
palette.pending_run = Some(name.clone());
|
palette.pending_run = Some(entry.name.clone());
|
||||||
palette.open = false;
|
dismiss_requested = true;
|
||||||
ui.close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ui.input_mut(|input| input.consume_key(egui::Modifiers::NONE, egui::Key::Escape)) {
|
if ui.input_mut(|input| input.consume_key(egui::Modifiers::NONE, egui::Key::Escape)) {
|
||||||
palette.open = false;
|
dismiss_requested = true;
|
||||||
ui.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.separator();
|
ui.separator();
|
||||||
egui::ScrollArea::vertical()
|
egui::ScrollArea::vertical()
|
||||||
.max_height(280.0)
|
.max_height(320.0)
|
||||||
.show(ui, |ui| {
|
.show(ui, |ui| {
|
||||||
for (index, name) in filtered_names.iter().enumerate() {
|
if filtered_entries.is_empty() {
|
||||||
|
ui.weak("No matching commands");
|
||||||
|
}
|
||||||
|
for (index, entry) in filtered_entries.iter().enumerate() {
|
||||||
let selected = index == palette.selected_index;
|
let selected = index == palette.selected_index;
|
||||||
let response =
|
let response = ui.add_sized(
|
||||||
ui.selectable_label(selected, egui::RichText::new(name).color(TEXT));
|
[ui.available_width(), 40.0],
|
||||||
|
egui::Button::selectable(selected, command_palette_row(entry)),
|
||||||
|
);
|
||||||
if selected {
|
if selected {
|
||||||
response.scroll_to_me(Some(egui::Align::Center));
|
response.scroll_to_me(Some(egui::Align::Center));
|
||||||
}
|
}
|
||||||
if response.clicked() {
|
if response.clicked() {
|
||||||
palette.selected_index = index;
|
palette.selected_index = index;
|
||||||
palette.pending_run = Some(name.clone());
|
palette.pending_run = Some(entry.name.clone());
|
||||||
palette.open = false;
|
dismiss_requested = true;
|
||||||
ui.close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
palette.open = open;
|
palette.open = resolve_palette_open(open, dismiss_requested);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn resolve_palette_open(window_open: bool, dismiss_requested: bool) -> bool {
|
||||||
|
window_open && !dismiss_requested
|
||||||
|
}
|
||||||
|
|
||||||
|
fn filtered_command_entries(
|
||||||
|
registry: &EditorCommandRegistry,
|
||||||
|
filter: &str,
|
||||||
|
) -> Vec<EditorCommandEntry> {
|
||||||
|
let filter = filter.trim().to_lowercase();
|
||||||
|
registry
|
||||||
|
.entries()
|
||||||
|
.into_iter()
|
||||||
|
.filter(|entry| {
|
||||||
|
filter.is_empty()
|
||||||
|
|| entry.name.to_lowercase().contains(&filter)
|
||||||
|
|| entry.label.to_lowercase().contains(&filter)
|
||||||
|
})
|
||||||
|
.collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn command_palette_row(entry: &EditorCommandEntry) -> egui::WidgetText {
|
||||||
|
let mut job = egui::text::LayoutJob::default();
|
||||||
|
job.append(
|
||||||
|
&entry.label,
|
||||||
|
0.0,
|
||||||
|
egui::TextFormat {
|
||||||
|
font_id: egui::FontId::new(13.0, egui::FontFamily::Proportional),
|
||||||
|
color: TEXT,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
);
|
||||||
|
job.append(
|
||||||
|
&format!("\n{}", entry.name),
|
||||||
|
0.0,
|
||||||
|
egui::TextFormat {
|
||||||
|
font_id: egui::FontId::new(11.0, egui::FontFamily::Monospace),
|
||||||
|
color: TEXT_DIM,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
);
|
||||||
|
job.into()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use crate::history::{apply_command_redo, apply_command_undo, EditorHistory};
|
||||||
|
use crate::operators::test_harness::OperatorInvariantHarness;
|
||||||
|
use crate::operators::{ActiveOperator, OperatorPhase};
|
||||||
|
use crate::scene_io::SceneIo;
|
||||||
|
use crate::selection::{SelectedEntity, ViewportClick};
|
||||||
|
use crate::viewport::brush_tool::BrushToolState;
|
||||||
|
use shared::{
|
||||||
|
ActorKind, AuthoringLightKind, BrushDesc, EditorVisibility, HierarchySiblingIndex,
|
||||||
|
LevelObject, LightDesc,
|
||||||
|
};
|
||||||
|
|
||||||
|
fn command_world() -> World {
|
||||||
|
let mut world = World::new();
|
||||||
|
world.init_resource::<ActiveOperator>();
|
||||||
|
world.init_resource::<EditorHistory>();
|
||||||
|
world.init_resource::<SceneIo>();
|
||||||
|
world.init_resource::<SelectedEntity>();
|
||||||
|
world.init_resource::<ViewportClick>();
|
||||||
|
world.init_resource::<BrushToolState>();
|
||||||
|
world.init_resource::<crate::viewport::brush_csg::BrushCsgPreview>();
|
||||||
|
world.insert_resource(State::new(EditorMode::Editing));
|
||||||
|
world.insert_resource(UiState::default_layout());
|
||||||
|
let mut registry = EditorCommandRegistry::default();
|
||||||
|
populate_builtin_commands(&mut registry);
|
||||||
|
world.insert_resource(registry);
|
||||||
|
world
|
||||||
|
}
|
||||||
|
|
||||||
|
fn hierarchy_projection(world: &mut World) -> Vec<(String, Option<String>, i32)> {
|
||||||
|
let mut query = world.query_filtered::<(Entity, &Name), With<LevelObject>>();
|
||||||
|
let mut result = query
|
||||||
|
.iter(world)
|
||||||
|
.map(|(entity, name)| {
|
||||||
|
let parent = world
|
||||||
|
.get::<ChildOf>(entity)
|
||||||
|
.and_then(|child| world.get::<Name>(child.parent()))
|
||||||
|
.map(|name| name.as_str().to_string());
|
||||||
|
let sibling_index = world
|
||||||
|
.get::<HierarchySiblingIndex>(entity)
|
||||||
|
.map(|index| index.0)
|
||||||
|
.unwrap_or_default();
|
||||||
|
(name.as_str().to_string(), parent, sibling_index)
|
||||||
|
})
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
result.sort();
|
||||||
|
result
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn command_filter_matches_human_label_and_stable_id() {
|
||||||
|
let mut registry = EditorCommandRegistry::default();
|
||||||
|
registry.register(Box::new(TogglePlayCommand));
|
||||||
|
registry.register(Box::new(ResetLightingCommand));
|
||||||
|
|
||||||
|
let by_label = filtered_command_entries(®istry, "scene lighting");
|
||||||
|
assert_eq!(by_label.len(), 1);
|
||||||
|
assert_eq!(by_label[0].name, "scene.reset_lighting");
|
||||||
|
|
||||||
|
let by_id = filtered_command_entries(®istry, "play.toggle");
|
||||||
|
assert_eq!(by_id.len(), 1);
|
||||||
|
assert_eq!(by_id[0].label, "Toggle Play / Edit");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn empty_command_filter_preserves_registration_order() {
|
||||||
|
let mut registry = EditorCommandRegistry::default();
|
||||||
|
registry.register(Box::new(TogglePlayCommand));
|
||||||
|
registry.register(Box::new(ResetLightingCommand));
|
||||||
|
|
||||||
|
let entries = filtered_command_entries(®istry, " ");
|
||||||
|
assert_eq!(entries[0].name, "play.toggle");
|
||||||
|
assert_eq!(entries[1].name, "scene.reset_lighting");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn command_palette_dismissal_wins_over_stale_window_open_state() {
|
||||||
|
assert!(!resolve_palette_open(true, true));
|
||||||
|
assert!(!resolve_palette_open(false, false));
|
||||||
|
assert!(resolve_palette_open(true, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn grouping_dispatch_is_one_history_transaction_and_round_trips() {
|
||||||
|
let mut world = command_world();
|
||||||
|
let first = world
|
||||||
|
.spawn((
|
||||||
|
Name::new("First"),
|
||||||
|
LevelObject,
|
||||||
|
ActorKind::Empty,
|
||||||
|
Transform::from_xyz(1.0, 0.0, 0.0),
|
||||||
|
GlobalTransform::default(),
|
||||||
|
HierarchySiblingIndex(0),
|
||||||
|
EditorVisibility::default(),
|
||||||
|
))
|
||||||
|
.id();
|
||||||
|
let second = world
|
||||||
|
.spawn((
|
||||||
|
Name::new("Second"),
|
||||||
|
LevelObject,
|
||||||
|
ActorKind::Empty,
|
||||||
|
Transform::from_xyz(2.0, 0.0, 0.0),
|
||||||
|
GlobalTransform::default(),
|
||||||
|
HierarchySiblingIndex(1),
|
||||||
|
EditorVisibility::default(),
|
||||||
|
))
|
||||||
|
.id();
|
||||||
|
let unselected = world
|
||||||
|
.spawn((
|
||||||
|
Name::new("Unselected"),
|
||||||
|
LevelObject,
|
||||||
|
ActorKind::Empty,
|
||||||
|
Transform::from_xyz(3.0, 0.0, 0.0),
|
||||||
|
GlobalTransform::default(),
|
||||||
|
HierarchySiblingIndex(2),
|
||||||
|
EditorVisibility::default(),
|
||||||
|
))
|
||||||
|
.id();
|
||||||
|
world
|
||||||
|
.resource_mut::<UiState>()
|
||||||
|
.selected_entities
|
||||||
|
.select_replace(first);
|
||||||
|
world
|
||||||
|
.resource_mut::<UiState>()
|
||||||
|
.selected_entities
|
||||||
|
.select_maybe_add(second, true);
|
||||||
|
let initial = hierarchy_projection(&mut world);
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
|
||||||
|
dispatch_editor_command(&mut world, "selection.group");
|
||||||
|
|
||||||
|
harness.assert_committed(&mut world, 1, 1);
|
||||||
|
harness.assert_status(&world, "selection.group", OperatorPhase::Committed);
|
||||||
|
let committed = hierarchy_projection(&mut world);
|
||||||
|
assert!(committed
|
||||||
|
.iter()
|
||||||
|
.any(|(name, parent, _)| name == "First" && parent.as_deref() == Some("Group")));
|
||||||
|
assert!(committed
|
||||||
|
.iter()
|
||||||
|
.any(|(name, parent, _)| name == "Second" && parent.as_deref() == Some("Group")));
|
||||||
|
assert_group_has_visibility_hierarchy(&mut world);
|
||||||
|
apply_command_undo(&mut world);
|
||||||
|
assert_eq!(hierarchy_projection(&mut world), initial);
|
||||||
|
apply_command_redo(&mut world);
|
||||||
|
assert_eq!(hierarchy_projection(&mut world), committed);
|
||||||
|
assert_group_has_visibility_hierarchy(&mut world);
|
||||||
|
assert!(world.get::<ChildOf>(unselected).is_none());
|
||||||
|
apply_command_undo(&mut world);
|
||||||
|
assert_eq!(hierarchy_projection(&mut world), initial);
|
||||||
|
apply_command_redo(&mut world);
|
||||||
|
assert_eq!(hierarchy_projection(&mut world), committed);
|
||||||
|
assert!(world.get::<ChildOf>(unselected).is_none());
|
||||||
|
}
|
||||||
|
|
||||||
|
fn assert_group_has_visibility_hierarchy(world: &mut World) {
|
||||||
|
let group = world
|
||||||
|
.query::<(Entity, &Name)>()
|
||||||
|
.iter(world)
|
||||||
|
.find_map(|(entity, name)| (name.as_str() == "Group").then_some(entity))
|
||||||
|
.expect("group command should spawn the group actor");
|
||||||
|
assert!(world.get::<Visibility>(group).is_some());
|
||||||
|
assert!(world.get::<InheritedVisibility>(group).is_some());
|
||||||
|
assert!(world.get::<ViewVisibility>(group).is_some());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn reset_lighting_dispatch_is_one_undoable_group() {
|
||||||
|
let mut world = command_world();
|
||||||
|
let point = world
|
||||||
|
.spawn((
|
||||||
|
LevelObject,
|
||||||
|
ActorKind::Light,
|
||||||
|
LightDesc {
|
||||||
|
kind: AuthoringLightKind::Point,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
))
|
||||||
|
.id();
|
||||||
|
let directional = world
|
||||||
|
.spawn((
|
||||||
|
LevelObject,
|
||||||
|
ActorKind::Light,
|
||||||
|
LightDesc {
|
||||||
|
kind: AuthoringLightKind::Directional,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
))
|
||||||
|
.id();
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
|
||||||
|
dispatch_editor_command(&mut world, "scene.reset_lighting");
|
||||||
|
|
||||||
|
harness.assert_committed(&mut world, 1, 0);
|
||||||
|
harness.assert_status(&world, "scene.reset_lighting", OperatorPhase::Committed);
|
||||||
|
assert!(world.get::<LightDesc>(point).is_none());
|
||||||
|
assert!(world.get::<LightDesc>(directional).is_none());
|
||||||
|
apply_command_undo(&mut world);
|
||||||
|
assert!(world.get::<LightDesc>(point).is_some());
|
||||||
|
assert!(world.get::<LightDesc>(directional).is_some());
|
||||||
|
apply_command_redo(&mut world);
|
||||||
|
assert!(world.get::<LightDesc>(point).is_none());
|
||||||
|
assert!(world.get::<LightDesc>(directional).is_none());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn modal_command_dispatch_retains_preview_ownership() {
|
||||||
|
let mut world = command_world();
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
|
||||||
|
dispatch_editor_command(&mut world, "brush.draw");
|
||||||
|
|
||||||
|
harness.assert_status(&world, "brush.draw", OperatorPhase::Preview);
|
||||||
|
harness.assert_projection_unchanged(&mut world, 0, |world| {
|
||||||
|
world.resource::<EditorHistory>().undo_depth()
|
||||||
|
});
|
||||||
|
assert!(!world.resource::<SceneIo>().dirty);
|
||||||
|
assert!(world.resource::<BrushToolState>().active);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn failed_csg_dispatch_terminates_without_preview_or_history() {
|
||||||
|
let mut world = command_world();
|
||||||
|
let first = world
|
||||||
|
.spawn((
|
||||||
|
LevelObject,
|
||||||
|
BrushDesc::cuboid(Vec3::splat(1.0)),
|
||||||
|
Transform::IDENTITY,
|
||||||
|
))
|
||||||
|
.id();
|
||||||
|
let mut invalid = BrushDesc::cuboid(Vec3::splat(1.0));
|
||||||
|
invalid.faces.clear();
|
||||||
|
let second = world
|
||||||
|
.spawn((LevelObject, invalid, Transform::IDENTITY))
|
||||||
|
.id();
|
||||||
|
world
|
||||||
|
.resource_mut::<UiState>()
|
||||||
|
.selected_entities
|
||||||
|
.select_replace(first);
|
||||||
|
world
|
||||||
|
.resource_mut::<UiState>()
|
||||||
|
.selected_entities
|
||||||
|
.select_maybe_add(second, true);
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
|
||||||
|
dispatch_editor_command(&mut world, "brush.intersect");
|
||||||
|
|
||||||
|
harness.assert_canceled(&mut world);
|
||||||
|
harness.assert_status(&world, "brush.intersect", OperatorPhase::Canceled);
|
||||||
|
assert!(!world.resource::<SceneIo>().dirty);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn csg_dispatch_blocks_read_only_selection_without_history() {
|
||||||
|
let mut world = command_world();
|
||||||
|
let first = world
|
||||||
|
.spawn((
|
||||||
|
LevelObject,
|
||||||
|
BrushDesc::cuboid(Vec3::splat(1.0)),
|
||||||
|
Transform::IDENTITY,
|
||||||
|
))
|
||||||
|
.id();
|
||||||
|
let second = world
|
||||||
|
.spawn((
|
||||||
|
LevelObject,
|
||||||
|
BrushDesc::cuboid(Vec3::splat(1.0)),
|
||||||
|
Transform::from_xyz(0.5, 0.0, 0.0),
|
||||||
|
))
|
||||||
|
.id();
|
||||||
|
let mut hierarchy = crate::ui::hierarchy_state::HierarchyPanelState::default();
|
||||||
|
hierarchy.locked.insert(second);
|
||||||
|
world.insert_resource(hierarchy);
|
||||||
|
world
|
||||||
|
.resource_mut::<UiState>()
|
||||||
|
.selected_entities
|
||||||
|
.select_replace(first);
|
||||||
|
world
|
||||||
|
.resource_mut::<UiState>()
|
||||||
|
.selected_entities
|
||||||
|
.select_maybe_add(second, true);
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
|
||||||
|
dispatch_editor_command(&mut world, "brush.merge_convex");
|
||||||
|
|
||||||
|
harness.assert_blocked(&mut world);
|
||||||
|
harness.assert_status(&world, "brush.merge_convex", OperatorPhase::Blocked);
|
||||||
|
assert!(!world.resource::<SceneIo>().dirty);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn disabled_command_dispatch_is_a_blocked_no_op() {
|
||||||
|
let mut world = command_world();
|
||||||
|
let harness = OperatorInvariantHarness::capture(&mut world);
|
||||||
|
|
||||||
|
dispatch_editor_command(&mut world, "selection.group");
|
||||||
|
|
||||||
|
harness.assert_blocked(&mut world);
|
||||||
|
harness.assert_status(&world, "selection.group", OperatorPhase::Blocked);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use shared::{
|
use shared::{
|
||||||
ActorId, ActorKind, ActorName, BrushDesc, ColliderDesc, EditorVisibility, InspectorOrder,
|
ActorId, ActorKind, ActorName, AnimationControllerDesc, AudioListenerDesc, AudioSourceDesc,
|
||||||
LightDesc, MaterialDesc, MaterialOverride, ModelRef, ObjectiveMarker, PhysicsBody,
|
AuthoringComponentStates, BrushDesc, ColliderDesc, EditorVisibility, InspectorOrder, LightDesc,
|
||||||
PostProcessVolumeDesc, PrefabInstance, PrefabRef, Primitive, RigidBodyDesc, StaticMeshRenderer,
|
MaterialDesc, MaterialOverride, ModelRef, NavigationArea, NavigationBounds, NavigationLink,
|
||||||
|
NavigationObstacle, ObjectiveMarker, PhysicsBody, PostProcessVolumeDesc, PrefabInstance,
|
||||||
|
PrefabRef, Primitive, RigidBodyDesc, SceneComposition, SkinnedMeshRenderer, StaticMeshRenderer,
|
||||||
TeamSpawn, TriggerVolume, WeaponSpawn,
|
TeamSpawn, TriggerVolume, WeaponSpawn,
|
||||||
};
|
};
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
@@ -15,12 +19,16 @@ pub struct EditorEntitySnapshot {
|
|||||||
pub primitive: Option<Primitive>,
|
pub primitive: Option<Primitive>,
|
||||||
pub brush: Option<BrushDesc>,
|
pub brush: Option<BrushDesc>,
|
||||||
pub static_mesh_renderer: Option<StaticMeshRenderer>,
|
pub static_mesh_renderer: Option<StaticMeshRenderer>,
|
||||||
|
pub skinned_mesh_renderer: Option<SkinnedMeshRenderer>,
|
||||||
pub material: Option<MaterialDesc>,
|
pub material: Option<MaterialDesc>,
|
||||||
pub material_override: Option<MaterialOverride>,
|
pub material_override: Option<MaterialOverride>,
|
||||||
pub rigid_body: Option<RigidBodyDesc>,
|
pub rigid_body: Option<RigidBodyDesc>,
|
||||||
pub collider: Option<ColliderDesc>,
|
pub collider: Option<ColliderDesc>,
|
||||||
pub physics: Option<PhysicsBody>,
|
pub physics: Option<PhysicsBody>,
|
||||||
pub light: Option<LightDesc>,
|
pub light: Option<LightDesc>,
|
||||||
|
pub animation_controller: Option<AnimationControllerDesc>,
|
||||||
|
pub audio_source: Option<AudioSourceDesc>,
|
||||||
|
pub audio_listener: Option<AudioListenerDesc>,
|
||||||
pub player_spawn: bool,
|
pub player_spawn: bool,
|
||||||
pub model: Option<ModelRef>,
|
pub model: Option<ModelRef>,
|
||||||
pub prefab: Option<PrefabRef>,
|
pub prefab: Option<PrefabRef>,
|
||||||
@@ -30,11 +38,52 @@ pub struct EditorEntitySnapshot {
|
|||||||
pub post_process_volume: Option<PostProcessVolumeDesc>,
|
pub post_process_volume: Option<PostProcessVolumeDesc>,
|
||||||
pub team_spawn: Option<TeamSpawn>,
|
pub team_spawn: Option<TeamSpawn>,
|
||||||
pub objective: Option<ObjectiveMarker>,
|
pub objective: Option<ObjectiveMarker>,
|
||||||
|
pub navigation_bounds: Option<NavigationBounds>,
|
||||||
|
pub navigation_obstacle: Option<NavigationObstacle>,
|
||||||
|
pub navigation_area: Option<NavigationArea>,
|
||||||
|
pub navigation_link: Option<NavigationLink>,
|
||||||
pub hierarchy_sibling_index: i32,
|
pub hierarchy_sibling_index: i32,
|
||||||
pub editor_visibility: EditorVisibility,
|
pub editor_visibility: EditorVisibility,
|
||||||
|
pub inspector_order: Option<InspectorOrder>,
|
||||||
|
pub component_states: Option<AuthoringComponentStates>,
|
||||||
pub children: Vec<EditorEntitySnapshot>,
|
pub children: Vec<EditorEntitySnapshot>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// One reflected component value used by registry-driven editor transactions.
|
||||||
|
/// `component_id` is stable; `type_path` is retained only to resolve Bevy's
|
||||||
|
/// reflection adapter for this build.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
|
pub struct ReflectedComponentValue {
|
||||||
|
pub component_id: String,
|
||||||
|
pub type_path: String,
|
||||||
|
pub ron: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
|
pub struct ComponentDelta {
|
||||||
|
pub component_id: String,
|
||||||
|
pub type_path: String,
|
||||||
|
pub before: Option<ReflectedComponentValue>,
|
||||||
|
pub after: Option<ReflectedComponentValue>,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// An atomic add/remove/reset/paste operation. Requirements, dependent removals,
|
||||||
|
/// and the derived ActorKind hint can be represented as additional deltas.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
|
pub struct ComponentTransaction {
|
||||||
|
pub entity: Entity,
|
||||||
|
pub label: &'static str,
|
||||||
|
pub deltas: Vec<ComponentDelta>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Default, PartialEq)]
|
||||||
|
pub struct NavigationComponentState {
|
||||||
|
pub bounds: Option<NavigationBounds>,
|
||||||
|
pub obstacle: Option<NavigationObstacle>,
|
||||||
|
pub area: Option<NavigationArea>,
|
||||||
|
pub link: Option<NavigationLink>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct SiblingChange {
|
pub struct SiblingChange {
|
||||||
pub entity: Entity,
|
pub entity: Entity,
|
||||||
@@ -42,14 +91,34 @@ pub struct SiblingChange {
|
|||||||
pub new_parent: Option<Entity>,
|
pub new_parent: Option<Entity>,
|
||||||
pub old_index: i32,
|
pub old_index: i32,
|
||||||
pub new_index: i32,
|
pub new_index: i32,
|
||||||
|
pub old_transform: Option<Transform>,
|
||||||
|
pub new_transform: Option<Transform>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
pub struct PrefabEditState {
|
||||||
|
pub instance: Option<PrefabInstance>,
|
||||||
|
pub prefab_ref: Option<PrefabRef>,
|
||||||
|
pub blocked_reason: Option<String>,
|
||||||
|
pub transform: Option<Transform>,
|
||||||
|
pub material: Option<MaterialDesc>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum EditorCommand {
|
pub enum EditorCommand {
|
||||||
|
GroupSelection {
|
||||||
|
snapshot: EditorEntitySnapshot,
|
||||||
|
group: Option<Entity>,
|
||||||
|
changes: Vec<SiblingChange>,
|
||||||
|
},
|
||||||
Spawn {
|
Spawn {
|
||||||
snapshot: EditorEntitySnapshot,
|
snapshot: EditorEntitySnapshot,
|
||||||
entity: Option<Entity>,
|
entity: Option<Entity>,
|
||||||
},
|
},
|
||||||
|
SpawnMany {
|
||||||
|
snapshots: Vec<EditorEntitySnapshot>,
|
||||||
|
entities: Vec<Entity>,
|
||||||
|
},
|
||||||
Despawn {
|
Despawn {
|
||||||
snapshot: EditorEntitySnapshot,
|
snapshot: EditorEntitySnapshot,
|
||||||
entity: Option<Entity>,
|
entity: Option<Entity>,
|
||||||
@@ -73,6 +142,11 @@ pub enum EditorCommand {
|
|||||||
old: Option<MaterialDesc>,
|
old: Option<MaterialDesc>,
|
||||||
new: MaterialDesc,
|
new: MaterialDesc,
|
||||||
},
|
},
|
||||||
|
SetMaterialGroup {
|
||||||
|
entities: Vec<Entity>,
|
||||||
|
olds: Vec<Option<MaterialDesc>>,
|
||||||
|
news: Vec<MaterialDesc>,
|
||||||
|
},
|
||||||
SetMaterialOverride {
|
SetMaterialOverride {
|
||||||
entity: Entity,
|
entity: Entity,
|
||||||
old: Option<MaterialOverride>,
|
old: Option<MaterialOverride>,
|
||||||
@@ -83,6 +157,27 @@ pub enum EditorCommand {
|
|||||||
old: Option<LightDesc>,
|
old: Option<LightDesc>,
|
||||||
new: LightDesc,
|
new: LightDesc,
|
||||||
},
|
},
|
||||||
|
SetLightGroup {
|
||||||
|
entities: Vec<Entity>,
|
||||||
|
olds: Vec<Option<LightDesc>>,
|
||||||
|
news: Vec<Option<LightDesc>>,
|
||||||
|
label: &'static str,
|
||||||
|
},
|
||||||
|
SetAnimationController {
|
||||||
|
entity: Entity,
|
||||||
|
old: Option<AnimationControllerDesc>,
|
||||||
|
new: AnimationControllerDesc,
|
||||||
|
},
|
||||||
|
SetAudioSource {
|
||||||
|
entity: Entity,
|
||||||
|
old: Option<AudioSourceDesc>,
|
||||||
|
new: AudioSourceDesc,
|
||||||
|
},
|
||||||
|
SetAudioListener {
|
||||||
|
entity: Entity,
|
||||||
|
old: Option<AudioListenerDesc>,
|
||||||
|
new: AudioListenerDesc,
|
||||||
|
},
|
||||||
SetPhysics {
|
SetPhysics {
|
||||||
entity: Entity,
|
entity: Entity,
|
||||||
old: Option<PhysicsBody>,
|
old: Option<PhysicsBody>,
|
||||||
@@ -108,6 +203,21 @@ pub enum EditorCommand {
|
|||||||
old: Option<BrushDesc>,
|
old: Option<BrushDesc>,
|
||||||
new: BrushDesc,
|
new: BrushDesc,
|
||||||
},
|
},
|
||||||
|
SetBrushTransform {
|
||||||
|
entity: Entity,
|
||||||
|
old_transform: Transform,
|
||||||
|
new_transform: Transform,
|
||||||
|
old_brush: Option<BrushDesc>,
|
||||||
|
new_brush: BrushDesc,
|
||||||
|
},
|
||||||
|
ApplyBrushCsg {
|
||||||
|
primary: Entity,
|
||||||
|
old_transform: Transform,
|
||||||
|
new_transform: Transform,
|
||||||
|
old_brush: Option<BrushDesc>,
|
||||||
|
new_brush: BrushDesc,
|
||||||
|
deleted: Vec<(EditorEntitySnapshot, Option<Entity>)>,
|
||||||
|
},
|
||||||
SetStaticMeshRenderer {
|
SetStaticMeshRenderer {
|
||||||
entity: Entity,
|
entity: Entity,
|
||||||
old: Option<StaticMeshRenderer>,
|
old: Option<StaticMeshRenderer>,
|
||||||
@@ -118,6 +228,11 @@ pub enum EditorCommand {
|
|||||||
old: Option<PostProcessVolumeDesc>,
|
old: Option<PostProcessVolumeDesc>,
|
||||||
new: PostProcessVolumeDesc,
|
new: PostProcessVolumeDesc,
|
||||||
},
|
},
|
||||||
|
SetNavigation {
|
||||||
|
entity: Entity,
|
||||||
|
old: NavigationComponentState,
|
||||||
|
new: NavigationComponentState,
|
||||||
|
},
|
||||||
SetTransformGroup {
|
SetTransformGroup {
|
||||||
entities: Vec<Entity>,
|
entities: Vec<Entity>,
|
||||||
olds: Vec<Transform>,
|
olds: Vec<Transform>,
|
||||||
@@ -146,6 +261,35 @@ pub enum EditorCommand {
|
|||||||
old: Option<InspectorOrder>,
|
old: Option<InspectorOrder>,
|
||||||
new: InspectorOrder,
|
new: InspectorOrder,
|
||||||
},
|
},
|
||||||
|
SetSceneComposition {
|
||||||
|
old: SceneComposition,
|
||||||
|
new: SceneComposition,
|
||||||
|
},
|
||||||
|
SetPrefabState {
|
||||||
|
entity: Entity,
|
||||||
|
old: PrefabEditState,
|
||||||
|
new: PrefabEditState,
|
||||||
|
},
|
||||||
|
ApplyPrefabToSource {
|
||||||
|
entity: Entity,
|
||||||
|
source_path: PathBuf,
|
||||||
|
before_source: String,
|
||||||
|
after_source: String,
|
||||||
|
old: PrefabEditState,
|
||||||
|
new: PrefabEditState,
|
||||||
|
},
|
||||||
|
UnpackPrefab {
|
||||||
|
entity: Entity,
|
||||||
|
instance: PrefabInstance,
|
||||||
|
prefab_ref: PrefabRef,
|
||||||
|
linked_actor_kind: ActorKind,
|
||||||
|
fully_local: bool,
|
||||||
|
linked_local_snapshots: Vec<EditorEntitySnapshot>,
|
||||||
|
linked_local_roots: Vec<Entity>,
|
||||||
|
unpacked_snapshots: Vec<EditorEntitySnapshot>,
|
||||||
|
unpacked_parented_to_anchor: Vec<bool>,
|
||||||
|
unpacked_roots: Vec<Entity>,
|
||||||
|
},
|
||||||
AddComponent {
|
AddComponent {
|
||||||
entity: Entity,
|
entity: Entity,
|
||||||
snapshot: EditorEntitySnapshot,
|
snapshot: EditorEntitySnapshot,
|
||||||
@@ -154,34 +298,55 @@ pub enum EditorCommand {
|
|||||||
entity: Entity,
|
entity: Entity,
|
||||||
snapshot: EditorEntitySnapshot,
|
snapshot: EditorEntitySnapshot,
|
||||||
},
|
},
|
||||||
|
ComponentTransaction(ComponentTransaction),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EditorCommand {
|
impl EditorCommand {
|
||||||
pub fn label(&self) -> &'static str {
|
pub fn label(&self) -> &'static str {
|
||||||
match self {
|
match self {
|
||||||
|
EditorCommand::GroupSelection { .. } => "Group Selection",
|
||||||
EditorCommand::Spawn { .. } => "Spawn",
|
EditorCommand::Spawn { .. } => "Spawn",
|
||||||
|
EditorCommand::SpawnMany { .. } => "Spawn Brushes",
|
||||||
EditorCommand::Despawn { .. } => "Delete",
|
EditorCommand::Despawn { .. } => "Delete",
|
||||||
EditorCommand::Duplicate { .. } => "Duplicate",
|
EditorCommand::Duplicate { .. } => "Duplicate",
|
||||||
EditorCommand::Rename { .. } => "Rename",
|
EditorCommand::Rename { .. } => "Rename",
|
||||||
EditorCommand::SetTransform { .. } => "Move",
|
EditorCommand::SetTransform { .. } => "Move",
|
||||||
EditorCommand::SetMaterial { .. } => "Set Material",
|
EditorCommand::SetMaterial { .. } => "Set Material",
|
||||||
|
EditorCommand::SetMaterialGroup { .. } => "Apply Material to Selection",
|
||||||
EditorCommand::SetMaterialOverride { .. } => "Set Material Override",
|
EditorCommand::SetMaterialOverride { .. } => "Set Material Override",
|
||||||
EditorCommand::SetLight { .. } => "Set Light",
|
EditorCommand::SetLight { .. } => "Set Light",
|
||||||
|
EditorCommand::SetLightGroup { label, .. } => label,
|
||||||
|
EditorCommand::SetAnimationController { .. } => "Set Animation Controller",
|
||||||
|
EditorCommand::SetAudioSource { .. } => "Set Audio Source",
|
||||||
|
EditorCommand::SetAudioListener { .. } => "Set Audio Listener",
|
||||||
EditorCommand::SetPhysics { .. } => "Set Physics",
|
EditorCommand::SetPhysics { .. } => "Set Physics",
|
||||||
EditorCommand::SetRigidBody { .. } => "Set Rigid Body",
|
EditorCommand::SetRigidBody { .. } => "Set Rigid Body",
|
||||||
EditorCommand::SetCollider { .. } => "Set Collider",
|
EditorCommand::SetCollider { .. } => "Set Collider",
|
||||||
EditorCommand::SetPrimitive { .. } => "Set Primitive",
|
EditorCommand::SetPrimitive { .. } => "Set Primitive",
|
||||||
EditorCommand::SetBrush { .. } => "Set Brush",
|
EditorCommand::SetBrush { .. } => "Set Brush",
|
||||||
|
EditorCommand::SetBrushTransform { .. } => "Clip Brush",
|
||||||
|
EditorCommand::ApplyBrushCsg { .. } => "Brush CSG",
|
||||||
EditorCommand::SetStaticMeshRenderer { .. } => "Set Static Mesh Renderer",
|
EditorCommand::SetStaticMeshRenderer { .. } => "Set Static Mesh Renderer",
|
||||||
EditorCommand::SetPostProcessVolume { .. } => "Set Post Process Volume",
|
EditorCommand::SetPostProcessVolume { .. } => "Set Post Process Volume",
|
||||||
|
EditorCommand::SetNavigation { .. } => "Set Navigation",
|
||||||
EditorCommand::SetTransformGroup { .. } => "Move Selection",
|
EditorCommand::SetTransformGroup { .. } => "Move Selection",
|
||||||
EditorCommand::Reparent { .. } => "Reparent",
|
EditorCommand::Reparent { .. } => "Reparent",
|
||||||
EditorCommand::SetActorKind { .. } => "Set Actor Kind",
|
EditorCommand::SetActorKind { .. } => "Set Actor Kind",
|
||||||
EditorCommand::ReorderSibling { .. } => "Reorder Hierarchy",
|
EditorCommand::ReorderSibling { .. } => "Reorder Hierarchy",
|
||||||
EditorCommand::SetEditorVisibility { .. } => "Set Visibility",
|
EditorCommand::SetEditorVisibility { .. } => "Set Visibility",
|
||||||
EditorCommand::SetInspectorOrder { .. } => "Set Component Order",
|
EditorCommand::SetInspectorOrder { .. } => "Set Component Order",
|
||||||
|
EditorCommand::SetSceneComposition { .. } => "Set Scene Composition",
|
||||||
|
EditorCommand::SetPrefabState { .. } => "Edit Prefab Instance",
|
||||||
|
EditorCommand::ApplyPrefabToSource { .. } => "Apply Prefab to Source",
|
||||||
|
EditorCommand::UnpackPrefab {
|
||||||
|
fully_local: true, ..
|
||||||
|
} => "Convert Prefab to Local",
|
||||||
|
EditorCommand::UnpackPrefab {
|
||||||
|
fully_local: false, ..
|
||||||
|
} => "Unpack Prefab Layer",
|
||||||
EditorCommand::AddComponent { .. } => "Add Component",
|
EditorCommand::AddComponent { .. } => "Add Component",
|
||||||
EditorCommand::RemoveComponent { .. } => "Remove Component",
|
EditorCommand::RemoveComponent { .. } => "Remove Component",
|
||||||
|
EditorCommand::ComponentTransaction(transaction) => transaction.label,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2444
-63
File diff suppressed because it is too large.
Load diff
Loaded 100 of 511 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user