Limited answer:  del cmds
General answer: restart maya

Otherwise you have to track everything you create, delete objects via the del 
command, and make sure nothing else is using them in their own code

There is no magic method to "reset" the environment because there is no basline 
to consider a reset point. The env can be modified even from mayas startup 
process with scripts. 

See how far the del command will get you. Then, restart





On Jun 15, 2012, at 7:39 AM, Mathew Schwartz <umca...@gmail.com> wrote:

> Okay I see,
> 
> I think what I am wondering then is if there is a way to clear everything 
> that was done, such as a global variable.  Its not just one script thats 
> doing it, but the best example I can give is when the tooltip is activated.  
> Typing "cmd" does not give any options, but if I run "import maya.cmds as 
> cmds", the even when I create a new python tab, "cmd" brings up the cmds 
> option.  I need to restart to get rid of the cmds option under tooltip.  So 
> the question is, how can restart the python environment without restarting 
> Maya?
> 
> Thanks
> 
> m
> 
> On Thu, Jun 14, 2012 at 2:42 PM, Justin Israel <justinisr...@gmail.com> wrote:
> Maya runs python as a persistant environment. If your script is doing things 
> on a global level, then those would continue to live on. Also like you said, 
> if you are setting up other global callbacks like scriptJobs or attaching to 
> existing UI elements and not cleaning those up, they too would be a 
> persistant issue.
> 
> But yea, we would need to see some more specific examples of what you are 
> doing and how you are doing it. Ideally your data structures should be bound 
> to instances of classes or die withe the scope of a function. If your script 
> fails, there shouldn't be anything persistant. Are you using global variables 
> in your script? 
> 
> 
> On Thu, Jun 14, 2012 at 9:17 AM, jdob <dobson...@googlemail.com> wrote:
> Hi Mat-
> 
> Tough to say what the problem is without more info.  There should be no need 
> to "clear Mayas memory of things that happened in the script editor" but 
> maybe I'm misunderstanding what you're trying to do.  Can you post a short 
> example of your code?  Also, can you turn on "Show Stack Trace" (in the 
> script editor's Edit menu) and make it fail again?  You should get some 
> useful info if something is failing in python land.
> 
> 
> -- 
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings: 
> http://groups.google.com/group/python_inside_maya/subscribe
> 
> -- 
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings: 
> http://groups.google.com/group/python_inside_maya/subscribe
> 
> -- 
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings: 
> http://groups.google.com/group/python_inside_maya/subscribe

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to