def createAsset(self):
	    try:
	        name = str(self.textField.text())
	        name = name.replace(' ', '_')
	        project = Project()
	        if self.element == 'asset':
	            asset = project.create_asset(name)
	        else:
			    shot = project.create_shot(name)
	        app.quit()
	    except EnvironmentError, e:
		    print e
		    app.quit()
 def createAsset(self):
     try:
         name = str(self.textField.text())
         name = name.replace(' ', '_')
         project = Project()
         if self.element == 'asset':
             asset = project.create_asset(name)
         else:
             shot = project.create_shot(name)
         self.parent.accept()
     except EnvironmentError, e:
         print e
         self.parent.accept()
def createBody(bodyType, name):
    project = Project()
    if bodyType == 'asset':

        msgBox = QtWidgets.QMessageBox()
        msgBox.setText(msgBox.tr("What type of asset is this?"))
        # noButton = msgBox.addButton(QtWidgets.QMessageBox.No)
        # yesButton = msgBox.addButton(QtWidgets.QMessageBox.Yes)
        cancelButton = msgBox.addButton(QtWidgets.QMessageBox.Cancel)
        propButton = msgBox.addButton(msgBox.tr("Prop"),
                                      QtWidgets.QMessageBox.YesRole)
        characterButton = msgBox.addButton(msgBox.tr("Character"),
                                           QtWidgets.QMessageBox.YesRole)
        setButton = msgBox.addButton(msgBox.tr("Set"),
                                     QtWidgets.QMessageBox.YesRole)

        msgBox.exec_()

        if msgBox.clickedButton() == propButton:
            asset_type = AssetType.PROP
        elif msgBox.clickedButton() == characterButton:
            asset_type = AssetType.CHARACTER
        elif msgBox.clickedButton() == setButton:
            asset_type = AssetType.SET

        asset = project.create_asset(name, asset_type)
        #generate xml for houdini toolshelf
        try:
            byu_xml.writeXML(name)
        except Exception as error:
            print error
            message_gui.error(error.args)

    elif bodyType == 'shot':
        shot = project.create_shot(name)
    elif bodyType == 'tool':
        tool = project.create_tool(name)
    elif bodyType == 'crowd cycle':
        cycle = project.create_crowd_cycle(name)
    else:
        message_gui.error(
            bodyType +
            " is not a valid type!\nThis should not have happend. Please contact a Pipline Management Team member for help!\nTake a screenshot of this error and tell him/her that it came from new_body_gui.py"
        )
Beispiel #4
0
def createBody(bodyType, name):
    project = Project()
    if bodyType == 'asset':

        msgBox = QtWidgets.QMessageBox()
        msgBox.setText(msgBox.tr("What type of asset is this?"))
        # noButton = msgBox.addButton(QtWidgets.QMessageBox.No)
        # yesButton = msgBox.addButton(QtWidgets.QMessageBox.Yes)
        cancelButton = msgBox.addButton(QtWidgets.QMessageBox.Cancel)
        setButton = msgBox.addButton(msgBox.tr("Set"),
                                     QtWidgets.QMessageBox.YesRole)
        propButton = msgBox.addButton(msgBox.tr("Prop"),
                                      QtWidgets.QMessageBox.YesRole)
        characterButton = msgBox.addButton(msgBox.tr("Character"),
                                           QtWidgets.QMessageBox.YesRole)
        accessoryButton = msgBox.addButton(msgBox.tr("Accessory"),
                                           QtWidgets.QMessageBox.YesRole)

        msgBox.exec_()

        if msgBox.clickedButton() == propButton:
            asset_type = AssetType.PROP
        elif msgBox.clickedButton() == characterButton:
            asset_type = AssetType.CHARACTER
        elif msgBox.clickedButton() == setButton:
            asset_type = AssetType.SET
        elif msgBox.clickedButton() == accessoryButton:
            asset_type = AssetType.ACCESSORY

        print asset_type + " is the asset type"
        asset = project.create_asset(name, asset_type)
    elif bodyType == 'shot':
        shot = project.create_shot(name)
    elif bodyType == 'tool':
        tool = project.create_tool(name)
    else:
        message_gui.error(
            bodyType +
            " is not a valid type!\nThis should not have happend. Please contact a Pipline Management Team member for help!\nTake a screenshot of this error and tell him/her that it came from new_body_gui.py"
        )