Skip to main content

objectionengine2

objectionengine2 converts comment chains and scripted dialogue into Ace Attorney style videos. It is an independent continuation of Objection Engine, originally created by Luis Mayo Valbuena. The original copyright and MIT license are preserved in LICENSE.

The distribution, repository, and Python import are all named objectionengine2. Update existing objection_engine imports when migrating scripts.

Requirements

  • Python 3.10 through 3.14
  • FFmpeg and ffprobe on PATH
  • The Objection Engine asset pack. The renderer downloads it on first use into the user cache directory selected by platformdirs for objectionengine2. An existing complete ./assets/ pack is copied there on first use.

Install

From a clone, sync the locked environment with uv:

uv sync --python 3.14 --locked

The package supports Python 3.10–3.14; .python-version selects 3.14 by default. To enable Hugging Face sentiment, add --extra sentiment to the run command, for example uv run --locked --extra sentiment python examples/example_easy.py. This downloads a model on first use into the same user cache under models/. The base installation does not need a model. Find the cache location with uv run python -c 'from objectionengine2.cache import cache_path; print(cache_path())'.

Render comments

from objectionengine2.beans.comment import Comment
from objectionengine2.renderer import render_comment_list

comments = [
    Comment(user_name="Phoenix", text_content="The defense is ready."),
    Comment(user_name="Edgeworth", text_content="The prosecution is ready."),
]
render_comment_list(comments, output_filename="outputs/output.mp4")

Run uv run python examples/example_easy.py from the repository root for a complete example. Additional scene, XML, and casting examples are in examples/; reference documentation is in docs/. Pass an output_filename in an existing directory. Scripts with literal assets/... paths still need a local asset directory; generated comment dialogue uses the user cache.

Sentiment settings

By default, dialogue uses neutral sentiment and needs no machine learning dependency. Explicit Comment(score=...) values still select positive or negative sprites. Set oe_sentiment_model=hf after installing the sentiment extra to use the Hugging Face model. Setting oe_bypass_sentiment to a nonempty value forces neutral sentiment. The former Polyglot mode is no longer supported; an unsupported oe_sentiment_model value raises a clear error.

Set OE_DIRECT_H264_ENCODING=true only if your OpenCV build provides an H.264 encoder. The default path encodes the intermediate video with OpenCV and creates the final H.264/AAC MP4 with FFmpeg.

Container (Podman)

The Docker image uses Python 3.14 and includes FFmpeg. Build and run the included example from the repository root:

podman build -t objectionengine2 .
podman volume create objectionengine2-cache
podman run --rm \
  --mount type=volume,src=objectionengine2-cache,dst=/root/.cache/objectionengine2 \
  --mount type=bind,src="$(pwd)/outputs",dst=/app/outputs \
  objectionengine2

The result is outputs/output.mp4. Ensure outputs/ exists before running; the image saves downloaded assets and models in the mounted cache volume. To run your own script, mount it at /app/render.py and add render.py after the image name. Have the script write into outputs/.

Tests

uv sync --locked installs the default dev group, including pytest. Run uv run --locked pytest -q for offline tests. They generate their own small media inputs and require FFmpeg and ffprobe but do not download assets or models.

For a complete courtroom smoke test, run uv run --locked pytest -q -m asset_integration. The test calls ensure_assets_are_available() from objectionengine2.utils first, which populates the platform cache if needed. Keep that cache to avoid downloading the pack again.

Contributing

Changes and fixes are welcome. Please run the offline suite before opening a pull request.

Metadata

Release files for objectionengine2 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for objectionengine2 1.0.1
File Size Uploaded Provenance Actions
objectionengine2-1.0.1.tar.gz 35.4 kB With provenance Details for objectionengine2-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for objectionengine2 1.0.1
File Interpreter ABI Platform Actions
objectionengine2-1.0.1-py3-none-any.whl Python 3 none any Details for objectionengine2-1.0.1-py3-none-any.whl

Total release size: 77.9 kB

Release files / objectionengine2-1.0.1.tar.gz

Download URL objectionengine2-1.0.1.tar.gz
Size 35.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d621b2f17b70fc464a03d14425418a5bdd0ca3016aebbee1ecbbf151ae0c7599
BLAKE2b-256 checksum
How to use checksums
0a4806a0e331d2743089421abd73e7f7fc49b1892dbb30b57d99d710477e5d36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / objectionengine2-1.0.1-py3-none-any.whl

Download URL objectionengine2-1.0.1-py3-none-any.whl
Size 42.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52b0c10e0c92c348937780a782be3b38919abaa8dba8e5e4c194b7e22bd5adba
BLAKE2b-256 checksum
How to use checksums
8ec27dfee5266c889befc2bf47885d0bc7e6480c97e8725cf5913fc537519103
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for objectionengine2 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for objectionengine2-1.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page