Class NameMaker

3DS Max Plug-In SDK

Class NameMaker

See Also: Class Interface.

class NameMaker

Description:

This class is used with method Interface::NewUniqueName(). All methods of this class are implemented by the system.

Methods:

Prototype:

virtual void MakeUniqueName(TSTR &name)=0;

Remarks:

This method is used to make a unique version of the name passed and return it. This method is much more efficient than Interface::MakeNameUnique(), which does a brute force enumeration of the scene hierarchy for every call. On creation, the NameMaker builds a directory which has one entry for each "base" name, such as "Sphere", "Camera", "Block", and along with each the maximum number suffix for that base name in the scene. When you call:

 nm->MakeNameUnique

it only has to look at this relatively small list. It also caches the last hit, for further efficiency.

Parameters:

TSTR &name

This is the name that is made unique (it contains both the source and the result).

Prototype:

virtual void AddName(TSTR &name)=0;

Remarks:

This method is available in release 2.0 and later only.

This method allows you to seed the name maker table with your own names. This was used, for example, because 3ds max uses NameMakers to name sub-objects in the NURBS object, and it's not appropriate to have the table seeded with top-level object names, but only with the existing sub-object names.

Parameters:

TSTR &name

The name to add.