Skip to content

Navigation Menu

Sign in
Sign up

Added 5 Unity classes + Fix X-mirroring of models - #103

Open
j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz wants to merge 5 commits into
HearthSim:master from
j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz:master
Open

Added 5 Unity classes + Fix X-mirroring of models #103
j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz wants to merge 5 commits into
HearthSim:master from
j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz:master

Conversation

@j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz

@j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz commented Jun 19, 2021

Copy link
Copy Markdown

I added 5 classes that I came along on my travels:
MeshFilter, MeshRenderer, MeshCollider, SphereCollider and CapsuleCollider.

I also cleaned up renderer.py a bit.

Added SphereCollider, CapsuleCollider and MeshCollider.
Added SphereCollider, CapsuleCollider and MeshCollider.
- Added MeshRenderer
- Added RendererBase and ParticleRendererBase to reduce code while achieving the same result.
Added the one value MeshFilter has.

Copy link
Copy Markdown

Hey! By any chance, would you know how to add support for the new (Unity 5.5+) shaders?

Copy link
Copy Markdown
Author

I would recommend looking at the YAML-dump of such a shader.
unity2yaml ShaderSampleBundle > out.yaml
vim out.yaml

Copy link
Copy Markdown

Thanks for the advice. Unfortunately, that doesn't help because the shader code itself is stored under compressedBlob and would need to be decompressed / decoded.

Copy link
Copy Markdown
Author

I see. The compression you're looking at is most likely done using the .net deflate class.
But as for the code itself, I don't know. You might have use of tools such as Radare2, Ghidra or ILSpy.

I had a headache trying to figure out what was wrong with my code. Turns out it wasn't my code but this code.
Might have to do with the specific Unity version?
Comment thread unitypack/export.py
@staticmethod
def face_str(indices, coords, normals):
ret = ["f "]
for i in indices[::-1]:

@robert-nix robert-nix Jul 16, 2021
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was done to convert from left-handed coordinates to right-handed coordinates, FWIW. So without this the face normals would all be inside out in tools that expect right-handed models.

@j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz Jul 20, 2021
edited
Loading

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, um, TBH I thought pull requests would only add the commits from before they were made.
Either way, you are correct, however removing the - on line 31 inverts the models once, so the face normals are as they should.
I know it's a bit counter-intuitive but if you test it, it should be fine.

@j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz changed the title (削除) Added 5 Unity classes (削除ここまで) (追記) Added 5 Unity classes + Fix X-mirroring of models (追記ここまで) Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers
@robert-nix robert-nix robert-nix left review comments
@dyc3 dyc3 dyc3 approved these changes
Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /