Jump to content

Recommended Posts

  • Engineers
Posted (edited)
1 hour ago, h3x3r said:

Sure, but not sure how to rewrite it to noesis... If it's even possible...

Haha, good luck! (found this in pluginshare.h: void  (*rpgSmoothNormals)(smNrmParm_t *parms); but 'smooth' normals does not mean 'fix' them, I guess)

(pmed you)

edit: car1A, normals recalc

car1A, normals, recalc, imported dae.zip

edit2: fun fact, instead of using a script in blender you can simply press shift-n in edit mode, all faces selected.

Same result as in the zip file.

Edited by shak-otay
  • Engineers
Posted (edited)

Hey, why noesis output floats like this? This is from print function

1.0 -0.0 -0.0 0.0 -0.0 1.0 0.0 0.0 -0.0 0.0 1.0 0.0 -0.8107157945632935 0.0 1.3126823902130127 0.0 0
-1.0 -0.0 1.5099580252808664e-07 0.0 -0.0 1.0 0.0 0.0 -1.5099580252808664e-07 0.0 -1.0 0.0 0.8107157945632935 0.0 1.3126823902130127 0.0 1
1.0 -0.0 -0.0 0.0 -0.0 1.0 0.0 0.0 -0.0 0.0 1.0 0.0 -0.8107159733772278 0.0 -1.342969536781311 0.0 2
-1.0 -0.0 1.5099580252808664e-07 0.0 -0.0 1.0 0.0 0.0 -1.5099580252808664e-07 0.0 -1.0 0.0 0.8107157945632935 0.0 -1.342969536781311 0.0 3

and not like this? This is 010 editor output which is correct.

1.000000 -0.000000 -0.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 -0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.810716 0.000000 1.312682 0.000000
-1.000000 -0.000000 0.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 -0.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.810716 0.000000 1.312682 0.000000
1.000000 -0.000000 -0.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 -0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.810716 0.000000 -1.342970 0.000000
-1.000000 -0.000000 0.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 -0.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.810716 0.000000 -1.342970 0.000000

Looks like rapi.rpgSetTransform deosn't like this output: 1.5099580252808664e-07

So now how to convert them to 010 editor format?

Well if I print them with this in noesis: "{:f}".format()

Then it's correct

1.000000 -0.000000 -0.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 -0.000000 0.000000 1.000000 0.000000 -0.810716 0.000000 1.312682 0.000000
-1.000000 -0.000000 0.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 -0.000000 0.000000 -1.000000 0.000000 0.810716 0.000000 1.312682 0.000000
1.000000 -0.000000 -0.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 -0.000000 0.000000 1.000000 0.000000 -0.810716 0.000000 -1.342970 0.000000
-1.000000 -0.000000 0.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 -0.000000 0.000000 -1.000000 0.000000 0.810716 0.000000 -1.342970 0.000000

Hell no! it's not. See first row 6th value from right, compared to the 010 output above. Noesis output 1.000000 and 010 editor 0.000000

I reading them as follow:

float RwMat00,RwMat01,RwMat02,RwMat03,
      RwMat10,RwMat11,RwMat12,RwMat13,
      RwMat20,RwMat21,RwMat22,RwMat23,
      RwPosX,RwPosY,RwPosZ,RwPadding;

Also if i use this Matrix4x4 in maya, it fails. So i must use 4x3 and then positions. In other cases it works as 4x4.

So when i use rapi.rpgSetTransform the wheel dissapear. Based on the outputs it must be different ordering which causes the dissapearing

 

EDiT. My bad... I have modified 010 template to print another set of indices. That's the reason of not matching outputs.

Edited by h3x3r
  • Engineers
Posted

Which file did you use?

For SetTransform,

Usually it's used like so:

trans = NoeMat43((NoeVec3((-1, 0, 0)),
                         NoeVec3((0, 1, 0)),
                         NoeVec3((0, 0, 1)),
                         NoeVec3((0, 0, 0))))
rapi.rpgSetTransform(trans)

so a 4x3 matrix, how did you use it?

  • Engineers
Posted (edited)
14 minutes ago, shak-otay said:

so a 4x3 matrix, how did you use it?

Like in PS2 script. But here it doesn't work....

Also another strange thing i see in inc_noesis.py there is NoeMat44 but when i feed it with 64 bytes buffer it still says invalid matrix

I'll PM you script + file

Edited by h3x3r
  • Engineers
Posted

Got it! there must by flag: bigEnd = NOE_BIGENDIAN

NoeMat43.fromBytes(matrix_data, bigEnd = NOE_BIGENDIAN).transpose()

  • Like 1
  • Engineers
Posted (edited)

That This line is in the script I sent you - commented out because it didn't work:  edit: yeah, seems fromMat44() doesn't exist

#mat43 = NoeMat43.fromMat44(RwBodyPartTransform)

(I  had used NoeVec4, of course and commented out the bs.read(4) lines for such in the loop for i in range(0, RwNumBodyParts):.)

That's the reason why I used NoeVec3, and the transpose worked. (I handled RwBodyPartTransform only but I'll compare it to you initial version + your fix.)

Edited by shak-otay

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...