Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Shortcut for accessing the input line menu ?

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
LifeArtist
1017 Views, 5 Replies

Shortcut for accessing the input line menu ?

Good Evening,

 

I always use maya without status menu but sometimes I want to place my object at specific coordinates, therefore I need to reactivate the status menu and type in my coordinates.

 

place.png

 

Is there a way to not use it inside the status menu ?

 

 

5 REPLIES 5
Message 2 of 6
pshwayka
in reply to: LifeArtist

You can use the move command in the MEL window. For example, to move an object to the absolute coordinates of 0,0,0 you would type:

move -a 0 0 0 <enter>

 

Not sure that's any faster though...

Smiley Wink

Message 3 of 6
LifeArtist
in reply to: pshwayka

Okay so now I have just coded a small py script which will popup a window and you can put in the coordinates. <escape> Closes the window. <Enter> Moves the Object.

 

Maybe I will improve it. Have a nice day.

 

@pshwayka accepted yours because you gave me the hint. 😉

 

spos.png

 

from PySide import QtCore as qc
from PySide import QtGui as qg
import maya.cmds as cmds

class SetPosition(qg.QDialog):
    def __init__(self):
        qg.QDialog.__init__(self)
        self.setWindowTitle("Set Position")
        self.setWindowFlags(qc.Qt.WindowStaysOnTopHint)
        self.setFixedWidth(250)
        self.setFixedHeight(40)
        self.keyPressEvent = self.KeyPress
        
        self.setLayout(qg.QGridLayout())
        
        self.cbox01 = qg.QComboBox()
        self.cbox01.addItem("Absolute")
        self.cbox01.addItem("Relative")
        self.layout().addWidget(self.cbox01, 1, 0)
        
        self.entry_x = qg.QLineEdit()
        self.layout().addWidget(self.entry_x, 1, 1)
        
        self.entry_y = qg.QLineEdit()
        self.layout().addWidget(self.entry_y, 1, 2)
        
        self.entry_z = qg.QLineEdit()
        self.layout().addWidget(self.entry_z, 1, 3)
        
        #self.labl02 = qg.QLabel("press <enter> or <escape>")
        #self.layout().addWidget(self.labl02, 2, 1, 2, 3)
        
    def KeyPress(self, event):
        if event.key() == qc.Qt.Key_Return:
            cmds.move(self.entry_x.text(),
                      self.entry_y.text(),
                      self.entry_z.text(),
                      absolute = True if self.cbox01.currentIndex() == 0 else False)
            self.close()
        elif event.key() == qc.Qt.Key_Escape:
            self.close()
        
dialog = SetPosition()
dialog.show()

 

Message 4 of 6
pshwayka
in reply to: LifeArtist

I've marked your post as a solution, too. Glad you got it working.!

Smiley Wink

Message 5 of 6
LifeArtist
in reply to: pshwayka

I cant edit my post anymore but if someone wants to use this script:

add*

absolute = True if self.cbox01.currentIndex() == 0 else False,
relative = True if self.cbox01.currentIndex() == 1 else False) <---- This Line*


Thanks

Message 6 of 6

# Error: ModuleNotFoundError: file C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py line 142: No module named 'PySide' #

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report