BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Properties | List of all members
BrawlLib.SSBB.ResourceNodes.MDL0NormalNode Class Reference
Inheritance diagram for BrawlLib.SSBB.ResourceNodes.MDL0NormalNode:
BrawlLib.SSBB.ResourceNodes.MDL0EntryNode BrawlLib.SSBB.ResourceNodes.ResourceNode

Public Types

enum  NormalType
 

Public Member Functions

override bool OnInitialize ()
 
override int OnCalculateSize (bool force)
 
override void OnRebuild (VoidPtr address, int length, bool force)
 
- Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.MDL0EntryNode
override void SignalPropertyChange ()
 
- Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
void OnRenamed ()
 
List< ResourceNodeGetChildrenRecursive ()
 Used primarily to get bone lists. Kept for all resource nodes for utility. More...
 
virtual void SignalPropertyChange ()
 
virtual void Dispose ()
 
void SelectChildAtIndex (int index)
 
void UpdateProperties ()
 
void UpdateCurrentControl ()
 
virtual bool MoveUp ()
 
virtual bool MoveDown ()
 
virtual void OnMoved ()
 
virtual void DoMoveDown ()
 
virtual void DoMoveDown (bool select)
 
virtual void DoMoveUp ()
 
virtual void DoMoveUp (bool select)
 
virtual bool AddUp ()
 
virtual bool AddDown ()
 
virtual bool ToParent ()
 
void Populate (int levels=-1)
 
virtual void OnPopulate ()
 
void Initialize (ResourceNode parent, FileMap source)
 
void Initialize (ResourceNode parent, VoidPtr address, int length)
 
void Initialize (ResourceNode parent, DataSource origSource)
 
virtual void Initialize (ResourceNode parent, DataSource origSource, DataSource uncompSource)
 
virtual bool OnInitialize ()
 
virtual void Restore ()
 
virtual void Remove ()
 
virtual void RemoveChild (ResourceNode child)
 
virtual void AddChild (ResourceNode child)
 
virtual void AddChild (ResourceNode child, bool change)
 
virtual void InsertChild (ResourceNode child, int index)
 
virtual void InsertChild (ResourceNode child, bool change, int index)
 
void SetSizeInternal (int size)
 
virtual void Replace (string fileName)
 
virtual void Replace (ResourceNode node)
 
virtual void Replace (string fileName, FileMapProtect prot, FileOptions options)
 
virtual void ReplaceRaw (VoidPtr address, int length)
 
virtual void ReplaceRaw (FileMap map)
 
virtual void Export (string outPath)
 
void Export (FileStream outStream)
 
virtual void ExportUncompressed (string outPath)
 
void ExportUncompressed (FileStream outStream)
 
virtual void Rebuild ()
 
virtual void Rebuild (bool force)
 
virtual void Rebuild (VoidPtr address, int length, bool force)
 
virtual void OnRebuild (VoidPtr address, int length, bool force)
 
virtual int CalculateSize (bool force)
 
virtual int OnCalculateSize (bool force)
 
void Merge ()
 
void Merge (bool forceBuild)
 
ResourceNode FindChildByType (string path, bool searchChildren, params ResourceType[] types)
 
ResourceNode FindChildByType (string path, bool searchChildren, StringComparison compare, params ResourceType[] types)
 
ResourceNode FindChild (string path)
 
ResourceNode FindChild (string path, bool searchChildren)
 
ResourceNode FindChild (string path, StringComparison compare)
 
ResourceNode FindChild (string path, bool searchChildren, StringComparison compare)
 
ResourceNode[] FindChildrenByClassType (string path, Type type)
 
ResourceNode[] FindChildrenByType (string path, ResourceType type)
 
ResourceNode[] FindChildrenByTypeInGroup (string path, ResourceType type, byte group)
 
ResourceNode[] FindChildrenByName (string name)
 
unsafe string FindName (string name)
 
ResourceNode FindEmbeddedIndex (int index)
 
virtual unsafe byte[] MD5 ()
 Find the MD5 checksum of this node's data. If this node doesn't have any data (BRESGroupNode, for example), this method will return null. More...
 
string MD5Str ()
 Get the result of the MD5() function as a string of hexadecimal digits. If MD5() returns null, this method will return an empty string. More...
 
ResourceNode PrevSibling ()
 
ResourceNode NextSibling ()
 
override string ToString ()
 
virtual void SortChildren ()
 

Public Attributes

List< MDL0ObjectNode_objects = new List<MDL0ObjectNode>()
 
VertexCodec _enc
 
bool _forceRebuild
 
bool _forceFloat
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.MDL0EntryNode
int _entryIndex
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
Form _mainForm
 
string _name
 
string _origPath
 
ResourceNode _parent
 
