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
    • Recent
    • Tags
    • Users
    • Login

    Accessing objects from InExcludeData

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 360 Views
    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 Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 22/11/2009 at 12:34, xxxxxxxx wrote:

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

      ---------
      In a shader, I have an IN_EXCLUDE description element, which only accepts Base Objects
      ACCEPT { Obase; }

      Basically this works, I get InExcludeData and can i.e. get the right object count.
      However, I'm struggling with the best way to acces the objects itself during RenderInit (just reading of course).

      With GetData(i) I get a valid BaseContainer, but my attempts to create the BaseObject* fail.
      The BaseContainer delivers -1 on GetId() - NOTOK?

      Any insight? Should be straight forward to get the BaseObjects from a list with some cast...

      Thanks!

      Kabe

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 23/11/2009 at 00:47, xxxxxxxx wrote:

        Is that question stupid simple or complicated?

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 23/11/2009 at 06:05, xxxxxxxx wrote:

          It's actually pretty stright forward.

          Accessing the list objetcs:

            
          LONG MandelbrotData::InitRender(PluginShader *sh, InitRenderStruct *irs)  
          {  
            BaseContainer *data = sh->GetDataInstance();  
            
            InExcludeData *list = NULL;  
            list = (InExcludeData* )data->GetCustomDataType(MYLIST,CUSTOMDATATYPE_INEXCLUDE_LIST);  
            
            if (list)  
            {  
                BaseObject *obj = NULL;  
                LONG i, ocnt = list->GetObjectCount();  
                for (i=0; i<ocnt; i++)  
                {  
                    obj = (BaseObject* )list->ObjectFromIndex(sh->GetDocument(),i);  
                    if (obj)  
                    {  
                        GePrint(obj->GetName());  
                    }  
                }  
            }  
            
            return LOAD_OK;  
          }  
          

          from the resource file:

            
          ...  
          IN_EXCLUDE MYLIST { ACCEPT { OBase; } }  
          ...  
          

          cheers,
          Matthias

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 23/11/2009 at 08:01, xxxxxxxx wrote:

            Thanks Matthias!

            Turned out that I failed in the beginning because I used GetActiveDocument() to get the doc, which fails during preview...

            Kabe

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