If you are using a module (offline .py script file that you import
into your python, in maya or in another module)
Then you are in the namespace of that module.

So

import myModule as mm

then

mm.myFunc()

is in the mm namespace

import myModule

myModule.myFunc()

is in the myModule namespace.

On Tue, Aug 10, 2010 at 10:35 AM, Alan Fregtman <[email protected]> wrote:
> Hey guys,
>
> Coming from Softimage I'm a little confused by Maya's way of handling
> function declarations in scripts. In Soft, they're always local unless
> declared global using some SDK/API stuff.
>
> It would appear that in Maya in any Python script (or MEL for that
> matter) a function declaration stays in memory and is accessible
> globally.
>
> I'm worried about overriding other people's or Maya's own functions if
> I don't give it very unique names. Is there some way to declare
> functions for local use by the main global function in the same
> script? Am I making sense?
>
> Cheers,
>
>   -- Alan
>
> --
> http://groups.google.com/group/python_inside_maya

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to