BFRES : Fix bone matching for models with multiple skeletons.
This commit is contained in:
parent
1fd81feb22
commit
8a9390cb6c
@ -227,20 +227,23 @@ namespace Bfres.Structs
|
||||
private STSkeleton GetActiveSkeleton()
|
||||
{
|
||||
var viewport = LibraryGUI.GetActiveViewport();
|
||||
if (viewport != null)
|
||||
foreach (var drawable in viewport.scene.objects)
|
||||
{
|
||||
foreach (var drawable in viewport.scene.objects)
|
||||
if (drawable is STSkeleton)
|
||||
{
|
||||
if (drawable is STSkeleton)
|
||||
bool hasMatchingBoneset = true;
|
||||
foreach (var bone in Bones)
|
||||
{
|
||||
foreach (var bone in Bones)
|
||||
{
|
||||
var animBone = ((STSkeleton)drawable).GetBone(bone.Text);
|
||||
|
||||
if (animBone != null)
|
||||
return (STSkeleton)drawable;
|
||||
var animBone = ((STSkeleton)drawable).GetBone(bone.Text);
|
||||
if (animBone == null) {
|
||||
hasMatchingBoneset = false;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//Animation has all bones present in skeleton
|
||||
if (hasMatchingBoneset)
|
||||
return (STSkeleton)drawable;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,9 @@ Keep in mind this tool is still very experimental. If something breaks from a co
|
||||
## Discord
|
||||
https://discord.gg/eyvGXWP
|
||||
|
||||
## Support
|
||||
If you'd like to support me, you can [donate!](https://www.paypal.com/donate?business=TCG7P6PH6V3PU¤cy_code=USD)
|
||||
|
||||
## Features
|
||||
|
||||
This tool currently features:
|
||||
|
Loading…
Reference in New Issue
Block a user