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
    • Register
    • Login

    How access to the listview from videopost

    Cinema 4D SDK
    r20 sdk
    2
    3
    850
    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.
    • m_tamuraM
      m_tamura
      last edited by m_tamura

      Cinema4D R20;
      Windows 10;
      C++;

      Hi all,

      I did add the simple listview custom GUI on the my VideoPost plugin.
      Listview is the same as the SDK example.

      Also, I have listview displayed in using GetDDescription in the VideoPost.

      And I'd like to access this list of data from the VideoPost function.
      e.g, GetItem or GetItemCount etc from the listview1 or listvew2.
      But I still do not know how to do it.

      If I want to do get data of the listview from VideoPost, what kind of procedure should I access?
      alt text

      GetDDescription in my VideoPost

      ///// inside My VideoPostPlugin GetDDescription //////////////
      ///// ListView ///////////////////////////////////////////////
      
      cid = DescLevel(MY_VIDEOPOST_TAB, DTYPE_GROUP, 0);
      if (!singleid || cid.IsPartOf(*singleid, nullptr)) // important to check for speedup c4d!
      {
          BaseContainer secondgroup = GetCustomDataTypeDefault(DTYPE_GROUP);
          secondgroup.SetString(DESC_NAME, "Test Tab"_s);
          if (!description->SetParameter(cid, secondgroup, DescLevel(0)))
              return true;
      }
      
      DescID cid_Tree = DescLevel(IDS_MY_CUSTOMGUI, ID_MY_CUSTOMGUI_CUSTOMDATATYPE, 0);
      if (!singleid || cid.IsPartOf(*singleid, nullptr))	// important to check for speedup c4d!
      {
          BaseContainer bc = GetCustomDataTypeDefault(ID_MY_CUSTOMGUI_CUSTOMDATATYPE);
          bc.GetCustomDataType(DESC_CUSTOMGUI, ID_MY_CUSTOMGUI_CUSTOMDATATYPE);
          if (!description->SetParameter(cid_Tree, bc, DescLevel(MY_VIDEOPOST_TAB))) return TRUE;
      }
      

      Any opinion will be helpful.
      Best Regards,
      Makoto,

      1 Reply Last reply Reply Quote 0
      • S
        s_bach
        last edited by s_bach

        Hello,

        in your code snippet it looks like that you are using a custom data type and a custom GUI. Is that correct?

        So your actual question is how to access the custom data type value?

        You can access a parameter using GetParameter(). From the obtained GeData object you can access the custom data with GetCustomDataType().

        Within your module you can cast that pointer to your iCustomDataType based class.

        In this example the custom data is iMyDataType:

        // get parameter
        GeData data;
        if (!activeObject->GetParameter(parameterID, data, DESCFLAGS_GET::NONE))
        	return maxon::UnexpectedError(MAXON_SOURCE_LOCATION);
        
        // get custom data
        CustomDataType* const customData = data.GetCustomDataType(MY_CUSTOM_DATA_TYPE);
        if (!customData)
        	return maxon::UnexpectedError(MAXON_SOURCE_LOCATION);
        
        // cast
        iMyDataType* const myDataTyp = (iMyDataType*)customData;
        ApplicationOutput(myDataTyp->_string);
        

        Be sure to use the fully constructed DescID including the data type.

        best wishes,
        Sebastian

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • m_tamuraM
          m_tamura
          last edited by

          Thank you, Sebastian.

          Your reply clearly shows what I should learn.

          I need a little time to understand, but I am working on it and I made a little progress.

          Cheers
          Makoto

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