That's a pretty big difference in indices they're storing...
Did you release any code?
Important information: this site is currently scheduled to go offline indefinitely by end of the year.
[NOESIS] Titan Quest
-
- mega-veteran
- Posts: 241
- Joined: Fri Aug 05, 2011 9:31 pm
- Location: Antwerp
- Has thanked: 13 times
- Been thanked: 41 times
Re: [NOESIS] Titan Quest
Not yet, both the .tex and .msh files are 1 big pile of unorganized code atm
I did get the triangles after rapi.constructmodel with Triangles = mdl.meshes[0].indices though, instead of the raw triangles.
I did get the triangles after rapi.constructmodel with Triangles = mdl.meshes[0].indices though, instead of the raw triangles.
-
- M-M-M-Monster veteran
- Posts: 2382
- Joined: Sat Apr 09, 2011 1:22 am
- Has thanked: 170 times
- Been thanked: 307 times
Re: [NOESIS] Titan Quest
Hmm that's interesting actually. I would've thought both methods should ideally produce the same results, given the same index buffer lol
-
- mega-veteran
- Posts: 241
- Joined: Fri Aug 05, 2011 9:31 pm
- Location: Antwerp
- Has thanked: 13 times
- Been thanked: 41 times
Re: [NOESIS] Titan Quest
Ok so I corrected all the boneindices for the weights and turned it back into bytes using struct.pack
then called
weightIdx = 6015 vertices * 4 indices length worth of bytes. I checked it and It has the correct length and data
self.vertBuff is the global buffer I also used for my UV/XYZ/normals so this should be correct , including the Offset.
This is called after my UV/XYZ/normal/tri's but before my
but nothing happens. What's the format for the weightList? I'll create it myself if needed.
then called
Code: Select all
rapi.rpgBindBoneIndexBufferOfs(weightIdx, noesis.RPGEODATA_UBYTE, 4, 0, 4)
rapi.rpgBindBoneWeightBufferOfs(self.vertBuff, noesis.RPGEODATA_FLOAT, self.vertLength, self.boneWeightOffset, 4)
self.vertBuff is the global buffer I also used for my UV/XYZ/normals so this should be correct , including the Offset.
This is called after my UV/XYZ/normal/tri's but before my
Code: Select all
mdl=rapi.rpgConstructModel()
if not mdl.meshes[0].weights: print("you fail")
mdl.setModelMaterials(NoeModelMaterials(self.texList, self.matList))
mdl.setBones(self.bones)
mdlList=[]
mdlList.append(mdl)
-
- Moderator
- Posts: 1007
- Joined: Mon Mar 23, 2009 2:57 am
- Has thanked: 44 times
- Been thanked: 505 times
Re: [NOESIS] Titan Quest
rapi.rpgSetBoneMap is provided specifically so that you don't have to do that...Demonsangel wrote:Ok so I corrected all the boneindices for the weights and turned it back into bytes using struct.pack
Make sure you're binding your vertex weight buffers before you actually commit the triangles. If you aren't seeing weight influences at all, you aren't doing things in the right order, or the data you're feeding in is invalid. I'm just assuming the order you're doing things in is likely to be the problem, because it was your problem with the materials, and I'm forced to make assumptions because you've only posted snippets of your whole script.Demonsangel wrote:but nothing happens.
It's not needed. Using the rpg interface is cleaner, simpler, and more computationally efficient. (much the same as remapping bone indices in Python yourself is also far slower than using rpgSetBoneMap)Demonsangel wrote:What's the format for the weightList? I'll create it myself if needed.
-
- mega-veteran
- Posts: 241
- Joined: Fri Aug 05, 2011 9:31 pm
- Location: Antwerp
- Has thanked: 13 times
- Been thanked: 41 times
Re: [NOESIS] Titan Quest
is rapi.rpgSetBoneMap able to hold 2 lists and how do I make the vertices pick the correct list?
In other words how do I put the info in the following image into a bonemap?
What is the index for "nobone" for noesis rpgBindBoneIndexBufferOfs? In the .msh a weight of 0 or an index of 0xFF means nobone, but I have been binding these to the rootbone instead.
And it seems something has to be wrong with the data because the order is right, but only the root bone(MOVEAXIS) and the 2 claviculae are being added to the skin modifier.
And since you want the full code: they're attached below.
I haven't rewritten it yet so it's a mess with a lot of redundant code.
https://www.dropbox.com/sh/7pn17bxhwo9gwgu/cORIt1nsc_
In other words how do I put the info in the following image into a bonemap?
What is the index for "nobone" for noesis rpgBindBoneIndexBufferOfs? In the .msh a weight of 0 or an index of 0xFF means nobone, but I have been binding these to the rootbone instead.
And it seems something has to be wrong with the data because the order is right, but only the root bone(MOVEAXIS) and the 2 claviculae are being added to the skin modifier.
And since you want the full code: they're attached below.
I haven't rewritten it yet so it's a mess with a lot of redundant code.
https://www.dropbox.com/sh/7pn17bxhwo9gwgu/cORIt1nsc_
-
- mega-veteran
- Posts: 241
- Joined: Fri Aug 05, 2011 9:31 pm
- Location: Antwerp
- Has thanked: 13 times
- Been thanked: 41 times
Re: [NOESIS] Titan Quest
How would I go about adding multi .msh file monsters?
For instance the automai has a body and a head. Both have a bone named "Bone_Neck01". How do I make these play nice?
As far as I can tell the Position info for the bone is the same, but the bone in the head.msh is "parented" to 1 which is root and I assume I'm supposed to 'update' the bonelist by just adding the new bone( Bone_head) to the already existing Bone_Neck01.
Tamschi, do you happen to know in what file the link is between both meshes? I assumed it's in the actual ingame monster data since there are 3 mesh files:(body + 2 heads) which allows for variety.
For instance the automai has a body and a head. Both have a bone named "Bone_Neck01". How do I make these play nice?
As far as I can tell the Position info for the bone is the same, but the bone in the head.msh is "parented" to 1 which is root and I assume I'm supposed to 'update' the bonelist by just adding the new bone( Bone_head) to the already existing Bone_Neck01.
Tamschi, do you happen to know in what file the link is between both meshes? I assumed it's in the actual ingame monster data since there are 3 mesh files:(body + 2 heads) which allows for variety.
Re: [NOESIS] Titan Quest
There's a Bone_Head in the body mesh too. I'm pretty sure you can just use the bones from the body mesh and only use the data from the attached mesh for the bone map.
It's the same with helmets and most armor. Weapons are attached to the AttachPoints from the text data instead.
It's the same with helmets and most armor. Weapons are attached to the AttachPoints from the text data instead.
-
- mega-veteran
- Posts: 241
- Joined: Fri Aug 05, 2011 9:31 pm
- Location: Antwerp
- Has thanked: 13 times
- Been thanked: 41 times
Re: [NOESIS] Titan Quest
Then I have a look in how to import more than 1 mesh and make sure the torso goes in first.
-
- Moderator
- Posts: 2602
- Joined: Sun May 18, 2008 3:01 pm
- Has thanked: 57 times
- Been thanked: 1422 times
Re: [NOESIS] Titan Quest
it should not matter what mesh gets imported first.
what i did for rumble roses which is the same is just import all the files in a folder.
then as you import the model you will have access to all the bones and won't have to create the bone that exists already again.
just on bone creation check if it exists before creating it and if it does exist just add it to your bone list instead of re creating it.
what i did for rumble roses which is the same is just import all the files in a folder.
then as you import the model you will have access to all the bones and won't have to create the bone that exists already again.
just on bone creation check if it exists before creating it and if it does exist just add it to your bone list instead of re creating it.
-
- mega-veteran
- Posts: 241
- Joined: Fri Aug 05, 2011 9:31 pm
- Location: Antwerp
- Has thanked: 13 times
- Been thanked: 41 times
Re: [NOESIS] Titan Quest
I'll try that, though I need to seriously rewrite the script before I can do anything like that.
Thanks.
Thanks.
-
- Moderator
- Posts: 1007
- Joined: Mon Mar 23, 2009 2:57 am
- Has thanked: 44 times
- Been thanked: 505 times
Re: [NOESIS] Titan Quest
You don't need 2 lists, it only applies to the current draw. You call rpgSetBoneMap for each draw every time you commit triangles. The list is a map that converts the per-vertex bone index to an index into the global bone list.
There should never be a vertex without a bone weight. If you want something that's static and not weighted to any part of the main skeleton, you should create a new bone for it outside of the main hierarchy and weight that static stuff to that, or just split it into a separate NoeModel with no skeleton. Or, don't bind vertex weight buffers at all, but that will require faces with no weights to be drawn in their own draw calls. No format should ever really be using static/boneless verts in the same mesh as weighted verts unless it's already internally assigning them to a bone/matrix with an assumed weighting of 1.0, because that would screw up any kind of shader/hardware transform path.
There should never be a vertex without a bone weight. If you want something that's static and not weighted to any part of the main skeleton, you should create a new bone for it outside of the main hierarchy and weight that static stuff to that, or just split it into a separate NoeModel with no skeleton. Or, don't bind vertex weight buffers at all, but that will require faces with no weights to be drawn in their own draw calls. No format should ever really be using static/boneless verts in the same mesh as weighted verts unless it's already internally assigning them to a bone/matrix with an assumed weighting of 1.0, because that would screw up any kind of shader/hardware transform path.
-
- mega-veteran
- Posts: 241
- Joined: Fri Aug 05, 2011 9:31 pm
- Location: Antwerp
- Has thanked: 13 times
- Been thanked: 41 times
Re: [NOESIS] Titan Quest
Not really vertices without any weights, but with boneindices like (10,255,255,255). I'm not sure if the weights for all the 255 are zero so it might try to add the vertex to a nonexisting bone along with the bone #10, unless Noesis treats 255 as nobone as well?
But I'll make it loop over the data first to see if it does this before I start worrying over this.
For the drawcalls, I'll split the triangle list into 2 (which should be easy) and commit them seperately, but what do I do with the vertex list, can I keep committing them as 1 big list?
But I'll make it loop over the data first to see if it does this before I start worrying over this.
For the drawcalls, I'll split the triangle list into 2 (which should be easy) and commit them seperately, but what do I do with the vertex list, can I keep committing them as 1 big list?
-
- Moderator
- Posts: 2602
- Joined: Sun May 18, 2008 3:01 pm
- Has thanked: 57 times
- Been thanked: 1422 times
-
- mega-veteran
- Posts: 241
- Joined: Fri Aug 05, 2011 9:31 pm
- Location: Antwerp
- Has thanked: 13 times
- Been thanked: 41 times
Re: [NOESIS] Titan Quest
That's what I was doing at first but changed it back to normal.
While rewriting the script it seems rapi.multiplyBones doesn't position the bones correctly so I'm just going to rewrite my current function and if someone could take a look at it later it'd be much appreciated.
Edit:https://www.dropbox.com/sh/7pn17bxhwo9gwgu/cORIt1nsc_
Updated the texture importer to correctly load all textures for each drawcall.
Vertex-Boneweight seems to be correct atm but I'm calling the bindboneIndex/Weight on the full vertex list
for each drawcall because I'm not sure how to cut the vertex list.
Also how would I go about loading bumpTextures?
which of the following is a bumptex?
While rewriting the script it seems rapi.multiplyBones doesn't position the bones correctly so I'm just going to rewrite my current function and if someone could take a look at it later it'd be much appreciated.
Edit:https://www.dropbox.com/sh/7pn17bxhwo9gwgu/cORIt1nsc_
Updated the texture importer to correctly load all textures for each drawcall.
Vertex-Boneweight seems to be correct atm but I'm calling the bindboneIndex/Weight on the full vertex list
Code: Select all
rapi.rpgSetBoneMap(self.drawCallIndex[i])
rapi.rpgBindBoneIndexBufferOfs(self.vertBuff, noesis.RPGEODATA_UBYTE, self.vertLength, self.boneIndexOffset, 4)
rapi.rpgBindBoneWeightBufferOfs(self.vertBuff, noesis.RPGEODATA_FLOAT, self.vertLength, self.boneWeightOffset, 4)
rapi.rpgCommitTriangles(idxBuff, noesis.RPGEODATA_USHORT, numIdx*3, noesis.RPGEO_TRIANGLE, 1)
Also how would I go about loading bumpTextures?
which of the following is a bumptex?
Code: Select all
def setNormalTexture(self, texName):
def setSpecularTexture(self, texName):
def setOpacityTexture(self, texName):