Showing posts with label mel. Show all posts
Showing posts with label mel. Show all posts

common camera commands (MEL functions)






while working in maya, i always miss 3dsmax wild / precise / speedy environement. there is huge list of things to document in this context about customization. but attached are three simple mel functions which let me assign 3 common camera commands to short cut keys or quad menus, exactly as i have those in 3dsmax.



below are functions descriptions and then how to install those quickly (at end)
click function name to download relevant MEL file.








  • Create camera from view (DOWNLOAD)
    • equivilant to 3dsmax menu > view > create camera from view
    • no idea, if it already exists in default maya.
  • Select Camera From View (DOWNLOAD)
    • equivilant to 3dsmax > view menu > select camera
    • in maya view menu, select camera. now u can assign key, move mouse in view, hit, it will select camera, 
    • useful for quickly showing camera settings and tweaking
  • View From Selected Camera (DOWNLOAD)
    • useful when multiple cameras in view. 
    • easiest is, simply select camera in view, hit shortcut key, it will move your current view to look at from this camera
    • if no camera is selected, it will pop up a dialog similar to max ( with list of cameras)
    • picking a camera will update viewport
    • double clicking will close this dialog as well.
i think, installation is so simple, i can't forget that. incase you need help about that, feel free to discuss

mel editor (ide)




this is on-going debate. so i'll add as i learn. it frustrates but hoping that some day, maya has simple decent script editor like max has.....




update 2008
searched a lot about IDE’s and found that actually commercial products are best like MEL STUDIO PRO and MAXYA. so many other opensource IDE’s and syntax hilighting files are available on highend3d but none ever worked for me the way it should be. for simple scripter like me, having funtions list available is huge stuff and if somehow i am not able to send commands to maya from external editor then it is useless. even some free ide’s complained that they do (jedit) but it never worked for me.
lastly in terms of free IDE’s i tried a lot and get closer to eclipse and jedit. both then needs to add bla bla plugins and setup that it gives me nothing but frustration rather then automating task and get the job done.
update 2009
i had puchased "maxya" and trust me if u r on windows, it is best possible thing u can have. later on i moved to linux. for some time, i had used CUTTER. pretty good. really amazing. java based script editor by genius guy "". its amazing for mel.
then i used mapy and scite for some time. its also equally good (except it supports python as well)
lastly i moved to eclipse and there is a plugin on creative crash. it also supports pymel etc and becomes as good as maxya on windows...

maya Dropbox Setup & Notes


MAYA_APP_DIR (user variables)
this sets where different versions of maya created base preferences folder. e.g 8.5 and 2008
must remember that somehow it wasn’t updated unless i restart my PC.
windows::e.g : C:\Documents and Settings\haseebah\My Documents\maya\


MAYA_SCRIPT_PATH (system variables)
this helps to manage multiple folders organized. if you didn’t set this one in environment variables. also remember to put semicolon and add multiple path and was very helpful to put zooToolBox separately managed in above examples. this can also be set in maya.env file. but system / user variables take precedence if declared.
window::e.g : C:\Documents and Settings\haseebah\My Documents\maya\2008\scripts\zooToolBox;C:\Documents and Settings\haseebah\My Documents\maya\2008\scripts
e.g.
setting separate folder for python scripts is simple , add line in maya env file

PYTHONPATH = C:\Documents and Settings\haseebah\My Documents\maya\2008\scripts\Python

userSetup.mel or userSetup.py to initialize simple script commands at startup (loading packages and assigning simple name spaces helps a lot, e.g: import maya.cmds as mc etc) also useful to setup ports for listening from jedit and eclipse.

linux::e.g : (in .profile file located at /home/lala) add lines below, this helps to avoid all maya installations at multiple machines ( home / office ) has same look n feel. even installation of one script is also done at all places. changing hotkeys and shelfs at one place update other places. too good. offcourse u have to setup dropbox :D
----------------------------------------------------------
export MAYA_APP_DIR=/home/lala/Dropbox/Maya
export MAYA_SCRIPT_PATH=/home/lala/maya/2009-x64/scripts/zoo:/home/lala/maya/2009-x64/scripts/lala
export PYTHONDEV=/home/lala/Dropbox/Maya/2009-x64/scripts/pymel
export MAYA_LOCATION=/usr/autodesk/maya2009-x64
export PATH=$MAYA_LOCATION/bin:$PATH
export PYTHONPATH=$PYTHONPATH:$PYTHONDEV
----------------------------------------------------------
maya.env in linux is like

MAYA_PLUG_IN_PATH = /home/lala/maya/2009-x64/scripts/pyPlugin
MAYA_SCRIPT_PATH=/home/lala/maya/2009-x64/scripts/zoo:/home/lala/maya/2009-x64/scripts/lala:/home/lala/maya/2009-x64/scripts/rigging
PYTHONPATH=/usr/local
MAYA_MMSET_DEFAULT_XCURSOR=1