Exemple #1
0
	def showPasses(self):
		steps = None
		if self.node is not None:
			if self.node.type().name() == "ifd":
				steps = self.core.getConfig("defaultpasses", "houdini_mantra", configPath=self.core.prismIni)
			elif self.node.type().name() == "Redshift_ROP":
				steps = self.core.getConfig("defaultpasses", "houdini_redshift", configPath=self.core.prismIni)

		if steps == None or len(steps) == 0:
			return False

		steps = eval(steps)

		try:
			del sys.modules["ItemList"]
		except:
			pass

		import ItemList
		self.il = ItemList.ItemList(core = self.core)
		self.il.setWindowTitle("Select Passes")
		self.core.parentWindow(self.il)
		self.il.tw_steps.doubleClicked.connect(self.il.accept)
		self.il.b_addStep.setVisible(False)
		self.il.tw_steps.horizontalHeaderItem(0).setText("Name")
		self.il.tw_steps.horizontalHeaderItem(1).setText("VEX Variable")
		for i in steps:
			rc = self.il.tw_steps.rowCount()
			self.il.tw_steps.insertRow(rc)
			item1 = QTableWidgetItem(i[0])
			self.il.tw_steps.setItem(rc, 0, item1)
			item2 = QTableWidgetItem(i[1])
			self.il.tw_steps.setItem(rc, 1, item2)
	
		result = self.il.exec_()

		if result != 1:
			return False

		for i in self.il.tw_steps.selectedItems():
			if i.column() == 0:
				if self.node.type().name() == "ifd":
					passNum = self.node.parm("vm_numaux").eval()+1
					self.core.appPlugin.setNodeParm(self.node, "vm_numaux", val=passNum)
					self.core.appPlugin.setNodeParm(self.node, "vm_channel_plane" + str(passNum), val=steps[i.row()][0])
					self.core.appPlugin.setNodeParm(self.node, "vm_usefile_plane" + str(passNum), val=True)
					self.core.appPlugin.setNodeParm(self.node, "vm_variable_plane" + str(passNum), val=steps[i.row()][1])
				elif self.node.type().name() == "Redshift_ROP":
					passNum = self.node.parm("RS_aov").eval()+1
					self.core.appPlugin.setNodeParm(self.node, "RS_aov", val=passNum)
					typeID = self.node.parm("RS_aovID_" + str(passNum)).menuLabels().index(steps[i.row()][0])
					self.core.appPlugin.setNodeParm(self.node, "RS_aovID_" + str(passNum), val=typeID)
					self.core.appPlugin.setNodeParm(self.node, "RS_aovSuffix_" + str(passNum), val=steps[i.row()][1])

		self.updateUi()
Exemple #2
0
    def showPasses(self):
        steps = None
        if self.node is not None:
            steps = self.curRenderer.getDefaultPasses(self)

        if steps == None or len(steps) == 0:
            return False

        if type(steps) != list:
            steps = eval(steps)

        try:
            del sys.modules["ItemList"]
        except:
            pass

        import ItemList
        self.il = ItemList.ItemList(core=self.core)
        self.il.setWindowTitle("Select Passes")
        self.core.parentWindow(self.il)
        self.il.tw_steps.doubleClicked.connect(self.il.accept)
        self.il.b_addStep.setVisible(False)
        if self.curRenderer.label == "Mantra":
            self.il.tw_steps.horizontalHeaderItem(0).setText("Name")
            self.il.tw_steps.horizontalHeaderItem(1).setText("VEX Variable")
        else:
            self.il.tw_steps.horizontalHeaderItem(0).setText("Type")
            self.il.tw_steps.horizontalHeaderItem(1).setText("Name")

        for i in steps:
            rc = self.il.tw_steps.rowCount()
            self.il.tw_steps.insertRow(rc)
            item1 = QTableWidgetItem(i[0])
            self.il.tw_steps.setItem(rc, 0, item1)
            item2 = QTableWidgetItem(i[1])
            self.il.tw_steps.setItem(rc, 1, item2)

        self.il.tw_steps.resizeColumnsToContents()

        result = self.il.exec_()

        if result != 1:
            return False

        for i in self.il.tw_steps.selectedItems():
            if i.column() == 0:
                self.curRenderer.addAOV(self, steps[i.row()])

        self.updateUi()
Exemple #3
0
    def showPasses(self):
        steps = getattr(self.core.appPlugin, "sm_render_getRenderPasses",
                        lambda x: None)(self)

        if steps is None or len(steps) == 0:
            return False

        if pVersion == 2:
            isStr = isinstance(steps, basestring)
        else:
            isStr = isinstance(steps, str)

        if isStr:
            steps = eval(steps)

        try:
            del sys.modules["ItemList"]
        except:
            pass

        import ItemList

        self.il = ItemList.ItemList(core=self.core)
        self.il.setWindowTitle("Select Passes")
        self.core.parentWindow(self.il)
        self.il.b_addStep.setVisible(False)
        self.il.tw_steps.doubleClicked.connect(self.il.accept)
        self.il.tw_steps.horizontalHeaderItem(0).setText("Name")
        self.il.tw_steps.setColumnHidden(1, True)
        for i in sorted(steps, key=lambda s: s.lower()):
            rc = self.il.tw_steps.rowCount()
            self.il.tw_steps.insertRow(rc)
            item1 = QTableWidgetItem(i)
            self.il.tw_steps.setItem(rc, 0, item1)

        result = self.il.exec_()

        if result != 1:
            return False

        for i in self.il.tw_steps.selectedItems():
            if i.column() == 0:
                self.core.appPlugin.sm_render_addRenderPass(self,
                                                            passName=i.text(),
                                                            steps=steps)

        self.updateUi()
        self.stateManager.saveStatesToScene()
Exemple #4
0
	def __init__(self, eng, mobs, host, sec):
		self.engine = eng
		self.specific = mobs
		self.dir = "./data/mobster/"
		self.bot_name = mobs.nick
		self.host_channel = host
		self.prop_list = PropertyList.PropertyList(self.import_file(self.dir + "data/property_list.l"))
		self.item_list = ItemList.ItemList(self.import_file(self.dir + "data/item_list.l"))
		self.game = MobstersGame.MobstersGame(self)
		self.timer = 0
		self.security = sec
		self.public_toggle = False
		self.mobCredLevelUp = 3 # Points granted per level up
		self.msgb = MessageBuffer.MessageBuffer()
		#easy number reading
		locale.setlocale(locale.LC_ALL, "")
Exemple #5
0
                self.buttons[i].hover = False
                
def loadPictures(path):#loads every picture in a directory
    files = os.listdir(path)#gets the direcotry
    images = []#init empty image list

    for i in range(len(files)):
        imagePath = path + files[i]#gets the path of each file
        pic = loadPic(imagePath)

        if pic != False:
            images.append(pic)#loads the picture and adds it to a list


    return images
itemList = ItemList.itemList(loadPictures('data/images/Items/'))
weaponPics = loadPictures('data/images/Weapons/')#empty list of weapons
armorPics = loadPictures('data/Images/Armor/')

play = False#play is a boolean for whether the play has ppressed play

pygame.display.set_caption('Game2')#adds caption
pygame.mouse.set_visible(1)#makes mouse visible

#pygame.key.set_repeat(1,10)#allows keys to be held down
font = pygame.font.Font(pygame.font.match_font('bitstreamverasans'), 24)#creates a default font
buttonFont = pygame.font.Font(pygame.font.match_font('bitstreamverasans'), 36)#creates a button font
clock = pygame.time.Clock()#creates a game clock
background = pygame.Surface(screen.get_size())#creates a background
background = background.convert()
Exemple #6
0
def loadPictures(path):  # loads every picture in a directory
    files = os.listdir(path)  # gets the direcotry
    images = []  # init empty image list

    for i in range(len(files)):
        imagePath = path + files[i]  # gets the path of each file
        pic = loadPic(imagePath)

        if pic != False:
            images.append(pic)  # loads the picture and adds it to a list

    return images


itemList = ItemList.itemList(loadPictures("data/images/Items/"))
weaponPics = loadPictures("data/images/Weapons/")  # empty list of weapons
armorPics = loadPictures("data/Images/Armor/")

play = False  # play is a boolean for whether the play has ppressed play

pygame.display.set_caption("Game2")  # adds caption
pygame.mouse.set_visible(1)  # makes mouse visible

# pygame.key.set_repeat(1,10)#allows keys to be held down
font = pygame.font.Font(pygame.font.match_font("bitstreamverasans"), 24)  # creates a default font
buttonFont = pygame.font.Font(pygame.font.match_font("bitstreamverasans"), 36)  # creates a button font
clock = pygame.time.Clock()  # creates a game clock
background = pygame.Surface(screen.get_size())  # creates a background
background = background.convert()
__author__ = 'David Sweetman'
from ItemList import *
from Bidder import *

itemlist = ItemList()
bidDict = {}
status = True                                                 # True while we want programme to keep running


while status is True:
    while True:
        try:
            userinput = int(input("""Do you want to?
                         Place a Bid (1)
                         Get Highest Bid for item(2)
                         See all bids for item(3)
                         See all items bid on by user(4)
                         Exit(5)
                         Enter selection: """))                     # Ask user for number corresponding to task req.
        except ValueError:                                          # Not a valid selection
            print("Error, invalid selection")
        else:                                                       # Set number as task
            task = userinput
            break

    if task == 1:
        while True:
            try:
                itemtobid = input("Enter Item name to bid on: ").upper()
                iteminfo = itemlist.getItem(itemtobid)
                biddername = input("Enter Bidder name: ").upper()