コード例 #1
0
        public void FlattenItem(ref IINode itemNode)
        {
            AnimationGroupList animationGroupList = new AnimationGroupList();

            animationGroupList.LoadFromData(Loader.Core.RootNode);

            if (itemNode == null)
            {
                string message = "Flattening nodes of scene not supported...";
                logger?.RaiseMessage(message, 0);
            }
            else
            {
                string message = $"Flattening child nodes of {itemNode.Name}...";
                logger?.RaiseMessage(message, 0);
                List <IINode> flattenableNodes = new List <IINode>();
                if (IsMeshFlattenable(itemNode, animationGroupList, ref flattenableNodes))
                {
                    itemNode = itemNode.FlattenHierarchyMS();
                }
                else
                {
                    string msg = $"{itemNode.Name} cannot be flatten, check the content of his hierarchy.";
                    logger?.RaiseWarning(msg, 0);
                }
            }
        }