Пример #1
0
        //NMSTEmplate Export

        public virtual TkSceneNodeData ExportTemplate(bool keepRenderable)
        {
            //Copy main info
            TkSceneNodeData cpy = new TkSceneNodeData();

            cpy.Transform  = nms_template.Transform;
            cpy.Attributes = nms_template.Attributes;
            cpy.Type       = nms_template.Type;
            cpy.Name       = nms_template.Name;
            cpy.NameHash   = nms_template.NameHash;

            if (children.Count > 0)
            {
                cpy.Children = new List <TkSceneNodeData>();
            }

            foreach (Model child in children)
            {
                if (!child.renderable && keepRenderable)
                {
                    continue;
                }
                else if (child.nms_template != null)
                {
                    cpy.Children.Add(child.ExportTemplate(keepRenderable));
                }
            }

            return(cpy);
        }
Пример #2
0
        public override TkSceneNodeData ExportTemplate(bool keepRenderable)
        {
            //Copy main info
            TkSceneNodeData cpy = new TkSceneNodeData();

            cpy.Transform  = nms_template.Transform;
            cpy.Attributes = nms_template.Attributes;
            cpy.Type       = nms_template.Type;
            cpy.Name       = nms_template.Name;
            cpy.NameHash   = nms_template.NameHash;

            //The only difference with references is that the first children of the reference object is a copy of the
            //actual scene

            if (children.Count > 1)
            {
                cpy.Children = new List <TkSceneNodeData>();
            }

            for (int i = 1; i < children.Count; i++)
            {
                Model child = children[i];
                if (!child.renderable && keepRenderable)
                {
                    continue;
                }
                else if (child.nms_template != null)
                {
                    cpy.Children.Add(child.ExportTemplate(keepRenderable));
                }
            }

            return(cpy);
        }
Пример #3
0
        //Export to MBIN
        private void exportToMBIN(object sender, RoutedEventArgs e)
        {
            if (_mdl?.nms_template != null)
            {
                //Fetch scene name
                string[] split   = _mdl.nms_template.Name.Split('\\');
                string   scnName = split[split.Length - 1];

                TkSceneNodeData temp = _mdl.ExportTemplate(true);
                temp.WriteToMbin(scnName.ToUpper() + ".SCENE.MBIN");
                Util.showInfo("Scene successfully exported to " + scnName.ToUpper() + ".MBIN", "Info");
            }
        }