Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Nn::mii::detail::ResourceShapeHeader
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
ShapeMid.dat, and others. == Struct Format (Header) == This abridged sample is implemented in Rust, using the binrw library. This sample is edited for readability, full sample can be found here<ref>https://github.com/j0lol/vee/blob/f134e28eec22bdf8587d5abbf0f2d0f1ffc5b8a5/crates/vee_resources/src/shape.rs#L1</ref>. <syntaxhighlight lang="rust"> /// Specifies where data is, now big it is, and how compressed it is. /// Used for both textures and shapes. #[derive(BinRead)] pub struct ResourceCommonAttribute { pub offset: u32, pub size: u32, pub size_compressed: u32, pub compression_level: u8, pub memory_level: u8, pad: u16, } /// Specifies where {vertex,index} buffers are, and how big they are. #[derive(BinRead)] pub struct ResourceShapeAttribute { pub attr_offset: [u32; 5], pub attr_size: [u32; 5], pub index_offset: u32, pub index_size: u32, pub bounding_box: [[f32; 3]; 2], } /// All the data required to read a mesh from the shape file. /// Essentially a 'pointer' to the data. #[derive(BinRead)] pub struct ShapeElement { pub common: ResourceCommonAttribute, pub shape: ResourceShapeAttribute, } /// Contains positional data for any headwear that /// may be placed on the model post-render. #[derive(BinRead)] pub struct ResourceShapeHairTransform { front_translate: [f32; 3], front_rotate: [f32; 3], side_translate: [f32; 3], side_rotate: [f32; 3], top_translate: [f32; 3], top_rotate: [f32; 3], } /// Contains positional data used to move face parts /// like the beard, nose, hair, glasses, etc. #[derive(BinRead)] pub struct ResourceShapeFacelineTransform { pub hair_translate: [f32; 3], pub nose_translate: [f32; 3], pub beard_translate: [f32; 3], } /// Header of the `Shape` resource file. #[derive(BinRead)] #[br(little, magic = b"NFSR")] pub struct ResourceShape { ver: u32, file_size: u32, max_size: [u32; 12], max_alignment: [u32; 12], pub beard: [ShapeElement; 4], pub face_line: [ShapeElement; 12], pub mask: [ShapeElement; 12], pub hat_normal: [ShapeElement; 132], pub hat_cap: [ShapeElement; 132], pub forehead_normal: [ShapeElement; 132], pub forehead_cap: [ShapeElement; 132], pub hair_normal: [ShapeElement; 132], pub hair_cap: [ShapeElement; 132], pub glasses: [ShapeElement; 1], pub nose: [ShapeElement; 18], pub nose_line: [ShapeElement; 18], pub hair_transform: [ResourceShapeHairTransform; 132], pub face_line_transform: [ResourceShapeFacelineTransform; 12], } </syntaxhighlight> == References == <references />{{Resource-Navbox}}
Summary:
Please note that all contributions to Mii Technical Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Mii Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Hlist/styles.css
(
edit
)
Template:Navbox
(
edit
)
Template:Resource-Navbox
(
edit
)
Module:Arguments
(
edit
)
Module:Navbar
(
edit
)
Module:Navbar/configuration
(
edit
)
Module:Navbar/styles.css
(
edit
)
Module:Navbox
(
edit
)
Module:Navbox/configuration
(
edit
)
Module:Navbox/styles.css
(
edit
)
Module:TableTools
(
edit
)
Search
Search
Editing
Nn::mii::detail::ResourceShapeHeader
Add topic