Beispiel #1
0
        /// <summary>
        /// Explore the material to find a MaterialTextureNode behind a name.
        /// </summary>
        /// <param name="material">The material.</param>
        /// <param name="startNode">The name of the stating node.</param>
        /// <returns>The MaterialTextureNode if found.</returns>
        private static MaterialTextureNode FindTextureNode(MaterialDescription material, string startNode)
        {
            var currentNode = material.FindNode(startNode);

            while (currentNode is MaterialReferenceNode)
            {
                var currentReferenceNode = (MaterialReferenceNode)currentNode;
                currentNode = material.FindNode(currentReferenceNode.Name);
            }

            return(currentNode as MaterialTextureNode);
        }