private Color GetItemColor(IObject3D item) { Color drawColor = item.WorldColor(); if (item.WorldOutputType() == PrintOutputTypes.Support) { drawColor = new Color(Color.Yellow, 120); } // If there is a printer - check if the object is within the bed volume (has no AABB outside the bed volume) if (sceneContext.Printer != null) { if (!item.InsideBuildVolume(sceneContext.Printer)) { drawColor = new Color(drawColor, 65); } } // check if we should be rendering materials (this overrides the other colors) if (sceneContext.ViewState.RenderType == RenderTypes.Materials) { drawColor = MaterialRendering.Color(item.WorldMaterialIndex()); } if (drawColor.alpha != 255 && item is Object3D item3D) { item3D.EnsureTransparentSorting(); } return(drawColor); }
public static Color GetExtruderColor(int extruderIndex) { return(MaterialRendering.Color(extruderIndex)); }