Another viewport fix

This commit is contained in:
KillzXGaming 2019-04-25 21:25:55 -04:00
parent 7f272c37b9
commit 38e4cbad6a
7 changed files with 21 additions and 21 deletions

Binary file not shown.

View file

@ -399,6 +399,24 @@ namespace FirstPlugin
return; return;
} }
var toolstrips = new List<ToolStripMenuItem>();
var menu = new ToolStripMenuItem("Animation Loader", null, AnimLoader);
toolstrips.Add(menu);
if (drawables.Count <= 0)
{
//Add drawables
drawables.Add(BFRESRender);
for (int m = 0; m < BFRESRender.models.Count; m++)
drawables.Add(BFRESRender.models[m].Skeleton);
}
if (Runtime.UseOpenGL)
bfresEditor.LoadViewport(drawables, toolstrips);
bool IsSimpleEditor = PluginRuntime.UseSimpleBfresEditor; bool IsSimpleEditor = PluginRuntime.UseSimpleBfresEditor;
if (IsSimpleEditor) if (IsSimpleEditor)
@ -487,26 +505,6 @@ namespace FirstPlugin
} }
else else
{ {
var toolstrips = new List<ToolStripMenuItem>();
var menu = new ToolStripMenuItem("Animation Loader", null, AnimLoader);
toolstrips.Add(menu);
bool IsLoaded = drawables.Count != 0;
bfresEditor.IsLoaded = IsLoaded;
if (drawables.Count <= 0)
{
//Add drawables
drawables.Add(BFRESRender);
for (int m = 0; m < BFRESRender.models.Count; m++)
drawables.Add(BFRESRender.models[m].Skeleton);
}
if (Runtime.UseOpenGL)
bfresEditor.LoadViewport(drawables, toolstrips);
if (SelectedSection is BFRES) if (SelectedSection is BFRES)
{ {

View file

@ -213,6 +213,8 @@ namespace FirstPlugin.Forms
if (IsLoaded || Drawables == null || !Runtime.UseOpenGL || !Runtime.DisplayViewport) if (IsLoaded || Drawables == null || !Runtime.UseOpenGL || !Runtime.DisplayViewport)
return; return;
Console.WriteLine("drawables count " + Drawables.Count);
foreach (var draw in Drawables) foreach (var draw in Drawables)
{ {
if (!viewport.scene.staticObjects.Contains(draw) && if (!viewport.scene.staticObjects.Contains(draw) &&