Skip to main content

My Virtual Rig (MVR) library for Python

Project description

python-mvr

Python library for MVR (My Virtual Rig). MVR is part of GDTF (General Device Type Format)

MVR specification as per https://gdtf.eu/mvr/prologue/introduction/

See source code for documentation. Naming conventions, in general, are identical to that on the GDTF, CamelCase is replaced with underscore_delimiters.

Source code

PyPi page

Pytest

Check links in markdown

Installation

pip install pymvr

To install latest version from git via pip:

python -m pip install https://codeload.github.com/open-stage/python-mvr/zip/refs/heads/master

Usage

Reading

import pymvr
mvr_scene = pymvr.GeneralSceneDescription("mvr_file.mvr")

for layer_index, layer in enumerate(mvr_scene.layers):
    ... #process data

Writing

fixtures_list = []
mvr = pymvr.GeneralSceneDescriptionWriter()
pymvr.UserData().to_xml(parent=mvr.xml_root)
scene = pymvr.SceneElement().to_xml(parent=mvr.xml_root)
layers = pymvr.LayersElement().to_xml(parent=scene)
layer = pymvr.Layer(name="Test layer").to_xml(parent=layers)
child_list = pymvr.ChildList().to_xml(parent=layer)

fixture = pymvr.Fixture(name="Test Fixture")  # not really a valid fixture
child_list.append(fixture.to_xml())
fixtures_list.append((fixture.gdtf_spec, fixture.gdtf_spec))

pymvr.AUXData().to_xml(parent=scene)

mvr.files_list = list(set(fixtures_list))
mvr.write_mvr("example.mvr")

See BlenderDMX and tests for reference implementation.

Status

  • Reading:

    • Address
    • Alignment
    • AUXData
    • ChildList
    • Class
    • Connection
    • CustomCommand
    • Data
    • Fixture
    • FocusPoint
    • Geometries
    • Geometry3D
    • Gobo
    • GroupObject
    • Layer
    • Mapping
    • Overwrite
    • Position
    • Projector
    • Protocol
    • SceneObject
    • Sources
    • Support
    • Symbol
    • Symdef
    • Truss
    • UserData
    • VideoScreen
  • Writing:

    • Fixture
    • Focus point
    • creating MVR zip file

Development

PRs appreciated. You can use uv to get the project setup by running:

uv sync

Typing

  • We try to type the main library, at this point, the --no-strict-optional is needed for mypy tests to pass:
mypy pymvr/*py  --pretty  --no-strict-optional

Format

Testing

  • to test, use pytest
pytest
  • to test typing with mypy use:
pytest --mypy -m mypy pymvr/*py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymvr-0.5.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file pymvr-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pymvr-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for pymvr-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b179b40bf60adc8d22563714f5b55b98d65539561f6c12971e1ae7defc64bbce
MD5 56a20b11075572ce0bdf0fd67cba7614
BLAKE2b-256 33c90b56cf99a76c032f29f9b7aacee2ecb3c559dfd5f82abf346c9918864988

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page