Skip to main content
vmartin00
Participant
August 18, 2020
Question

TextDocumentSuite1()->AEGP_GetNewText returning null handle

  • August 18, 2020
  • 1 reply
  • 378 views

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 ?

This topic has been closed for replies.

1 reply

James Whiffin
Legend
November 26, 2020

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.