当前位置: 首页>>代码示例>>Python>>正文


Python AnimEditor.getAnimBlock方法代码示例

本文整理汇总了Python中animeditor.AnimEditor.getAnimBlock方法的典型用法代码示例。如果您正苦于以下问题:Python AnimEditor.getAnimBlock方法的具体用法?Python AnimEditor.getAnimBlock怎么用?Python AnimEditor.getAnimBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在animeditor.AnimEditor的用法示例。


在下文中一共展示了AnimEditor.getAnimBlock方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ParticleEditor

# 需要导入模块: from animeditor import AnimEditor [as 别名]
# 或者: from animeditor.AnimEditor import getAnimBlock [as 别名]

#.........这里部分代码省略.........
		
		self.m2.particle_emitters[self.last] = p
			
			
	def changeEdit(self):
		self.saveOld()
		if(self.chooseBox.count() == 0):
			return
		self.last = self.chooseBox.currentIndex()
		p = self.m2.particle_emitters[self.last]
		self.boneBox.setCurrentIndex(p.bone+1)
		self.textureBox.setCurrentIndex(p.texture)
		self.particleColorBox.setCurrentIndex(p.color_dbc-10 if( p.color_dbc in (11,12,13)) else 0)
		self.htBox.setCurrentIndex(p.head_or_tail)
		self.typeBox.setCurrentIndex(p.particletype)
		
		self.xEdit.setText(str(p.Pos.x))
		self.yEdit.setText(str(p.Pos.y))
		self.zEdit.setText(str(p.Pos.z))
		
		self.modelEdit.setText(p.ModelName)
		self.particleEdit.setText(p.ParticleName)
		
	

	def editEmissionSpeed(self):		
		temp = self.chooseBox.currentIndex()
		self.eSpeedEditor = AnimEditor()
		self.eSpeedEditor.setAnimBlock(self.m2.particle_emitters[temp].emission_speed,self.m2.gSequ)
		self.eSpeedEditor.show()
		self.connect(self.eSpeedEditor,QtCore.SIGNAL("AnimBlockEdited()"),self.setEmissionSpeed)

	def setEmissionSpeed(self):
		self.m2.particle_emitters[self.chooseBox.currentIndex()].emission_speed = self.eSpeedEditor.getAnimBlock()
		
	

	def editSpeedVariation(self):		
		temp = self.chooseBox.currentIndex()
		self.eSpeedVarEditor = AnimEditor()
		self.eSpeedVarEditor.setAnimBlock(self.m2.particle_emitters[temp].speed_var,self.m2.gSequ)
		self.eSpeedVarEditor.show()
		self.connect(self.eSpeedVarEditor,QtCore.SIGNAL("AnimBlockEdited()"),self.setSpeedVariation)

	def setSpeedVariation(self):
		self.m2.particle_emitters[self.chooseBox.currentIndex()].speed_var = self.eSpeedVarEditor.getAnimBlock()
		
	

	def editVerticalRange(self):		
		temp = self.chooseBox.currentIndex()
		self.VertRangeEditor = AnimEditor()
		self.VertRangeEditor.setAnimBlock(self.m2.particle_emitters[temp].vert_range,self.m2.gSequ)
		self.VertRangeEditor.show()
		self.connect(self.VertRangeEditor,QtCore.SIGNAL("AnimBlockEdited()"),self.setVerticalRange)

	def setVerticalRange(self):
		self.m2.particle_emitters[self.chooseBox.currentIndex()].vert_range = self.VertRangeEditor.getAnimBlock()
		
	

	def editHorizontalRange(self):		
		temp = self.chooseBox.currentIndex()
		self.HorRangeEditor = AnimEditor()
		self.HorRangeEditor.setAnimBlock(self.m2.particle_emitters[temp].hor_range,self.m2.gSequ)
		self.HorRangeEditor.show()
开发者ID:GanjaNoel,项目名称:pym2,代码行数:70,代码来源:particleeditor.py

示例2: AttachmentEditor

