BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Member Functions | Static Protected Member Functions | Properties | List of all members
BrawlCrate.NodeWrappers.MDL0Wrapper Class Reference
Inheritance diagram for BrawlCrate.NodeWrappers.MDL0Wrapper:
BrawlCrate.NodeWrappers.GenericWrapper BrawlCrate.NodeWrappers.BaseWrapper BrawlCrate.NodeWrappers.MultiSelectableWrapper

Public Member Functions

 MDL0Wrapper ()
 
void ReimportMeshes ()
 
void Preview ()
 
MDL0ShaderNode NewShader ()
 
MDL0MaterialNode NewMaterial ()
 
void AutoMetal ()
 
void NameMaterial ()
 
void NameObject ()
 
void NameVertex ()
 
void NameNormal ()
 
void NameColor ()
 
void NameUV ()
 
MDL0VertexNode NewVertex ()
 
MDL0NormalNode NewNormal ()
 
MDL0ColorNode NewColor ()
 
MDL0UVNode NewUV ()
 
void ImportMaterial ()
 
void ImportShader ()
 
void ImportVertex ()
 
void ImportNormal ()
 
void ImportColor ()
 
void ImportUV ()
 
void ImportObject ()
 
void SortMaterial ()
 
void SortVertex ()
 
void SortNormal ()
 
void SortColor ()
 
void SortUV ()
 
void SortObject ()
 
void SortTexture ()
 
void ShadowConvert ()
 
void SpyConvert ()
 
void InvertMaterials ()
 
void CullMaterials (CullMode mode)
 
- Public Member Functions inherited from BrawlCrate.NodeWrappers.GenericWrapper
 GenericWrapper (IWin32Window owner)
 
 GenericWrapper ()
 
virtual void Sort ()
 
void MoveUp ()
 
virtual void MoveUp (bool select)
 
void MoveDown ()
 
virtual void MoveDown (bool select)
 
void DeleteSelected ()
 
void ExportSelected ()
 
virtual string Export ()
 
virtual void OnExport (string outPath)
 
virtual void Replace ()
 
virtual void OnReplace (string inStream)
 
void Restore ()
 
virtual void Delete ()
 
void Rename ()
 
virtual ResourceNode Duplicate ()
 
virtual ResourceNode Duplicate (bool changeName)
 
- Public Member Functions inherited from BrawlCrate.NodeWrappers.BaseWrapper
void Link (ResourceNode res)
 
void Unlink ()
 

Static Protected Member Functions

static void PreviewAction (object sender, EventArgs e)
 
static void ImportObjectAction (object sender, EventArgs e)
 
static void RecalcBBsOption (object sender, EventArgs e)
 
static void MetalAction (object sender, EventArgs e)
 
static void NewShaderAction (object sender, EventArgs e)
 
static void NewMaterialAction (object sender, EventArgs e)
 
static void NewVertexAction (object sender, EventArgs e)
 
static void NewNormalAction (object sender, EventArgs e)
 
static void NewColorAction (object sender, EventArgs e)
 
static void NewUVAction (object sender, EventArgs e)
 
static void NameMaterialAction (object sender, EventArgs e)
 
static void NameVertexAction (object sender, EventArgs e)
 
static void NameNormalAction (object sender, EventArgs e)
 
static void NameColorAction (object sender, EventArgs e)
 
static void NameUVAction (object sender, EventArgs e)
 
static void NameObjectAction (object sender, EventArgs e)
 
static void ImportVertexAction (object sender, EventArgs e)
 
static void ImportNormalAction (object sender, EventArgs e)
 
static void ImportColorAction (object sender, EventArgs e)
 
static void ImportUVAction (object sender, EventArgs e)
 
static void ImportMaterialAction (object sender, EventArgs e)
 
static void ImportShaderAction (object sender, EventArgs e)
 
static void SortMaterialAction (object sender, EventArgs e)
 
static void SortVertexAction (object sender, EventArgs e)
 
static void SortNormalAction (object sender, EventArgs e)
 
static void SortColorAction (object sender, EventArgs e)
 
static void SortUVAction (object sender, EventArgs e)
 
static void SortObjectAction (object sender, EventArgs e)
 
static void SortTextureAction (object sender, EventArgs e)
 
static void InvertMaterialsAction (object sender, EventArgs e)
 
static void CullNoneAction (object sender, EventArgs e)
 
static void CullOutsideAction (object sender, EventArgs e)
 
static void CullInsideAction (object sender, EventArgs e)
 
static void CullAllAction (object sender, EventArgs e)
 
static void ShadowConvertAction (object sender, EventArgs e)
 
static void SpyConvertAction (object sender, EventArgs e)
 
static void StripAction (object sender, EventArgs e)
 
- Static Protected Member Functions inherited from BrawlCrate.NodeWrappers.GenericWrapper
static void MoveUpAction (object sender, EventArgs e)
 
static void MoveDownAction (object sender, EventArgs e)
 
static void ExportAction (object sender, EventArgs e)
 
static void ExportSelectedAction (object sender, EventArgs e)
 
static void DeleteSelectedAction (object sender, EventArgs e)
 
static void DuplicateAction (object sender, EventArgs e)
 
static void ReplaceAction (object sender, EventArgs e)
 
static void RestoreAction (object sender, EventArgs e)
 
static void DeleteAction (object sender, EventArgs e)
 
static void RenameAction (object sender, EventArgs e)
 
static void SortAction (object sender, EventArgs e)
 
- Static Protected Member Functions inherited from BrawlCrate.NodeWrappers.BaseWrapper
static T GetInstance< T > ()
 
static IEnumerable< T > GetInstances< T > ()
 

Properties

override string ExportFilter [get]
 
override string ImportFilter [get]
 
- Properties inherited from BrawlCrate.NodeWrappers.GenericWrapper
virtual ContextMenuStrip MultiSelectMenuStrip [get]
 
virtual string DefaultName [get]
 
virtual string ExportFilter [get]
 
virtual string ImportFilter [get]
 
virtual string ReplaceFilter [get]
 
- Properties inherited from BrawlCrate.NodeWrappers.BaseWrapper
ResourceNode Resource [get]
 
virtual ? Color DefaultBackColor [get]
 
virtual ? Color DefaultForeColor [get]
 
- Properties inherited from BrawlCrate.NodeWrappers.MultiSelectableWrapper
ContextMenuStrip MultiSelectMenuStrip [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from BrawlCrate.NodeWrappers.BaseWrapper
static BaseWrapper[] GetAllNodes (BaseWrapper root)
 
static BaseWrapper Wrap (ResourceNode node)
 
static BaseWrapper Wrap (IWin32Window owner, ResourceNode node)
 
- Static Public Attributes inherited from BrawlCrate.NodeWrappers.BaseWrapper
static IWin32Window _owner
 
- Protected Member Functions inherited from BrawlCrate.NodeWrappers.BaseWrapper
 BaseWrapper ()
 
- Protected Attributes inherited from BrawlCrate.NodeWrappers.BaseWrapper
bool _discovered
 
ResourceNode _resource
 
- Static Protected Attributes inherited from BrawlCrate.NodeWrappers.BaseWrapper
static readonly ContextMenuStrip _emptyMenu = new ContextMenuStrip()
 

Constructor & Destructor Documentation

◆ MDL0Wrapper()

BrawlCrate.NodeWrappers.MDL0Wrapper.MDL0Wrapper ( )
inline
370 {
371 ContextMenuStrip = _menu;
372 }

Member Function Documentation

◆ AutoMetal()

void BrawlCrate.NodeWrappers.MDL0Wrapper.AutoMetal ( )
inline
486 {
487 if (MessageBox.Show(null,
488 "Are you sure you want to (re)generate metal materials for Brawl?\nAll existing metal materials and shaders will be reset.",
489 "", MessageBoxButtons.YesNo) == DialogResult.Yes)
490 {
491 ((MDL0Node) _resource).GenerateMetalMaterials();
492 }
493 }
ResourceNode _resource
Definition: BaseWrapper.cs:76
Definition: MDL0Node.cs:24

◆ CullAllAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.CullAllAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
306 {
307 GetInstance<MDL0Wrapper>().CullMaterials(CullMode.Cull_All);
309 }
Definition: MainForm.cs:34
unsafe void resourceTree_SelectionChanged(object sender, EventArgs e)
Definition: MainForm.cs:533
static MainForm Instance
Definition: MainForm.cs:36
CullMode
Definition: MDL0.cs:958

◆ CullInsideAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.CullInsideAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
300 {
301 GetInstance<MDL0Wrapper>().CullMaterials(CullMode.Cull_Inside);
303 }

◆ CullMaterials()

void BrawlCrate.NodeWrappers.MDL0Wrapper.CullMaterials ( CullMode  mode)
inline
899 {
900 if (_resource is MDL0Node mdl)
901 {
902 if (mdl.MaterialList == null)
903 {
904 return;
905 }
906
907 foreach (MDL0MaterialNode mat in mdl.MaterialList)
908 {
909 mat.CullMode = mode;
910 }
911 }
912 }
Definition: MDL0MaterialNode.cs:22

◆ CullNoneAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.CullNoneAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
288 {
289 GetInstance<MDL0Wrapper>().CullMaterials(CullMode.Cull_None);
291 }

◆ CullOutsideAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.CullOutsideAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
294 {
295 GetInstance<MDL0Wrapper>().CullMaterials(CullMode.Cull_Outside);
297 }

◆ ImportColor()

void BrawlCrate.NodeWrappers.MDL0Wrapper.ImportColor ( )
inline
776 {
777 if (Program.OpenFiles("Raw Color Set (*.*)|*.*", out string[] paths) > 0)
778 {
779 foreach (string path in paths)
780 {
781 NewColor().Replace(path);
782 }
783 }
784 }
MDL0ColorNode NewColor()
Definition: MDL0Wrapper.cs:681
virtual void Replace(string fileName)
Definition: ResourceNode.cs:829

◆ ImportColorAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.ImportColorAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
227 {
228 GetInstance<MDL0Wrapper>().ImportColor();
229 }

◆ ImportMaterial()

void BrawlCrate.NodeWrappers.MDL0Wrapper.ImportMaterial ( )
inline
730 {
731 if (Program.OpenFiles(FileFilters.MDL0Material, out string[] paths) > 0)
732 {
733 foreach (string path in paths)
734 {
736 m.Name = Path.GetFileNameWithoutExtension(path);
737 m.Replace(path);
738 }
739 }
740 }
MDL0MaterialNode NewMaterial()
Definition: MDL0Wrapper.cs:438
Definition: FileFilters.cs:8
static string MDL0Material
Definition: FileFilters.cs:161
override void Replace(string fileName)
Definition: MDL0MaterialNode.cs:2450

◆ ImportMaterialAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.ImportMaterialAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
237 {
238 GetInstance<MDL0Wrapper>().ImportMaterial();
239 }

◆ ImportNormal()

void BrawlCrate.NodeWrappers.MDL0Wrapper.ImportNormal ( )
inline
765 {
766 if (Program.OpenFiles("Raw Normal Set (*.*)|*.*", out string[] paths) > 0)
767 {
768 foreach (string path in paths)
769 {
770 NewNormal().Replace(path);
771 }
772 }
773 }
MDL0NormalNode NewNormal()
Definition: MDL0Wrapper.cs:657

◆ ImportNormalAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.ImportNormalAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
222 {
223 GetInstance<MDL0Wrapper>().ImportNormal();
224 }

◆ ImportObject()

void BrawlCrate.NodeWrappers.MDL0Wrapper.ImportObject ( )
inline
798 {
799 if (Program.OpenFiles(ImportFilter, out string[] paths) > 0)
800 {
801 foreach (string path in paths)
802 {
803 MDL0Node external;
804 if ((external = MDL0Node.FromFile(path)) != null)
805 {
806 new ObjectImporter().ShowDialog((MDL0Node) _resource, external);
807 }
808 else
809 {
810 MessageBox.Show($"Could not import an object from {path}", "Error", MessageBoxButtons.OK,
811 MessageBoxIcon.Error);
812 }
813 }
814 }
815 }
override string ImportFilter
Definition: MDL0Wrapper.cs:367
Definition: ObjectImporter.cs:11
DialogResult ShowDialog(MDL0Node internalModel, MDL0Node externalModel)
Definition: ObjectImporter.cs:36
static MDL0Node FromFile(string path, FileOptions options=FileOptions.RandomAccess)
Definition: MDL0Node.cs:2649

◆ ImportObjectAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.ImportObjectAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
142 {
143 GetInstance<MDL0Wrapper>().ImportObject();
144 }

◆ ImportShader()

void BrawlCrate.NodeWrappers.MDL0Wrapper.ImportShader ( )
inline
743 {
744 if (Program.OpenFiles(FileFilters.MDL0Shader, out string[] paths) > 0)
745 {
746 foreach (string path in paths)
747 {
748 NewShader()?.Replace(path);
749 }
750 }
751 }
MDL0ShaderNode NewShader()
Definition: MDL0Wrapper.cs:403
static string MDL0Shader
Definition: FileFilters.cs:164

◆ ImportShaderAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.ImportShaderAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
242 {
243 GetInstance<MDL0Wrapper>().ImportShader();
244 }

◆ ImportUV()

void BrawlCrate.NodeWrappers.MDL0Wrapper.ImportUV ( )
inline
787 {
788 if (Program.OpenFiles("Raw UV Set (*.*)|*.*", out string[] paths) > 0)
789 {
790 foreach (string path in paths)
791 {
792 NewUV().Replace(path);
793 }
794 }
795 }
MDL0UVNode NewUV()
Definition: MDL0Wrapper.cs:705

◆ ImportUVAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.ImportUVAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
232 {
233 GetInstance<MDL0Wrapper>().ImportUV();
234 }

◆ ImportVertex()

void BrawlCrate.NodeWrappers.MDL0Wrapper.ImportVertex ( )
inline
754 {
755 if (Program.OpenFiles("Raw Vertex Set (*.*)|*.*", out string[] paths) > 0)
756 {
757 foreach (string path in paths)
758 {
759 NewVertex().Replace(path);
760 }
761 }
762 }
MDL0VertexNode NewVertex()
Definition: MDL0Wrapper.cs:633

◆ ImportVertexAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.ImportVertexAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
217 {
218 GetInstance<MDL0Wrapper>().ImportVertex();
219 }

◆ InvertMaterials()

void BrawlCrate.NodeWrappers.MDL0Wrapper.InvertMaterials ( )
inline
876 {
877 if (_resource is MDL0Node mdl)
878 {
879 if (mdl.MaterialList == null)
880 {
881 return;
882 }
883
884 foreach (MDL0MaterialNode mat in mdl.MaterialList)
885 {
886 if (mat.CullMode == CullMode.Cull_Inside)
887 {
888 mat.CullMode = CullMode.Cull_Outside;
889 }
890 else if (mat.CullMode == CullMode.Cull_Outside)
891 {
892 mat.CullMode = CullMode.Cull_Inside;
893 }
894 }
895 }
896 }
CullMode CullMode
Definition: MDL0MaterialNode.cs:1211

◆ InvertMaterialsAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.InvertMaterialsAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
282 {
283 GetInstance<MDL0Wrapper>().InvertMaterials();
285 }

◆ MetalAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.MetalAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
152 {
153 GetInstance<MDL0Wrapper>().AutoMetal();
154 }

◆ NameColor()

void BrawlCrate.NodeWrappers.MDL0Wrapper.NameColor ( )
inline
588 {
589 MDL0Node model = (MDL0Node) _resource;
590 MDL0GroupNode g = model._colorGroup;
591 if (g != null)
592 {
593 foreach (MDL0ColorNode v in g.Children)
594 {
595 string name = model.Name + "_";
596 if (v._objects.Count > 0)
597 {
598 MDL0ObjectNode o = v._objects[0];
599 name += o.Name;
600 if (o._drawCalls.Count > 0)
601 {
602 DrawCall c = o._drawCalls[0];
603 if (c.MaterialNode != null && c.VisibilityBoneNode != null)
604 {
605 name += "_" + c.Material + "_" + c.VisibilityBone;
606 }
607 }
608 }
609 else
610 {
611 name += "ColorArray";
612 }
613
614 v.Name = g.FindName(name);
615 }
616 }
617 }
Definition: MDL0ObjectNode.cs:2040
string VisibilityBone
Definition: MDL0ObjectNode.cs:2079
MDL0MaterialNode MaterialNode
Does not signal a property change!
Definition: MDL0ObjectNode.cs:2121
MDL0BoneNode VisibilityBoneNode
Does not signal a property change!
Definition: MDL0ObjectNode.cs:2144
Definition: MDL0ColorNode.cs:12
List< MDL0ObjectNode > _objects
Definition: MDL0ColorNode.cs:17
Definition: MDL0GroupNode.cs:79
MDL0GroupNode _colorGroup
Definition: MDL0Node.cs:299
Definition: MDL0ObjectNode.cs:21
BindingList< DrawCall > _drawCalls
Definition: MDL0ObjectNode.cs:626
unsafe string FindName(string name)
Definition: ResourceNode.cs:1578
virtual string Name
Definition: ResourceNode.cs:223
List< ResourceNode > Children
Definition: ResourceNode.cs:262

◆ NameColorAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.NameColorAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
202 {
203 GetInstance<MDL0Wrapper>().NameColor();
204 }

◆ NameMaterial()

void BrawlCrate.NodeWrappers.MDL0Wrapper.NameMaterial ( )
inline
496 {
497 MDL0Node model = (MDL0Node) _resource;
498 MDL0GroupNode g = model._matGroup;
499 int i = 0;
500 if (g != null)
501 {
502 foreach (MDL0MaterialNode m in g.Children)
503 {
504 m.Name = "Material_" + i++;
505 }
506 }
507 }
MDL0GroupNode _matGroup
Definition: MDL0Node.cs:290

◆ NameMaterialAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.NameMaterialAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
187 {
188 GetInstance<MDL0Wrapper>().NameMaterial();
189 }

◆ NameNormal()

void BrawlCrate.NodeWrappers.MDL0Wrapper.NameNormal ( )
inline
556 {
557 MDL0Node model = (MDL0Node) _resource;
558 MDL0GroupNode g = model._normGroup;
559 if (g != null)
560 {
561 foreach (MDL0NormalNode v in g.Children)
562 {
563 string name = model.Name + "_";
564 if (v._objects.Count > 0)
565 {
566 MDL0ObjectNode o = v._objects[0];
567 name += o.Name;
568 if (o._drawCalls.Count > 0)
569 {
570 DrawCall c = o._drawCalls[0];
571 if (c.MaterialNode != null && c.VisibilityBoneNode != null)
572 {
573 name += "_" + c.Material + "_" + c.VisibilityBone;
574 }
575 }
576 }
577 else
578 {
579 name += "NormalArray";
580 }
581
582 v.Name = g.FindName(name);
583 }
584 }
585 }
MDL0GroupNode _normGroup
Definition: MDL0Node.cs:296
Definition: MDL0NormalNode.cs:10
List< MDL0ObjectNode > _objects
Definition: MDL0NormalNode.cs:16

◆ NameNormalAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.NameNormalAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
197 {
198 GetInstance<MDL0Wrapper>().NameNormal();
199 }

◆ NameObject()

void BrawlCrate.NodeWrappers.MDL0Wrapper.NameObject ( )
inline
510 {
511 MDL0Node model = (MDL0Node) _resource;
512 MDL0GroupNode g = model._objGroup;
513 int i = 0;
514 if (g != null)
515 {
516 foreach (MDL0ObjectNode o in g.Children)
517 {
518 o.Name = "polygon" + i++;
519 }
520 }
521 }
MDL0GroupNode _objGroup
Definition: MDL0Node.cs:292

◆ NameObjectAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.NameObjectAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
212 {
213 GetInstance<MDL0Wrapper>().NameObject();
214 }

◆ NameUV()

void BrawlCrate.NodeWrappers.MDL0Wrapper.NameUV ( )
inline
620 {
621 MDL0Node model = (MDL0Node) _resource;
622 MDL0GroupNode g = model._uvGroup;
623 int i = 0;
624 if (g != null)
625 {
626 foreach (MDL0UVNode v in g.Children)
627 {
628 v.Name = "#" + i++;
629 }
630 }
631 }
MDL0GroupNode _uvGroup
Definition: MDL0Node.cs:297
Definition: MDL0UVNode.cs:10

◆ NameUVAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.NameUVAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
207 {
208 GetInstance<MDL0Wrapper>().NameUV();
209 }

◆ NameVertex()

void BrawlCrate.NodeWrappers.MDL0Wrapper.NameVertex ( )
inline
524 {
525 MDL0Node model = (MDL0Node) _resource;
526 MDL0GroupNode g = model._vertGroup;
527 if (g != null)
528 {
529 foreach (MDL0VertexNode v in g.Children)
530 {
531 string name = model.Name + "_";
532 if (v._objects.Count > 0)
533 {
534 MDL0ObjectNode o = v._objects[0];
535 name += o.Name;
536 if (o._drawCalls.Count > 0)
537 {
538 DrawCall c = o._drawCalls[0];
539 if (c.MaterialNode != null && c.VisibilityBoneNode != null)
540 {
541 name += "_" + c.Material + "_" + c.VisibilityBone;
542 }
543 }
544 }
545 else
546 {
547 name += "VertexArray";
548 }
549
550 v.Name = g.FindName(name);
551 }
552 }
553 }
MDL0GroupNode _vertGroup
Definition: MDL0Node.cs:295
Definition: MDL0VertexNode.cs:11
List< MDL0ObjectNode > _objects
Definition: MDL0VertexNode.cs:15

◆ NameVertexAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.NameVertexAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
192 {
193 GetInstance<MDL0Wrapper>().NameVertex();
194 }

◆ NewColor()

MDL0ColorNode BrawlCrate.NodeWrappers.MDL0Wrapper.NewColor ( )
inline
682 {
683 MDL0Node model = (MDL0Node) _resource;
684
685 MDL0GroupNode g = model._colorGroup;
686 if (g == null)
687 {
688 model.AddChild(g = new MDL0GroupNode(MDLResourceType.Colors), true);
689 model._colorGroup = g;
690 model._colorList = g.Children;
691 }
692
693 MDL0ColorNode node = new MDL0ColorNode {Name = "ColorSet" + ((MDL0Node) _resource)._colorList.Count};
694 node.Colors = new RGBAPixel[] {new RGBAPixel {A = 255, R = 128, G = 128, B = 128}};
695 g.AddChild(node, true);
696
697 node.Rebuild(true);
699
700 FindResource(node, true).EnsureVisible();
701
702 return node;
703 }
override void SignalPropertyChange()
Definition: MDL0GroupNode.cs:66
override void AddChild(ResourceNode child, bool change)
Definition: MDL0Node.cs:821
virtual void Rebuild()
Definition: ResourceNode.cs:987
virtual void AddChild(ResourceNode child)
Definition: ResourceNode.cs:757
MDLResourceType
Definition: ModelLinker.cs:15
Definition: PixelTypes.cs:327

◆ NewColorAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.NewColorAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
177 {
178 GetInstance<MDL0Wrapper>().NewColor();
179 }

◆ NewMaterial()

MDL0MaterialNode BrawlCrate.NodeWrappers.MDL0Wrapper.NewMaterial ( )
inline
439 {
440 MDL0Node model = (MDL0Node) _resource;
441
442 if (model._matGroup == null)
443 {
444 MDL0GroupNode g = model._matGroup;
445 if (g == null)
446 {
447 model.AddChild(g = new MDL0GroupNode(MDLResourceType.Materials), true);
448 model._matGroup = g;
449 model._matList = g.Children;
450 }
451 }
452
454 model._matGroup.AddChild(mat);
455 mat.Name = "Material" + mat.Index;
456
457 if (model._shadGroup == null)
458 {
459 MDL0GroupNode g = model._shadGroup;
460 if (g == null)
461 {
462 model.AddChild(g = new MDL0GroupNode(MDLResourceType.Shaders), true);
463 model._shadGroup = g;
464 model._shadList = g.Children;
465 }
466 }
467
468 if (model._shadList.Count == 0)
469 {
470 NewShader();
471 }
472
473 mat.ShaderNode = (MDL0ShaderNode) model._shadList[0];
475 mat.AddChild(mr);
476 mr.Name = "MatRef0";
477 mat.Rebuild(true);
478
479 BaseWrapper b = FindResource(mat, true);
480 b?.EnsureVisible();
481
482 return mat;
483 }
BaseWrapper()
Definition: BaseWrapper.cs:79
Definition: MDL0MaterialRefNode.cs:17
MDL0GroupNode _shadGroup
Definition: MDL0Node.cs:291
List< ResourceNode > _shadList
Definition: MDL0Node.cs:305
Definition: MDL0ShaderNode.cs:11
int Index
Definition: ResourceNode.cs:301

◆ NewMaterialAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.NewMaterialAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
162 {
163 GetInstance<MDL0Wrapper>().NewMaterial();
164 }

◆ NewNormal()

MDL0NormalNode BrawlCrate.NodeWrappers.MDL0Wrapper.NewNormal ( )
inline
658 {
659 MDL0Node model = (MDL0Node) _resource;
660
661 MDL0GroupNode g = model._normGroup;
662 if (g == null)
663 {
664 model.AddChild(g = new MDL0GroupNode(MDLResourceType.Normals), true);
665 model._normGroup = g;
666 model._normList = g.Children;
667 }
668
669 MDL0NormalNode node = new MDL0NormalNode {Name = "NormalSet" + ((MDL0Node) _resource)._normList.Count};
670 node.Normals = new Vector3[] {new Vector3(0)};
671 g.AddChild(node, true);
672 node._forceRebuild = true;
673 node.Rebuild(true);
675
676 FindResource(node, true).EnsureVisible();
677
678 return node;
679 }
Definition: Vector3.cs:40

◆ NewNormalAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.NewNormalAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
172 {
173 GetInstance<MDL0Wrapper>().NewNormal();
174 }

◆ NewShader()

MDL0ShaderNode BrawlCrate.NodeWrappers.MDL0Wrapper.NewShader ( )
inline
404 {
405 MDL0Node model = (MDL0Node) _resource;
406
407 if (model._shadGroup == null)
408 {
409 MDL0GroupNode g = model._shadGroup;
410 if (g == null)
411 {
412 model.AddChild(g = new MDL0GroupNode(MDLResourceType.Shaders), true);
413 model._shadGroup = g;
414 model._shadList = g.Children;
415 }
416 }
417
418 if (model._shadList != null &&
419 model._matList != null &&
420 model._shadList.Count < model._matList.Count)
421 {
422 MDL0ShaderNode shader = new MDL0ShaderNode();
423 model._shadGroup.AddChild(shader);
424 shader.Default();
425 shader.Rebuild(true);
426
427 BaseWrapper b = FindResource(shader, true);
428 b?.EnsureVisible();
429
430 return shader;
431 }
432
433 MessageBox.Show("Shader could not be added. Make sure that you do not have more shaders than materials",
434 "Error");
435 return null;
436 }
List< ResourceNode > _matList
Definition: MDL0Node.cs:304
void Default()
Definition: MDL0ShaderNode.cs:480

◆ NewShaderAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.NewShaderAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
157 {
158 GetInstance<MDL0Wrapper>().NewShader();
159 }

◆ NewUV()

MDL0UVNode BrawlCrate.NodeWrappers.MDL0Wrapper.NewUV ( )
inline
706 {
707 MDL0Node model = (MDL0Node) _resource;
708
709 MDL0GroupNode g = model._uvGroup;
710 if (g == null)
711 {
712 model.AddChild(g = new MDL0GroupNode(MDLResourceType.UVs), true);
713 model._uvGroup = g;
714 model._uvList = g.Children;
715 }
716
717 MDL0UVNode node = new MDL0UVNode {Name = "#" + ((MDL0Node) _resource)._uvList.Count};
718 node.Points = new Vector2[] {new Vector2(0)};
719 g.AddChild(node, true);
720 node._forceRebuild = true;
721 node.Rebuild(true);
723
724 FindResource(node, true).EnsureVisible();
725
726 return node;
727 }
Definition: Vector2.cs:10

◆ NewUVAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.NewUVAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
182 {
183 GetInstance<MDL0Wrapper>().NewUV();
184 }

◆ NewVertex()

MDL0VertexNode BrawlCrate.NodeWrappers.MDL0Wrapper.NewVertex ( )
inline
634 {
635 MDL0Node model = (MDL0Node) _resource;
636
637 MDL0GroupNode g = model._vertGroup;
638 if (g == null)
639 {
640 model.AddChild(g = new MDL0GroupNode(MDLResourceType.Vertices), true);
641 model._vertGroup = g;
642 model._vertList = g.Children;
643 }
644
645 MDL0VertexNode node = new MDL0VertexNode {Name = "VertexSet" + ((MDL0Node) _resource)._vertList.Count};
646 node.Vertices = new Vector3[] {new Vector3(0)};
647 g.AddChild(node, true);
648 node.ForceRebuild = true;
649 node.Rebuild(true);
651
652 FindResource(node, true).EnsureVisible();
653
654 return node;
655 }

◆ NewVertexAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.NewVertexAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
167 {
168 GetInstance<MDL0Wrapper>().NewVertex();
169 }

◆ Preview()

void BrawlCrate.NodeWrappers.MDL0Wrapper.Preview ( )
inline
394 {
395 new ModelForm().Show(_owner, (MDL0Node) _resource);
396 }
static IWin32Window _owner
Definition: BaseWrapper.cs:398

◆ PreviewAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.PreviewAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
137 {
138 GetInstance<MDL0Wrapper>().Preview();
139 }

◆ RecalcBBsOption()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.RecalcBBsOption ( object  sender,
EventArgs  e 
)
inlinestaticprotected
147 {
148 GetInstance<MDL0Wrapper>().RecalcBoundingBoxes();
149 }

◆ ReimportMeshes()

void BrawlCrate.NodeWrappers.MDL0Wrapper.ReimportMeshes ( )
inline
375 {
376 OpenFileDialog ofd = new OpenFileDialog
377 {
378 Filter = ImportFilter,
379 Title = "Please select a model to reimport meshes from."
380 };
381 if (ofd.ShowDialog() == DialogResult.OK)
382 {
383 MDL0Node replacement = MDL0Node.FromFile(ofd.FileName);
384 if (replacement != null)
385 {
386 ((MDL0Node) _resource).ReplaceMeshes(replacement, true, true, true);
387 replacement.Dispose();
389 }
390 }
391 }
void ReplaceMeshes(MDL0Node replacement, bool doSearch, bool replaceIfFound, bool addIfNotFound)
Definition: MDL0Node.cs:1289
virtual void Dispose()
Definition: ResourceNode.cs:430
void UpdateCurrentControl()
Definition: ResourceNode.cs:482

◆ ShadowConvert()

void BrawlCrate.NodeWrappers.MDL0Wrapper.ShadowConvert ( )
inline
866 {
867 ((MDL0Node) _resource).ConvertToShadowModel();
868 }

◆ ShadowConvertAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.ShadowConvertAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
312 {
313 GetInstance<MDL0Wrapper>().ShadowConvert();
315 }

◆ SortColor()

void BrawlCrate.NodeWrappers.MDL0Wrapper.SortColor ( )
inline
836 {
837 ((MDL0Node) _resource).ColorGroup.SortChildren();
838 RefreshView(_resource);
839 }

◆ SortColorAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.SortColorAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
262 {
263 GetInstance<MDL0Wrapper>().SortColor();
264 }

◆ SortMaterial()

void BrawlCrate.NodeWrappers.MDL0Wrapper.SortMaterial ( )
inline
818 {
819 ((MDL0Node) _resource).MaterialGroup.SortChildren();
820 RefreshView(_resource);
821 }

◆ SortMaterialAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.SortMaterialAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
247 {
248 GetInstance<MDL0Wrapper>().SortMaterial();
249 }

◆ SortNormal()

void BrawlCrate.NodeWrappers.MDL0Wrapper.SortNormal ( )
inline
830 {
831 ((MDL0Node) _resource).NormalGroup.SortChildren();
832 RefreshView(_resource);
833 }

◆ SortNormalAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.SortNormalAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
257 {
258 GetInstance<MDL0Wrapper>().SortNormal();
259 }

◆ SortObject()

void BrawlCrate.NodeWrappers.MDL0Wrapper.SortObject ( )
inline
848 {
849 ((MDL0Node) _resource).PolygonGroup.SortChildren();
850 RefreshView(_resource);
851 }

◆ SortObjectAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.SortObjectAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
272 {
273 GetInstance<MDL0Wrapper>().SortObject();
274 }

◆ SortTexture()

void BrawlCrate.NodeWrappers.MDL0Wrapper.SortTexture ( )
inline
854 {
855 ((MDL0Node) _resource).TextureGroup.SortChildren();
856 RefreshView(_resource);
857 }

◆ SortTextureAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.SortTextureAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
277 {
278 GetInstance<MDL0Wrapper>().SortTexture();
279 }

◆ SortUV()

void BrawlCrate.NodeWrappers.MDL0Wrapper.SortUV ( )
inline
842 {
843 ((MDL0Node) _resource).UVGroup.SortChildren();
844 RefreshView(_resource);
845 }

◆ SortUVAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.SortUVAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
267 {
268 GetInstance<MDL0Wrapper>().SortUV();
269 }

◆ SortVertex()

void BrawlCrate.NodeWrappers.MDL0Wrapper.SortVertex ( )
inline
824 {
825 ((MDL0Node) _resource).VertexGroup.SortChildren();
826 RefreshView(_resource);
827 }

◆ SortVertexAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.SortVertexAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
252 {
253 GetInstance<MDL0Wrapper>().SortVertex();
254 }

◆ SpyConvert()

void BrawlCrate.NodeWrappers.MDL0Wrapper.SpyConvert ( )
inline
871 {
872 ((MDL0Node) _resource).ConvertToSpyModel();
873 }

◆ SpyConvertAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.SpyConvertAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
318 {
319 GetInstance<MDL0Wrapper>().SpyConvert();
321 }

◆ StripAction()

static void BrawlCrate.NodeWrappers.MDL0Wrapper.StripAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
324 {
325 GetInstance<MDL0Wrapper>().StripModel();
327 }

Property Documentation

◆ ExportFilter

override string BrawlCrate.NodeWrappers.MDL0Wrapper.ExportFilter
get

◆ ImportFilter

override string BrawlCrate.NodeWrappers.MDL0Wrapper.ImportFilter
get

The documentation for this class was generated from the following file: