Adverti horiz upsell

mSetProject 2.0.2 for Maya (maya script)

Automatically Set Project before opening a scene

License
Button download
1,351 Downloads

Reviews

Rating: 4.8
(6)

Compatibility

  • 2016, 2015, 2014, 2013

Operating Systems

  • Windows

History

Created:10/20/2014
Last Modified:10/13/2016
File Size: 1.96 KB

Keywords

maya, set, automatic

Q/A

error and maya freeze

Date:05/10/2016
Submitted by: tony yang tony yang
Hi myara
i have tried new version 2 script. I notice this error message # Error: AttributeError: 'module' object has no attribute 'mSetProject' #
appear on command line.

when i open a scene the maya will be freeze, and it keeps showing
error: runtimerror:maximum recursion depth exceeded in cmp//
warning:python callback failed

tony

Replies to this question:

  • myara

    myara said over 8 years ago:

    I rewrote the tool so it is using a different command to load up. It seems that you are still using the old one, so you will need to delete the old commands from your userSetup.py. Look for these lines and delete them, sorry I wasn't clear in the instructions. import maya.cmds as m import mSetProject reload (mSetProject) m.scriptJob( event=("SceneOpened", "mSetProject.mSetProject()") ) And replace them with import mSetProject mSetProject.main() if you haven't add them already. It's been working without problems here for the last 2 or 3 days, but I'm still testing it in different situations.
  • Replyindent
    myara

    myara said over 8 years ago:

    That's great ! Feel free to write me anytime if you have any problem. If you put an script in maya\scripts it will load for all Maya versions. If you put it in maya\2014-x64\scripts it will only load for that version. I mainly use the maya\scripts folder unless it is an script that only works in an specified version. The mSetProject 1.x installer was creating it by default in the scripts folder. With 2.x you'll have to do it manually.
  • Replyindent
    tony yang

    tony yang said over 8 years ago:

    hi myara i have solved the problem. i put my script in C:\Users\tony\Documents\maya\2014-x64\scripts, but when I enter install command. I found it won't put any command in usersetup.py. It will put command in usersetup.py from C:\Users\tony\Documents\maya\scripts. I find old install command there and delete it,but i still have to type import mSetProject; mSetProject.mSetProject_Setup( False ) to uninstall it. otherwise the maya will still get freezing cuz it's trying to set the project by using the script. I think it's my bad to put it in C:\Users\tony\Documents\maya\2014-x64\scripts. i am sorry.
  • Replyindent
    myara

    myara said over 8 years ago:

    Sorry, it seems that these forums automaticaly eliminate all spaces you should have at least one space before the if I'm replacing the spaces with ___ so you can see how it should be. Something like this: from maya import cmds jobs = cmds.scriptJob( listJobs=True ) for i in jobs: ___if (i.find('mSetProject')!=-1): print ("==================================\nEvent Found : \n" + str(i))
  • Replyindent
    myara

    myara said over 8 years ago:

    Indentation Error means that there is some spaced text that shouldn't be there. In mel, javascript or other languages it doesn't really matter but Python is very strict with this. It just won't work. Did you included some spaces before the commands in your userSetup.py ? It should be: import mSetProject mSetProject.main() if you write it like this import mSetProject mSetProject.main() or like this: import mSetProject mSetProject.main() You will get an indentation error.
  • Replyindent
    tony yang

    tony yang said over 8 years ago:

    i got this error # Error: IndentationError: expected an indented block #
  • Replyindent
    myara

    myara said over 8 years ago:

    The mSetProject 1.x uninstaller was doing exactly what I told you to do it manually (search for those lines and delete them). Since you already have edited your userSetup.py, it won't work. Delete (temporary) your userSetup.mel and only use the included userSetup.py. Try this and copy & paste me the exact error message if possible. A way to find if Maya has a ScriptJob event for the old mSetProject would be to run this script in your Script Editor (Python): #### from maya import cmds jobs = cmds.scriptJob( listJobs=True ) for i in jobs: if (i.find('mSetProject')!=-1): print ("==================================\nEvent Found : \n" + str(i)) #### If you have something like this: Event Found : 175: event=('SceneOpened', 'mSetProject.mSetProject()') It means that something is loading this event. If it doesn't log anything, then it means nothing is trying to use the old mSetProject and there is something else wrong that hopefully that error log I asked you for can help me figure it out.
  • Replyindent
    tony yang

    tony yang said over 8 years ago:

    hi myara i don't have any command in my usersetup.py, only msetproject command. even i delete all command in usersetup.mel and I still got the error message . so i don't think i need to send u the files. i asked u for the uninstall command, cuz i remembered u did put some uninstall and install command on description for v1 or v1.1?? cuz i never put any command in my usersetup.py for v1 or v1.1. but i did put install command in my script editor and executed . or....i was wrong???
  • Replyindent
    myara

    myara said over 8 years ago:

    The old mSetProject uninstaller just opens the userSetup.py and deletes those lines I told you. Can you send me your userSetup.py ? I'll have a look at it. And just in case the userSetup.mel too. Those 2 files are the ones that trigger commands before Maya starts. I've send you a friend request to give you my email address in private.
  • Replyindent
    tony yang

    tony yang said over 8 years ago:

    -no i don't have multiple usersetup.py in maya folder -i am using maya 2014 64bit -i only use english characters maybe u can give me the uninstall command again ,cucz i can't find it anymore. and i can try again. thx
  • Replyindent
    myara

    myara said over 8 years ago:

    Sorry for the trouble. - Do you have multiple userSetup.py files inside your Maya folder ? (ex: maya\scripts, maya\2016\scripts, etc ) - What Maya version are you using? - Does this problem occurs with paths with only english characters? (Today I've discovered that we are having problems with non-english japanese characters) The AttributeError means that you are calling the old command and failing because the version 2 doesn't have a mSetProject attribute. So you must have the old scriptJob event alive somewhere. (these events disappear when you shutdown Maya, so it needs to be inside userSetup.py to be called everytime Maya starts up.)
  • Replyindent
    tony yang

    tony yang said over 8 years ago:

    i did put those 2 command inside usersetup.py,and still got the error and freezing problem. i didn't have the old command in my usersetup.py in the first place. it's because i used the install command to install the old script???

Post a reply: