Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Batman by Jason Edwards
You are here > Home > SimplyMaya Community Forums

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 09-11-2008, 02:31 PM   #1
Registered User
Join Date: Nov 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Python script runs twice from Menu or Hotkey

I have written a python save increment script for Maya to make the saves compatible with our pipeline. The script itself runs fine, and if run from the script editor, only runs once. When I attach a hotkey and a menu list, the script will run twice, the first time you use it. But only when Maya first starts. After that, it will just run once.

Below are the files I altered to make the scripts run:

userSetup.mel (all on one line):

menuItem -p "mainFileMenu" -l "EXC IncSave" -ia "" -c "python(\"import maya_incsave\"); python(\"maya_incsave.IncSave_Execute()\");";

//Maya Preference 8.50 (Release 1)

hotkey -keyShortcut "0" -releaseName ("HfAttrSelect_Menu_revert");
hotkey -keyShortcut "s" -ctl -name ("EXC_SaveIncNameCommand");

//Maya Preference 8.50 (Release 1)

TAB-annotation "EXC_SaveIncNameCommand"
TAB-command ("EXC_SaveInc")

//Maya Preference 8.50 (Release 1)

TAB-annotation "EXC Save Increment"
TAB-category "File"
TAB-command ("python(\"import maya_incsave\");\r\npython(\"maya_incsave.IncSave_ Execute()\");")
and finally, attached is the python script, It is called .mel, because I cannot upload a .py file! Please rename it to .py.

Can anyone tell me why this is running twice when Maya 2008 first starts, and then running once every time after?

Attached Files
File Type: mel maya_incsave.mel (3.7 KB, 12 views)
Thurman Merman
thurman is offline   Reply With Quote

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.