List< ResourceNode_children = new List<ResourceNode>()
 
int _calcSize
 
EventHandler UpdateControl
 
MoveEventHandler MovedDown
 
ResourceEventHandler Renamed
 
ResourceEventHandler PropertyChanged
 
ResourceEventHandler Replaced
 
ResourceEventHandler Restored
 
ResourceChildEventHandler ChildRemoved
 
bool _isPopulating
 
bool _replaced
 

Properties

override ResourceType ResourceFileType [get]
 
MDL0ObjectNode[] Objects [get]
 
int ID [get]
 
NormalType Type [get]
 
WiiVertexComponentType Format [get]
 
int Divisor [get]
 
int EntryStride [get]
 
int NumEntries [get]
 
bool ForceRebuild [get, set]
 
bool ForceFloat [get, set]
 
Vector3[] Normals [get, set]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.MDL0EntryNode
MDL0Node Model [get]
 
BRRESNode BRESNode [get]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
string FilePath [get]
 
string FileName [get]
 
string DirectoryName [get]
 
ResourceNode RootNode [get]
 
DataSource OriginalSource [get]
 
DataSource UncompressedSource [get]
 
DataSource WorkingSource [get]
 
DataSource WorkingUncompressed [get]
 
virtual bool HasChildren [get]
 
virtual ResourceType ResourceFileType [get]
 
string NodeType [get]
 
virtual string TreePathAbsolute [get]
 
virtual string TreePath [get]
 
virtual int Level [get]
 
virtual int MaxNameLength [get]
 
virtual bool AllowDuplicateNames [get]
 
virtual bool AllowNullNames [get]
 
virtual string Name [get, set]
 
ResourceNode Parent [get, set]
 
List< ResourceNodeChildren [get]
 
int Index [get]
 
int HexIndex [get]
 
bool IsCompressed [get]
 
bool HasChanged [get, set]
 
bool IsBranch [get]
 
bool HasMerged [get]
 
virtual bool AllowSaving [get, set]
 
virtual bool IsDirty [get, set]
 
virtual uint UncompressedSize [get]
 
virtual Type[] AllowedChildTypes [get]
 
virtual string Compression [get, set]
 
virtual bool RetainChildrenOnReplace [get]
 
virtual bool supportsCompression [get]
 
