Pixyz Metadata

Hi,

In Pixyz Studio, is there a way to,when I go to export model to FBX or .prefab (imported revit models), it exports Metadata Components with it as well?
Not using Unity’s Pixyz Plugin, but rather looking for a simple checkbox “include Metadata component” when exporting in Studio(I suppose that’s an option with Unity’s plugin) or, worst case scenario, creating a custom plugin from zero.
Plugin from zero is going to be a bit tricky for me, so if you have any detailed explanations, or some kind of a step by step guide as to how could it be done, that would be great.

Thanks everyone.

1 Like

at least unity doesn’t import fbx extra user attributes,
you’d need custom scripts to handle it…

there’s some examples in forums (other than this old script too)

Hello @steweye !
Thank you for your question.

FBX exported from Pixyz Studio do maintain metadata.
Importing the generated FBX with Unity’s native importer does not retain metadata.
Importing the generated FBX with Pixyz Plugin for Unity retains metadata.
Prefabs exported from Pixyz Studio don’t retain metadata.

An alternative to FBX is using glTF:

  • Export a .gltf file (or .glb) from Pixyz Studio: metadata are stored in the extras property (that’s the worfklow described here in the doc)
  • Import the generated .gltf in Unity (Editor or Runtime) with the latest version of Unity’s glTFast, which now supports extras in version.
    It’s a very recent addition, so there is no sample or doc yet on how to access extras though.

Hope this helps!

1 Like

is it possible to convert metadata into fbx userdata inside pixyz?

or i guess other alternative would be to save metadata as txt/json file… next to that fbx.

Actually all user properties or metadata component from PiXYZ are exported into fbx file as FbxProperty

2 Likes

This importing of metadata seems very interesting. Indeed, couldn’t find any samples or docs on this.

Anyone got any code or tips to share on this?

Hello @janne_rasanen_sweco ,
A doc is on its way… stay tuned!

2 Likes

@AxelJacquet any news on the documentation ? Inside the latest 6.0.1 package, I’m unable to see any references to extras in a script or so.
It was an experimental branch on atteneder GitHub page with metadata, but is has disappeared.

A doc or a quick tutorial will be very appreciated!

I was not able to get extras working with the official package, since the assembly gltfast.newtonsoft is not referenced or used.
I managed to get it working by importing the latest code from the github repository, remove glTFast.Newtonsoft.asmdef from “glTFast/Runtime/Scripts/Newtonsoft” to make sure it is accessible from the gltfast package.
Then replace “GLTFast.GltfImport” with “GLTFast.Newtonsoft.GltfImport” where you want to use it.
With those changes, the extras data is available in the IGltfReadable object and you can access the metadata to your instantiated objects in the GameObjectInstantiator.cs script in the CreateNode function as such

GLTFast.Newtonsoft.Schema.Node node = (GLTFast.Newtonsoft.Schema.Node)m_Gltf.GetSourceNode((int)nodeIndex);
string val = "";
node.extras.TryGetValue("MetadataName", out val);

Hello @mgear , @janne_rasanen_sweco , @VincentBarnoux , @kenshin1 , @AndHog

As announced here , a documentation explaining how to access metadata with glTFast is now available: Use case: Use glTFast Add-on API | Unity glTFast | 6.2.0

Cheers!

2 Likes

Hi AxelJacquet.
I have an IFC file and Revit then exports it to glTF, will the metadata be included in the glTF. I want to save the glTF to Autodesk ACC and then download it to Unity at the path and can my model come with the metadata when downloaded?

Answered here