Skip to main content

scenemerge

File injection tool to allow reuse of ConstraintSet/KeyFrameSet/etc definitions in multiple MotionScenes.

Installation

pip install motionscene-merger

or

git clone https://github.com/motionscene-merger
python setup.py install

Then run with:

scenemerge .

Creating merge instructions

In your Android project res/xml directory:

  • Create a MotionScene file with content that you want to inject into some other file. The filename must start with _ e.g. res/xml/_my_injectable_motionscene.xml
  • Create a template for your parent MotionScene. Again, the filename must start with _ e.g. res/xml/_my_parent_motionscene.xml
    • add a line in this file with <inject src="source_filename"/> e.g:

          <?xml version="1.0" encoding="utf-8"?>
          <MotionScene
              xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:motion="http://schemas.android.com/apk/res-auto">
      
              <!-- Any other content here -->
      
              <inject src="my_injectable_motionscene"/>
      
              <!-- Any other content here -->
      
          </MotionScene>
      

Now when you run scenemerge the content from the MotionScene in _my_injectable_motionscene.xml will be copied in place into a new MotionScene file called my_parent_motionscene.xml in your res/xml directory. The <MotionScene...></MotionScene> tags will not be copied - only the content between them.

Please check the files in test/example_root_dir/res/inject for example source files.

Android Studio File Watcher

  • Install the File Watcher plugin for Android Studio via Settings -> Plugins.
  • Restart and open Settings -> Tools -> File Watchers, then click the + to create a new Watcher.
  • Set File type to XML.
  • Create a Scope with a pattern like file[app]:src/**/res/xml/_*.xml
  • Set Program to scenemerge in your environment. e.g. env/Scripts/scenemerge
  • Set Arguments to .
  • Set Working directoryto your app root.
  • OK

Now scenemerge should run automatically whenever you edit a res/xml/_YOUR_FILENAME.xml file, creating/updating the merged MotionScene file res/xml/YOUR_FILENAME.xml.

This project was written on a Sunday evening. It is unlikely to have any major updates but feel free to make pull requests or whatever. Hopefully MotionScene will someday have some kind built-in include/merge functionality and make this obsolete but this will have to do for now...

Metadata

Release files for motionscene-merger 2.4.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 motionscene-merger 2.4.1
File Size Uploaded Provenance Actions
motionscene-merger-2.4.1.tar.gz 7.9 kB Without provenance Details for motionscene-merger-2.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for motionscene-merger 2.4.1
File Interpreter ABI Platform Actions
motionscene_merger-2.4.1-py3-none-any.whl Python 3 none any Details for motionscene_merger-2.4.1-py3-none-any.whl

Total release size: 27.2 kB

Release files / motionscene-merger-2.4.1.tar.gz

Download URL motionscene-merger-2.4.1.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
16993182f55a40e5c52cd476d0c9f7ed7af4ce47a48a1a230273cb0dae278c33
BLAKE2b-256 checksum
How to use checksums
633b33127e8bef1f339ed77415d6f2992354cba52c7ea774c9839eccd428f81c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.1

Release files / motionscene_merger-2.4.1-py3-none-any.whl

Download URL motionscene_merger-2.4.1-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04224cfcff5a7f7744318304c5566cb6a300dfd3ad6f4de0ff137844eaf675ea
BLAKE2b-256 checksum
How to use checksums
08a07f9d3821a29b64670bcef4e04bd1fee4f34a9f7c59edc0fbfd748279211b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.1

Security for motionscene-merger 2.4.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

2.4.1 This release

2 release files No provenance

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