How can I assign a keyboard shortcut to View -> Image Plane -> Import Image...?
I searched within the Hotkey Editor, but could not find the corresponding command.
Or as a newbie, maybe I am approaching this in an entirely incorrect fashion.
Would appreciate help; thank you.
Solved! Go to Solution.
Solved by Abdulla-Qaladzay. Go to Solution.
hi @Anonymous
we can create a custom keyboard shortcut pretty much for any thing in Maya !!
you can use this script to do that :
watch the video attachment "importImageByKeyboardShortcut.mp4"
//import image to the viewPort that the hovered cursor mouse
string $cam=`getPanel -underPointer `;
string $activCamName="";
switch($cam){
case "modelPanel4":
$activCamName = "perspShape";
break;
case "modelPanel1":
$activCamName = "topShape";
break;
case "modelPanel2":
$activCamName = "sideShape";
break;
case "modelPanel3":
$activCamName = "frontShape";
break;
}
importImagePlane { $activCamName };
Or you can use this :
watch the video attachment "importImageByKeyboardShortcut.mp4"
//import image to the viewPort not for the viewPort cameras
string $impImg_1[] =`imagePlane -width 10 -height 10 -maintainRatio 1 -lookThrough persp`;
string $imgShape_2[] = `listRelatives -s $impImg_1`;
string $ipUi_[] = `fileDialog2 -fm 1 -caption "Select an image for the Image plane"`;
setAttr -type "string" ($imgShape_2[0]+".imageName") $ipUi_[0];
pleas let me know if you need me to explain any part of the scrips
I hope that help 💙🤍.
Abdulla,
A HUGE thank you for your help. I implemented the first part (i.e. for camera under the mouse), and it works like a charm.
I don't quite understand each detail, but I can study that on my own, now that I have something to start from.
Again, many thanks. Seems like you're a Maya wizard! 🙂
Todd
Can't find what you're looking for? Ask the community or share your knowledge.