GetDataInstance and GetParameter in TagData Read
On 16/09/2016 at 00:47, xxxxxxxx wrote:
Cinema 4D Version: R17
Platform: Windows ;
Language(s) : C++ ;
I have a filename parameter, which I try to retrieve in Read method (TagData plugin).
Here is the code using GetDataInstance and GetParameter
//1 BaseContainer* tag_data = tag->GetDataInstance(); String filename = tag_data->GetFilename(FILENAME_PARAM).GetString(); //2 GeData ge_data; tag->GetParameter(FILENAME_PARAM, ge_data, DESCFLAGS_GET_PARAM_GET); String filename = ge_data.GetFilename().GetString();
The first filename gets the value correctly, while the second filename string appears empty.
Why GetParameter doesn't return the value correctly ?
On 16/09/2016 at 02:07, xxxxxxxx wrote:
you are using DESCFLAGS_GET_PARAM_GET, which is the flag for saying, the parameter got read successfully. Can you please try, if the problem persists, if you use DESCFLAGS_GET_0 instead?
On 16/09/2016 at 05:44, xxxxxxxx wrote:
Using DESCFLAGS_GET_0 returns the correct value. So I assume that whenever I want to read a parameter, I have to use DESCFLAGS_GET_0 right ?
When am I supposed to use DESCFLAGS_GET_PARAM_GET ?
Thank you for your time.
On 16/09/2016 at 05:50, xxxxxxxx wrote:
DESCFLAGS_GET_PARAM_GET is used inside GetDParameter() to mark the successful retrieval of the parameter. You don't pass it into GetParameter().
On 16/09/2016 at 06:16, xxxxxxxx wrote:
I didn't know that. I assume SET_PARAM_SET does the same right (in SetDParameter)?
On 16/09/2016 at 08:56, xxxxxxxx wrote:
Yes. Sorry, I got disturbed, while posting. I actually wanted to mention this in my post.
On 16/09/2016 at 09:01, xxxxxxxx wrote: