Skip to content

Parts of an SO

i want to be able to select and mutate children of an SO

remaining tasks

done

  • rename Trivial -> Setup
  • Multiple SO (named)
  • Add name input field to details
    • sync it to selected SO
  • store current SO name in localStorage
  • ability to add another SO, as a child to the active SO
  • rename active -> root
  • add a store and preference for the selected SO and its selected face
  • put its name in the Name input field
  • to each rendered SO add its name to each front-facing face (small font, gray color)
  • add a row of buttons in details, one for each SO, click -> selects forward face of that SO
  • remove input for name of SO from d selected part
    • allow editing of name in hierarchy (parts) list
      • single click selects that part
      • second click edits the name of that part
  • convert button in header -> colspan above last three columns
  • move constants -> attributes below table
  • remove empty button
  • right side header button -> hide/show parts
  • move segmented control up -> center of duplicates row
  • constants:
    • add a header with a single button spanning all columns
      • hide constants <-> show constants
    • plus button -> far right, separate button
  • position/size -> replace fractions (decimals) with faint "+"
  • parts table: new column after name
    • open eye unicode / dash
      • like photoshop
      • on each row containing an SO that has children
    • remove (replaces) hidden/visible button
  • add 3 segment control
    • new D_Repeater.svelte
    • content view below -> just that d_ component
    • default -> attr
    • persist user's choice
    • remove banners for rotation, attributes
  • move [un]repeat button
  • ability to collapse parts
    • not a new column
    • only a triangle pointing right (collapsed) down (children revealed)
    • only for SO that have children
    • when parts table is visible, user hits an arrow key
      • assure that the selected SO is visible
      • by uncollapsing parent if it is collapsed
      • left arrow collapses selected SO (or its parent if it is a leaf)
      • right arrow uncollapses and selects first child
  • gap at right end of parts toggle and at beginning of pos/size toggle
    • do not widen the eye visibility column
  • "root has no angles" -> d_selected_part for angles in segmented control
  • when nothing is selected, remove the sep div below the parts list
  • parts: position/size button -> convert into a colspan th above last three cols
  • move lines 244 through 254 from d parts -> p attributes
  • add eye/hyphen to leaf SO's as well

Tasks

1. Active SO store

  • Name the single SO "A"
  • Add w_active_so writable to Setup.ts (alongside w_scale)
  • Set it during init() after creating the SO

2. Wire Details panel

  • Subscribe to w_active_so in Details.svelte
  • Show SO name in editable text input
  • On change, update so.name and call scenes.save()

3. Multi-SO loading

  • Load all saved.smart_objects in init() (not just [0])
  • Create an O_Scene for each, register with hits_3d
  • First loaded (or only) SO becomes active

4. Persist active selection

  • Add active_name to Saved_Scene in Scenes.ts
  • Save active SO name on switch
  • Restore active selection on load

5. Add child SO to active SO

  • Setup.tsadd_child_so(): create SO + O_Scene with parent = active scene, register, set active, save
  • Scenes.ts — serialize parent_name per SO, restore parent refs on load
  • Details.svelte — "add child" button, wired to add_child_so()

Files

FileChange
src/lib/ts/render/Setup.tsw_active_so store, multi-SO loading, add_child_so()
src/lib/svelte/main/Details.sveltename input, wired to store, add child button
src/lib/ts/managers/Scenes.tsactive_name field in Saved_Scene, parent_name serialization