Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Displacer Modifier..

    SDK Help
    0
    3
    270
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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..

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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..

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post