public override bool ExecConduit(ref MRhinoDisplayPipeline dp, uint nChannel, ref bool bTerminate)
        {
            if (nChannel == MSupportChannels.SC_DRAWOBJECT)
            {
                if (null != m_pChannelAttrs.m_pObject)
                {
                    if (m_pChannelAttrs.m_pObject.m_runtime_object_serial_number == m_runtime_object_serial_number)
                    {
                        if (null == m_mesh_face_colors)
                        {
                            IRhinoMeshObject mesh_object = MRhinoMeshObject.ConstCast(m_pChannelAttrs.m_pObject);
                            if (null != mesh_object)
                            {
                                int mesh_face_count = mesh_object.Mesh().FaceCount();
                                m_mesh_face_colors = new ArrayOnColor(mesh_face_count);
                                for (int i = 0; i < mesh_face_count; i++)
                                {
                                    OnColor color = new OnColor(m_random.Next(0, 255), m_random.Next(0, 255), m_random.Next(0, 255));
                                    m_mesh_face_colors.Append(color);
                                }
                            }
                        }

                        if (null != m_mesh_face_colors)
                        {
                            m_pChannelAttrs.m_bDrawObject = false;

                            MDisplayPipelineAttributes da = new MDisplayPipelineAttributes();
                            da.m_bShadeSurface = true;
                            da.m_pMaterial.m_FrontMaterial.SetTransparency(0.0);
                            da.m_pMaterial.m_BackMaterial.SetTransparency(0.0);
                            da.m_pMaterial.m_FrontMaterial.m_bFlatShaded = true;
                            da.m_pMaterial.m_BackMaterial.m_bFlatShaded  = true;

                            dp.EnableDepthWriting(true);

                            if (da.m_bCullBackfaces)
                            {
                                dp.PushCullFaceMode(1);
                            }

                            for (int i = 0; i < m_mesh_face_colors.Count(); i++)
                            {
                                da.m_pMaterial.m_FrontMaterial.m_diffuse = m_mesh_face_colors[i];
                                da.m_pMaterial.m_BackMaterial.m_diffuse  = m_mesh_face_colors[i];
                                dp.DrawFace(m_pChannelAttrs.m_pObject, i, da);
                            }

                            if (da.m_bCullBackfaces)
                            {
                                dp.PopCullFaceMode();
                            }
                        }
                    }
                }
            }
            return(true);
        }
        public override bool ExecConduit(ref MRhinoDisplayPipeline dp, uint nChannel, ref bool bTerminate)
        {
            if (nChannel == MSupportChannels.SC_DRAWOBJECT)
              {
            if (null != m_pChannelAttrs.m_pObject)
            {
              if (m_pChannelAttrs.m_pObject.m_runtime_object_serial_number == m_runtime_object_serial_number)
              {
            if (null == m_mesh_face_colors)
            {
              IRhinoMeshObject mesh_object = MRhinoMeshObject.ConstCast(m_pChannelAttrs.m_pObject);
              if (null != mesh_object)
              {
                int mesh_face_count = mesh_object.Mesh().FaceCount();
                m_mesh_face_colors = new ArrayOnColor(mesh_face_count);
                for (int i = 0; i < mesh_face_count; i++)
                {
                  OnColor color = new OnColor(m_random.Next(0, 255), m_random.Next(0, 255), m_random.Next(0, 255));
                  m_mesh_face_colors.Append(color);
                }
              }
            }

            if (null != m_mesh_face_colors)
            {
              m_pChannelAttrs.m_bDrawObject = false;

              MDisplayPipelineAttributes da = new MDisplayPipelineAttributes();
              da.m_bShadeSurface = true;
              da.m_pMaterial.m_FrontMaterial.SetTransparency(0.0);
              da.m_pMaterial.m_BackMaterial.SetTransparency(0.0);
              da.m_pMaterial.m_FrontMaterial.m_bFlatShaded = true;
              da.m_pMaterial.m_BackMaterial.m_bFlatShaded = true;

              dp.EnableDepthWriting(true);

              if (da.m_bCullBackfaces)
                dp.PushCullFaceMode(1);

              for (int i = 0; i < m_mesh_face_colors.Count(); i++)
              {
                da.m_pMaterial.m_FrontMaterial.m_diffuse = m_mesh_face_colors[i];
                da.m_pMaterial.m_BackMaterial.m_diffuse = m_mesh_face_colors[i];
                dp.DrawFace(m_pChannelAttrs.m_pObject, i, da);
              }

              if (da.m_bCullBackfaces)
                dp.PopCullFaceMode();
            }
              }
            }
              }
              return true;
        }