Often, to create relationships between the objects you want to make a property that would store a scene object or even a list of objects. It is desirable to replication in the user interface. For example, object B needs object A for computing purpose, the user can assign an object from the scene by dragging an object A in the corresponding property of the object B.

For such properties, at first, I found the class FBPropertyModel, which I tried to use. All my attempts failed: the property does not wish to correctly refer to objects and not working on save / load with the file. I has to manualy store object string name when save and to search object by name in the scene when retrieve.

But I came across with another class – FBPropertyListObject. With this one, the situation is better, it can be used as a list or to assign only one object, by exhibiting the appropriate flag
<property>.SetSingleConnect (true);

So the moral of the story – use FBPropertyListObject instead FBPropertyModel

Another small hint as to the property for a user read-only
<property>.ModifyPropertyFlag (kFBPropertyFlagReadOnly, true);

MoBu tip: property with object reference
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *