scope of procedures in python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • knish
    New Member
    • May 2007
    • 5

    scope of procedures in python

    Hi,

    The following works.

    import maya.cmds as cmds

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

    cmds.fileBrowse rDialog( m=0, fc='python("imp ortImage")', ft='image', an='Import_Imag e', om='Import' )

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

    =============== =============== =============== =========
    Cannot find procedure "importImag e".
    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.fileBrowse rDialog( m=0, fc='python("imp ortImage")', ft='image', an='Import_Imag e', om='Import' )

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

    BRgds,

    kNish
Working...