-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MeshPlugin #221
base: master
Are you sure you want to change the base?
MeshPlugin #221
Conversation
MeshPlugin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the problem with the FindAssetClassByName and ClassDatabase
Plugin for extracting mesh files from unity assets files The format supported is .obj for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
MeshPlugin/Half.cs
Outdated
/// - IEEE 754 revision, link: http://grouper.ieee.org/groups/754/ | ||
/// </remarks> | ||
[Serializable] | ||
public struct Half : IComparable, IFormattable, IConvertible, IComparable<Half>, IEquatable<Half> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.NET 6 has this class now, please use that instead.
MeshPlugin/HalfHelper.cs
Outdated
/// - Fast Half Float Conversions, Jeroen van der Zijp, link: http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf | ||
/// </remarks> | ||
[ComVisible(false)] | ||
internal static class HalfHelper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, only used with Half.cs
|
||
namespace MeshPlugin | ||
{ | ||
public class MeshClass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put these in separate files. Even if it was like that in AssetStudio, I'd rather not have 30 classes in a single file.
MeshPlugin/MeshClass.cs
Outdated
{ | ||
|
||
string searchPath = m_StreamData.path; | ||
if (searchPath.StartsWith("archive:/")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate code here with what's in ResourceReader.
MeshPlugin/MeshClass.cs
Outdated
ResourceLoader loader = new ResourceLoader(); | ||
bool saved = await loader.ShowDialog<bool>(loader); | ||
} | ||
private void ProcessDataBytes(AssetsFileInstance AFinst, MemoryStream ms) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not using ms here, stream is read twice.
|
||
MeshClass.Mesh mesh = new MeshClass.Mesh(baseField, cont.FileInstance); | ||
{ | ||
if (mesh.m_VertexData.m_VertexCount <= 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of duplicate code here. Please put this in a method.
@@ -0,0 +1,23 @@ | |||
<Window xmlns="https://github.com/avaloniaui" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can just be a MessageBox.
AssetBundleDirectoryInfo info = dirInf[i]; | ||
if (info.Name == searchPath) | ||
{ | ||
reader.Position = bundle.Header.GetFileDataOffset() + info.Offset + (long)offset2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a single set of offset and size fields and use DataReader instead of GetFileDataOffset(). GetFileDataOffset won't work for LZ4 bundles.
MeshPlugin/TypeStructs.cs
Outdated
namespace AssetsTools | ||
{ | ||
[StructLayout(LayoutKind.Sequential, Pack = 4)] | ||
public struct Vector3 : IEquatable<Vector3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put these in separate files as well (in their own directory). Even if it was originally like that in the AssetStudio repo, I'd rather them be separate.
MeshPlugin/TypeStructs.cs
Outdated
using System.Collections.Generic; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace AssetsTools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in the right namespace.
MeshPlugin to export meshes from UABEA