Skip to content

Lights: Slice G — Scene round-trip (save/load lights with project & glTF) #489

@fernandotonon

Description

@fernandotonon

Parent epic: #482
Depends on: Slice C, Slice F

Goal

Lights survive save → load through the project file and through glTF scene export, so a fully-lit scene is portable.

Scope

  • Project file: extend the existing scene serializer to write a lights: block with type, transform, colour, intensity, range, attenuation, cone, shadow settings, enabled flag, rig group name.
  • Load path recreates lights via LightManager::createLight so the existing signals fire correctly (inspector and outliner update).
  • glTF export (MeshImporterExporter::sceneExporter): write lights using KHR_lights_punctual. Map QtMeshEditor's intensity model onto glTF's lumens/lux convention (document the mapping).
  • glTF import: read KHR_lights_punctual and reconstruct lights through LightManager.
  • FBX export: FBX has its own (different) light model — write lights with best-effort property mapping. Document the lossy fields.
  • FBX import: read FBX lights into LightManager.
  • Backwards-compat: project files without a lights: block load with the legacy single-key default. Bumping the project file format minor version is acceptable; major version is not.
  • Rig metadata: when a rig is applied (Epic: Lights — Scene lighting management #482-E), persist the rig name and a "preserve rig grouping" flag so re-load doesn't scatter the lights into the flat outliner.

Acceptance Criteria

  • Save → close → load preserves every light property bit-exactly.
  • glTF round-trip: export a 6-light scene to .gltf, re-import, all lights present with correct types and properties (within glTF's representable precision).
  • FBX round-trip works for the properties FBX supports; documented limitations for the rest.
  • Old project files without lights still open (legacy single-key default kicks in).
  • Rig groupings persist through save/load.
  • CLI: qtmesh info scene.gltf --json lists lights with their properties.
  • Unit tests cover save/load and at least the glTF round-trip on a fixture scene.

Effort

~6 days.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlightingScene lighting: add/edit/manage lights, shadows, IES

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions