Пример #1
0
        protected internal override void LoadFromXml(XElement element)
        {
            base.LoadFromXml(element);

            if (element.HasElement(nameof(ReplacementMeshes), out XElement geomElem))
            {
                foreach (var elem in geomElem.Elements(ModelMeshReference.NODE_NAME))
                {
                    var mesh = new ModelMeshReference();
                    mesh.LoadFromXml(elem);
                    ReplacementMeshes.Add(mesh);
                }
            }

            //LEGACY
            if (element.HasElement("Studs", out XElement studsElem))
            {
                foreach (var studElem in studsElem.Elements(StudReference.NODE_NAME))
                {
                    var studRef = StudReference.FromXml(studElem);
                    if (!string.IsNullOrEmpty(LegacyConnectionID))
                    {
                        studRef.ConnectionID = LegacyConnectionID;
                    }
                    ReferencedStuds.Add(studRef);
                }
            }
        }
Пример #2
0
        protected internal override void LoadFromXml(XElement element)
        {
            base.LoadFromXml(element);
            var geomElem = element.Element(nameof(Meshes));

            if (geomElem != null)
            {
                foreach (var elem in geomElem.Elements(ModelMeshReference.NODE_NAME))
                {
                    var mesh = new ModelMeshReference();
                    mesh.LoadFromXml(elem);
                    Meshes.Add(mesh);
                }
            }
        }