本文整理汇总了Python中rapi.rpgSetMaterial函数的典型用法代码示例。如果您正苦于以下问题:Python rpgSetMaterial函数的具体用法?Python rpgSetMaterial怎么用?Python rpgSetMaterial使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rpgSetMaterial函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: build_meshes
def build_meshes(self):
for meshInfo in self.meshInfo:
vertBuff = meshInfo[0]
idxBuff = meshInfo[1]
numIdx = meshInfo[2]
matNum = meshInfo[3]
meshName = meshInfo[4]
if self.xxFormat >= 4:
rapi.rpgBindPositionBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 70, 2)
rapi.rpgBindNormalBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 70, 30)
rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 70, 42)
else:
rapi.rpgBindPositionBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 52, 4)
rapi.rpgBindNormalBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 52, 32)
rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 52, 44)
if len(self.matList) > matNum:
mat = self.matList[matNum]
matName = mat.name
rapi.rpgSetMaterial(matName)
rapi.rpgSetName(meshName)
rapi.rpgCommitTriangles(idxBuff, noesis.RPGEODATA_USHORT, numIdx, noesis.RPGEO_TRIANGLE, 1)
rapi.rpgClearBufferBinds()
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:26,代码来源:fmt_illusion_xx.py
示例2: build_meshes
def build_meshes(self):
rapi.rpgSetOption(noesis.RPGOPT_TRIWINDBACKWARD, 1)
for mesh in self.meshList:
print(mesh.vertSize)
if mesh.vertSize == 28:
rapi.rpgBindPositionBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 28, 0)
elif mesh.vertSize == 32:
rapi.rpgBindPositionBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 32, 0)
#rapi.rpgBindNormalBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 32, 20)
rapi.rpgBindUV1BufferOfs(mesh.vertBuff, noesis.RPGEODATA_HALFFLOAT, 32, 16)
elif mesh.vertSize == 36:
rapi.rpgBindPositionBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 36, 0)
elif mesh.vertSize == 40:
rapi.rpgBindPositionBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 40, 0)
elif mesh.vertSize == 44:
rapi.rpgBindPositionBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 44, 0)
#for j in range(mesh.numFaceGroups): # Not sure
for j in range(1):
numIdx = mesh.numIndices[j]
idxBuff = mesh.idxBuffs[j]
rapi.rpgSetMaterial("WP_A_1550small.tga")
rapi.rpgCommitTriangles(idxBuff, noesis.RPGEODATA_USHORT, numIdx, noesis.RPGEO_TRIANGLE_STRIP, 1)
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:26,代码来源:fmt_DarkSouls_flv.py
示例3: noepyLoadModel
def noepyLoadModel(data, mdlList):
'''Build the model, set materials, bones, and animations. You do not
need all of them as long as they are empty lists (they are by default)'''
ctx = rapi.rpgCreateContext()
parser = SanaeParser(data)
parser.parse_file()
#build meshes
for pose in parser.vertGroups.keys():
print(pose, len(parser.vertGroups[pose]))
vertBuffs = parser.vertGroups["walk"]
for i in range(len(vertBuffs)):
idxBuff, numIdx, matNum = parser.idxBuffs[i%len(parser.idxBuffs)]
vertBuff = vertBuffs[i]
rapi.rpgBindPositionBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 32, 0)
rapi.rpgBindNormalBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 32, 12)
rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 32, 24)
matName = parser.matList[matNum].name
rapi.rpgSetMaterial(matName)
rapi.rpgSetOption(noesis.RPGOPT_TRIWINDBACKWARD, 1)
rapi.rpgCommitTriangles(idxBuff, noesis.RPGEODATA_USHORT, numIdx, noesis.RPGEO_TRIANGLE, 1)
mdl = rapi.rpgConstructModel()
mdl.setModelMaterials(NoeModelMaterials(parser.texList, parser.matList))
mdl.setBones(parser.boneList)
mdl.setAnims(parser.animList)
mdlList.append(mdl)
return 1
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:30,代码来源:fmt_YiJianXiang_fak.py
示例4: parse_file
def parse_file(self):
meshName = self.read_name()
matName = self.read_name()
texName = meshName
numIdx = self.inFile.readUInt() * 3
numVerts, numUV = self.inFile.read('2L')
vertBuff = self.parse_vertices(numVerts)
idxBuff = self.parse_faces(numIdx)
uvBuff = self.parse_uv(numUV)
self.parse_uv_index(numIdx)
#create material
material = NoeMaterial(matName, texName)
self.matList.append(material)
#build mesh
rapi.rpgBindPositionBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 24, 0)
rapi.rpgBindNormalBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 24, 12)
#commit triangles
rapi.rpgSetMaterial(texName)
rapi.rpgCommitTriangles(idxBuff, noesis.RPGEODATA_USHORT, numIdx, noesis.RPGEO_TRIANGLE, 1)
#what to do with these UV's?
rapi.rpgBindUV1Buffer(uvBuff, noesis.RPGEODATA_FLOAT, 8)
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:27,代码来源:fmt_ares_n3cskins.py
示例5: parse_unskinned_mesh
def parse_unskinned_mesh(self):
meshName = "mesh"
matName = meshName
rapi.rpgSetMaterial(matName)
check = self.inFile.readInt() #important?
while check != -1:
print(self.read_name())
self.inFile.readUInt()
self.inFile.readUInt()
self.inFile.read('9f')
print(self.inFile.tell())
check = self.inFile.readInt()
print(self.inFile.tell())
self.inFile.read('6f')
unk2 = self.inFile.readUInt()
if unk2:
self.read_name()
self.inFile.read('2L')
numVerts = self.inFile.readUInt()
print("%d verts" %numVerts)
self.parse_unskinned_vertices(numVerts)
numIdx = self.inFile.readUInt()
self.parse_faces(numIdx)
#if bBones == 1:
#self.parse_weights(numVerts)
#sectionSize = self.inFile.readUInt()
#self.parse_bones(sectionSize)
print(self.inFile.tell())
self.parse_unskinned_materials(matName)
开发者ID:tianye910208,项目名称:restool_jiuyintool,代码行数:30,代码来源:fmt_AgeOfWulin_xmod.py
示例6: parse_mesh
def parse_mesh(self, numMesh):
for i in range(numMesh):
self.read_name() # scene root
meshName = self.read_name()
rapi.rpgSetName(meshName)
numVerts, numIdx, unk = self.inFile.read("3L")
triStrip, flag1, unk, unk = self.inFile.read("4B")
self.inFile.seek(496, 1)
idxBuff = self.parse_faces(numIdx)
self.parse_vertices(numVerts)
print(self.inFile.tell())
if self.hasBones:
numBones = self.inFile.readUInt()
self.parse_mesh_bones(numBones)
texName = meshName + ".dds"
matName = "material"
material = NoeMaterial(matName, texName)
self.matList.append(material)
print(self.inFile.tell())
rapi.rpgSetMaterial(matName)
if triStrip:
rapi.rpgCommitTriangles(idxBuff, noesis.RPGEODATA_USHORT, numIdx, noesis.RPGEO_TRIANGLE_STRIP, 1)
else:
rapi.rpgCommitTriangles(idxBuff, noesis.RPGEODATA_USHORT, numIdx, noesis.RPGEO_TRIANGLE, 1)
开发者ID:mstevenson,项目名称:noesis-plugins-official,代码行数:27,代码来源:fmt_DragonNest_msh.py
示例7: parse_file
def parse_file(self, filename):
idstring = self.inFile.readBytes(6)
unk, numMesh = self.inFile.read('2H')
self.read_name()
modelName = self.read_name()
self.inFile.readByte() #?
self.inFile.read('6f')
self.inFile.read('2L')
numVerts, numIdx = self.inFile.read('2H')
self.parse_vertices(numVerts)
idxBuff = self.parse_faces(numIdx)
matName = self.parse_material()
rapi.rpgSetMaterial(matName)
rapi.rpgCommitTriangles(idxBuff, noesis.RPGEODATA_USHORT, numIdx, noesis.RPGEO_TRIANGLE, 1)
##unknowns
#self.parse_unk()
#count = self.inFile.readUInt()
#self.parse_unk2(count)
#count2 = self.inFile.readUInt()
#self.parse_unk3(count2)
#count3 = self.inFile.readUInt()
#self.parse_unk4(count3)
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:24,代码来源:fmt_CloudNine_xskin.py
示例8: parse_mesh
def parse_mesh(self):
meshName = self.read_name()
null, matNum = self.inFile.read("2L")
numMat = self.inFile.readUInt()
if numMat:
self.inFile.readUInt()
if numMat > 1:
self.inFile.readUInt()
self.parse_materials(numMat)
self.inFile.readUInt()
self.inFile.read('2f')
self.inFile.read('3L')
flag1 = self.inFile.readUInt()
numVerts = self.inFile.readUInt()
numNorms = self.inFile.readUInt()
numIdx = self.inFile.readUInt() * 3
numBones = self.inFile.readUInt()
numWeights = self.inFile.readUInt()
self.inFile.read('50f')
self.parse_vertices(numVerts, numNorms, numWeights)
idxBuff = self.parse_faces(numIdx)
#idxBuff2 = self.parse_faces(numIdx)
if numIdx:
matName = self.matList[matNum].name
rapi.rpgSetMaterial(matName)
rapi.rpgCommitTriangles(idxBuff, noesis.RPGEODATA_UINT, numIdx, noesis.RPGEO_TRIANGLE, 1)
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:29,代码来源:fmt_croixleur_geo.py
示例9: build_meshes
def build_meshes(self):
rapi.rpgSetOption(noesis.RPGOPT_TRIWINDBACKWARD, 1)
for i in range(len(self.meshList)):
mesh = self.meshList[i]
rapi.rpgSetName(mesh.name)
if mesh.vertSize == 32:
rapi.rpgBindPositionBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 32, 0)
rapi.rpgBindNormalBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 32, 12)
rapi.rpgBindUV1BufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 32, 24)
elif mesh.vertSize == 40:
rapi.rpgBindPositionBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 40, 0)
rapi.rpgBindNormalBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 40, 20)
rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 40, 32)
elif mesh.vertSize == 48:
rapi.rpgBindPositionBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 48, 0)
rapi.rpgBindNormalBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 48, 28)
rapi.rpgBindUV1BufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 48, 40)
for sub in mesh.submeshes:
idxStart = sub.idxOfs
idxEnd = idxStart + sub.numIdx * 2
idxBuff = mesh.idxBuff[idxStart:idxEnd]
rapi.rpgSetMaterial(self.tex)
rapi.rpgCommitTriangles(idxBuff, noesis.RPGEODATA_USHORT, sub.numIdx, noesis.RPGEO_TRIANGLE, 1)
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:26,代码来源:fmt_UCGundamOnline_det.py
示例10: parse_file
def parse_file(self):
idstring = self.inFile.readBytes(12)
offVerts, offBones, offFaces, unkOff1, unkOff2, ofsbbox, unkOff4, \
unk1, unk2, unkOff5, unk3, unk4, unk5, vertType, unk7 \
= self.inFile.read('15L')
meshName = self.read_name()
matName = self.read_name()
self.inFile.readUInt()
self.inFile.seek(offVerts)
numVerts = self.inFile.readUInt()
self.parse_vertices(numVerts, vertType)
self.inFile.seek(offBones)
numBones = self.inFile.readUInt()
self.parse_bones(numBones, numVerts)
self.inFile.seek(offFaces)
numFaces = self.inFile.readUInt()
rapi.rpgSetMaterial(matName)
self.parse_faces(numFaces*3)
self.load_texture(matName)
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:26,代码来源:fmt_silkroad_bms.py
示例11: noepyLoadModel
def noepyLoadModel(data, mdlList):
'''Build the model, set materials, bones, and animations. You do not
need all of them as long as they are empty lists (they are by default)'''
parser = SanaeParser(data)
parser.parse_file()
ctx = rapi.rpgCreateContext()
for i in range(len(parser.vertBuffs)):
vertBuff, numVerts = parser.vertBuffs[i]
idxBuff, numIdx, matNum = parser.idxBuffs[i]
matList = [parser.matList[matNum]]
texList = [parser.texList[matNum]]
matName = matList[0].name
rapi.rpgReset()
rapi.rpgBindPositionBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 32, 0)
rapi.rpgBindNormalBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 32, 12)
rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 32, 24)
rapi.rpgSetMaterial(matName)
rapi.rpgCommitTriangles(idxBuff, noesis.RPGEODATA_USHORT, numIdx, noesis.RPGEO_TRIANGLE, 1)
mdl = rapi.rpgConstructModel()
mdl.setModelMaterials(NoeModelMaterials(texList, matList))
mdl.setBones(parser.boneList)
mdl.setAnims(parser.animList)
mdlList.append(mdl)
return 1
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:32,代码来源:fmt_CabalOnline_ebm.py
示例12: build_vertices
def build_vertices(self, mesh, meshName):
vertBuff = bytes()
normBuff = bytes()
uvBuff = bytes()
idxBuff = bytes()
rapi.rpgSetName(meshName)
for i in range(mesh.numIdx):
index = mesh.idxList[i]
vertBuff += struct.pack('3f', *mesh.vertList[index])
normBuff += struct.pack('3f', *mesh.normList[index])
uvBuff += struct.pack('2f', *mesh.uvList[i])
idxBuff += struct.pack('H', i)
rapi.rpgBindPositionBuffer(vertBuff, noesis.RPGEODATA_FLOAT, 12)
rapi.rpgBindNormalBuffer(normBuff, noesis.RPGEODATA_FLOAT, 12)
rapi.rpgBindUV1Buffer(uvBuff, noesis.RPGEODATA_FLOAT, 8)
matName = meshName
material = NoeMaterial(matName, self.basename)
material.setDefaultBlend(0)
self.matList.append(material)
rapi.rpgSetMaterial(meshName)
rapi.rpgCommitTriangles(idxBuff, noesis.RPGEODATA_USHORT, mesh.numIdx, noesis.RPGEO_TRIANGLE, 1)
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:26,代码来源:fmt_LithTech_abc.py
示例13: build_meshes
def build_meshes(self):
for i in range(len(self.idxBuffs)):
idxBuff, numIdx = self.idxBuffs[i]
matName = self.matList[i].name
rapi.rpgSetMaterial(matName)
rapi.rpgCommitTriangles(idxBuff, noesis.RPGEODATA_USHORT, numIdx, noesis.RPGEO_TRIANGLE, 1)
开发者ID:mstevenson,项目名称:noesis-plugins-official,代码行数:8,代码来源:fmt_loong_fscn.py
示例14: build_mesh
def build_mesh(self, idxBuff):
for matInfo in self.materials:
one, start, count, matNum = matInfo
end = start*2 + count*2
idxList = idxBuff[start*2:end]
matName = self.matList[matNum].name
rapi.rpgSetMaterial(matName)
rapi.rpgCommitTriangles(idxList, noesis.RPGEODATA_USHORT, count, noesis.RPGEO_TRIANGLE, 1)
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:9,代码来源:fmt_Gothic4_bakedgeom.py
示例15: parse_face_section
def parse_face_section(self, numSects):
for i in range(numSects):
numIdx = self.inFile.readInt()
idxList = self.parse_faces(numIdx)
self.inFile.readInt()
matName = self.read_name()
rapi.rpgSetMaterial(matName)
rapi.rpgCommitTriangles(idxList, noesis.RPGEODATA_USHORT, numIdx, noesis.RPGEO_TRIANGLE, 1)
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:10,代码来源:fmt_FatalFake_cdt.py
示例16: build_faces
def build_faces(self, idxBuff, matUsed, materials):
start = 0
for i in range(len(matUsed)):
numIdx = matUsed[i] * 3
end = start + numIdx * 4
buff = idxBuff[start:end]
rapi.rpgSetMaterial(materials[i])
rapi.rpgCommitTriangles(buff, noesis.RPGEODATA_UINT, numIdx, noesis.RPGEO_TRIANGLE, 1)
start = end
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:11,代码来源:fmt_DirectX_xbin.py
示例17: build_mesh
def build_mesh(self):
for i in range(len(self.meshList)):
mesh = self.meshList[i]
rapi.rpgBindPositionBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 48, 0)
rapi.rpgBindNormalBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 48, 28)
rapi.rpgBindUV1BufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 48, 40)
matName = self.matList[i].name
rapi.rpgSetMaterial(matName)
rapi.rpgCommitTriangles(mesh.idxBuff, noesis.RPGEODATA_USHORT, mesh.numIdx, noesis.RPGEO_TRIANGLE, 1)
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:11,代码来源:fmt_Yulgang_skin.py
示例18: build_mesh
def build_mesh(self):
for mesh in self.meshList:
rapi.rpgBindPositionBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 92, 0)
rapi.rpgBindNormalBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 92, 12)
rapi.rpgBindUV1BufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 92, 28)
rapi.rpgSetName(mesh.meshName)
matName = self.matList[mesh.matNum].name
rapi.rpgSetMaterial(matName)
rapi.rpgCommitTriangles(mesh.idxBuff, noesis.RPGEODATA_UINT, mesh.numIdx, noesis.RPGEO_TRIANGLE, 1)
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:11,代码来源:fmt_queensBlade_mesh.py
示例19: build_meshes
def build_meshes(self):
for i in range(len(self.meshList)):
mesh = self.meshList[i]
rapi.rpgBindPositionBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 32, 0)
rapi.rpgBindNormalBufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 32, 12)
rapi.rpgBindUV1BufferOfs(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 32, 24)
print(mesh.matNum)
matName = self.matList[mesh.matNum].name
rapi.rpgSetMaterial(matName)
rapi.rpgCommitTriangles(mesh.idxBuff, noesis.RPGEODATA_USHORT, mesh.numIdx, noesis.RPGEO_TRIANGLE_STRIP, 1)
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:12,代码来源:fmt_MusicGirlForMiku_mdl.py
示例20: build_meshes
def build_meshes(self):
for i in range(len(self.meshList)):
mesh = self.meshList[i]
if mesh.numVerts > 0:
rapi.rpgBindPositionBuffer(mesh.vertBuff, noesis.RPGEODATA_FLOAT, 12)
self.invert_faces()
if mesh.matNum != -1:
matName = self.matList[mesh.matNum].name
rapi.rpgSetMaterial(matName)
rapi.rpgCommitTriangles(mesh.idxBuff, noesis.RPGEODATA_UINT, mesh.numIdx, noesis.RPGEO_TRIANGLE, 1)
开发者ID:Danilodum,项目名称:noesis-plugins-official,代码行数:13,代码来源:fmt_RanceQuest_pol.py
注:本文中的rapi.rpgSetMaterial函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论