TextDocumentSuite1()->AEGP_GetNewText returning null handle

New Here ,
Aug 18, 2020

Copy link to clipboard

Copied

Hi, I'm trying to get the text from a layer, my code is currently looking like that :

 

AEGP_StreamVal2		streamValue;
AEGP_StreamType		streamType = AEGP_StreamType_TEXT_DOCUMENT;

result |= suites.StreamSuite5()->AEGP_GetLayerStreamValue(textLayer, AEGP_LayerStream_SOURCE_TEXT, AEGP_LTimeMode_CompTime, &AETime, false, &streamValue, &streamType);

AEGP_ObjectType  layerType;
result |= suites.LayerSuite8()->AEGP_GetLayerObjectType(textLayer, &layerType);

if (layerType != AEGP_ObjectType_TEXT)
	return;

AEGP_MemHandle	textHandle;
result |= suites.TextDocumentSuite1()->AEGP_GetNewText(m_AEGPID, streamValue.text_documentH, &textHandle);

 

 AEGP_GetNewText return A_Err_PARAMETER and textHandle is null.

According to the documentation, I should get the StreamValue using streamType = AEGP_StreamType_TEXT_DOCUMENT, but It doesn't not provide the AEGP_LayerStream value that I should get.

Any advice on that ?

TOPICS
SDK

Views

73

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Participant ,
Nov 25, 2020

Copy link to clipboard

Copied

I was confused by the documentation too. I'm not sure if it's incorrect, but it seems instead of AEGP_GetLayerStreamValue you should use AEGP_GetNewStreamValue (as per the Text_Twiddler example), this worked for me. 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more