By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,235 Members | 1,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,235 IT Pros & Developers. It's quick & easy.

scope of procedures in python

P: 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
Share this question for a faster answer!
Share on Google+

Post your reply

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