inochi-creator icon indicating copy to clipboard operation
inochi-creator copied to clipboard

Feature Request: Mirrored Nodes

Open lualucky opened this issue 3 years ago • 1 comments

I'd like to mirror a node and its children across the line of symmetry, and if I make changes to the original node or its children, those changes are also applied to the mirrored version. For instance: I rig one arm, shoulder -> elbow -> hand etc. and each of those has a complicated set of rigging. I'd like to then mirror the shoulder onto the other side of the body (across the canvas' middle). In my use case I don't need unique art across both sides, but I could see that being a wanted feature.

Additionally, I'd like the mirrored side to have its own set of parameters (AKA a copied set of parameters). Some of these parameters should also be flipped, but some of them should stay as they were. For instance the user might want parameters pertaining to horizontal movement to be mirrored, but parameters that pertain to vertical movement should stay the same.

lualucky avatar Jun 12 '21 07:06 lualucky

Been thinking about how I'd go about implementing something like this. Don't know how feasible cloning and mirroring parameters with different setups would be, but the node tree, physics settings, bones, etc. can at least be copied straight away. Potential option would be to add 2 new Node types in Inochi Creator (which only is available there), called NodeMirror and NodeMirrored. Right clicking a node and selecting "Mirror Node" would spawn a NodeMirror node as well as a corresponding NodeMirrored.

NodeMirrored would contain a reference to its parent NodeMirror, and periodically update its children to reflect the mirrored state of their parent. All the new nodes generated and maintained by NodeMirrored should have their own UUIDs and should potentially be able to edit their NodeMirror counterparts.

There should be a consolidate option in the node dropdown for NodeMirror and NodeMirrored nodes which would delete the NodeMirror and NodeMirrored nodes and put their children where they were; this way the mirrored data would stay but be consolidated and no longer auto updated by the mirror nodes.

As for parameters, I'm unsure whether can effectively mirror their state in a way that's intuitive to the user, need to do more research on this.

Alternate Design Could also make a single Mirror node, move the reference node tree in to it then allow you to make multiple mirrored copies that become children of the mirror node too. That would make it less obnoxious in the node tree and could potentially have a special rendering path in the node tree renderer to make the UX more friendly. Moving the reference node out would cause the mirrored nodes and the Mirror node to delete itself (though via the action stack you can undo that), consolidation would remove the mirror node but keep all child nodes in the tree. With this path the "Mirror" node could be invisible and an other means could be used to display that a node is mirrored to prevent you from accidentally breaking the mirror link.

Notes

  1. Inochi2D does not have the concept of a "canvas", though the Mirror node could base the symmetry on the scene origin points or allow you to set a mirror/flip direction, then allow you to orient those mirror nodes yourself.
  2. Inochi2D's parameters currently are still very WIP and aren't final so it would be unwise to plan their mirroring implementation at this point, nor fully estimate how doable it would be.

LunaTheFoxgirl avatar Jun 12 '21 11:06 LunaTheFoxgirl