skppy.data_structure.model_metadata¶
Model-level metadata data structures for skppy.
These classes represent non-geometric model data: rendering options, watermarks, styles, fonts, text styles, dimension styles, line styles, options manager, environment data, sun data, model view axes, and attribute dictionaries.
All classes are pure data containers (no parsing logic).
- class skppy.data_structure.model_metadata.AttributeDictionary[source]
Bases:
objectA named attribute dictionary (SUAttributeDictionary).
Modern files store these dictionaries in the
0x0209model-properties block. Each dictionary has a name and a list of typed key-value entries.- name
Dictionary name.
- Type:
str
- entries
Typed key-value entries.
- Type:
list of AttributeDictionaryEntry
- __init__(name: str = '', entries: List[AttributeDictionaryEntry] = <factory>) None
- class skppy.data_structure.model_metadata.AttributeDictionaryEntry[source]
Bases:
objectA single typed key-value entry in an attribute dictionary.
Values are stored in a type-tagged union. The
value_typefield determines which value field is valid:0 –
int_value1 –
float_value2 –
bool_value3 –
string_value4 –
nested_payload(nested TLV blob)
- key
Entry key name.
- Type:
str
- flags
Entry flags bitmask.
- Type:
int
- value_type
Type code (0 = int, 1 = float, 2 = bool, 3 = string, 4 = nested).
- Type:
int
- int_value
Integer payload (valid when
value_type == 0).- Type:
int
- float_value
Float64 payload (valid when
value_type == 1).- Type:
float
- bool_value
Boolean payload (valid when
value_type == 2).- Type:
bool
- string_value
String payload (valid when
value_type == 3).- Type:
str
- nested_payload
Nested TLV blob (valid when
value_type == 4).- Type:
bytes or None
- __init__(key: str = '', flags: int = 0, value_type: int = 0, int_value: int = 0, float_value: float = 0.0, bool_value: bool = False, string_value: str = '', nested_payload: bytes | None = None) None
- class skppy.data_structure.model_metadata.DimensionStyle[source]
Bases:
objectDimension style settings (SUDimensionStyle).
Modern files store this style in the
0x01FFblock. It controls how dimension entities are rendered.- font_ref
Reference to the font definition.
- Type:
int
- text_3d
Whether dimension text is 3-D.
- Type:
bool
- always_readable
Whether text is always readable (auto-orient).
- Type:
bool
- extension_offset
Extension line offset.
- Type:
int
- extension_overshoot
Extension line overshoot past dimension line.
- Type:
int
- line_weight
Dimension line weight.
- Type:
int
- arrow_type
Arrow type enum (0 = none, 1 = dot, 2 = closed, 3 = open).
- Type:
int
- arrow_size
Arrow size.
- Type:
int
- highlight_non_associative
Highlight non-associative dimensions.
- Type:
bool
- highlight_non_associative_color
ARGB highlight color for non-associative dims.
- Type:
int
- show_radial_diameter_prefix
Show radial/diameter prefix.
- Type:
bool
- hide_out_of_plane
Hide dimensions out of the viewing plane.
- Type:
bool
- hide_out_of_plane_value
Threshold angle for hiding (radians).
- Type:
float
- hide_small
Hide dimensions smaller than a threshold.
- Type:
bool
- hide_small_value
Small dimension threshold (inches).
- Type:
float
- color
ARGB dimension line color.
- Type:
int
- text_color
ARGB dimension text color.
- Type:
int
- text_position
Text position enum (0 = above, 1 = inline, 2 = below).
- Type:
int
- __init__(font_ref: int = 0, text_3d: bool = False, always_readable: bool = False, extension_offset: int = 0, extension_overshoot: int = 0, line_weight: int = 0, arrow_type: int = 0, arrow_size: int = 0, highlight_non_associative: bool = False, highlight_non_associative_color: int = 4278255360, show_radial_diameter_prefix: bool = False, hide_out_of_plane: bool = False, hide_out_of_plane_value: float = 0.0, hide_small: bool = False, hide_small_value: float = 0.0, color: int = 4278190080, text_color: int = 4278190080, text_position: int = 0) None
- class skppy.data_structure.model_metadata.EntityRelationship[source]
Bases:
objectA directed relationship between two entities in the same scope.
- __init__(source_id: int | None = None, target_id: int | None = None) None
- class skppy.data_structure.model_metadata.EnvironmentData[source]
Bases:
objectEnvironment data (SUEnvironment).
Modern files store this data in the
0x0210block. It contains environment presets (sky/ground settings).- selected
The currently selected environment entry.
- Type:
EnvironmentEntry or None
- entries
All available environment entries.
- Type:
list of EnvironmentEntry
- __init__(selected: EnvironmentEntry | None = None, entries: List[EnvironmentEntry] = <factory>) None
- class skppy.data_structure.model_metadata.EnvironmentEntry[source]
Bases:
objectA single environment entry.
Represents a sky/ground/environment preset.
- id
Entry ID.
- Type:
int
- name
Display name of the environment.
- Type:
str
- thumbnail_path
Path to the thumbnail image file.
- Type:
str
- image_filename
Basename of the HDR or EXR image stored with the environment.
- Type:
str
- image_data
Image bytes used when writing the environment resource.
- Type:
bytes or None
- thumbnail_data
Optional thumbnail bytes stored at
thumbnail_path.- Type:
bytes or None
- description
Human-readable environment description.
- Type:
str
- use_as_skydome
Whether the image is enabled as the model skydome.
- Type:
bool
- use_for_reflections
Whether the image is enabled for image-based reflections.
- Type:
bool
- rotation
Horizontal image rotation in degrees.
- Type:
float
- skydome_exposure
Skydome exposure multiplier.
- Type:
float
- reflection_exposure
Reflection exposure multiplier.
- Type:
float
- __init__(id: int = 0, name: str = '', thumbnail_path: str = '', image_filename: str = '', image_data: bytes | None = None, thumbnail_data: bytes | None = None, description: str = '', use_as_skydome: bool = False, use_for_reflections: bool = False, rotation: float = 0.0, skydome_exposure: float = 1.0, reflection_exposure: float = 1.0) None
- class skppy.data_structure.model_metadata.Font[source]
Bases:
objectA font definition (SUFont).
Modern files store fonts in the
0x01FDblock.- face_name
Font family name (e.g.
"Arial","Times New Roman").- Type:
str
- bold
Whether the font is bold.
- Type:
bool
- italic
Whether the font is italic.
- Type:
bool
- point_size
Font size in points.
- Type:
int
- use_world_size
If True,
world_sizeis used instead ofpoint_size.- Type:
bool
- world_size
Font size in SketchUp inches (used when
use_world_sizeis True).- Type:
float
- __init__(face_name: str = '', bold: bool = False, italic: bool = False, point_size: int = 0, use_world_size: bool = False, world_size: float = 0.0) None
- class skppy.data_structure.model_metadata.LineStyle[source]
Bases:
objectA line style definition (SULineStyle).
Modern files store these values in the
0x0208block. They define custom dash patterns and stipple styles for edges.- name
Style name.
- Type:
str
- dash_pattern
Dash pattern string (e.g.
"-.-").- Type:
str
- stipple_scale
Stipple pattern scale factor.
- Type:
float
- line_width_points
Line width in points.
- Type:
float
- color
ARGB line color.
- Type:
int
- mutability
Whether the style can be modified by the user.
- Type:
bool
- __init__(name: str = '', dash_pattern: str = '', stipple_scale: float = 1.0, line_width_points: float = 1.0, color: int = 4278190080, mutability: bool = True) None
- class skppy.data_structure.model_metadata.ModelViewAxes[source]
Bases:
objectSketch axes origin and orientation (SUAxes).
Modern files store these axes in the
0x01FCblock. They define the model-space coordinate system axes displayed in the viewport.All positions are in SketchUp inches.
- origin
Axes origin
(x, y, z)in model space (inches).- Type:
tuple of float
- x_axis
X-axis direction unit vector
(dx, dy, dz).- Type:
tuple of float
- y_axis
Y-axis direction unit vector
(dx, dy, dz).- Type:
tuple of float
- z_axis
Z-axis direction unit vector
(dx, dy, dz).- Type:
tuple of float
- flags
Display flags bitmask.
- Type:
int
- __init__(origin: Tuple[float, float, float] = (0.0, 0.0, 0.0), x_axis: Tuple[float, float, float] = (1.0, 0.0, 0.0), y_axis: Tuple[float, float, float] = (0.0, 1.0, 0.0), z_axis: Tuple[float, float, float] = (0.0, 0.0, 1.0), flags: int = 0) None
- class skppy.data_structure.model_metadata.OptionsManager[source]
Bases:
objectOptions manager (SUOptionsManager).
Modern files store this manager in the
0x0200block. It contains all options providers that store application-level settings.- providers
All options providers.
- Type:
list of OptionsProvider
- __init__(providers: List[OptionsProvider] = <factory>) None
- class skppy.data_structure.model_metadata.OptionsProvider[source]
Bases:
objectA single options provider within the options manager.
Each provider groups a set of key-value configuration options (e.g.
"UnitsOptions","PageOptions").- name
Provider name (e.g.
"UnitsOptions").- Type:
str
- keys
Key-value option pairs.
- Type:
dict of str to bool, int, float, or str
- __init__(name: str = '', keys: Dict[str, bool | int | float | str]=<factory>) None
- class skppy.data_structure.model_metadata.RenderingOptions[source]
Bases:
objectRendering and display options normalized across SKP container versions.
Modern files store these values in the
0x01FBblock; legacy files use a versionedCRenderingOptionsbody.Controls edge display, face colors, fog, sky, ground, shadows, section cuts, transparency, ambient occlusion, and many other visual settings.
All color fields are encoded as 32-bit ARGB integers (
0xAARRGGBB). Distances are in SketchUp inches.- render_mode
Render mode enum.
- Type:
int
- model_transparency
Enable model-level transparency.
- Type:
bool
- material_transparency
Enable material-level transparency.
- Type:
bool
- texture
Whether textures are displayed.
- Type:
bool
- edge_display_mode
Edge display mode.
- Type:
int
- edge_type
Edge type enum.
- Type:
int
- display_sketch_axes
Whether sketch axes are shown.
- Type:
bool
- display_text
Whether text entities are shown.
- Type:
bool
- display_dims
Whether dimension entities are shown.
- Type:
bool
- hide_construction_geometry
Hide construction geometry.
- Type:
bool
- display_color_by_layer
Color faces by their layer assignment.
- Type:
bool
- edge_color_mode
Edge color mode.
- Type:
int
- face_color_mode
Legacy face color mode enum.
- Type:
int
- display_instance_axes
Show component instance axes.
- Type:
bool
- jitter_edges
Jitter extension lines.
- Type:
bool
- line_style_edges
Use line-style edges.
- Type:
bool
- extend_lines
Extend lines past endpoints.
- Type:
bool
- line_extension
Extension length.
- Type:
int
- draw_silhouettes
Draw silhouette edges.
- Type:
bool
- silhouette_width
Silhouette edge width.
- Type:
int
- draw_depth_que
Draw depth cue.
- Type:
bool
- depth_que_width
Depth cue line width.
- Type:
int
- draw_line_ends
Draw line endpoints.
- Type:
bool
- line_end_width
Line end width.
- Type:
int
- draw_profiles_only
Draw profiles only.
- Type:
bool
- draw_back_edges
Draw back-facing edges.
- Type:
bool
- background_color
ARGB background color.
- Type:
int
- foreground_color
ARGB foreground color.
- Type:
int
- highlight_color
ARGB highlight color.
- Type:
int
- locked_color
ARGB locked-element color.
- Type:
int
- construction_color
ARGB construction geometry color.
- Type:
int
- face_front_color
ARGB front-face color.
- Type:
int
- face_back_color
ARGB back-face color.
- Type:
int
- display_watermarks
Show watermarks.
- Type:
bool
- display_fog
Show fog.
- Type:
bool
- fog_color
ARGB fog color.
- Type:
int
- fog_use_background_color
Use background color for fog.
- Type:
bool
- fog_start_dist
Fog start distance (inches).
- Type:
float
- fog_end_dist
Fog end distance (inches).
- Type:
float
- fog_hint_mode
Fog hint mode.
- Type:
int
- sky_color
ARGB sky color.
- Type:
int
- horizon_color
ARGB horizon color.
- Type:
int
- ground_color
ARGB ground color.
- Type:
int
- draw_horizon
Draw horizon line.
- Type:
bool
- draw_ground
Draw ground plane.
- Type:
bool
- draw_underground
Draw underground.
- Type:
bool
- ground_transparency
Ground plane transparency.
- Type:
int
- inactive_fade
Fade factor for inactive entities.
- Type:
float
- instance_fade
Fade factor for instances.
- Type:
float
- inactive_hidden
Hide inactive entities.
- Type:
bool
- instance_hidden
Hide instances.
- Type:
bool
- section_active_color
ARGB active section cut color.
- Type:
int
- section_inactive_color
ARGB inactive section color.
- Type:
int
- section_default_cut_color
ARGB default cut color.
- Type:
int
- section_default_fill_color
ARGB default fill color.
- Type:
int
- section_cut_width
Section cut line width.
- Type:
int
- section_display_mode
Section display bitmask. Bit 0 controls section planes and bit 1 controls section cuts.
- Type:
int
- display_section_planes
Whether section planes are displayed.
- Type:
bool
- display_section_cuts
Whether section cuts are displayed.
- Type:
bool
- section_cut_filled
Whether section cuts are filled.
- Type:
bool
- transparency_sort
Transparency sort order.
- Type:
int
- xray_opacity
X-ray mode opacity.
- Type:
float
- draw_soft_edges
Whether edges marked soft are hidden.
- Type:
bool
- soft_edge_limit
Angular soft-edge limit in radians.
- Type:
float
- draw_smooth_edges
Whether edges marked smooth affect displayed normals.
- Type:
bool
- photomatch_draw_background
Draw photomatch background.
- Type:
bool
- photomatch_background_opacity
Photomatch background opacity.
- Type:
float
- photomatch_draw_overlay
Draw photomatch overlay.
- Type:
bool
- photomatch_overlay_opacity
Photomatch overlay opacity.
- Type:
float
- draw_hidden_geometry
Draw hidden geometry.
- Type:
bool
- draw_hidden_objects
Draw hidden objects.
- Type:
bool
- hide_custom_control_points
Hide custom control points.
- Type:
bool
- ambient_occlusion
Enable ambient occlusion.
- Type:
bool
- ao_distance
AO sampling distance.
- Type:
int
- ao_intensity
AO intensity.
- Type:
int
- ao_multiplier
AO multiplier.
- Type:
int
- ao_color
ARGB AO color.
- Type:
int
- ao_color_enabled
Whether AO color is enabled.
- Type:
bool
- __init__(render_mode: int = 0, model_transparency: bool = False, material_transparency: bool = False, texture: bool = True, edge_display_mode: int = 0, edge_type: int = 0, display_sketch_axes: bool = False, display_text: bool = True, display_dims: bool = True, hide_construction_geometry: bool = False, display_color_by_layer: bool = False, edge_color_mode: int = 0, face_color_mode: int = 0, display_instance_axes: bool = False, jitter_edges: bool = False, line_style_edges: bool = False, extend_lines: bool = False, line_extension: int = 0, draw_silhouettes: bool = False, silhouette_width: int = 0, draw_depth_que: bool = False, depth_que_width: int = 0, draw_line_ends: bool = False, line_end_width: int = 0, draw_profiles_only: bool = False, draw_back_edges: bool = False, background_color: int = 4294967295, foreground_color: int = 4278190080, highlight_color: int = 4278255360, locked_color: int = 4286611584, construction_color: int = 4286611584, face_front_color: int = 4294967295, face_back_color: int = 4291611852, display_watermarks: bool = False, display_fog: bool = False, fog_color: int = 4291611852, fog_use_background_color: bool = False, fog_start_dist: float = 0.0, fog_end_dist: float = 0.0, fog_hint_mode: int = 0, sky_color: int = 4287090411, horizon_color: int = 4290828520, ground_color: int = 4287317267, draw_horizon: bool = False, draw_ground: bool = False, draw_underground: bool = False, ground_transparency: int = 0, inactive_fade: float = 0.0, instance_fade: float = 0.0, inactive_hidden: bool = False, instance_hidden: bool = False, section_active_color: int = 4278190080, section_inactive_color: int = 4286611584, section_default_cut_color: int = 4278190080, section_default_fill_color: int = 0, section_cut_width: int = 0, section_display_mode: int = 0, section_cut_filled: bool = False, transparency_sort: int = 0, xray_opacity: float = 0.0, draw_soft_edges: bool = False, soft_edge_limit: float = 0.0, draw_smooth_edges: bool = False, photomatch_draw_background: bool = False, photomatch_background_opacity: float = 0.0, photomatch_draw_overlay: bool = False, photomatch_overlay_opacity: float = 0.0, draw_hidden_geometry: bool = False, draw_hidden_objects: bool = False, hide_custom_control_points: bool = False, ambient_occlusion: bool = False, ao_distance: int = 0, ao_intensity: int = 0, ao_multiplier: int = 0, ao_color: int = 4294967295, ao_color_enabled: bool = False) None
- property display_section_cuts: bool
Return whether section cuts are displayed.
- property display_section_planes: bool
Return whether section planes are displayed.
- class skppy.data_structure.model_metadata.StyleDescriptor[source]
Bases:
objectA single style descriptor within the styles registry.
Each style references a .style file and optionally a set of watermark references.
- guid
16-byte GUID blob identifying the style.
- Type:
bytes
- display_name
Human-readable style name.
- Type:
str
- file_name
Path to the .style file on disk.
- Type:
str
- watermark_reference_ids
IDs of watermarks associated with this style.
- Type:
list of int
- xml_data
Optional complete style XML resource used by the writer.
- Type:
bytes or None
- __init__(guid: bytes = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', display_name: str = '', file_name: str = '', watermark_reference_ids: List[int] = <factory>, xml_data: bytes | None = None) None
- class skppy.data_structure.model_metadata.StylesRegistry[source]
Bases:
objectStyles registry (SUStyles).
Modern files store this registry in the
0x0206block. It contains all styles available in the model and a reference to the active style.- styles
All style descriptors.
- Type:
list of StyleDescriptor
- active_style_ref
Reference ID of the currently active style.
- Type:
int
- inline_style_override
Inline style override, if any.
- Type:
StyleDescriptor or None
- selected_style_dirty
Whether the selected style has unsaved changes.
- Type:
bool
- __init__(styles: List[StyleDescriptor] = <factory>, active_style_ref: int = 0, inline_style_override: StyleDescriptor | None = None, selected_style_dirty: bool = False) None
- class skppy.data_structure.model_metadata.SunData[source]
Bases:
objectSun data (SUSunData).
Modern files store this data in the
0x0213block. The internal format is not yet fully mapped; the raw TLV payload is preserved for inspection.- raw_payload
Raw TLV payload bytes of the sun data record.
- Type:
bytes or None
- __init__(raw_payload: bytes | None = None) None
- class skppy.data_structure.model_metadata.TextStyle[source]
Bases:
objectText style settings (SUTextStyle).
Modern files store this style in the
0x01FEblock. It controls how text entities are rendered (font, color, leader behavior, etc.).- font_ref
Reference to the font definition.
- Type:
int
- screen_font_ref
Reference to the screen-space font.
- Type:
int
- arrow_type
Arrow type enum (0 = none, 1 = dot, 2 = closed, 3 = open).
- Type:
int
- line_weight
Line weight for leaders.
- Type:
int
- hide_out_of_plane
Hide text that is out of the viewing plane.
- Type:
bool
- leader_type
Leader type enum (0 = none, 1 = view-based, 2 = pushpin).
- Type:
int
- display_leader
Whether leaders are displayed.
- Type:
bool
- color
ARGB text color.
- Type:
int
- screen_color
ARGB screen-space text color.
- Type:
int
- __init__(font_ref: int = 0, screen_font_ref: int = 0, arrow_type: int = 0, line_weight: int = 0, hide_out_of_plane: bool = False, leader_type: int = 0, display_leader: bool = True, color: int = 4278190080, screen_color: int = 4278190080) None
- class skppy.data_structure.model_metadata.Watermark[source]
Bases:
objectA single watermark definition (SUWatermark).
Watermarks are overlay images displayed on the model viewport.
- name
Watermark display name.
- Type:
str
- image_data
Raw image data (PNG/JPEG bytes), or None if not loaded.
- Type:
bytes or None
- opacity
Opacity from 0.0 (fully transparent) to 1.0 (fully opaque).
- Type:
float
- position
Position enum (0 = center, 1 = top-left, 2 = top-right, 3 = bottom-left, 4 = bottom-right, 5 = tile).
- Type:
int
- id
Persistent entity ID when decoded from a modern file.
- Type:
int
- __init__(name: str = '', image_data: bytes | None = None, opacity: float = 1.0, position: int = 0, id: int = 0) None
- class skppy.data_structure.model_metadata.WatermarkManager[source]
Bases:
objectWatermark manager storing all watermarks (SUWatermarkManager).
Modern files store this manager in the
0x0203block.- watermarks
All watermark definitions in the model.
- Type:
list of Watermark
- serialized_count
Serialized watermark count from the file.
- Type:
int
- __init__(watermarks: List[Watermark] = <factory>, serialized_count: int = 0) None