pac3 icon indicating copy to clipboard operation
pac3 copied to clipboard

Models placed on specific bones snap to 'invalidbone' on LOD changes.

Open Yagira opened this issue 3 years ago • 8 comments

That includes bones like bicep/ulna/shoulder/elbow but also common ones like fingers. Simply adding a model to one of these bones will move it to 'invalidbone' when the LOD changes. Video: https://i.imgur.com/XxTX9e3.mp4 Outfit: prop.txt

Yagira avatar Mar 16 '22 23:03 Yagira

This is a tough one, not sure if gmod's lua bindings have the tools needed to fix this. Maybe the part can try to find a parent bone if the current one becomes invalid (don't know if there's even a function to tell if the bone is invalid. getBoneName maybe?). There's no way to get the 'replace-bone' afaik.

thegrb93 avatar Mar 16 '22 23:03 thegrb93

Yeah because the finer LOD's bones aren't there on the rougher LOD... Nonexistent. Collapsed out. Apparently Source can do this. https://developer.valvesoftware.com/wiki/LOD_Models#Simplify_your_models_skeleton

Not sure if it's fixable. For these types of cases my opinion is to workaround back to the simple, reliable, straightforward way; in other words, methods that tend to survive multiple pac versions and makes the intended result regardless of the thing at issue (LOD here). Because, for example, instead of left bicep (if the biceps get collapsed), left upperarm will still be there at every LOD.

So if it's up to me, let it be common wisdom not to use the "unconventional" bones. But, if absolutely needed (fingers), force the model into the higher LOD (which would be 0, I believe) in pac. Doesn't solve the underlying engine/lua reasons, but if this becomes a problem for more people, at least we'll have a workaround, or in other terms a piece of good practice that just works.

pingu7867 avatar Mar 17 '22 04:03 pingu7867

I think we should at least hide the part or something if the bone loses validity.

thegrb93 avatar Mar 17 '22 04:03 thegrb93

I think we should at least hide the part or something if the bone loses validity.

Sounds good on paper, in some cases better than reverting to invalidbone. But make it leave a trace/error message if it happens, please.

I don't know about other users' habits, I'll leave that to whoever agrees or disagrees with my view. But if I make a mistake or get a pac from someone, I'd prefer that the stuff remains visible on invalidbone, because it'd be a usable sign to visually see what part is wrong, just at a glance at my feet. If you make such changes where the part gets hidden, at least there should be visual indicators on the pac tree, the part's parameter's line, the console or the chat to indicate when it happens.

Wherever it is, it needs to be there instead of just making stuff vanish without trace or explanation. Like a red X, red font writing or a ! with a tooltip saying "bone not valid!", some visual indicator on the part's parameter in the menu when the bone isn't found. That's for when the bone is input wrong. But for bones depending on LODs, then when the model loses bones, it's obviously not a user mistake on the editor side. Instead it's a rather opaque phenomenon occurring only on certain models. What indicator then? Hopefully one chat/console message for the user, telling "a part inside a model of (insert model path) in the pac is no longer on a valid bone", and recommending to change the model's LOD, for the user isn't too intrusive, proxies already do that so people can expect these error messages. But to check the validity, I don't know if it'll affect performance, but if you're gonna hide the part, leave a trace for the user to see what happened (part hidden) and why (invalid bone).

More generally, I bet people will still find ways to be surprised when they find out something changed and to complain about stuff going missing. Keep in mind as we have this discussion: we know what causes the switch, but most users have little to no conscious awareness of LODs if they encounter this issue blindly.

pingu7867 avatar Mar 17 '22 05:03 pingu7867

Yeah I guess letting it break is the only thing you can do. Gmod doesn't even have a GetLOD function.

thegrb93 avatar Mar 17 '22 06:03 thegrb93

Some things make sense to disappear though, like a ring on a finger perhaps.

thegrb93 avatar Mar 17 '22 06:03 thegrb93

I just had an idea. We have access to the 'SetLOD' function, so we can determine which bones may become invalid. Maybe we can color those differently in the editor and hide parts parented to them when they go invalid.

thegrb93 avatar Mar 18 '22 09:03 thegrb93

It could be an is_replaceable property in the table formed by pac.GetAllBones

thegrb93 avatar Mar 18 '22 09:03 thegrb93