One hotkey to match them all

Discussions concerning programming of SOFTIMAGE©
Post Reply
Jho
Posts: 49
Joined: 12 Feb 2013, 07:57

One hotkey to match them all

Post by Jho » 11 Nov 2013, 09:14

Hi.

I constantly match stuff while rigging and so I assigned a hotkey for matching translation. But quite often I need to match the rotation too.
Of course I could just assing a hotkey for that too, but it would be cool to just have one matchmaking hotkey
I could just use the match all transforms but i almost never want to match scale.
So I just copypasted match translate and match rotation from script editor separately, saved that as a script and assigned a hotkey for that:

Code: Select all

MatchTransform , , siTrn 
MatchTransform , , siRot
When using this I click two times, first for translation matching and second for rotation. Which is exactly what I want.
But sometimes it matches the rotation incorrectly or I don't want to match rotation after all and I try to cancel the second click by clicking the right mouse button. Sometimes when I do this the object flips into a weird rotation. It only seems to happen with more complicated scenes but clearly it doesn't just cancel when I hit the RMB.
GEAR has a match trans+rot which seems to work a bit better but it doesn't have the option to cancel so I still need two hotkeys (one for matching trans+rot and one for just matching translation).

So I would like to make it match the rotation better and be able to cancel (by clicking on an empty area or right mouse clicking preferably). How would I go about doing that?

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 01:41
Contact:

Re: One hotkey to match them all

Post by EricTRocks » 12 Nov 2013, 02:00

Look into the PickElement command. You can do two pick elements. Each time test if the return value of the first PickElement command's "ButtonPressed" return is 0 (right clicking). If it is continue to the next pick element do the same.

That and a couple if statements and you're good to go.

This thread is more of a programming topic than a rigging one though so I'm moving it to that forum.
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

User avatar
csaez
Posts: 253
Joined: 09 Jul 2012, 15:31
Skype: csaezmargotta
Location: Sydney, Australia
Contact:

Re: One hotkey to match them all

Post by csaez » 12 Nov 2013, 03:25

I would go object model, there was a bug on MatchTransform when trying to match objects with fcurves in rotation params, it was fixed but I don't remember in which release.

Post Reply

Who is online

Users browsing this forum: No registered users and 51 guests