On Mon, 23 Feb 2015 11:54 PM Lidia Martinez wrote:
Cesar, that looks great.
This catched my attention.
"If a module instantiates instances of a class, reloading the module that
defines the class does not affect the method definitions of the instances —
they continue to use the old class defini
> If this was like C++ , where you can tell it to see if you are in a debug
or release version... i guess that would be something to be added, a global
variable in maya modified on the click of the shelf button, and have the
button to test for developers and the released one...
I'm not sure this i
Cesar, that looks great.
This catched my attention.
"If a module instantiates instances of a class, reloading the module that
defines the class does not affect the method definitions of the instances —
they continue to use the old class definition. The same is true for derived
classes."
Does it
This still works great for me:
https://groups.google.com/d/msg/python_inside_maya/sNqxa2yDt5s/CC9MNpFni50J
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it,
The execfile is just a standard python builtin :
https://docs.python.org/2/library/functions.html#execfile
The plugin uses it to create a namespace specifically for the plugin, and
execs the file under it to avoid affecting the main namespace of Maya, and
to let it be persistent across calls.
htt
Thanks!
The solutions on changing : sys.dont_write_bytecode = True won't work for
me. The reason is that i'm deploying this code for production and at the
same time i'm working on development. If i set that variable to true, then
the people who use the tool will be reloading the code all the tim
@damon: reload only works on modules, right?
Usually when I run reload(), it takes care of loading from the py and not a
pyc (you can usually confirm this by running reload manually and seeing the
path it prints out).
If your top level module imports other modules, whose source you are
changing,
If you print your module, you’ll see where it exists on disk, the .pyc file
might lie right next to it. It’s also possible that you’ve got two modules
with the same name in your PYTHONPATH, which would explain why you can
import it, but not see the changes you make to the other one.
--
You rec
The PYTHONDONTWRITEBYTECODE will only have an effect for newly compiled
files. If this is the problem, you’ll need to manually remove the existing
pyc file first.
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsu
Thanks Damon and Marcus!
Well, i tried doing reload of a the class inside the file, and it didn't
work...
I'll see if it works once again.
The PYTHONDONTWRITEBYTECODE stuff , i'll see how that works.
Thanks!
--
Lidia
2015-02-20 16:08 GMT+01:00 damon shelton :
> You need to reload(className)
Make sure you don’t have a .pyc version of your script lying around. And
while you’re at it, disable the generation of those buggers permanently by
setting PYTHONDONTWRITEBYTECODE to 1 in your environment. It’ll make sure
you keep the hair on your scalp. :)
--
You received this message because
You need to reload(className)
Even though you reloaded moduleName
ClassName is not getting reloaded in globals.
Reload won't work with import * unless you write code to remove all the
objects from globals that import * creates first
On Feb 20, 2015 6:35 AM, "Lidia Martinez" wrote:
>
> While deve
While developing i need to be compiling code all the time.
I've reached a point where i realised my files where not reloading, no
matter what i told them.
I have my code inside a button, after watching Sublime Text failing when
executing reload code inside:
if __name__== "__main__" :
...
I moved
13 matches
Mail list logo