Skip to content

Commit

Permalink
texture fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ArgoreOfficial committed Jan 28, 2023
1 parent dd670f9 commit 88e6148
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 22 deletions.
Binary file modified .vs/SPETS/v16/.suo
Binary file not shown.
Binary file modified bin/Debug/netcoreapp3.1/SPETS.dll
Binary file not shown.
Binary file modified bin/Debug/netcoreapp3.1/SPETS.pdb
Binary file not shown.
Binary file removed bin/Debug/netcoreapp3.1/heightmaptemp.png
Binary file not shown.
34 changes: 12 additions & 22 deletions forms/AdvancedEditorForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -436,38 +436,27 @@ private void UpdateGLCamera()

private void DeleteItemButton_Click(object sender, EventArgs e)
{

for (int i = ImportListView.SelectedIndices.Count - 1; i >= 0; i--)
{
ImportObjects.RemoveAt(ImportListView.SelectedIndices[i]);
}

// remove mesh from scene
for (int i = 0; i < GLMeshPreview.Scene.SceneContainer.Children.Count; i++)
{
if (GLMeshPreview.Scene.SceneContainer.Children[i].Name == ImportObjects[lastSelected].ModelName)
{
for (int p = 0; p < GLMeshPreview.Scene.SceneContainer.Children[i].Children.Count; p++)
{
// unfreeze
((Polygon)GLMeshPreview.Scene.SceneContainer.Children[i].Children[p]).Unfreeze(GLMeshPreview.OpenGL);

// create and set material
Material m = new Material();
m.Diffuse = Color.FromArgb(128, 255, 0, 0);
((Polygon)GLMeshPreview.Scene.SceneContainer.Children[i].Children[p]).Material = m;

// freeze
((Polygon)GLMeshPreview.Scene.SceneContainer.Children[i].Children[p]).Freeze(GLMeshPreview.OpenGL);
}

// move to last in list, that way it'll be drawn on top of everything else
var scenelement = GLMeshPreview.Scene.SceneContainer.Children[i];
GLMeshPreview.Scene.SceneContainer.RemoveChild(GLMeshPreview.Scene.SceneContainer.Children[i]);
GLMeshPreview.Scene.SceneContainer.AddChild(scenelement);
break;
}
}

// remove from list
for (int i = ImportListView.SelectedIndices.Count - 1; i >= 0; i--)
{
ImportObjects.RemoveAt(ImportListView.SelectedIndices[i]);
}

lastSelected = 0;
ImportListView.SelectedIndices.Clear();

// refresh stuff
RefreshObjectList();
RefreshMeshPreview();
}
Expand Down Expand Up @@ -514,6 +503,7 @@ private void ImportListView_SelectedIndexChanged(object sender, EventArgs e)
}

RefreshMeshPreview(ImportListView.SelectedIndices.Count == 0);
RefreshTexturePreview();
}

private void DecalDistanceNumeric_ValueChanged(object sender, EventArgs e)
Expand Down
Binary file modified obj/Debug/netcoreapp3.1/SPETS.csproj.AssemblyReference.cache
Binary file not shown.
Binary file modified obj/Debug/netcoreapp3.1/SPETS.csproj.GenerateResource.cache
Binary file not shown.
Binary file modified obj/Debug/netcoreapp3.1/SPETS.dll
Binary file not shown.
Binary file modified obj/Debug/netcoreapp3.1/SPETS.pdb
Binary file not shown.

0 comments on commit 88e6148

Please sign in to comment.