3ds Max C++ API Reference
IPopulateIdleArea Class Reference

IPopulateIdleArea is the interface class to Populate idle area objects. More...

#include <IPopulateIdleArea.h>

+ Inheritance diagram for IPopulateIdleArea:

Public Member Functions

 IPopulateIdleArea ()
 
 ~IPopulateIdleArea ()
 
POPULATE_EXPORT bool SetIdleAreaObjInstance (ReferenceTarget *instance)
 Sets the internal reference to the idle area object. More...
 
POPULATE_EXPORT float GetDensity () const
 Returns the area density, a value between 0.0 and 1.0. More...
 
POPULATE_EXPORT bool SetDensity (float density)
 Sets the area density. More...
 
POPULATE_EXPORT float GetGroups () const
 Returns the percent of groups in the area, a value between 0.0 and 1.0. More...
 
POPULATE_EXPORT bool SetGroups (float groupPercent)
 Sets the percent of groups in the area. More...
 
POPULATE_EXPORT float GetPair () const
 Returns the percent of pairs in the area, a value between 0.0 and 1.0. More...
 
POPULATE_EXPORT bool SetPair (float pairPercent)
 Sets the percent of pairs in the area. More...
 
POPULATE_EXPORT float GetFemPercent () const
 Returns the percent of females in the area, a value between 0.0 and 1.0. More...
 
POPULATE_EXPORT bool SetFemPercent (float femPercent)
 Sets the percent of females in the area. More...
 
POPULATE_EXPORT float GetSinglesOrientation () const
 Returns the base orientation of single characters, an angle in degrees. More...
 
POPULATE_EXPORT bool SetSinglesOrientation (float orientation)
 Sets the base orientation of single characters. More...
 
POPULATE_EXPORT float GetOrientSpread () const
 Returns the maximum random variation from the base orientation of single characters, an angle in degrees. More...
 
POPULATE_EXPORT bool SetOrientSpread (float spread)
 Sets the maximum random variation from the base orientation of single characters. More...
 
POPULATE_EXPORT bool GetFacing () const
 Returns whether or not the single characters on the area are facing the look at object. More...
 
POPULATE_EXPORT bool SetFacing (bool facing)
 Sets whether or not the single characters on the area are facing the look at object. More...
 
POPULATE_EXPORT INodeGetLookAtObject () const
 Returns the area look at object. More...
 
POPULATE_EXPORT bool SetLookAtObject (INode *node)
 Sets the area look at object. More...
 
POPULATE_EXPORT int GetPositionRandomSeed () const
 Returns the position randomization seed. More...
 
POPULATE_EXPORT bool SetPositionRandomSeed (int seed)
 Sets the position randomization seed. More...
 
POPULATE_EXPORT int GetSinglesRandomSeed () const
 Returns the singles randomization seed. More...
 
POPULATE_EXPORT bool SetSinglesRandomSeed (int seed)
 Sets the singles randomization seed. More...
 
POPULATE_EXPORT int GetOrientationRandomSeed () const
 Returns the orientation spread randomization seed. More...
 
POPULATE_EXPORT bool SetOrientationRandomSeed (int seed)
 Sets the orientation spread randomization seed. More...
 
POPULATE_EXPORT int GetGenderRandomSeed () const
 Returns the gender randomization seed. More...
 
POPULATE_EXPORT bool SetGenderRandomSeed (int seed)
 Sets the gender randomization seed. More...
 
POPULATE_EXPORT int GetMotionRandomSeed () const
 Returns the motion randomization seed. More...
 
POPULATE_EXPORT bool SetMotionRandomSeed (int seed)
 Sets the motion randomization seed. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 
- Protected Member Functions inherited from Noncopyable
 Noncopyable ()
 
 ~Noncopyable ()
 

Detailed Description

IPopulateIdleArea is the interface class to Populate idle area objects.


The idle area object is a scripted plugin that can be found in: stdplugs\stdscripts\IdleAreaObject.ms. Because it is a scripted plugin, the interface to it is different than a standard class interface.
Also, Idle Areas inherit from EPoly class. To create or edit their geometry, you have to access the base edit poly object.

