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

    Accessing TP Group

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 216 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 14/10/2007 at 08:29, xxxxxxxx wrote:

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

      ---------
      I want to link a particle group in the attribute manager, but c4d crashes while accessing it. It looks like that the cast from BaseList2D* to TP_PGroup* doesnt work like i expect it.

      > _
      > BaseObject *ParticleGeometrie::GetVirtualObjects(PluginObject *op, HierarchyHelp *hh)
      > {
      >      BaseDocument *doc = hh->GetDocument();
      >      if (!doc) return NULL;
      >
      >      BaseContainer *data = op->GetDataInstance();
      >      if (!data) return NULL;
      >
      >      TP_PGroup *tpGroup = (TP_PGroup* )data->GetLink( PARTICLE_GROUP, doc, ID_TP_PGROUP);
      >      if (!tpGroup) return NULL;
      >
      >      tpGroup->GetName();        // this works
      >      tpGroup->NumParticles();    // C4D crashes while accessing members of TP_PGroup
      >      return NULL;
      > }
      > _

      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 14/10/2007 at 09:17, xxxxxxxx wrote:

        I found the answer myself, had to call
        > InitThinkingParticles();
        before 😉

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