Example #1
0
        /// <summary>
        /// Constructs a new basic material from a <see cref="Rhino.DocObjects.Material">Material</see>.
        /// </summary>
        /// <param name="material">(optional)The material to create the basic material from.</param>
        /// <returns>A new basic material.</returns>
        public static RenderMaterial CreateBasicMaterial(Rhino.DocObjects.Material material)
        {
            IntPtr pConstSourceMaterial      = (material == null ? IntPtr.Zero : material.ConstPointer());
            IntPtr pNewMaterial              = UnsafeNativeMethods.Rdk_Globals_NewBasicMaterial(pConstSourceMaterial);
            NativeRenderMaterial newMaterial = RenderContent.FromPointer(pNewMaterial) as NativeRenderMaterial;

            if (newMaterial != null)
            {
                newMaterial.AutoDelete = true;
            }
            return(newMaterial);
        }
Example #2
0
        /// <summary>
        /// Constructs a new basic material from a <see cref="Rhino.DocObjects.Material">Material</see>.
        /// </summary>
        /// <param name="material">(optional)The material to create the basic material from.</param>
        /// <returns>A new basic material.</returns>
        public static RenderMaterial CreateBasicMaterial(DocObjects.Material material)
        {
            IntPtr const_ptr_source_material  = (material == null ? IntPtr.Zero : material.ConstPointer());
            IntPtr ptr_new_material           = UnsafeNativeMethods.Rdk_Globals_NewBasicMaterial(const_ptr_source_material);
            NativeRenderMaterial new_material = FromPointer(ptr_new_material) as NativeRenderMaterial;

            if (new_material != null)
            {
                new_material.AutoDelete = true;
            }
            return(new_material);
        }