Skip to content

Add a utility to copy Inochi Session bindings from different versions of the same puppet.#111

Open
ArcturusEmrys wants to merge 3 commits intoInochi2D:mainfrom
ArcturusEmrys:inp-copybindings
Open

Add a utility to copy Inochi Session bindings from different versions of the same puppet.#111
ArcturusEmrys wants to merge 3 commits intoInochi2D:mainfrom
ArcturusEmrys:inp-copybindings

Conversation

@ArcturusEmrys
Copy link
Contributor

Inochi Session uses a vendor block to store its own mappings. Inochi Creator is completely unaware of these mappings and exports a blank file each time, and Inochi Session does not offer a way to copy bindings. This results in me having to hand-copy about 40 parameters every time I export a version of myself.

This PR adds an example script that automates copying Session's mappings to newer versions of the same puppet. This has dramatically improved my ability to add to and tweak my model.

(NOTE: Inochi Session's parameter mappings are called bindings internally, even though the INP format already has a thing called bindings. For the purpose of disambiguation, I'm calling Inochi Session's bindings "mappings".)

This requires having a JSON form of the puppet data, and we don't have
a function to convert `Puppet` into that yet. So instead, I added another
function to read an INP into JSON ONLY and not convert it into a Puppet.
@Speykious
Copy link
Member

Seems like you have some TODOs, is your PR a draft?

Small thing, I'd prefer every comment have a space after the //, I saw some without so it's better to be consistent there.

…ible with the puppet they are being copied to before saving.
@ArcturusEmrys
Copy link
Contributor Author

@Speykious I updated this PR as you requested. It now also has code to parse the Session parameter bindings block enough to where it can validate that it's copying bindings that are compatible with the target puppet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants