Hello.
I am working on a plugin that utilizes a custom FieldList I create with the code below.
cid = DescLevel(idField, CUSTOMDATATYPE_FIELDLIST, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(CUSTOMDATATYPE_FIELDLIST);
bc.SetBool(DESC_FIELDLIST_NOCOLOR, TRUE);
bc.SetBool(DESC_FIELDLIST_NODIRECTION, TRUE);
bc.SetBool(DESC_FIELDLIST_NOROTATION, TRUE);
bc.SetString(DESC_NAME, "Field"_s);
bc.SetBool(DESC_ANIMATE, true);
if (!description->SetParameter(cid, bc, fieldgroup))
return TRUE;
}
My issue comes in when I try to catch when one of the objects inside of the FieldList is dirty.
The code below is how I am checking the layers in the FieldList. This code is working properly on things like the Linear Field but on layers like the Time Field Layer it doesn't catch when they are dirty.
GeData data;
UInt32 falloffDirtySum = 0;
const DescID fieldParameterID(idFieldList);
if (op->GetParameter(fieldParameterID, data, DESCFLAGS_GET::NONE))
{
CustomDataType* const customData = data.GetCustomDataType(CUSTOMDATATYPE_FIELDLIST);
FieldList* const fieldList = static_cast<FieldList*>(customData);
UInt32 falloffDirtySum = 0;
if (fieldList)
{
GeListHead *listHead = fieldList->GetLayersRoot();
if (listHead)
{
Int32 fieldIndex = 0;
Int32 fieldListCount = fieldList->GetCount();
FieldLayer *layer = static_cast<FieldLayer*>(listHead->GetFirst());
while (layer && fieldIndex < fieldListCount)
{
const FieldLayerLink layerLink = layer->GetLinkedObject(doc);
BaseObject *fieldObject = static_cast<BaseObject*>(layerLink._object);
if (fieldObject)
{
falloffDirtySum = falloffDirtySum + fieldObject->GetDirty(DIRTYFLAGS::CACHE | DIRTYFLAGS::DATA | DIRTYFLAGS::MATRIX);
}
layer = layer->GetNext();
fieldIndex++;
}
}
}
if (falloffDirtySum != prevFalloffDirtySum)
{
// Mark object as dirty
prevFalloffDirtySum = falloffDirtySum;
}
}
Running my own tests I know that this code isn't working on these layers because they don't have a linked object to retrieve with GetLinkedObject() to give me something to use GetDirty() on. Using GetDirty() on the FieldLayers that don't have a linked object doesn't work either.
Is there an alternative way to check dirtiness on FieldLayers that don't have a linked object?
I've tried looking through the SDK and on the forums and none of the solutions in the posts I looked at that dealt with a similar topic worked for me.
Any help would be greatly appreciated.
John Terenece