static MD5CryptoServiceProvider MD5Provider [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
static ResourceNode[] FindAllSubNodes (ResourceNode root)
 
static ResourceNode FindNode (ResourceNode root, string path, bool searchChildren, StringComparison compare)
 
- Protected Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
void ForceReplacedEvent ()
 
virtual void MergeInternal ()
 
- Events inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
SelectEventHandler SelectChild
 
EventHandler UpdateProps
 
MoveEventHandler MovedUp
 
ResourceEventHandler Disposing
 
ResourceChildEventHandler ChildAdded
 
ResourceChildInsertEventHandler ChildInserted
 

Member Enumeration Documentation

◆ NormalType

20 {
21 XYZ = 0,
22 NBT = 1, // one index per NBT
23 NBT3 = 2 // one index per each of N/B/T
24 }

Member Function Documentation

◆ OnCalculateSize()

override int BrawlLib.SSBB.ResourceNodes.MDL0NormalNode.OnCalculateSize ( bool  force)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

100 {
102 {
103 _enc = new VertexCodec(Normals, false, _forceFloat);
104 return _enc._dataLen.Align(0x20) + 0x20;
105 }
106
107 return base.OnCalculateSize(force);
108 }
MDL0Node Model
Definition: MDL0GroupNode.cs:28
bool _isImport
Definition: MDL0Node.cs:47
bool _forceRebuild
Definition: MDL0NormalNode.cs:96
bool _forceFloat
Definition: MDL0NormalNode.cs:97
Vector3[] Normals
Definition: MDL0NormalNode.cs:61
VertexCodec _enc
Definition: MDL0NormalNode.cs:95
Definition: VertexCodec.cs:9
int _dataLen
Definition: VertexCodec.cs:21

◆ OnInitialize()

override bool BrawlLib.SSBB.ResourceNodes.MDL0NormalNode.OnInitialize ( )
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

78 {
79 //Clear the coordinates so they're reparsed,
80 //just in case the node has been replaced.
81 _normals = null;
82
83 _hdr = *Header;
84
85 //SetSizeInternal(_hdr._dataLen);
86
87 if (_name == null && Header->_stringOffset != 0)
88 {
89 _name = Header->ResourceString;
90 }
91
92 return false;
93 }
string _name
Definition: ResourceNode.cs:139
string ResourceString
Definition: MDL0.cs:792
bint _stringOffset
Definition: MDL0.cs:769

◆ OnRebuild()

override void BrawlLib.SSBB.ResourceNodes.MDL0NormalNode.OnRebuild ( VoidPtr  address,
int  length,
bool  force 
)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

111 {
113 {
114 MDL0NormalData* header = (MDL0NormalData*) address;
115
116 header->_dataLen = length;
117 header->_dataOffset = 0x20;
118 header->_index = _entryIndex;
119 header->_isNBT = 0;
120 header->_type = (int) _enc._type;
121 header->_divisor = (byte) _enc._scale;
122 header->_entryStride = (byte) _enc._dstStride;
123 header->_numVertices = (ushort) _enc._srcCount;
124
125 _enc.Write(Normals, (byte*) header + 0x20);
126 _enc.Dispose();
127 _enc = null;
128
129 _forceRebuild = false;
130 }
131 else
132 {
133 base.OnRebuild(address, length, force);
134 }
135 }
int _entryIndex
Definition: MDL0GroupNode.cs:22
void Dispose()
Definition: VertexCodec.cs:37
void Write(byte *pOut)
Definition: VertexCodec.cs:369
int _scale
Definition: VertexCodec.cs:20
int _dstStride
Definition: VertexCodec.cs:18
WiiVertexComponentType _type
Definition: VertexCodec.cs:15
int _srcCount
Definition: VertexCodec.cs:17
Definition: MDL0.cs:765
byte _entryStride
Definition: MDL0.cs:774
bint _dataLen
Definition: MDL0.cs:766
byte _divisor
Definition: MDL0.cs:773
bint _type
Definition: MDL0.cs:772
bushort _numVertices
Definition: MDL0.cs:775
bint _isNBT
Definition: MDL0.cs:771
bint _index
Definition: MDL0.cs:770
bint _dataOffset
Definition: MDL0.cs:768

Member Data Documentation

◆ _enc

VertexCodec BrawlLib.SSBB.ResourceNodes.MDL0NormalNode._enc

◆ _forceFloat

bool BrawlLib.SSBB.ResourceNodes.MDL0NormalNode._forceFloat

◆ _forceRebuild

bool BrawlLib.SSBB.ResourceNodes.MDL0NormalNode._forceRebuild

◆ _objects

List<MDL0ObjectNode> BrawlLib.SSBB.ResourceNodes.MDL0NormalNode._objects = new List<MDL0ObjectNode>()

Property Documentation

◆ Divisor

int BrawlLib.SSBB.ResourceNodes.MDL0NormalNode.Divisor
get

◆ EntryStride

int BrawlLib.SSBB.ResourceNodes.MDL0NormalNode.EntryStride
get

◆ ForceFloat

bool BrawlLib.SSBB.ResourceNodes.MDL0NormalNode.ForceFloat
getset
47 {
48 get => _forceFloat;
49 set
50 {
51 if (_forceFloat != value)
52 {
53 _forceFloat = value;
54 }
55 }
56 }

◆ ForceRebuild

bool BrawlLib.SSBB.ResourceNodes.MDL0NormalNode.ForceRebuild
getset
34 {
35 get => _forceRebuild;
36 set
37 {
38 if (_forceRebuild != value)
39 {
40 _forceRebuild = value;
42 }
43 }
44 }
override void SignalPropertyChange()
Definition: MDL0GroupNode.cs:66

◆ Format

WiiVertexComponentType BrawlLib.SSBB.ResourceNodes.MDL0NormalNode.Format
get

◆ ID

int BrawlLib.SSBB.ResourceNodes.MDL0NormalNode.ID
get

◆ Normals

Vector3 [] BrawlLib.SSBB.ResourceNodes.MDL0NormalNode.Normals
getset
61 {
62 get => _normals ?? (_normals = VertexCodec.ExtractNormals(Header));
63 set
64 {
65 _normals = value;
66
67 _forceRebuild = true;
68 if (Format == WiiVertexComponentType.Float)
69 {
70 _forceFloat = true;
71 }
72
74 }
75 }
WiiVertexComponentType Format
Definition: MDL0NormalNode.cs:28
static Vector3[] ExtractNormals(MDL0NormalData *normals)
Definition: VertexCodec.cs:585
WiiVertexComponentType
Definition: Enum.cs:4

◆ NumEntries

int BrawlLib.SSBB.ResourceNodes.MDL0NormalNode.NumEntries
get

◆ Objects

MDL0ObjectNode [] BrawlLib.SSBB.ResourceNodes.MDL0NormalNode.Objects
get

◆ ResourceFileType

override ResourceType BrawlLib.SSBB.ResourceNodes.MDL0NormalNode.ResourceFileType
get

◆ Type

NormalType BrawlLib.SSBB.ResourceNodes.MDL0NormalNode.Type
get

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