Now we can edit material colors

This commit is contained in:
LarsBrubaker 2021-01-29 08:22:00 -08:00
parent 53e96f7d79
commit 257fa19638
11 changed files with 47 additions and 30 deletions

View file

@ -801,7 +801,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
else if (sceneContext.ViewState.RenderType == RenderTypes.Materials)
{
// check if we should be rendering materials (this overrides the other colors)
drawColor = MaterialRendering.Color(item.WorldMaterialIndex());
drawColor = MaterialRendering.Color(sceneContext.Printer, item.WorldMaterialIndex());
}
if (sceneContext.Printer is PrinterConfig printer)
@ -983,7 +983,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
var matrix = Matrix4X4.CreateTranslation(emulator.CurrentPosition + new Vector3(.5, .5, 5));
GLHelper.Render(emulatorNozzleMesh,
MaterialRendering.Color(emulator.ExtruderIndex),
MaterialRendering.Color(sceneContext.Printer, emulator.ExtruderIndex),
matrix,
RenderTypes.Shaded,
matrix * World.ModelviewMatrix);