Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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 access thinkin particles data channels correctly?

    Cinema 4D SDK
    c++ 2024
    2
    3
    578
    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.
    • A
      Aaron
      last edited by ferdinand

      Hi All,
      There is thinking particles system and it has few named channels such as here:

       Float   [chan   5] DataChannelType    19 DataChannelName mass(Real)
       Float   [chan   6] DataChannelType    19 DataChannelName oldP(Real)
       Float   [chan   8] DataChannelType    19 DataChannelName pscale(Real)
       Float   [chan 10] DataChannelType    19 DataChannelName spriteuv(Real)
       Vector [chan   1] DataChannelType    23 DataChannelName Cd(Vector)
      

      I get channel info using tps->DataChannelType(chan) and etc.
      19 is DTYPE_REAL, 23 is DTYPE_VECTOR
      But when I try to read the channel value per particle then it returns false and doesn't read the values. For example this request returns false:

        TP_MasterSystem* tps;
        Vector fval(0.0);
        tps->GetData(pid, channel, &fval, DTYPE_VECTOR);
      // nothing is written in fval. I also tried to use GeData, but it didn't help
      

      Other particle data such as tps->Transform(...), tps->Color(...), tps->Age(...) is returning relevant results.

      Please, can someone show me a valid example of correct TP data channel access?

      Cheers

      1 Reply Last reply Reply Quote 0
      • A
        Aaron
        last edited by

        Solved, it works this way:

        Vector v(0.0);
        tps->GetData(pid, channel, &v, ID_GV_VALUE_TYPE_VECTOR);
        
        ferdinandF 1 Reply Last reply Reply Quote 0
        • ferdinandF
          ferdinand @Aaron
          last edited by

          Hey @Aaron,

          thank you for sharing your solution!

          Cheers,
          Ferdinand

          MAXON SDK Specialist
          developers.maxon.net

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