def load_item_from_path_3dsmax(self, path):

        from Py3dsMax import mxs
        
        # there is a file open
        if mxs.getSaveRequired():
            # there are unsaved changes in the scene
            # TODO: handle this for the user!
            
            # the currently opened file has not been saved
            mxs.messageBox("Your current scene has unsaved changes. Please save it before proceeding.")
            return
                    
        else:
            # no need to save any change. load new file.
            mxs.loadMaxFile(path)
Exemplo n.º 2
0
                                         QtGui.QMessageBox.Ok|QtGui.QMessageBox.Cancel)

        if res == QtGui.QMessageBox.Ok:

            # first clear the scene
            if self._app.engine.name == "tk-maya":

                if not self._clear_current_scene_maya():
                    # return back to dialog
                    return

            elif self._app.engine.name == "tk-3dsmax":

                from Py3dsMax import mxs

                if mxs.getSaveRequired():
                    # not an empty scene
                    # this will ask the user if they want to reset
                    mxs.resetMaxFile()

                if mxs.getSaveRequired():
                    # if save is still required, this means that the user answered No
                    # when asked to reset. So now, exit and don't carry out the switch
                    return


            elif self._app.engine.name == "tk-motionbuilder":
                if not self._clear_current_scene_motionbuilder():
                    # return back to dialog
                    return
Exemplo n.º 3
0
            QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel)

        if res == QtGui.QMessageBox.Ok:

            # first clear the scene
            if self._app.engine.name == "tk-maya":

                if not self._clear_current_scene_maya():
                    # return back to dialog
                    return

            elif self._app.engine.name == "tk-3dsmax":

                from Py3dsMax import mxs

                if mxs.getSaveRequired():
                    # not an empty scene
                    # this will ask the user if they want to reset
                    mxs.resetMaxFile()

                if mxs.getSaveRequired():
                    # if save is still required, this means that the user answered No
                    # when asked to reset. So now, exit and don't carry out the switch
                    return

            elif self._app.engine.name == "tk-motionbuilder":
                if not self._clear_current_scene_motionbuilder():
                    # return back to dialog
                    return

            # note - on nuke, we always start from a clean scene, so no need to check.