Thanks for the response Ferdinand.
I am running R23 SP1 (R23.110) on Windows 10 (OS build 19041.1110). I am also encountering the same problem when running it in R24 (R24.111).
Here is all of my code, trimmed down to the bare minimum that still showed the issue.
#include "c4d.h"
#include "c4d_symbols.h"
#include "lib_description.h"
#define ID_BREAKSPLINE 1058002
class BreakSpline : public ObjectData
{
INSTANCEOF(BreakSpline, ObjectData)
public:
virtual Bool Init(GeListNode *node);
static NodeData *Alloc() { return NewObjClear(BreakSpline); }
Bool GetDDescription(GeListNode *node, Description *description, DESCFLAGS_DESC &flags);
};
Bool BreakSpline::GetDDescription(GeListNode *node, Description *description, DESCFLAGS_DESC &flags)
{
if (!description->LoadDescription(node->GetType()))
return FALSE;
BaseObject* op = static_cast<BaseObject*>(node);
if (op == nullptr)
return FALSE;
const DescID *singleid = description->GetSingleDescID();
BaseObject *pp;
Bool first = TRUE;
DescID cid;
BaseContainer* datainstance = op->GetDataInstance();
DescID DescGroup = DescLevel(10000, DTYPE_GROUP, 0);
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, ID_BREAKSPLINE))
{
return TRUE;
}
}
DescID subgroupthree = DescLevel(10001, DTYPE_GROUP, 0);
if (!singleid || subgroupthree.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_GROUP);
bc.SetInt32(DESC_COLUMNS, 3);
bc.SetInt32(DESC_DEFAULT, 1);
bc.SetBool(DESC_SCALEH, false);
if (!description->SetParameter(subgroupthree, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10002, DTYPE_LONG, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetString(DESC_NAME, "Orientation "_s);
BaseContainer MeasureDivisionNames;
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
MeasureDivisionNames.SetString(-1, ""_s);
MeasureDivisionNames.SetString(0, "X+"_s);
MeasureDivisionNames.SetString(1, "Y+"_s);
MeasureDivisionNames.SetString(2, "Z+"_s);
bc.SetContainer(DESC_CYCLE, MeasureDivisionNames);
if (!description->SetParameter(cid, bc, subgroupthree))
return TRUE;
}
cid = DescLevel(10003, 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, "Run With Matrix"_s);
if (!description->SetParameter(cid, bc, subgroupthree))
return TRUE;
}
cid = DescLevel(10004, DTYPE_BUTTON, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_BUTTON);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_BUTTON);
bc.SetString(DESC_NAME, "Create Reference"_s);
if (!description->SetParameter(cid, bc, subgroupthree))
return TRUE;
}
DescID linkgroup = DescLevel(10005, DTYPE_GROUP, 0);
if (!singleid || subgroupthree.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_GROUP);
bc.SetInt32(DESC_COLUMNS, 3);
bc.SetInt32(DESC_DEFAULT, 1);
bc.SetBool(DESC_SCALEH, false);
if (!description->SetParameter(linkgroup, bc, DescGroup))
return TRUE;
}
DescID linkgroup2 = DescLevel(10006, DTYPE_GROUP, 0);
if (!singleid || subgroupthree.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_GROUP);
bc.SetInt32(DESC_COLUMNS, 3);
bc.SetInt32(DESC_DEFAULT, 1);
bc.SetBool(DESC_SCALEH, false);
if (!description->SetParameter(linkgroup2, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10007, DTYPE_SEPARATOR, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_SEPARATOR);
bc.SetBool(DESC_SEPARATORLINE, TRUE);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10008, DTYPE_LONG, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetInt32(DESC_MIN, 0);
bc.SetInt32(DESC_MINSLIDER, 0);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_LONGSLIDER);
bc.SetInt32(DESC_MAXSLIDER, 100);
bc.SetInt32(DESC_DEFAULT, 1);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Row 1"_s);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10009, DTYPE_LONG, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetInt32(DESC_MIN, 0);
bc.SetInt32(DESC_MINSLIDER, 0);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_LONGSLIDER);
bc.SetInt32(DESC_MAXSLIDER, 100);
bc.SetInt32(DESC_DEFAULT, 1);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Row 2"_s);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10010, DTYPE_LONG, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetInt32(DESC_MIN, 0);
bc.SetInt32(DESC_MINSLIDER, 0);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_LONGSLIDER);
bc.SetInt32(DESC_MAXSLIDER, 100);
bc.SetInt32(DESC_DEFAULT, 1);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Row 3"_s);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10011, DTYPE_LONG, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetInt32(DESC_MIN, 0);
bc.SetInt32(DESC_MINSLIDER, 0);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_LONGSLIDER);
bc.SetInt32(DESC_MAXSLIDER, 100);
bc.SetInt32(DESC_DEFAULT, 1);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Row 4"_s);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10012, DTYPE_LONG, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetInt32(DESC_MIN, 0);
bc.SetInt32(DESC_MINSLIDER, 0);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_LONGSLIDER);
bc.SetInt32(DESC_MAXSLIDER, 100);
bc.SetInt32(DESC_DEFAULT, 1);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Row 5"_s);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10013, DTYPE_LONG, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetInt32(DESC_MIN, 0);
bc.SetInt32(DESC_MINSLIDER, 0);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_LONGSLIDER);
bc.SetInt32(DESC_MAXSLIDER, 100);
bc.SetInt32(DESC_DEFAULT, 1);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Row 6"_s);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10014, DTYPE_LONG, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetInt32(DESC_MIN, 0);
bc.SetInt32(DESC_MINSLIDER, 0);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_LONGSLIDER);
bc.SetInt32(DESC_MAXSLIDER, 100);
bc.SetInt32(DESC_DEFAULT, 1);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Row 7"_s);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10015, DTYPE_LONG, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetInt32(DESC_MIN, 0);
bc.SetInt32(DESC_MINSLIDER, 0);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_LONGSLIDER);
bc.SetInt32(DESC_MAXSLIDER, 100);
bc.SetInt32(DESC_DEFAULT, 1);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Row 8"_s);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10016, DTYPE_LONG, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetInt32(DESC_MIN, 0);
bc.SetInt32(DESC_MINSLIDER, 0);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_LONGSLIDER);
bc.SetInt32(DESC_MAXSLIDER, 100);
bc.SetInt32(DESC_DEFAULT, 1);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Row 9"_s);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10017, DTYPE_LONG, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetInt32(DESC_MIN, 0);
bc.SetInt32(DESC_MINSLIDER, 0);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_LONGSLIDER);
bc.SetInt32(DESC_MAXSLIDER, 100);
bc.SetInt32(DESC_DEFAULT, 1);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Row 10"_s);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10018, DTYPE_REAL, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_REAL);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetInt32(DESC_MINSLIDER, 0);
bc.SetInt32(DESC_UNIT, DESC_UNIT_METER);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_REALSLIDER);
bc.SetInt32(DESC_MAXSLIDER, 5);
bc.SetFloat(DESC_DEFAULT, 0);
bc.SetFloat(DESC_STEP, .01);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Expand"_s);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10019, DTYPE_LONG, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetBool(DESC_FORBID_SCALING, TRUE);
bc.SetFloat(DESC_MIN, 0);
bc.SetInt32(DESC_MINSLIDER, 0);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_REALSLIDER);
bc.SetInt32(DESC_MAXSLIDER, 10);
bc.SetInt32(DESC_MAX, 500);
bc.SetFloat(DESC_DEFAULT, 0);
bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
bc.SetString(DESC_NAME, "Smoothing"_s);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
cid = DescLevel(10020, DTYPE_SEPARATOR, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_SEPARATOR);
bc.SetBool(DESC_SEPARATORLINE, TRUE);
if (!description->SetParameter(cid, bc, DescGroup))
return TRUE;
}
DescID SubGroupOne = DescLevel(10024, DTYPE_GROUP, 0);
if (!singleid || SubGroupOne.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_GROUP);
bc.SetInt32(DESC_COLUMNS, 2);
bc.SetBool(DESC_SCALEH, TRUE);
if (!description->SetParameter(SubGroupOne, bc, DescGroup))
{
return TRUE;
}
}
DescID DescDataSplineTab = DescLevel(10021, DTYPE_GROUP, 0);
if (!singleid || DescDataSplineTab.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_GROUP);
bc.SetString(DESC_NAME, "Spline Controls"_s);
bc.SetInt32(DESC_COLUMNS, 1);
bc.SetInt32(DESC_DEFAULT, 0);
bc.SetBool(DESC_SCALEH, TRUE);
if (!description->SetParameter(DescDataSplineTab, bc, DescLevel(ID_BREAKSPLINE)))
return TRUE;
}
DescID DescSplineGroup = DescLevel(10022, DTYPE_GROUP, 0);
if (!singleid || DescSplineGroup.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_GROUP);
bc.SetInt32(DESC_COLUMNS, 1);
bc.SetInt32(DESC_DEFAULT, 1);
bc.SetBool(DESC_SCALEH, TRUE);
if (!description->SetParameter(DescSplineGroup, bc, DescDataSplineTab))
return TRUE;
}
cid = DescLevel(10023, DTYPE_BOOL, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL))
{
BaseContainer bc;
bc = GetCustomDataTypeDefault(DTYPE_BOOL);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_BOOL);
bc.SetString(DESC_NAME, "Reverse"_s);
bc.SetBool(DESC_DEFAULT, TRUE);
if (!description->SetParameter(cid, bc, DescSplineGroup))
return TRUE;
}
flags |= DESCFLAGS_DESC::LOADED | DESCFLAGS_DESC::RECURSIONLOCK;
return SUPER::GetDDescription(node, description, flags);
}
Bool BreakSpline::Init(GeListNode *node)
{
BaseObject *op = (BaseObject*)node;
if (!op)
{
return FALSE;
}
return TRUE;
}
Bool RegisterBreakSpline()
{
Int32 flags = 0;
flags = OBJECT_GENERATOR | OBJECT_ISSPLINE | OBJECT_INPUT | OBJECT_UNIQUEENUMERATION;
return RegisterObjectPlugin(ID_BREAKSPLINE, "Break"_s, flags, BreakSpline::Alloc, "OBreak"_s, nullptr, 0);
}
The res file:
CONTAINER OBreak
{
NAME OBreak;
INCLUDE Obase;
GROUP ID_OBJECTPROPERTIES
{
}
}
The .h file
#ifndef _OBreak_H_
#define _OBreak_H_
enum
{
};
#endif
The .str file
STRINGTABLE OBreak
{
OBreak "Break";
}
John Terenece