Example
The following code creates a rectangular Populate idle area, sets some if its parameters, and adds it to Populate.
// need these includes:
// #include <iepoly.h> // necessary to edit the geometry of the idle area
// #include <mnmesh.h>
// Also need to add mnmath.lib to project libraries
// Create Idle Area
INode *iaNode = ip->CreateObjectNode(iaObj);
// To set the idle area geometry, get the Edit Poly Object at the base of the Idle Area Object
EPoly *cd = NULL; MNMesh* mm = NULL;
Object* base = iaNode->GetObjectRef();
{
ReferenceMaker* rmak = (ReferenceMaker*) base;
for (int i=0;i<rmak->NumRefs();i++)
{
ReferenceTarget* rtarg = rmak->GetReference(i);
cd = (EPoly *)(rtarg->GetInterface(EPOLY_INTERFACE));
if (cd)
{
mm = cd->GetMeshPtr();
break;
}
}
}
// set the idle area to be a rectangle
float width = 400.0f;
float length = 400.0f;
int faceVerts[4];
Point3 corner0(-(width*0.5f),-(length*0.5f),0.0f);
Point3 corner1(width*0.5f,-(length*0.5f),0.0f);
Point3 corner2(width*0.5f,length*0.5f,0.0f);
Point3 corner3(-(width*0.5f),length*0.5f,0.0f);
faceVerts[0] = mm->NewVert(corner0);
faceVerts[1] = mm->NewVert(corner1);
faceVerts[2] = mm->NewVert(corner2);
faceVerts[3] = mm->NewVert(corner3);
cd->EpfnCreateFace(faceVerts,4);
// get the interface to the idle area
IpopIA->SetIdleAreaObjInstance((ReferenceTarget*) iaObj);
// Set some parameters
IpopIA->SetDensity(0.7f);
IpopIA->SetGroups(0.33f);
// Add area to Populate
IPopulate *iPopulate = IPopulate::GetInstance();
iPopulate->AddIdleArea(iaNode);
#define POPULATE_IDLEAREA_CLASS_ID
The class ID for the IPopulateIdleArea class.
Definition: IPopulateIdleArea.h:18
#define NULL
Definition: autoptr.h:18
virtual CoreExport Class_ID ClassID()
Retrieves a constant that uniquely identifies the plugin class.
Definition: iepoly.h:315
virtual int EpfnCreateFace(int *v, int deg, bool select=true)
Definition: iepoly.h:1602
virtual MNMesh * GetMeshPtr()
Definition: iepoly.h:513
Definition: inode.h:55
virtual Object * GetObjectRef()=0
Definition: maxapi.h:2991
virtual INode * CreateObjectNode(Object *obj)=0
virtual void * CreateInstance(SClass_ID superID, Class_ID classID)=0
The MNMesh class is provided for temporary use by plug-ins, to help with complex topology-based modif...
Definition: mnmesh.h:1163
DllExport int NewVert(const Point3 &p)
Creates a new vertex (increasing numv) and sets it to the specified point.
static IPopulate * GetInstance()
Returns the interface to Populate.
Definition: IPopulate.h:284
IPopulateIdleArea()
Definition: IPopulateIdleArea.h:45
The object class is the base class for all objects.
Definition: object.h:1428
Definition: point3.h:56
A scene entity that owns other scene entities and listens to messages from them.
Definition: ref.h:1155
virtual CoreExport RefTargetHandle GetReference(int i)
Returns the 'i-th' reference.
virtual CoreExport int NumRefs()
Returns the total number of references this ReferenceMaker can hold.
A scene entity that is being owned and listened to by other scene entities.
Definition: ref.h:1844
virtual CoreExport void * GetInterface(ULONG id)
Inherited from Animatable.
#define GEOMOBJECT_CLASS_ID
Geometric object super-class ID.
Definition: plugapi.h:398
CoreExport Interface * GetCOREInterface()
#define EPOLY_INTERFACE
Definition: iepoly.h:203
    \sa IPopulate, IPopulateFlow, IPopulateSeat

Constructor & Destructor Documentation

◆ IPopulateIdleArea()

IPopulateIdleArea ( )
inline
45 {}

◆ ~IPopulateIdleArea()

~IPopulateIdleArea ( )
inline
46 {}

Member Function Documentation

◆ SetIdleAreaObjInstance()

POPULATE_EXPORT bool SetIdleAreaObjInstance ( ReferenceTarget instance)

Sets the internal reference to the idle area object.

This function must be called, and must return true, in order to use any of the other functions.

Parameters
[in]instance- an object of class POPULATE_IDLEAREA_CLASS_ID

◆ GetDensity()

POPULATE_EXPORT float GetDensity ( ) const