# 需要导入模块: from animeditor import AnimEditor [as 别名]
# 或者: from animeditor.AnimEditor import getAnimBlock [as 别名]

#.........这里部分代码省略.........
		self.label.setObjectName("label")

		self.xEdit = QtGui.QLineEdit(Dialog)
		self.xEdit.setGeometry(QtCore.QRect(20, 130, 50, 26))
		self.xEdit.setObjectName("xEdit")

		self.yEdit = QtGui.QLineEdit(Dialog)
		self.yEdit.setGeometry(QtCore.QRect(80, 130, 50, 26))
		self.yEdit.setObjectName("yEdit")

		self.zEdit = QtGui.QLineEdit(Dialog)
		self.zEdit.setGeometry(QtCore.QRect(140, 130, 50, 26))
		self.zEdit.setObjectName("zEdit")

		self.boneBox = QtGui.QComboBox(Dialog)
		self.boneBox.setGeometry(QtCore.QRect(20, 170, 100, 27))
		self.boneBox.setObjectName("boneBox")


		self.enabledIcon = QtGui.QIcon("Icons/edit-enabled.png")
		self.enabledButton = QtGui.QPushButton(self.enabledIcon,"Edit Enabled",Dialog)
		self.enabledButton.setGeometry(QtCore.QRect(20, 200, 140, 28))
		self.enabledButton.setObjectName("enabledButton")
		self.connect(self.enabledButton, QtCore.SIGNAL("clicked()"), self.editEnabled)

		self.retranslateUi(Dialog)
		QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), self.finalizeMe)
		QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
		QtCore.QMetaObject.connectSlotsByName(Dialog)


	def finalizeMe(self):
		self.saveOld()
		self.accept()

	def retranslateUi(self, Dialog):
		Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Attachment Editor", None, QtGui.QApplication.UnicodeUTF8))
		self.addButton.setText(QtGui.QApplication.translate("Dialog", "Add", None, QtGui.QApplication.UnicodeUTF8))
		self.label.setText(QtGui.QApplication.translate("Dialog", "Position:", None, QtGui.QApplication.UnicodeUTF8))

		for i in range(50):
			self.typeBox.setItemText(i, QtGui.QApplication.translate("Dialog", str(i)+": "+attachment_types[i], None, QtGui.QApplication.UnicodeUTF8))

	

	def setModel(self,m2,skin):
		self.m2 = m2
		self.skin = skin
		for i in range(len(self.m2.attachments)):
			self.comboBox.addItem(str(i)+": "+attachment_types[self.m2.attachments[i].Id])
		for i in range(len(self.m2.bones)):
			self.boneBox.addItem("Bone: "+str(i)+"/"+str(self.m2.bones[i].KeyBoneId))
		self.changeEdit()

	def setCurrentEditing(self,i):
		self.comboBox.setCurrentIndex(i)
		self.changeEdit()

	def addAttachment(self,parbone = 0):
		att = m2.Attachment()
		att.Enabled.type = m2.DATA_INT
		att.bone = parbone
		lu = m2.Lookup()
		lu.Id = self.m2.hdr.attachments.count
		self.m2.attach_lookup.append(lu)
		self.m2.attachments.append(att)
		self.comboBox.addItem(str(self.m2.hdr.attachments.count)+": "+attachment_types[self.m2.attachments[self.m2.hdr.attachments.count].Id])
		self.m2.hdr.attachments.count += 1
		self.m2.hdr.attach_lookup.count += 1


	def changeEdit(self):
		self.saveOld()
		self.last = self.comboBox.currentIndex()
		if not len(self.m2.attachments)<1:
			self.typeBox.setCurrentIndex(self.m2.attachments[self.comboBox.currentIndex()].Id)
			self.xEdit.setText(str(self.m2.attachments[self.comboBox.currentIndex()].pos.x))
			self.yEdit.setText(str(self.m2.attachments[self.comboBox.currentIndex()].pos.y))
			self.zEdit.setText(str(self.m2.attachments[self.comboBox.currentIndex()].pos.z))
			self.boneBox.setCurrentIndex(self.m2.attachments[self.comboBox.currentIndex()].bone)

	def saveOld(self):
		if (self.last == -1):
			return
		self.m2.attachments[self.last].Id = self.typeBox.currentIndex()
		self.m2.attachments[self.last].pos.x = float(self.xEdit.text())
		self.m2.attachments[self.last].pos.y = float(self.yEdit.text())
		self.m2.attachments[self.last].pos.z = float(self.zEdit.text())
		self.m2.attachments[self.last].bone = self.boneBox.currentIndex()
		self.comboBox.setItemText(self.last,str(self.last)+": "+attachment_types[self.m2.attachments[self.last].Id])

	def editEnabled(self):		
		temp = self.comboBox.currentIndex()
		self.EnabledEditor = AnimEditor()
		self.EnabledEditor.setAnimBlock(self.m2.attachments[temp].Enabled,self.m2.gSequ)
		self.EnabledEditor.show()
		self.connect(self.EnabledEditor,QtCore.SIGNAL("AnimBlockEdited()"),self.setEnabled)

	def setEnabled(self):
		self.m2.attachments[self.comboBox.currentIndex()].Enabled = self.EnabledEditor.getAnimBlock()
