How to get Effectors [SOLVED]



  • On 29/03/2016 at 04:33, xxxxxxxx wrote:

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

    ---------
    Hi,

    I use Melange in order to read Cinema4D files. Everything is kind of OK so far.
    Now I've got a file with Linear Cloner Object.
    It has an Effector, which is Spline and Cloner works differently... of course.

    Question is: How to retrieve list of effectors for any object in scene?

    Alex



  • On 30/03/2016 at 03:04, xxxxxxxx wrote:

    Hello and welcome,

    Not every object in a Cinema 4D scene has assigned effectors. Only MoGraph generators are linked to MoGraph effectors. When you look at a Cinema 4D scene you see that these effectors are linked using an InExclude list on the MoGraph cloner object.

    So to get the effectors that are assigned to a specific cloner you have to read that parameter to obtain that InExclude list. Such a list is stored in form of the InExcludeData data type.

      
    // check if the object is a MoGraph cloner  
    if(object->IsInstanceOf(1018544))  
    {  
      
      printf("Found a MoGraph Cloner object\n");  
      
      GeData data;  
      
      //ID_MG_MOTIONGENERATOR_EFFECTORLIST is 2009  
      if(object->GetParameter(DescLevel(2009), data))  
      {  
      InExcludeData* effectorList = (InExcludeData* )data.GetCustomDataType(CUSTOMDATATYPE_INEXCLUDE_LIST);  
      if(effectorList)  
      {  
        const Int32 count = effectorList->GetObjectCount();  
        for (Int32 i = 0; i < count; ++i)  
        {  
          BaseList2D* linkedObject = effectorList->ObjectFromIndex(loadedDoc, i);  
      
          // custom function to print the object name  
          PrintObjectName(linkedObject);  
        }  
      }  
      }  
    }  
    

    best wishes,
    Sebastian



  • On 30/03/2016 at 15:00, xxxxxxxx wrote:

    Hi Sebastian,

    Thank you very much - I've been expecting something like that.
    It works, at least I can get object :).

    Alex


Log in to reply