Esempio n. 1
0
        public FbxNode[] GetFbxNodes(string name, FbxNodeList fbxNodeList)
        {
            var nodeList = new List <FbxNode>();

            foreach (var node in fbxNodeList.Nodes)
            {
                if (node == null)
                {
                    continue;
                }
                if (node.Identifier.Value == name)
                {
                    nodeList.Add(node);
                }
                nodeList.AddRange(GetFbxNodes(name, node));
            }
            return(nodeList.ToArray());
        }
Esempio n. 2
0
        /// <summary>
        /// Generates the unique footer code based on the document's timestamp
        /// </summary>
        /// <param name="document"></param>
        /// <returns>A 16-byte code</returns>
        protected static byte[] GenerateFooterCode(FbxNodeList document)
        {
            var timestamp = document.GetRelative($"{timePath1}/{timePath2}");

            if (timestamp == null)
            {
                throw new FbxException(-1, "No creation timestamp");
            }

            try {
                return(GenerateFooterCode(
                           GetTimestampVar(timestamp, "Year"),
                           GetTimestampVar(timestamp, "Month"),
                           GetTimestampVar(timestamp, "Day"),
                           GetTimestampVar(timestamp, "Hour"),
                           GetTimestampVar(timestamp, "Minute"),
                           GetTimestampVar(timestamp, "Second"),
                           GetTimestampVar(timestamp, "Millisecond")
                           ));
            } catch (ArgumentOutOfRangeException) {
                throw new FbxException(-1, "Invalid timestamp");
            }
        }