RED4ext.SDK icon indicating copy to clipboard operation
RED4ext.SDK copied to clipboard

Replace `unk40` in Rig.hpp

Open Mozz3d opened this issue 10 months ago • 6 comments

Replaces the unk40 placeholder and adds boneParentIndexes and boneTransforms properties at offsets 0x40 and 0x48 respectively. Which have been confirmed through testing.

Mozz3d avatar Mar 28 '24 19:03 Mozz3d

I'm wondering, should it be defined here, without redscript declaration... Or better be in Codeware, as it already provides such kind of native extensions? FYI @psiberx

poirierlouis avatar Mar 29 '24 11:03 poirierlouis

It should be in SDK but not in Generated.

psiberx avatar Mar 29 '24 11:03 psiberx

Thanks for the PR :)

This file will be overwritten when every time we dump the types. You can move it out of the "Generated" directory and it should be fine, like we did for others (https://github.com/WopsS/RED4ext.SDK/tree/master/include/RED4ext/Scripting/Natives).

I moved it to Natives, I hope that's alright!

Mozz3d avatar Mar 29 '24 15:03 Mozz3d

Look at how other files are handled.

  1. Remove generated comments.
  2. Add generated stub that includes your manual override. After the edit you should still include generated header in your plugin, not the new one.

Also you could add a comment for new fields that the size is the same as boneNames.size.

psiberx avatar Mar 29 '24 15:03 psiberx

Is this better? I've never really used github for anything besides viewing code so you'll have to excuse me if it's a little messy. Trying my best to figure it out.

Mozz3d avatar Mar 29 '24 16:03 Mozz3d

Scripting/Natives/Generated/anim/Rig.hpp should include your overridden header. Look at Scripting/Natives/Generated/ink/Layer.hpp as an example. You can generate it by running GameReflection::Dump() again, but for a single file it's easier to create it manually.

psiberx avatar Mar 29 '24 16:03 psiberx

A little late, but here are the requested changes along with some further decoded properties.

Mozz3d avatar May 08 '24 16:05 Mozz3d

You also have to update the Reflection-inl file to exclude it from being generated in the future.

See https://github.com/WopsS/RED4ext.SDK/pull/121/files#diff-859ef96671f9a21f801808df16274cd12c0711860ddf5e6787fa521a088fae06L310.

wopss avatar May 09 '24 17:05 wopss

Is that okay? Also thank you for helping me help this project :3

Mozz3d avatar May 09 '24 17:05 Mozz3d

It should be placed at include/RED4ext/Scripting/Natives/animRig.hpp to exclude from being generated and keep existing includes valid, no manual override in Reflection-inl.

psiberx avatar May 09 '24 20:05 psiberx

Let me know if I need to adjust anything else.

Mozz3d avatar May 09 '24 21:05 Mozz3d