Returns the area density, a value between 0.0 and 1.0.

◆ SetDensity()

POPULATE_EXPORT bool SetDensity ( float  density)

Sets the area density.

Parameters
[in]density- a value between 0.0 and 1.0

◆ GetGroups()

POPULATE_EXPORT float GetGroups ( ) const

Returns the percent of groups in the area, a value between 0.0 and 1.0.

◆ SetGroups()

POPULATE_EXPORT bool SetGroups ( float  groupPercent)

Sets the percent of groups in the area.

Parameters
[in]groupPercent- a value between 0.0 and 1.0

◆ GetPair()

POPULATE_EXPORT float GetPair ( ) const

Returns the percent of pairs in the area, a value between 0.0 and 1.0.

◆ SetPair()

POPULATE_EXPORT bool SetPair ( float  pairPercent)

Sets the percent of pairs in the area.

Parameters
[in]pairPercent- a value between 0.0 and 1.0

◆ GetFemPercent()

POPULATE_EXPORT float GetFemPercent ( ) const

Returns the percent of females in the area, a value between 0.0 and 1.0.

◆ SetFemPercent()

POPULATE_EXPORT bool SetFemPercent ( float  femPercent)

Sets the percent of females in the area.

Parameters
[in]femPercent- a value between 0.0 and 1.0

◆ GetSinglesOrientation()

POPULATE_EXPORT float GetSinglesOrientation ( ) const

Returns the base orientation of single characters, an angle in degrees.

◆ SetSinglesOrientation()

POPULATE_EXPORT bool SetSinglesOrientation ( float  orientation)

Sets the base orientation of single characters.

Parameters
[in]orientation- an angle in degrees

◆ GetOrientSpread()

POPULATE_EXPORT float GetOrientSpread ( ) const

Returns the maximum random variation from the base orientation of single characters, an angle in degrees.

◆ SetOrientSpread()

POPULATE_EXPORT bool SetOrientSpread ( float  spread)

Sets the maximum random variation from the base orientation of single characters.

Parameters
[in]spread- an angle in degrees

◆ GetFacing()

POPULATE_EXPORT bool GetFacing ( ) const

Returns whether or not the single characters on the area are facing the look at object.

◆ SetFacing()

POPULATE_EXPORT bool SetFacing ( bool  facing)

Sets whether or not the single characters on the area are facing the look at object.

Parameters
[in]facing

◆ GetLookAtObject()

POPULATE_EXPORT INode* GetLookAtObject ( ) const

Returns the area look at object.

◆ SetLookAtObject()

POPULATE_EXPORT bool SetLookAtObject ( INode node)

Sets the area look at object.

Parameters
[in]node

◆ GetPositionRandomSeed()

POPULATE_EXPORT int GetPositionRandomSeed ( ) const

Returns the position randomization seed.

◆ SetPositionRandomSeed()

POPULATE_EXPORT bool SetPositionRandomSeed ( int  seed)

Sets the position randomization seed.

Parameters
[in]seed

◆ GetSinglesRandomSeed()

POPULATE_EXPORT int GetSinglesRandomSeed ( ) const

Returns the singles randomization seed.

This seeds the random placement of singles characters.

◆ SetSinglesRandomSeed()

POPULATE_EXPORT bool SetSinglesRandomSeed ( int  seed)

Sets the singles randomization seed.

This seeds the random placement of singles characters.

Parameters
[in]seed

◆ GetOrientationRandomSeed()

POPULATE_EXPORT int GetOrientationRandomSeed ( ) const

Returns the orientation spread randomization seed.

◆ SetOrientationRandomSeed()

POPULATE_EXPORT bool SetOrientationRandomSeed ( int  seed)

Sets the orientation spread randomization seed.

Parameters
[in]seed

◆ GetGenderRandomSeed()

POPULATE_EXPORT int GetGenderRandomSeed ( ) const

Returns the gender randomization seed.

◆ SetGenderRandomSeed()

POPULATE_EXPORT bool SetGenderRandomSeed ( int  seed)

Sets the gender randomization seed.

Parameters
[in]seed

◆ GetMotionRandomSeed()

POPULATE_EXPORT int GetMotionRandomSeed ( ) const

Returns the motion randomization seed.

◆ SetMotionRandomSeed()

POPULATE_EXPORT bool SetMotionRandomSeed ( int  seed)

Sets the motion randomization seed.

Parameters
[in]seed