470,641 Members | 1,674 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,641 developers. It's quick & easy.

scope of procedures in python

5
Hi,

The following works.

import maya.cmds as cmds

def importImage( fileName, fileType):
cmds.file( fileName, i=True );
return 1

cmds.fileBrowserDialog( m=0, fc='python("importImage")', ft='image', an='Import_Image', om='Import' )

However in the following situation it does not work. The error is

================================================== ====
Cannot find procedure "importImage".
Start of trace: (command window: line 1).
importImage (command window: line 1).

================================================== ====

import maya.cmds as cmds


def importImage( fileName, fileType):
cmds.file( fileName, i=True );
return 1

def OnBrowse(self, event):
cmds.fileBrowserDialog( m=0, fc='python("importImage")', ft='image', an='Import_Image', om='Import' )

what is the scope of a procedure in python. Can procedures be called globally. How ?

BRgds,

kNish
Mar 24 '08 #1
0 792

Post your reply

Sign in to post your reply or Sign up for a free account.

By using this site, you agree to our Privacy Policy and Terms of Use.