It's a very handy command because it does basically the same thing as "frame selected" or "frame all" so it centers the camera's pivot on what you're working on, but it doesn't zoom the camera in or out so you're claustrophobically close to a selection of vertices. Does this sound familiar? Modeling - Alt+LMB orbit - [oh, I'm tumbling away from where I'm working] - f - Alt+RMB zoom out zoom out zoom out - modeling and repeat. So it's great because the camera keeps its distance, but there's no hotkey for it... yet.
I used the MEL mentioned here as a starting point and modified it so it would work with the Look at Selection command which is
viewLookAt [-position linear linear linear] [camera]
so the little MEL script I ended up with is
$currentPanel = `getPanel -withFocus`;
$panelType = `getPanel -to $currentPanel`;
if ($panelType == "modelPanel")
{
string $camera = `modelEditor -q -camera $currentPanel`;
viewLookAt $camera;
}
And then all that was needed was to assign a hotkey to it as described here.$panelType = `getPanel -to $currentPanel`;
if ($panelType == "modelPanel")
{
string $camera = `modelEditor -q -camera $currentPanel`;
viewLookAt $camera;
}
Basically I created a new command in the hotkey editor (which I've assigned the hotkey '?' itself) and then assigned 'Ctrl+f', which wasn't already assigned anything and it's related to the frame hotkey 'f'.
I might end up just remapping 'f' to it if I find I don't use the frame command much anymore. The command is also handy because if there's nothing selected the camera just centers on the origin, instead of zooming way out into space as 'frame' will do in a large scene. Hopefully that's helpful for some people.
No comments:
Post a Comment