On Sat, Oct 4, 2008 at 6:21 AM, sim.On <[EMAIL PROTECTED]> wrote:
>
> hi Python users .
>
> i guess you all know this :
>
> you write a script in MEL or PYTHON ... you go on working and working
> - and you forget to save your script ... SUDDENLY maya crashes.
>
> e.g. the work for 4 hours ( IN SCRIPT EDITOR ) scripting is gone .
I have found the following to be the case for the script editor in the
copy of maya we have at work:
if you write stuff in the script editor, maya will save its contents
whenever you close the script window. So, simply closing it and
re-opening it should trigger a save. I have found this to be the case
for 8.5 and newer. Our on-site maya engineer mentioned this to us
some time ago and so far I've found it to be the case.
Of course, I wouldn't rely on maya for a text editing. The better
solution is to package your stuff up in a module and use the script
editor for purely throw-away stuff. Something like this:
# the_module.py -- edit this in vim, emacs, or any good $editor with
syntax highlighting
# ======================================================
class Example(object):
def good(self):
print "ya"
# for_maya_script_editor --
# ======================================================
# use this in the maya script editor. This is purely throw-away stuff
that's okay to lose.
# the reload() is used so that it picks up any changes you make to the module.
# make sure the module dir is in your sys.path -- sitecustomize.py is probably
# the right place for this snippet, though
import os
import sys
moduledir = os.path.dirname('/path/to/the_module.py')
if moduledir not in sys.path:
sys.path.insert(0, moduledir)
# now, use the module
import the_module
reload(the_module)
the_module.Example().good()
So, now that you don't need to use the maya script editor for real
editing you don't really need it to track history for you, either.
Tracking history is best left to scm tools designed to do just that.
For example, http://git-scm.com/ -- http://git.or.cz/ are all the rage
these days, and are highly recommended.
> QUESTION:
> does maya somewhere store the "history" of the script-editor in one of
> the windows-temporary-directories ?
>
> or might my "code" still be in my RAM somewhere , and i might find it
> with a "HEX-editor" or any kind of MEMORY-search ???
>
>
> -----------------------------------------------------------------
> does anyone ever found out , how to deal with this problem ?
>
--
David
--~--~---------~--~----~------------~-------~--~----~
Yours,
Maya-Python Club Team.
-~----------~----~----~----~------~----~------~--~---