How access to the listview from videopost
-
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?
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, -
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 -
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