A reference message is sent from a target to reference makers which maintain a direct reference (either strong or weak) to it. A reference message is represented by the type RefMessage
. Reference messages are sent by a reference target in response to a call to ReferenceTarget::NotifyDependents()
. The message is received by an observing reference maker in the method ReferenceMaker::NotifyRefChanged()
. A plug-in will override this method to process messages received from any scene objects that it observes and depends on.
Reference messages are integer constants defined in the file ref.h.
A full list of reference messages can be found in the topic Reference Messages
in the 3ds Max SDK reference guide.
Some of the most common reference messages follow:
REFMSG_TARGET_DELETED
- This message is sent when a ReferenceTarget
is deleted.REFMSG_CHANGE
- Sent to dependents of a ReferenceTarget
that has changed in some way.REFMSG_BEGIN_EDIT
- This is used by modifiers to indicate when they are beginning an edit.REFMSG_END_EDIT
- This is used by modifiers to indicate when they are ending an edit.REFMSG_MOD_EVAL
- Modifier uses this to tell modified objects to call their Object::Eval()
procedure.User defined reference messages should be defined as a value greater than REFMSG_USER
. For example.
const RefMessage MYMSG1 = REFMSG + 0;
const RefMessage MYMSG2 = REFMSG + 1;
// ...