skppy.parser.scenes_parser

Parser for the scenes block (TlvTag.SCENES_BLOCK = 0x0207) of model.dat.

SketchUp scenes (named pages) store camera positions, layer visibility, rendering settings, and other view-state data.

Internal hierarchy:

0x0207 (scenes_block)
  -> 0x6D60 (scenes_container)
    -> 0x6D61 (scenes_list)
      -> 0x7148 (scene_record) [repeated]
        -> 0x6F54 (scene_base_record)
          -> 0x05DC (id_wrapper) -> 0x05DE (id_value)
          -> 0x6F55 (scene_name)
          -> 0x6F56 (scene_description)
        -> 0x7149 (scene_flags_u32)
        -> 0x714A (scene_camera_snapshot) -> 0x34BC (camera_record)
        -> 0x714B (scene_hidden_entities_ref_ids)
        -> 0x714C (scene_style_ref)
        -> 0x7150 (scene_hidden_layers_ref_ids)
        -> 0x7151 (scene_active_section_planes_ref_ids)
        -> 0x7152 (scene_show_in_slideshow)
        -> 0x7156 (scene_background_image_ref)

Entry point:

from skppy.parser.scenes_parser import parse_scenes
skppy.parser.scenes_parser.parse_scenes(scenes_block_payload: bytes) List[Scene][source]

Parse the TlvTag.SCENES_BLOCK (0x0207) payload and return a list of Scene.

The parser follows the correct tag hierarchy: 0x0207 -> 0x6D60 -> 0x6D61 -> repeated 0x7148.

Each scene record is parsed for persistent ID, name, description, flags, camera, hidden entity/layer IDs, active section plane IDs, slideshow flag, style reference, and background image reference. The full raw payload of every record is stored in Scene.raw_payload so that future parsers can extract additional fields without needing to re-read the file.

Parameters:

scenes_block_payload – Raw bytes of the 0x0207 scenes-block record payload.

Returns:

One entry per named scene, in the order they appear in the file.

Return type:

list[Scene]