开发者ID:GanjaNoel,项目名称:pym2,代码行数:104,代码来源:attachmenteditor.py

示例3: ColorEditor

# 需要导入模块: from animeditor import AnimEditor [as 别名]
# 或者: from animeditor.AnimEditor import getAnimBlock [as 别名]
class ColorEditor(QtGui.QDialog):
	def __init__(self): 
		QtGui.QDialog.__init__(self) 
		self.setupUi(self)
		self.last = -1
		
	def setupUi(self, Dialog):
		Dialog.setObjectName("Dialog")
		Dialog.resize(450, 150)
		
		self.buttonBox = QtGui.QDialogButtonBox(Dialog)
		self.buttonBox.setGeometry(QtCore.QRect(90, 110, 341, 32))
		self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
		self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
		self.buttonBox.setObjectName("buttonBox")
		
		self.colorList = QtGui.QComboBox(Dialog)
		self.colorList.setGeometry(QtCore.QRect(10, 10, 69, 22))
		self.colorList.setObjectName("colorList")
		self.connect(self.colorList, QtCore.SIGNAL("currentIndexChanged(int)"), self.changeEdit) 
		
		self.line = QtGui.QFrame(Dialog)
		self.line.setGeometry(QtCore.QRect(10, 40, 211, 16))
		self.line.setFrameShape(QtGui.QFrame.HLine)
		self.line.setFrameShadow(QtGui.QFrame.Sunken)
		self.line.setObjectName("line")
		
		self.addIcon = QtGui.QIcon("Icons/edit-add.png")
		self.addButton = QtGui.QPushButton(self.addIcon,"Add",Dialog)
		self.addButton.setGeometry(QtCore.QRect(100, 10, 75, 23))
		self.addButton.setObjectName("addButton")
		self.connect(self.addButton, QtCore.SIGNAL("clicked()"), self.addColor)
		
		self.colorButton = QtGui.QPushButton(Dialog)
		self.colorButton.setGeometry(QtCore.QRect(150, 60, 75, 23))
		self.colorButton.setObjectName("colorButton")
		self.connect(self.colorButton, QtCore.SIGNAL("clicked()"), self.editColor)
		
		self.alphaButton = QtGui.QPushButton(Dialog)
		self.alphaButton.setGeometry(QtCore.QRect(240, 60, 75, 23))
		self.alphaButton.setObjectName("alphaButton")
		self.connect(self.alphaButton, QtCore.SIGNAL("clicked()"), self.editAlpha)

		self.retranslateUi(Dialog)
		QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
		QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
		QtCore.QMetaObject.connectSlotsByName(Dialog)

	def retranslateUi(self, Dialog):
		Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Color Editor", None, QtGui.QApplication.UnicodeUTF8))
		self.addButton.setText(QtGui.QApplication.translate("Dialog", "Add", None, QtGui.QApplication.UnicodeUTF8))
		self.colorButton.setText(QtGui.QApplication.translate("Dialog", "Edit Color", None, QtGui.QApplication.UnicodeUTF8))
		self.alphaButton.setText(QtGui.QApplication.translate("Dialog", "Edit Alpha", None, QtGui.QApplication.UnicodeUTF8))
		


	def editColor(self):		
		temp = self.colorList.currentIndex()
		self.ColEditor = AnimColorEditor()
		self.ColEditor.setAnimBlock(self.m2.colors[temp].color,self.m2.gSequ)
		self.ColEditor.show()
		self.connect(self.ColEditor,QtCore.SIGNAL("AnimBlockEdited()"),self.setColor)

	def setColor(self):
		self.m2.colors[self.colorList.currentIndex()].color = self.ColEditor.getAnimBlock()

	def editAlpha(self):		
		temp = self.colorList.currentIndex()
		self.AlphaEditor = AnimEditor()
		self.AlphaEditor.setAnimBlock(self.m2.colors[temp].alpha,self.m2.gSequ)
		self.AlphaEditor.show()
		self.connect(self.AlphaEditor,QtCore.SIGNAL("AnimBlockEdited()"),self.setAlpha)

	def setAlpha(self):
		self.m2.colors[self.colorList.currentIndex()].alpha = self.AlphaEditor.getAnimBlock()


	def finalizeMe(self):
		self.saveOld()
		self.accept()

	def setCurrentEditing(self,i):
		self.colorList.setCurrentIndex(i)
		self.changeEdit()

	def setModel(self,m2,skin):
		self.m2 = m2
		self.skin = skin
		for i in range(len(self.m2.colors)):
			self.colorList.addItem(str(i))
		self.changeEdit()
		
		
	def addColor(self):
		l = m2.Color()
		l.color.type = m2.DATA_VEC3
		l.alpha.type = m2.DATA_FLOAT

		self.m2.colors.append(l)
		
