Hello! I have a plugin that I compiled for R20 and R24 and I'm noticing a difference between the two of them.
Here is my plugin in R20:
And here is in R24:
In R20 the description is redrawn as the cube is dragged over. In R24 it isn't redrawn despite GetDDescription being called.
Here is my code, which is the same for each version, but they're behaving differently.
Bool ShortTest::GetDDescription(GeListNode *node, Description *description, DESCFLAGS_DESC &flags)
{
if (!description->LoadDescription(node->GetType()))
{
}
BaseObject* op = static_cast<BaseObject*>(node);
if (op == nullptr)
{
return FALSE;
}
const DescID *singleid = description->GetSingleDescID();
DescID cid;
BaseContainer* datainstance = op->GetDataInstance();
DescID DescGroup = DescLevel(2000, DTYPE_GROUP, 0);
Int32 idShowNothing = 1;
Int32 idShowEverything = 2;
Int32 idMode = 10001;
if (!singleid || DescGroup.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_GROUP);
bc.SetString(DESC_NAME, "Object"_s);
bc.SetInt32(DESC_COLUMNS, 1);
bc.SetFloat(DESC_DEFAULT, 1);
bc.SetBool(DESC_SCALEH, TRUE);
bc.SetBool(DESC_DEFAULT, TRUE);
if (!description->SetParameter(DescGroup, bc, DescLevel(1057950)))
{
return TRUE;
}
}
cid = DescLevel(idMode, DTYPE_LONG, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetBool(DESC_GUIOPEN, TRUE);
bc.SetString(DESC_NAME, "Test "_s);
BaseContainer MeasureDivisionNames;
// if (ModifiersNames == emptyBC) return TRUE;
MeasureDivisionNames.SetString(idShowNothing, "Show Nothing"_s);
MeasureDivisionNames.SetString(idShowEverything, "Show Parameters"_s);
bc.SetInt32(DESC_CUSTOMGUI, ID_QUICKTABSRADIO_GADGET);
bc.SetContainer(DESC_CYCLE, MeasureDivisionNames);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
if(datainstance->GetInt32(idMode) == idShowEverything)
{
cid = DescLevel(2002, DTYPE_REAL, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_REAL);
bc.SetInt32(DESC_UNIT,FORMAT_DEGREE);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Test 1"_s);
BaseContainer MeasureDivisionNames;
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(2003, DTYPE_VECTOR, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_VECTOR);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Test 2"_s);
BaseContainer MeasureDivisionNames;
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(2004, DTYPE_BOOL, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_BOOL);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Test 3"_s);
BaseContainer MeasureDivisionNames;
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(2005, DTYPE_BOOL, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_BOOL);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Test 4"_s);
BaseContainer MeasureDivisionNames;
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(2006, DTYPE_BOOL, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_BOOL);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Test 5"_s);
BaseContainer MeasureDivisionNames;
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
}
flags |= DESCFLAGS_DESC::LOADED| DESCFLAGS_DESC::RECURSIONLOCK;
return SUPER::GetDDescription(node, description, flags);
}
Any idea why there is the difference between versions of Cinema?
Thanks, Dan