Пример #1
0
 private String GetMaterialImageKey(OutlinerMaterial mat)
 {
     if (mat.IsUnassigned)
         return "material_unassigned";
     else if (mat.Type == OutlinerScene.XrefMaterialType)
         return "material_xref";
     else
         return "material";
 }
Пример #2
0
 public MaterialDragDropHandler(Outliner.TreeView tree, OutlinerMaterial data)
     : base(tree, null)
 {
     Data = data;
 }
Пример #3
0
      internal void AddMaterialToTree(OutlinerMaterial material)
      {
         if (material == null || ListMode != OutlinerListMode.Material)
            return;

         if (Filter.ShowNode(material))
         {
            BeginTimedUpdate();
            BeginTimedSort();

            TreeNode tn = CreateTreeNodeForOutlinerNode(material);

            // Add all objects belonging to the layer to the layers nodecollection.
            this.AddObjectsToTreeNodeCollection(tn.Nodes, material.ChildNodes, false);

            _treeNodes.Add(material, tn);
            this.Nodes.Add(tn);
         }
      }
Пример #4
0
 public void RemoveMaterial(OutlinerMaterial mat)
 {
     materials.Remove(mat.Handle);
     objects_by_materialHandle.Remove(mat.Handle);
     removeHandleFromListInDict(mat.Handle, materials_by_parentHandle, mat.ParentHandle);
 }
Пример #5
0
        public Boolean IsValidMaterialName(OutlinerMaterial editingMaterial, String newName)
        {
            if (newName == String.Empty)
                return false;

            foreach (KeyValuePair<Int32, OutlinerMaterial> kvp in materials)
            {
                if (String.Compare(kvp.Value.Name, newName, true) == 0 && kvp.Value != editingMaterial)
                    return false;
            }
            return true;
        }
Пример #6
0
 public void AddMaterial(Int32 handle, Int32 parentHandle, String name, String type)
 {
     OutlinerMaterial mat = new OutlinerMaterial(this, handle, parentHandle, name, type);
     AddMaterial(mat);
 }
Пример #7
0
        public void AddMaterial(OutlinerMaterial mat)
        {
            if (!materials.ContainsKey(mat.Handle))
            {
                materials.Add(mat.Handle, mat);

                addHandleToListInDict(mat.Handle, materials_by_parentHandle, mat.ParentHandle);
            }
        }
Пример #8
0
        private Boolean MaterialIsVisible(OutlinerMaterial mat)
        {
            if (NameFilter != String.Empty && !Regex.IsMatch(mat.Name, NameFilter, _nameFilterOptions))
                return false;

            if (mat.IsUnassigned && mat.ChildNodesCount == 0)
                return false;

            return true;
        }