Adding custom properties to FBX in Maya



So i want to access some custom properties through the FBX SDK in C++. I can access the properties in the nodes with FbxNode like this:

FbxProperty prop = fbxNode->FindProperty("someCustomDefinedProperty");
if (prop.IsValid()) { ... }

But I don’t want to access the properties in the nodes but rather in the FbxScene. Looking into the FBX file there is a section for scene properties.

; Documents Description

Documents:  {
	Count: 1
	Document: 1521358128, "", "Scene" {
		Properties70:  {
			P: "SourceObject", "object", "", ""
			P: "ActiveAnimStackName", "KString", "", "", "Take 001"
		RootNode: 0

Using addAttr (via mel, cmds or pymel) adds the property to the selection on the node but not on the scene. How can I add properties to the scene and not node using either mel, python or C++ in Maya? I have googled for days but can’t find any information (maybe I’m searching for the wrong terms?).



I’ve never found a way to add a scene level attribute to an FBX from maya itself using the vanilla exporter. It’s presumably possible with the api – I assume you’d have to read in the exported file and the API to annotate the scene root, then write it back out again.

AFAIK there’s nothing in the Maya scene that corresponds directly to the FBX scene root; I’ve usually resorted to adding metadata to in an existing node (or making a dummy node with a recognizable name at export time).


That’s too bad :cry: I guess I can work with adding it to a node if there is no way to add it directly to the scene. Thanks!