Important information: this site is currently scheduled to go offline indefinitely by end of the year.

[Noesis] Plugin to export to a new format

Post questions about game models here, or help out others!
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: [Noesis] Bone Mapping with Skeleton

Post by howfie »

oh cool, let us know how it goes lol.
Alsair
advanced
Posts: 66
Joined: Fri Jun 15, 2012 10:55 am
Has thanked: 4 times

Re: [Noesis] Bone Mapping with Skeleton

Post by Alsair »

Well I dealt with parsing few days ago already hence the code on the first page, like I have said before stuck on how to use this data to structure the model. I have tried with MrAdults suggested but to no avail. So I wont be able to make much progress until I can figure this out. I hope MrAdults has some clues to this issue.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: [Noesis] Bone Mapping with Skeleton

Post by shakotay2 »

Apart from the coding problems: in lack of a skeleton I took some bones positions from their first frame each and tried to paint a skeleton.

Code: Select all

Bone07 0.073126   34.099422 10.906952    ->    170 95
Bone01 -0.113336   34.896465 10.198335       175 91
Bone02 0.138354   44.527958 11.276074        222.5	96.5
Bone03 0.049265   50.583954 12.362673		253  101.8
Bone04 -0.195766   58.654728 10.172757		293.5 90.85
Bone05 -0.465472   71.594223 10.358674		358	91.75
Bone06, head -0.724543   78.850624 8.867167		394	84.3
Bone16 -0.018533   94.250137 -7.828193		471	1
Bone17 -3.997004   106.748070 14.560293	534	112.8
Bone18 -15.395306   107.772560 34.416512	-> 539	212
from gr_bone.bon
ignoring the x position, so turning your head 90 degrees clockwise you'll find the peak being the head :D :

Image

edit: hmm, well, no. The peak being Bone16, shxt

edit3: huuh, complete rewrite! Each bone having its own keyframe set in .x.

I'll try to create one...
Last edited by shakotay2 on Tue Jul 02, 2013 1:28 pm, edited 5 times in total.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: [Noesis] Bone Mapping with Skeleton

Post by MrAdults »

It's no bother, I appreciate when people pick up Noesis. More users and more developers means more use and more opportunity to find and fix issues.

The vert skin function didn't do anything because you didn't provide weights. Use the line of code from my last post to generate a list of per-vertex bone indices from a single index. That is what this format is going to use, you can tell by looking at the model.
howfie wrote:rich, you really love making things more complex than they really are :P. did you look at the bon file this guy posted? he's got more problems than just figuring out which noesis function to call lol.
You need to understand the core concepts of transform spaces and skinning to work with model formats. He's clearly new to this. lol, lol, hahahahaha, lol, and so on.
howfie wrote:you wanna know something, i don't even think this game uses skeletal animation lol.
even the meshes are named Bone13 lol.
You know how the verts are untransformed, so they look like they're in a clump? And you know those things that help you transform that clump of verts? And there's a lot of that data beyond a single pose worth...as if it's, like animating? Well... that's what we call "skeletal animation". ;)
Alsair wrote:How would I map my current model import script to one keyframe's matrices for each bone in Noesis? Pretty sure that's what has to be done to make my model appear to look right.
You have to bind bone indices like I mentioned above. Then use the skin function with your bone list. To bind bone indices, you have to know which chunk of verts goes to which bone. This could be implicit, if you have the same number of mesh chunks as bones, and I'm guessing you do. If that's so, you'd do something like this for each mesh:

Code: Select all

boneIndices = noePack("i"*numVerts, *[meshIndex]*numVerts)
boneWeights = noePack("f"*numVerts, *[1.0]*numVerts)
rapi.rpgBindBoneIndexBuffer(boneIndices, noesis.RPGEODATA_INT, 4, 1)
rapi.rpgBindBoneWeightBuffer(boneWeights, noesis.RPGEODATA_FLOAT, 4, 1)
Then you proceed to do your rpgCommitTriangles call as per usual.

Note that I haven't actually looked at these files at all. :) I haven't been implying anything, I've just been telling you all of the common possibilities. In your case it's most likely what I just said, based on the pic of the model and your description of the data. The actual matrices may be flattened with no hierarchy. You'll have to figure out how to actually turn that anim data into matrices for it to look right, though. I'd take a glance at the hex, but I'm on my way to work, so you'll have to rely on the degenerate I'm about to quote for that part. Or on shakotay, who seems to be more interested in looking at and understanding the data than hahahaha lol'ing, which is a good start.
howfie wrote:have some balls; don't use Noesis or else you'll be like Rich, without any balls LOL (see some other thread to find out why hahahahahahahaha).
I appreciate your need to be retarded, but please don't encourage prospective Noesis users to also be retarded. hahahahaha lol.

