pac3 icon indicating copy to clipboard operation
pac3 copied to clipboard

Pac3 incorrectly renames bones in the editor

Open TiberiumFusion opened this issue 3 years ago • 6 comments
trafficstars

I have a model with a bone named "Z_SniperRifle_Root". The editor is renaming this bone to "z_sniperrifle_rightoot". Entering "z_sniperrifle_root" into any bone selection field confuses pac and fails to the associate with the intended bone. Seems like a bad Lua pattern for matching stuff like "SomeBone_R".

This is with the workshop version of pac, which calls itself "Die-Clipping-Internal" as of writing this.

TiberiumFusion avatar Dec 18 '21 03:12 TiberiumFusion

Yeah, you gotta use the replaced name for it to work. z_sniperrifle_rightoot. It looks like only _R_ should get replaced with 'right' though so not sure why it replaced a single 'R' in this case.

thegrb93 avatar Mar 11 '22 23:03 thegrb93

I think a good improvement is to also add a key to the table for the real bone name https://github.com/CapsAdmin/pac3/blame/cd65ad180cd19cc5053b398df39e3df4621cab44/lua/pac3/core/client/bones.lua#L60

Also figure out why 'R' got replaced when only '_R_' is supposed to be replaced

thegrb93 avatar Mar 11 '22 23:03 thegrb93

I think the '_' got matched with {"%p", " "} and then the ' R' got matched with {" R", " right"},

thegrb93 avatar Mar 11 '22 23:03 thegrb93

The internals of how bone names work is stupid. It should have been using the actual bone name when serializing and then the friendly names as translation.

Because right now if we change how this works we might break other outfits.

CapsAdmin avatar Mar 12 '22 08:03 CapsAdmin

Yeah, I assume they saved the nice names. It's not too late to change it, just have to keep the old keys as well for compatibility.

thegrb93 avatar Mar 12 '22 09:03 thegrb93

I would rather suggest versioning the outfit savedata. It would be a cleaner fix than having two name keys and a still-loaded footgun.

TiberiumFusion avatar Mar 12 '22 10:03 TiberiumFusion