Esempio n. 1
0
    def _fileDialog(self, **kw):

        if not kw:

            ## \todo Remove at some suitable point, once we're happy no one is relying on
            ## a custom openDialog implementation to achieve their desired functionality.
            warnings.warn(
                "PathParameterUI.openDialog() is deprecated, please implement _filePicker() instead if you need to customise the dialog/returned path.",
                DeprecationWarning, 2)
            self.openDialog()

        else:

            # Allow a class to enforce a path if the default behaviour for
            # using existing paths or the default userData path is not desired.
            if "path" not in kw:
                kw["path"] = self._initialPath()

            # Allow the parameter userData to override the key from the caller.
            # This is a little different in concept to the path, but they key is
            # never dynamic in terms of the parameter, so I think it makes sense.
            uiUserData = self.parameter.userData().get('UI', {})
            key = uiUserData.get('fileDialogKey', IECore.StringData()).value
            if key:
                kw["key"] = key

            if "callback" not in kw:
                kw["callback"] = self.__defaultFileDialogCallback

            IECoreMaya.FileDialog(**kw)
Esempio n. 2
0
    def _fileDialog(self, **kw):

        # Allow a class to enforce a path if the default behaviour for
        # using existing paths or the default userData path is not desired.
        if "path" not in kw:
            kw["path"] = self._initialPath()

        # Allow the parameter userData to override the key from the caller.
        # This is a little different in concept to the path, but they key is
        # never dynamic in terms of the parameter, so I think it makes sense.
        uiUserData = self.parameter.userData().get('UI', {})
        key = uiUserData.get('fileDialogKey', IECore.StringData()).value
        if key:
            kw["key"] = key

        if "callback" not in kw:
            kw["callback"] = self.__defaultFileDialogCallback

        IECoreMaya.FileDialog(**kw)