Exemplo n.º 1
0
        public SerializableScene(MaxSharp.Node x)
        {
            root = new Node(x);

            Dictionary<UIntPtr, MaxSharp.Animatable> lookup = new Dictionary<UIntPtr, MaxSharp.Animatable>();

            var pluginList = new List<Plugin>();

            foreach (var rt in x.NodeReferenceTree)
            {
                // Make sure we don't repeat anything.
                if (!lookup.ContainsKey(rt.AnimHandle))
                {
                    if (rt is MaxSharp.Node || rt is MaxSharp.ParameterBlock1 || rt is MaxSharp.ParameterBlock2)
                    {
                        // do nothing these 
                    }
                    else
                    {
                        pluginList.Add(new Plugin(rt));
                    }

                   lookup.Add(rt.AnimHandle, rt);
                }
            }

            this.plugins = pluginList.ToArray();
        }
Exemplo n.º 2
0
 public Node(MaxSharp.Node n) 
     : base(n)
 {
     name = n.Name;
     if (n.Object != null)
         sceneobject = new Reference(n.Object.Base);
     else
         sceneobject = new Reference();
     transform = n.NodeTransform;
     nodes = (from x in n.Nodes select new Node(x)).ToArray();
     modifiers = (from x in n.Modifiers select new Reference(x)).ToArray();
 }