I have a custom data type for some time, and it works fine, without any GUI. I use it only to store data.
Now I made a custom GUI, based on the DOTS example, and seems to work well. The GUI sets the data, I save the scene and when loaded it correctly displays the stored data.
But, when I try to access my custom data using
GetParameter(), it's always empty.
I rarely use the object's container to access data, took me some time to figure out the data was hidden there, but I don't understand why
GetParameter() can't access it.
To check if I was doing something wrong, I added a
DOTS parameter to my object, and the same happens with it. The code below is inside a Generator's
GetVirtualObjects(), we can clearly see the difference.
// With GetParameter() the dots array is always empty
DescID desc( DescLevel( ID_USERDATA, DTYPE_SUBCONTAINER, 0 ), DescLevel( my_DOTS_parmeter, ID_SDK_EXAMPLE_CUSTOMDATATYPE_DOTS, 0 ) );
op->GetParameter( desc, dotsData, DESCFLAGS_GET_0 );
auto dots = static_cast<iCustomDataTypeDots*>( dotsData.GetCustomDataType( ID_SDK_EXAMPLE_CUSTOMDATATYPE_DOTS ) );
ApplicationOutput( "Dots GetParameter() size = " + String::IntToString( dots ? dots->_points.GetCount() : -1 ) );
// But the BaseContainer has it all...
auto bc = op->GetDataInstance();
dots = static_cast<iCustomDataTypeDots*>( bc->GetData( my_DOTS_parmeter ).GetCustomDataType( ID_SDK_EXAMPLE_CUSTOMDATATYPE_DOTS ) );
ApplicationOutput( "Dots BaseContainer size = " + String::IntToString( dots ? dots->_points.GetCount() : -1 ) );
Is that a limitation?
How do I make the data available from