Skip to content

How to read custom extras / user data from a GLB file. #1487

Description

@sankalp0412

I'm exporting a 3D model to GLB format using pythonOCC. During export, I store custom metadata on each face using TDataStd_NamedData:

...
user_data = TDataStd_NamedData.Set(some_shape_label)
user_data.SetString("some_variable", str(value))
....

This correctly saves as extras on each GLB node.

Now when I try to read it back using RWGltf_CafReader and TDataStd_NamedData, the attribute is never found.

.....
shape = shape_tool.GetShape(label)
    named_data = TDataStd_NamedData()
    if label.FindAttribute(TDataStd_NamedData.GetID(), named_data):
        if named_data.HasStrings():
            print("Yes") # does not print

Questions:

  • Does RWGltf_CafReader actually import extras ?
  • If not, what is the correct way to read back GLB extras / user data in pythonOCC, along with the shape at the same time.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions