Displacer Modifier..

On 26/06/2014 at 02:31, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R14 
Platform:   Windows  ;   
Language(s) :     C++  ;

---------
I am creating a generator plugin and setting up a basic object hierarchy within my GetVirtualObjects override as follows:

BaseObject* MyGenerator::GetVirtualObjects(BaseObject* op, HierarchyHelp* hh)
{
	Bool dirty = op->CheckCache(hh) || op->IsDirty(DIRTYFLAGS_DATA);
	if (!dirty) return op->GetCache(hh);
  
	//// NULL ////
	BaseObject *groupNull = BaseObject::Alloc(Onull);
	//// CUBE ////
	BaseObject *cube = BaseObject::Alloc(Ocube);
	BaseContainer *cubeData = cube->GetDataInstance();
	cubeData->SetBool(PRIM_CUBE_DOFILLET, TRUE);
	cubeData->SetLong(PRIM_CUBE_SUBF, 1);
	cubeData->SetReal(PRIM_CUBE_FRAD,10);
	cubeData->SetLong(PRIM_CUBE_SUBX, 20);
	cubeData->SetLong(PRIM_CUBE_SUBY, 8);
	cubeData->SetLong(PRIM_CUBE_SUBZ, 50);
	cubeData->SetVector(PRIM_CUBE_LEN, Vector(200,80,500));
	//// HYPERNURBS ////
	BaseObject *hN = BaseObject::Alloc(Osds);
	BaseContainer *subdivData = hN->GetDataInstance();
	subdivData->SetLong(SDSOBJECT_SUBEDITOR_CM, 2);
	subdivData->SetLong(SDSOBJECT_SUBRAY_CM, 3);
	//// DISPLACER ////
	BaseObject *dP1 = BaseObject::Alloc(1018685);			//Create Displacer Object
	BaseContainer *dispData = dP1->GetDataInstance();
	dispData->SetReal(MGDISPLACER_DISPLACEMENT_HEIGHT, 30);		//Displacement Height
	dispData->SetLong(MGDISPLACER_DISPLACEMENTMODE, 0);	//Intensity Mode
	dispData->SetLong(MGDISPLACER_POLYNORMALMODE, 1);			//Spherical Mode
  
	//// STACK OBJECTS ////
	dP1->InsertUnder(groupNull);
	cube->InsertUnder(hN);
	hN->InsertUnder(groupNull);
	
	return groupNull;
}
{

So what it`s doing is creating a Null, creating a Cube, creating a Hypernurbs, creating a Displacer and grouping it all together under the Null.

This works great except for the Displacement settings ( MGDISPLACER_DISPLACEMENT_HEIGHT etc ).  Those are throwing undeclared identifier errors..

Any ideas what the problem is here?

Im thinking maybe im missing an #import or something?

Pretty much working in the dark as the only reference to these id`s in in the actual raw html of the help files..

On 26/06/2014 at 04:26, xxxxxxxx wrote:

Adding this include worked:

#include "C:\Program Files\MAXON\CINEMA 4D R14\modules\mograph\res\description\omograph_displacer.h"

Prob better converting it to a relative address also..

On 26/06/2014 at 09:45, xxxxxxxx wrote:

You can use "../../modules/mograph/res/description/omograph_displacer.h" or add the path to the
projects additional include directories (but add them as relative paths, too).

-Niklas