MotionBuilder FBProperty object to string

Need to convert FBProperty object to string.

The object is from a property reference which is to FBCamera focal length but can’t convert the object. Tried str() and AsString() but none of it worked.
The property reference is on a FBHUDTextElement.


Might be lower case d in data.

It executed with upper case D but still just returned <property object at 0x000000001456F5E8>

What if you just print the data without converting to a string:

Can your code so I can see how you are attempting to solve it?

It wont let me do that. I thought at first it worked with .Data but now it just returns an error that .Data is not available for this object.

I set the reference prop like this:

foo = flText.PropertyCreate( cam.Name, FBPropertyType.kFBPT_Reference, ‘’, False, True, cam.FocalLength )

Tested: print(foo), str(foo), str(foo.Data), (foo.Data), AsString(foo) etc

But I still just get:
<pyfbsdk.FBProperty object at 0x0000000041266828>

I poked around AREA Autodesk forums and a few post had a similar reference object issue which one user thought it might not be supported in Python but in C++.

It’s possible to set up a HUD text element with focal length as reference prop if sat up manually (it’s an option in the hud text menu) but via scripting I can’t get it to work.

I tried to answer your question in your Discreet Forum post.