The 3ds Max reference system is primarily a mechanism for scene objects and plug-ins to communicate. A reference between two objects models the subject-observer pattern.
When talking about a "reference" the SDK documentation is talking about a reference link from a reference maker to a reference target. A reference maker manages the references and exposes them via the function ReferenceMaker::GetReference()
. Each reference managed by a reference maker is identified by an integer value called the reference index.
Objects that wish to be notified of changes in target objects (i.e. observers) are called reference makers and must derive from ReferenceMaker
. The target object (i.e. subject) is called the reference target and must derived from ReferenceTarget
. In 3ds Max all subjects can also be observers so ReferenceTarget
derives from ReferenceMaker
.
Strong references are used by 3ds Max to manage the lifetime of scene objects.
There are three kinds of references:
ReferenceTarget
objects (except nodes) when a strong direct reference exists to it. When a ReferenceTarget
has no more strong direct references it will be automatically deleted by 3ds Max.ReferenceMaker
that depends on a ReferenceTarget
, but can function properly without it, should create a weak reference to it. A weak reference does not prevent a ReferenceTarget
from being deleted. When the ReferenceTarget
is deleted the dependent ReferenceMaker
is notified.ReferenceMaker
to the ReferenceTarget
to other observers of that target. The purpose of an indirect reference is to model reciprocal subject-observer relationships between scene elements, and prevent loops.Reference relationships themselves are not represented by a specific class, but are managed through methods of ReferenceMaker
.