Seamles space swtich

by Hercules posted 977 days ago | 3 comments

Hi. does anyone have a good workflow/guide/tutorial for setting up space switches in Maya without the POP whe one would change form one space to another. Especially a setup where one can add or remove spaces after teh intial setup. I.e. like Riham Toulan amazing script. I'm just really curious in the underlying mechanics.

by chalk posted 966 days ago

Switching in generic single space case like a parent space is pretty trivial - you getting the world space of the object you want to keep, doing the switch and then getting that world representation relative to its parent space. Roughly speaking: n` = n p^-1

What gets tricky is when objects have multiple switches i.e a position and rotation, as switching one could cause a pop in the other. The way i handle this is to essentially look at the resulting n` value and see if its offset is different for each switch i.e. its position is now changed even though its was a rotation switch and vice versa - then i set the keying.

I don't have add/delete targets but i'd see it as pretty trivial - you just re-populating an enum, and generating you constraints. I don't think that would be advisable during an animation. You need to store the targets, constraints etc or pull them through via listConnections, listRelatives etc.

by EdArt posted 968 days ago

Oh boy, a subject near and dear to me. The sane method is to use a script to match spaces on a single keyframe when you switch - however, that can still give a jerk, which has to be smoothed out. Additionally scripting can obviously be finicky about any number of different aspects of the rig, from hierarchy to naming.

I'm working on a method to have a seamless, smoothly blending switch contained within the rig itself, entirely within default maya nodes. It technically relies on creating a cycle, but you manipulate the node state to blocking such that the cycle never actually completes - you just save the offsets as a matrix within the blocked node, and use that as a startpoint to blend to a different space.

At the moment, I can do it with world-space translation alone, which comes to the next downside: it gets complex fast. I'm planning to present it once it can handle orient and parent constraint behaviour, but for me not having to rely on a script is definitely worth the slight hit to performance.

by denilson020898 posted 971 days ago

Watch this video

to compensate the poping in viewport, you must match the space using the controller's local transform. Which will create a popping on the animation curve in graph editor.