It's trivial to push nothing but animation matrices to Noesis, and it will give you a stick figure displaying the animations. Just create the NoeModel with no mesh data, giving it your NoeAnim instead.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: [Noesis] Bone Mapping with Skeleton

Post by shakotay2 »

I used Noesis to export gr_trans_110.bsc as fbx.

Then converted it to ASCII-fbx; now at least having the damn bone names:

Code: Select all

	NodeAttribute: 34245520, "NodeAttribute::bone_cutter_skel", "LimbNode" {
	NodeAttribute: 34246792, "NodeAttribute::bone_RArm05x_skel", "LimbNode" {
	NodeAttribute: 34248064, "NodeAttribute::bone_LArm05x_skel", "LimbNode" {	
	NodeAttribute: 34249560, "NodeAttribute::bone_cutter01_skel", "LimbNode" {
	NodeAttribute: 34251248, "NodeAttribute::bone_RArm05x01_skel", "LimbNode" {
	NodeAttribute: 34252760, "NodeAttribute::bone_LArm05x01_skel", "LimbNode" {
	NodeAttribute: 34254272, "NodeAttribute::bone_root_skel", "LimbNode" {
	NodeAttribute: 34255984, "NodeAttribute::bone01_skel", "LimbNode" {
	NodeAttribute: 34257552, "NodeAttribute::bone01 Footsteps_skel", "LimbNode" {
	NodeAttribute: 34259080, "NodeAttribute::bone01 Pelvis_skel", "LimbNode" {
	NodeAttribute: 34260592, "NodeAttribute::bone01 Spine_skel", "LimbNode" {
	NodeAttribute: 34262104, "NodeAttribute::bone01 Spine1_skel", "LimbNode" {
	NodeAttribute: 34263648, "NodeAttribute::bone01 Neck_skel", "LimbNode" {
	NodeAttribute: 34265208, "NodeAttribute::bone01 Head_skel", "LimbNode" {
	NodeAttribute: 34266768, "NodeAttribute::bone_RArm01_skel", "LimbNode" {
	NodeAttribute: 34268304, "NodeAttribute::bone_RArm02_skel", "LimbNode" {
	NodeAttribute: 34270088, "NodeAttribute::bone_RArm03_skel", "LimbNode" {
	NodeAttribute: 34271728, "NodeAttribute::bone_RArm04_skel", "LimbNode" {
	NodeAttribute: 34273368, "NodeAttribute::bone_RArm05_skel", "LimbNode" {
	NodeAttribute: 34275088, "NodeAttribute::bone_LArm01_skel", "LimbNode" {
	NodeAttribute: 34276816, "NodeAttribute::bone_LArm02_skel", "LimbNode" {
	NodeAttribute: 34278536, "NodeAttribute::bone_LArm03_skel", "LimbNode" {
	NodeAttribute: 34280256, "NodeAttribute::bone_LArm04_skel", "LimbNode" {
	NodeAttribute: 34281976, "NodeAttribute::bone_LArm05_skel", "LimbNode" {
	NodeAttribute: 34283696, "NodeAttribute::bone01 L Thigh_skel", "LimbNode" {
	NodeAttribute: 34285376, "NodeAttribute::bone01 L Calf_skel", "LimbNode" {
	NodeAttribute: 34287096, "NodeAttribute::bone01 L Foot_skel", "LimbNode" {
	NodeAttribute: 34288816, "NodeAttribute::bone01 L Toe0_skel", "LimbNode" {
	NodeAttribute: 34290536, "NodeAttribute::bone01 R Thigh_skel", "LimbNode" {
	NodeAttribute: 34292256, "NodeAttribute::bone01 R Calf_skel", "LimbNode" {
	NodeAttribute: 34293976, "NodeAttribute::bone01 R Foot_skel", "LimbNode" {
	NodeAttribute: 34296400, "NodeAttribute::bone01 R Toe0_skel", "LimbNode" {
	NodeAttribute: 34298392, "NodeAttribute::bone_cutter02_skel", "LimbNode" {
	NodeAttribute: 34300112, "NodeAttribute::bone_RArm05x02_skel", "LimbNode" {
	NodeAttribute: 34301832, "NodeAttribute::bone_LArm05x02_skel", "LimbNode" {
	NodeAttribute: 34303552, "NodeAttribute::Bone99_skel", "LimbNode" {
	NodeAttribute: 34305192, "NodeAttribute::Bone98_skel", "LimbNode" {
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: [Noesis] Bone Mapping with Skeleton

Post by howfie »

well rich, you should have never said that one thing about your wife having your balls :).

shakotay, did you get a good skeleton out of it? i tried yesterday loading what i thought was skeleton data in the gr_bone.bon file and this is what i got:
Image
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: [Noesis] Bone Mapping with Skeleton

Post by howfie »

did you guys notice that there are also a lot of stray points in these models? in shakotay's gr_trans_110, half of the vertices are stray. i'm still not convinced this game uses skeletal animation, flattened hierarchies or otherwise (there's no blend indices or blend weights), seeing the models look like this. see that ring on the model? that's the "bone01 Spine1" mesh. you see now why i'm loling?

Image
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: [Noesis] Bone Mapping with Skeleton

Post by shakotay2 »

howfie wrote:shakotay, did you get a good skeleton out of it?
Nope.
I was just looking at Alsair's python file. Seems he tries to combine the bsc and the bon file data.
Well done, Alsair!

Maybe there's only a "trifle" missing.

But now it's my jogging time.
See u later, guys.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
Alsair
advanced
Posts: 66
Joined: Fri Jun 15, 2012 10:55 am
Has thanked: 4 times

Re: [Noesis] Bone Mapping with Skeleton

Post by Alsair »

Okay, now I'm getting an "WARNING: Mesh contains bone weights, but the model has no skeleton." error, not sure how to solve it.

But one thing I know for sure this script is missing, is that there is no association with the bone names in the skeleton with the bone names in the actual model file (so I can associate the correct bone with each mesh piece), not sure how to do this either. Here's what I have so far:

There's also a lot of unused variables, I'll likely clean this code up after it's complete.

Edit:

Does this have to do with the Bone List being mapped? Because the game references the bones via string identifiers whereas here we're using the incremental id used in the for loop. Could it be it's referencing the wrong bones this way? Still I don't understand why it would get the "but the model has no skeleton" error. Weird.

Also, the actual mesh pieces appear to be scattered everywhere now. (Assuming that there is no real reference from the model's bone string to the string in the skeleton file)
Last edited by Alsair on Wed Jul 03, 2013 1:22 am, edited 1 time in total.
Alsair
advanced
Posts: 66
Joined: Fri Jun 15, 2012 10:55 am
Has thanked: 4 times

Re: [Noesis] Bone Mapping with Skeleton

Post by Alsair »

Made my own attempt on adding association with the skeleton to the mesh files, still no luck meshes is scattered in different places.
Edit:

I noticed that rapi.rpgBindBoneWeightBuffer had no effect on the transformation of the model, I commented it and saw no changes.
Last edited by Alsair on Wed Jul 03, 2013 11:01 pm, edited 2 times in total.
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: [Noesis] Bone Mapping with Skeleton

Post by howfie »

you are not calling

mdl.setBones(your bonelist)
Alsair
advanced
Posts: 66
Joined: Fri Jun 15, 2012 10:55 am
Has thanked: 4 times

Re: [Noesis] Bone Mapping with Skeleton

Post by Alsair »

howfie wrote:you are not calling

mdl.setBones(your bonelist)
Pretty sure rapi.rpgSkinPreconstructedVertsToBones(bones) does that for me now.

edit:

Nvm, mdl.setBones(bones) didn't change the structure, but it allowed me to view the bones (via F6).
Last edited by Alsair on Wed Jul 03, 2013 11:02 pm, edited 1 time in total.
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: [Noesis] Bone Mapping with Skeleton

Post by howfie »

got a pic? which model u looking at? did you look at the vertex buffer and see valid blend weights and blend indices? cuz that's what you are binding in your noesis cose.
Alsair
advanced
Posts: 66
Joined: Fri Jun 15, 2012 10:55 am
Has thanked: 4 times

Re: [Noesis] Bone Mapping with Skeleton

Post by Alsair »

howfie wrote:got a pic? which model u looking at? did you look at the vertex buffer and see valid blend weights and blend indices? cuz that's what you are binding in your noesis cose.

Can't say for sure, but look at that model using that noesis script. the head and stuff are in the correct places, except the it's not pointing the right direction...
Last edited by Alsair on Wed Jul 03, 2013 11:02 pm, edited 1 time in total.
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: [Noesis] Bone Mapping with Skeleton

Post by MrAdults »

That's an easy fix. Don't plop the NoeMat44 data into a NoeMat43, use NoeMat44's toMat43() method instead. They aren't the same major, so it's not the same operation.
Post Reply