Ejemplo n.º 1
0
        /// <summary>
        /// Freezes / Unfreezes all IILayer objects.
        /// </summary>
        public static void FreezeUnfreezeAll()
        {
            Boolean        isFrozen     = false;
            IILayerManager LayerManager = GlobalInterface.Instance.COREInterface13.LayerManager;

            for (int i = 0; i < LayerManager.LayerCount; i++)
            {
                IILayer layer = LayerManager.GetLayer(i);
                if (!layer.IsFrozen)
                {
                    isFrozen = true;
                }
            }
            for (int i = 0; i < LayerManager.LayerCount; i++)
            {
                IILayer layer = LayerManager.GetLayer(i);

#if Max2013 || Max2014
                layer.IsFrozen = isFrozen;
#endif

#if Max2015
                layer.Freeze(isFrozen, false);
#endif
            }

            MaxUI.RedrawViewportsNow();
        }
Ejemplo n.º 2
0
        public override void PutMaxValue(BaseTreeNode treeNode, Object newValue)
        {
            ObjectTreeNode objectTreeNode = treeNode as ObjectTreeNode;

            if (objectTreeNode != null)
            {
                IINode maxNode = MaxAnimatable.GetAnimByHandle(objectTreeNode.Handle) as IINode;
                if (maxNode != null)
                {
                    maxNode.IsFrozen = !(Boolean)newValue;
                }
                return;
            }
            LayerTreeNode layerTreeNode = treeNode as LayerTreeNode;

            if (layerTreeNode != null)
            {
                IILayer maxLayer = MaxAnimatable.GetAnimByHandle(layerTreeNode.Handle) as IILayer;
#if Max2013 || Max2014
                if (maxLayer != null)
                {
                    maxLayer.IsFrozen = !(Boolean)newValue;
                }
#endif
#if Max2015
                if (maxLayer != null)
                {
                    maxLayer.Freeze(!(Boolean)newValue, false);
                }
#endif
                return;
            }
        }