#.........这里部分代码省略.........
开发者ID:GanjaNoel,项目名称:pym2,代码行数:103,代码来源:coloreditor.py

示例4: LightEditor

# 需要导入模块: from animeditor import AnimEditor [as 别名]
# 或者: from animeditor.AnimEditor import getAnimBlock [as 别名]

#.........这里部分代码省略.........
		self.m2.lights.append(l)
		
		self.lightList.addItem(str(self.m2.hdr.lights.count)+": "+LightTypes[self.m2.lights[self.last].Type])
		self.m2.hdr.lights.count += 1

	def saveOld(self):
		if (self.last == -1):
			return
		self.m2.lights[self.last].Type = self.typeBox.currentIndex()
		self.m2.lights[self.last].Pos.x = float(self.xPos.text())
		self.m2.lights[self.last].Pos.y = float(self.yPos.text())
		self.m2.lights[self.last].Pos.z = float(self.zPos.text())
		self.m2.lights[self.last].Bone = self.boneBox.currentIndex()-1
		self.lightList.setItemText(self.last,str(self.last)+": "+LightTypes[self.m2.lights[self.last].Type])
			
			
			
			
	def changeEdit(self):
		self.saveOld()
		self.last = self.lightList.currentIndex()
		if not len(self.m2.lights)<1:			
			self.typeBox.setCurrentIndex(self.m2.lights[self.lightList.currentIndex()].Type)
			self.xPos.setText(str(self.m2.lights[self.lightList.currentIndex()].Pos.x))
			self.yPos.setText(str(self.m2.lights[self.lightList.currentIndex()].Pos.y))
			self.zPos.setText(str(self.m2.lights[self.lightList.currentIndex()].Pos.z))			
			self.boneBox.setCurrentIndex(self.m2.lights[self.lightList.currentIndex()].Bone+1)
			
			
	

	def editAmbientColor(self):		
		temp = self.lightList.currentIndex()
		self.AmbColEditor = AnimEditor()
		self.AmbColEditor.setAnimBlock(self.m2.lights[temp].AmbientCol,self.m2.gSequ)
		self.AmbColEditor.show()
		self.connect(self.AmbColEditor,QtCore.SIGNAL("AnimBlockEdited()"),self.setAmbientColor)

	def setAmbientColor(self):
		self.m2.lights[self.lightList.currentIndex()].AmbientCol = self.AmbColEditor.getAnimBlock()

	def editAmbientIntensity(self):		
		temp = self.lightList.currentIndex()
		self.AmbIntEditor = AnimEditor()
		self.AmbIntEditor.setAnimBlock(self.m2.lights[temp].AmbientInt,self.m2.gSequ)
		self.AmbIntEditor.show()
		self.connect(self.AmbIntEditor,QtCore.SIGNAL("AnimBlockEdited()"),self.setAmbientIntensity)

	def setAmbientIntensity(self):
		self.m2.lights[self.lightList.currentIndex()].AmbientInt = self.AmbIntEditor.getAnimBlock()

	def editDiffuseColor(self):		
		temp = self.lightList.currentIndex()
		self.DiffColEditor = AnimEditor()
		self.DiffColEditor.setAnimBlock(self.m2.lights[temp].DiffuseCol,self.m2.gSequ)
		self.DiffColEditor.show()
		self.connect(self.DiffColEditor,QtCore.SIGNAL("AnimBlockEdited()"),self.setDiffuseColor)

	def setDiffuseColor(self):
		self.m2.lights[self.lightList.currentIndex()].DiffuseCol = self.DiffColEditor.getAnimBlock()

	def editDiffuseIntensity(self):		
		temp = self.lightList.currentIndex()
		self.DiffIntEditor = AnimEditor()
		self.DiffIntEditor.setAnimBlock(self.m2.lights[temp].DiffuseInt,self.m2.gSequ)
		self.DiffIntEditor.show()
		self.connect(self.DiffIntEditor,QtCore.SIGNAL("AnimBlockEdited()"),self.setDiffuseIntensity)

	def setDiffuseIntensity(self):
		self.m2.lights[self.lightList.currentIndex()].DiffuseInt = self.DiffIntEditor.getAnimBlock()

	def editAttenuationStart(self):		
		temp = self.lightList.currentIndex()
		self.AttStartEditor = AnimEditor()
		self.AttStartEditor.setAnimBlock(self.m2.lights[temp].AttStart,self.m2.gSequ)
		self.AttStartEditor.show()
		self.connect(self.AttStartEditor,QtCore.SIGNAL("AnimBlockEdited()"),self.setAttenuationStart)

	def setAttenuationStart(self):
		self.m2.lights[self.lightList.currentIndex()].AttStart = self.AttStartEditor.getAnimBlock()

	def editAttenuationEnd(self):		
		temp = self.lightList.currentIndex()
		self.AttEndEditor = AnimEditor()
		self.AttEndEditor.setAnimBlock(self.m2.lights[temp].AttEnd,self.m2.gSequ)
		self.AttEndEditor.show()
		self.connect(self.AttEndEditor,QtCore.SIGNAL("AnimBlockEdited()"),self.setAttenuationEnd)

	def setAttenuationEnd(self):
		self.m2.lights[self.lightList.currentIndex()].AttEnd = self.AttEndEditor.getAnimBlock()

	def editEnabled(self):		
		temp = self.lightList.currentIndex()
		self.EnabledEditor = AnimEditor()
		self.EnabledEditor.setAnimBlock(self.m2.lights[temp].Enabled,self.m2.gSequ)
		self.EnabledEditor.show()
		self.connect(self.EnabledEditor,QtCore.SIGNAL("AnimBlockEdited()"),self.setEnabled)

	def setEnabled(self):
		self.m2.lights[self.lightList.currentIndex()].Enabled = self.EnabledEditor.getAnimBlock()
开发者ID:GanjaNoel,项目名称:pym2,代码行数:104,代码来源:lighteditor.py


注:本文中的animeditor.AnimEditor.getAnimBlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。