SuperClassID Cleanup
Since plug-ins were never forced to overwrite the method virtual``SClass_ID``Animatable::SuperClassID
(), and the ReferenceMaker
and ReferenceTarget
classes have not been overwriting this method either, some plug-in classes were reporting an incorrect superclassid - a value of 0 or REF_MAKER_CLASS_ID
when, in fact, they derive from class ReferenceTarget
.
This led to subtle bugs and to special case code for checking whether a superclassid is 0 which is not an official superclassid value - it i's not defined as a superclassid value in the 3ds Max SDK.
Existing plug-ins fail to recompile if one of their classes derives directly from Animatable
and do not overwrite the SuperClassID()
method. The class should derive from a different 3ds Max SDK class, such as ReferenceMaker
or ReferenceTarget
which now correctly overwrite the method.
Legacy files containing the plug-in may fail to load. This is most likely caused by a change in the superclassid a plug-in class reports. This can be fixed by defining and exposing two class descriptors for that plug-in class. One would be the old ClassDesc
returning the old superclassid, with the IsPublic
method modified to return FALSE
. The plug-in should not be creatable by the user via this ClassDesc
. The other ClassDesc
would be the new one, reporting the new superclassid. If the plug-in object can be created using the 3ds Max UI or MaxScript, this new ClassDesc::IsPublic
method must return TRUE
.