Skip to content

Commit

Permalink
Лишние релоады вьюпорта
Browse files Browse the repository at this point in the history
  • Loading branch information
VaIeroK committed Dec 2, 2022
1 parent e409b42 commit 3535849
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions OGF tool/Forms/OgfEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,8 @@ private void TextBoxBonesFilter(object sender, EventArgs e)
if (i != OGF_V.bonedata.bones.Count - 1)
BoneNamesBox.Text += "\n";
}
ViewPortNeedReload = true;
if (ViewPortBones)
ViewPortNeedReload = true;
}
break;
case "MaterialBox": OGF_V.ikdata.bones[idx].material = curControl.Text; break;
Expand All @@ -1404,12 +1405,8 @@ private void TextBoxBonesFilter(object sender, EventArgs e)
case "RotationZ": OGF_V.ikdata.bones[idx].rotation[2] = Convert.ToSingle(curControl.Text); need_recalc_bones = true; break;
}

if (need_recalc_bones)
{
FixOldBonesBind(ref OGF_V);
CalcBonesTransform(ref OGF_V);
if (need_recalc_bones && (ViewPortBones || OGF_V.ikdata != null && OGF_V.ikdata.chunk_version == 2)) // Åñëè ïîêàçûâàåì êîñòè èëè çàãðóæåí ñòàðûé ìåø çàâèñÿùèé îò êîñòåé
ViewPortNeedReload = true;
}
}

bKeyIsDown = false;
Expand Down Expand Up @@ -2648,6 +2645,9 @@ private void InitViewPort(bool create_model = true, bool force_texture_reload =
ViewerWorking = false;
ViewPortNeedReload = false;

FixOldBonesBind(ref OGF_V);
CalcBonesTransform(ref OGF_V);

if (ViewerThread != null && ViewerThread.ThreadState != System.Threading.ThreadState.Stopped)
ViewerThread.Abort();

Expand Down

0 comments on commit 3535849

Please sign in to comment.