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

    How to get Effectors [SOLVED]

    SDK Help
    0
    3
    327
    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 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

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

        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

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

          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

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