Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

How can I assign a keyboard shortcut to View -> Image Plane -> Import Image...?

Anonymous

How can I assign a keyboard shortcut to View -> Image Plane -> Import Image...?

Anonymous
Not applicable

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.

 

Hotkey Editor.png

 

Or as a newbie, maybe I am approaching this in an entirely incorrect fashion.

Would appreciate help; thank you.

 

0 Likes
Reply
Accepted solutions (1)
948 Views
3 Replies
Replies (3)

Abdulla-Qaladzay
Collaborator
Collaborator
Accepted 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 💙🤍.

Anonymous
Not applicable

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

Abdulla-Qaladzay
Collaborator
Collaborator

any time ! you are more than welcome 😊🤍