Skip to content
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

Initial import of rendering / modelling formats #420

Closed

Conversation

hakanai
Copy link
Contributor

@hakanai hakanai commented Feb 13, 2021

Imported from my organisation's repository.

Since this is a new directory - is "rendering" a good name for this stuff? In IANA, these formats are classified as just "model", but the word has too many different meanings in software.

About these formats:

FBX - "Filmbox" format originally by Kaydara, now owned by Autodesk, standard interchange format between modelling software and game engines and the like.

GLB - Khronos group's standard binary format for model exchange. But unfortunately a terrible format for Kaitai. I implemented it as far in as was possible anyway.

The above two file types can be created using Blender. (Actually, Blender's own format is one that I want to take a look at as well.)

PMD, PMX - Model formats used by animation software MikuMikuDance (PMX newer, PMD older), many samples can be found on bowlrowl and similar sites.

VMD - Animation data format used by MikuMikuDance.

@@ -0,0 +1,148 @@
meta:
id: fbx
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe kaydara_fbx?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I be changing the filename to match? I notice the generated code ends up using this ID as the classname instead of the filename of the ksy. (Sucks that we have essentially the same info in two places...)

To parse the rest of the file, you have to parse the JSON first.

bin:
seq:
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks unfinished.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In what sense? A GLB file is made up of data chunks. The chunk can be either a JSON chunk or a binary chunk. This is a binary chunk. There's no way to know what sort of data you're looking at in here though, because, for that, you'd have to first parse the JSON to get the offsets out of there.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@hakanai hakanai Feb 16, 2021

Choose a reason for hiding this comment

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

Neither of those appear to actually solve the issue, but rather push it out to a single-language solution, which doesn't really fit with the spirit of Kaitai anyway.

What would be nice is a native JSON type in Kaitai, so that we can then just traverse into the tree of JSON objects.

So I guess one valid solution is, define a new format for JSON and import that format, so we can declare the type of this piece as json. And then say that implementing the JSON format is up to the reader. LOL

Copy link
Contributor

@KOLANICH KOLANICH Feb 16, 2021

Choose a reason for hiding this comment

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

Neither of those appear to actually solve the issue, but rather push it out to a single-language solution which doesn't really fit with the spirit of Kaitai anyway.

I completely agree.

What would be nice is a native JSON type in Kaitai, so that we can then just traverse into the tree of JSON objects.

It would be nice to have KS extensible, because blessing JSON over other serialization formats, including custom ones, is incorrect. And the impl still will be language-dependent. The same way as runtimes are and KS itself is. All of this is just an abstraction layer around languages.

So I guess one valid solution is, define a new format for JSON and import that format, so we can declare the type of this piece as json. And then say that implementing the JSON format is up to the reader. LOL

So a valid solution is finishing and landing interfaces proposal first, and then standardizing some interfaces and creating a standard library for each interface. See the discussion in kaitai-io/kaitai_struct#457 .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't saying that json would be the only format to implement, nor was I saying that json would be implemented by kaitai itself. I was just saying that we could implement a placeholder 'type' for any given unknown type, and then how that's implemented is up to the future. If the future happens to be some interface where the type is converted to something else using external code, that's fine. If someone figures out how to complete a kts file for json, that's fine too.

@hakanai
Copy link
Contributor Author

hakanai commented Mar 13, 2021

Closing as I'm splitting into multiple PRs as previously discussed.

@hakanai hakanai closed this Mar 13, 2021
@KOLANICH KOLANICH mentioned this pull request Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants