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

Add getHeaders() method + parsing headers logic #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

flarive
Copy link

@flarive flarive commented Jan 5, 2025

Hey !

I have added a getHeaders() method to be able to easily retreive headers data from FBX file (app, creator, FBX version...)

Here is how i use it in my own app that uses openfbx :

void fbx_mesh_loader::get_metadata(const ofbx::IScene* scene)
{
    const ofbx::Headers* headers = scene->getHeaders();
    if (headers)
    {
        int fbxHeaderVersion = headers->fbxHeaderVersion;
        int fbxVersion = headers->fbxVersion;
        int encryptionType = headers->encryptionType;
        char* creator = headers->creator;
        char* creationTime = headers->creationTime;

        char* documentUrl = headers->documentUrl;
        char* srcDocumentUrl = headers->srcDocumentUrl;

        char* originalApplicationVendor = headers->originalApplicationVendor;
        char* originalApplicationName = headers->originalApplicationName;
        char* originalApplicationVersion = headers->originalApplicationVersion;
        char* originalDateTimeGMT = headers->originalDateTimeGMT;
        char* originalFilename = headers->originalFilename;
        char* originalApplicationActiveProject = headers->originalApplicationActiveProject;
        char* originalApplicationNativeFile = headers->originalApplicationNativeFile;

        char* lastSavedApplicationVendor = headers->lastSavedApplicationVendor;
        char* lastSavedApplicationName = headers->lastSavedApplicationName;
        char* lastSavedApplicationVersion = headers->lastSavedApplicationVersion;
        char* lastSavedDateTimeGMT = headers->lastSavedDateTimeGMT;
    }
}

FBX datetime are returned as strings by my code, it could be improved but everything works well.
I can make changes or fixes if you want me to.

Hope you'll merge that in master !

Eviral

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.

1 participant