Accessing objects from InExcludeData



  • 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



  • 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?



  • 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



  • 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


Log in to reply