Skip to content

v0.5.0

Latest

Choose a tag to compare

@github-actions github-actions released this 26 Nov 08:21
· 129 commits to main since this release

Pite v0.5.0

Project-local Python plugins (Plugin System v1), workspace trust & safe mode, an interactive visual .ptatlas editor, instanced 2D sprite batching with z_index & modulate, content-hashed assets.pite.toml, standalone pite-stubs on PyPI, and a unified CLI/JSON output layer.


Breaking Changes & Migration Guide ⚠️

1. Atlas Sidecars Switched from .atlas.json to .ptatlas

Sprite-sheet atlas sidecars now use strict TOML (format_version = 1) with the .ptatlas extension.

  • Migration: Run pite check --reimport-assets in your project root to automatically convert legacy .atlas.json files to .ptatlas, rewrite references in .ptscn, .ptmap, and .py, and remove legacy files.

2. pite-export Library API (Progress Sink)

I/O-facing functions in pite_export (export_project, ensure_archive, verify, stage, download_and_extract_player, ensure_player_binary) now take &mut dyn pite_export::Progress instead of printing raw eprintln! lines.

  • Migration: Pass an implementation of pite_export::Progress, or pass &mut () for silent execution:
    // Before
    pite_export::export_project(&opts)?;
    
    // After
    pite_export::export_project(&opts, &mut ())?;

3. Unified CLI --json Envelope & stderr Human Output

All pite commands now share one --json envelope ({ schema_version, command, ok, data?, error? }, starting at schema_version: 1; previously pite check --json emitted schema_version: 3). Human progress, cards, and tables now write to stderr so stdout carries only JSON payloads and requested data.


Highlights 🔥

Plugin System (v1)

Extend both the runtime and editor with project-local Python plugins under res://plugins/<id>/:

  • Manifests & CLI Management: Configure [plugins] in pite.toml and manage plugins with pite plugin new|add|enable|disable|remove|list (local paths, git URLs with --rev, and .zip archives; added disabled by default).
  • Dynamic SchemaRegistry: Replaced static engine node tables in pite-core with a dynamic SchemaRegistry supporting plugin-contributed node types ([[nodes]]), typed properties ([[nodes.props]]), signals ([[nodes.signals]]), and custom [props].
  • Runtime PluginHost & Canvas2D _draw: Access plugins via pite.plugin("<id>") and pite.autoload("<Name>"), hook on_scene_loaded and post-node _process/_physics_process, auto-bind plugin node classes with live PluginPropDescriptors, and draw custom 2D geometry in _draw(self, canvas: pite.Canvas2D) (draw_rect, draw_line, draw_text, draw_sprite).
  • Editor Bridge & Tooling: Trust-gated EditorPluginHost in pite-editor (EditorUI / EditorContext, bottom panel tabs alongside Console, Inspector sections, Plugins menu, viewport overlay/pointer hooks, and Pyright extraPaths), plus validation in pite check and runtime-only staging in pite export.

Workspace Trust & Safe Mode

Opening an untrusted workspace in pite edit enters Safe Mode: the scene tree, inspector, code editor, and viewport render normally without importing or executing Python scripts or .py hot reloads.

  • Trust Gate: Top Safe Mode banner (Trust Workspace) and Play (F5 / Ctrl+R) confirmation modal (Trust & Play / Stay in Safe Mode).
  • External Trust Store: Trusted paths are stored outside repositories in <config_dir>/pite/trusted_workspaces.toml; pite new automatically trusts newly created projects.

Visual Atlas Creator & Inspector Editor

Author and edit .ptatlas sprite sheets directly inside the Inspector (Edit Atlas…, Create Atlas (.ptatlas)… on PNGs, or double-clicking a .ptatlas file in Assets):

  • Interactive Canvas: Zoom/pan, drag-to-create/move/resize frame boxes, frame filtering and renaming.
  • Grid Slicer: Slice by tile size or column/row counts with offset, spacing, and transparent-tile skipping.
  • Animation Sequences: Frame-range selection, FPS and loop controls, live playback preview, and automatic viewport texture/atlas invalidation on save.

2D Rendering Layering, Tinting, and Instanced Batching

  • z_index & modulate: Added z_index draw ordering on Node2D (inherited by 2D, UI, and physics nodes) and modulate RGBA tinting on Sprite2D and AnimatedSprite2D.
  • Instanced GPU Pipeline: Upgraded Renderer2D / WgpuRenderer to instanced quad rendering with persistent GPU buffers, 64-bit depth sort keys, texture slot handles, and texture-grouped batching within z_index layers.
  • TileMap2D Chunk Baking: Added baked 16×16 static chunks and pre-resolved atlas UV rects for TileMap2D.

Asset Manifest Completion (assets.pite.toml) & pite-stubs

  • Content-Hashed Asset Tracking: Removed legacy opaque UIDs in favor of assets.pite.toml (committed to git), automatically reconciled by pite new / pite edit and checked by pite check.
  • Standalone Type Stubs (pite-stubs): Added the lockstep pite-stubs PyPI distribution generated from NODE_SCHEMAS for import pite autocompletion in external editors.

Unified CLI Output Layer & Structured JSON

  • Every pite command shares one output context, accepts --color <auto|always|never>, --json, -v/--verbose, and -q/--quiet before or after subcommands, and renders consistent Error: / Warning: / Success: cards, aligned tables, and full-width summary bars.

Changes Overview 📜

• Plugin System v1: plugin.toml manifests, pite plugin CLI, SchemaRegistry, PluginHost, Canvas2D._draw, EditorPluginHost, pite check validation, and pite export runtime-only staging.
• Workspace Trust & Safe Mode: Safe Mode in pite edit, external trusted_workspaces.toml, Play confirmation modal, and auto-trust on pite new.
• Visual Atlas Creator: Interactive .ptatlas frame editor, grid slicer, and animation previewer in pite-editor.
• .ptatlas Migration: Strict TOML atlas sidecars (format_version = 1) with automatic migration via pite check --reimport-assets.
• 2D Rendering Upgrade: Node2D.z_index, Sprite2D/AnimatedSprite2D modulate, instanced quad batching in WgpuRenderer, and 16×16 baked TileMap2D chunks.
• assets.pite.toml: Content-hashed project asset tracking replacing legacy UIDs.
• pite-stubs: Lockstep PyPI stub package generated from NODE_SCHEMAS.
• Unified CLI & JSON: Shared output layer, stderr human output / stdout JSON, typed Finding values in pite check, and pite_export::Progress sink.
• Security & Workflow: Sandboxed res:// path resolution, bounded recursive scene-cache/instance expansion, pre-commit hooks, and workspace Clippy enforcement in CI.


Download ⬇️

• pite-v0.5.0-linux.tar.gz / pite-v0.5.0-windows.zip / pite-v0.5.0-macos.tar.gz: engine + player binaries (any machine exports for all supported platforms), verified by SHA256SUMS.
• pite-player-v0.5.0-<platform>: standalone player binaries for lightweight deployments and export toolchains.
• Crates & Stubs: cargo install pite / pip install pite-stubs
• Install scripts: install.sh (Linux/macOS) / install.ps1 (Windows) from the repo root.

Full Changelog: v0.4.0...v0.5.0