get the link for the real object



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

    On 17/02/2009 at 01:15, xxxxxxxx wrote:

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

    ---------
    In a deformer plugin, in this procedure:

    ModifyObject(PluginObject *mod, BaseDocument *doc, BaseObject *op, const Matrix &op;_mg, const Matrix &mod;_mg, Real lod, LONG flags, BaseThread *thread)

    The "Baseobjetc *op" point to the virtual deformed object, I need to get the link to the real object instead!
    Or alternatively a way to identify the real object unambiguously.

    Is this possible?

    Thank's in advance.
    Lorenzo



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

    On 17/02/2009 at 02:28, xxxxxxxx wrote:

    You can step up through the caches with GetCacheParent().
    This sample code will give you the original object.

    > \> Bool Spherify::ModifyObject(PluginObject \*mod, BaseDocument \*doc, BaseObject \*op, const Matrix &op;\_mg, const Matrix &mod;\_mg, Real lod, LONG flags, BaseThread \*thread) \> { \>      BaseObject \*temp = NULL; \>      BaseObject \*orig = NULL; \>      orig = op; \> \>      temp = op->GetCacheParent(); \> \>      while(temp) \>      { \>           orig = temp; \>           temp = temp->GetCacheParent(); \>      } \> \>      if(orig) \>      { \>           //orig is the original object, do something \>           GePrint(orig->GetName()); \>           GePrint(LongToString(orig->GetType())); \>      } \> \>      return TRUE; \> } \>

    cheers,
    Matthias



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

    On 17/02/2009 at 02:34, xxxxxxxx wrote:

    Thank Matthias very much, I'll try soon!

    Lorenzo


Log in to reply