Copy link to clipboard
Copied
Hey guys, I'm trying to getting some layer stream using stream suite, but I keep getting "internal verification failure{no current context}" error on After Effects cc 2015. but the same code working fine on After Effects cs6. Here's my code,
AEGP_TwoDVal value;
A_Err err = A_Err_NONE;
AEGP_StreamRefH stream = NULL;
ERR(_suites->StreamSuite4()->AEGP_GetNewLayerStream(_plugin_id, layer, AEGP_LayerStream_ANCHORPOINT, &stream));
AEGP_StreamValue2 val;
AEGP_StreamValue2 *sample_val = &val;
AEFX_CLR_STRUCT(val);
ERR(_suites->StreamSuite4()->AEGP_GetNewStreamValue(_plugin_id, stream, time_mode, time, ignore_expression, &val)); // "internal verification failure{no current context}" at this line
value.x = val.val.two_d.x;
value.y = val.val.two_d.y;
ERR(_suites->StreamSuite4()->AEGP_DisposeStreamValue(&val));
ERR(_suites->StreamSuite4()->AEGP_DisposeStream(stream));
And the error code is "A_Err_PARAMETER".
But the code is working fine on CS6. Have you guys ever running into this problem?
1 Correct answer
Yes, I think the thread problem is the case. I move all the ae operation to the idle hook, and now things are working fine!
Copy link to clipboard
Copied
try:
val.stream = stream;
and only then call AEGP_GetNewStreamValue().
(after you call AEFX_CLR_STRUCT, of course...)
Copy link to clipboard
Copied
Thanks shachar, but still not working with
A_Err err = A_Err_NONE;
AEGP_StreamRefH stream = NULL;
ERR(_suites->StreamSuite4()->AEGP_GetNewLayerStream(_plugin_id, layer, AEGP_LayerStream_ANCHORPOINT, &stream));
AEGP_StreamValue2 val;
AEGP_StreamValue2 *sample_val = &val;
AEFX_CLR_STRUCT(val);
val.streamH = stream;
ERR(_suites->StreamSuite4()->AEGP_GetNewStreamValue(_plugin_id, stream, time_mode, time, ignore_expression, &val));
By the way, I get my layer from a AEGP_CollectionItemV2 item (from selection).
Copy link to clipboard
Copied
are you getting a valid stream ref? can you check that it's non NULL?
(and also not any hexspeak like 0x8BADF00D or 0xDEADBEEF)
Copy link to clipboard
Copied
I think I got a valid stream, here's the address
Copy link to clipboard
Copied
that actually doesn't look right...
what's the layerH address you have?
Copy link to clipboard
Copied
The layer address is
,and the stream address is
Before requiring the layer stream, I also used "ERR(_suites->LayerSuite7()->AEGP_GetLayerMaskedBounds(layer, time_mode, time, bounds));" to get the layer's bounds, and the bounds is correct.
Copy link to clipboard
Copied
i don't think you're getting a valid stream.
the first value is waaay to high, and the second seems like garbage ram.
could it be that you're trying to get the anchor point of a layer that
doesn't have one? (like an audio layer, or a camera (i think a camera has
not anchor point))
Copy link to clipboard
Copied
Yes, I agree, because the second address is always "0x53535353" every time I run the code.
I'm not trying to get the anchor point from a layer that doesn't have anchor point property, I'm trying to get it from a solid layer.
I tested my code using "Instruments", found a memory leak at this line
Maybe this memory leak messed up the layer stream?
Copy link to clipboard
Copied
i don't know. that would take some scrutiny of the code.
Copy link to clipboard
Copied
Hi shachar,
I've been testing. I found that I can't even get my project by using "AEGP_GetProjectByIndex(0, &project)".
The address is always 0x00.
What I didn't mention is that I'm writing a AEGP plugin with a native panel. I created my panel using cocoa. And these operations are called when user click a button. The code looks like this,
[test_btn setTarget:self];
[test_btn setAction:@selector(generate_action)]; // those AE code is in the "generate_action" function
I notice from the sdk document, since After Effects CC 2015, the ui thread and render thread are separated.
Could the reason I can't get simple AE sdk code working is that I'm calling them from UI action? Do you have any experience with this?
Copy link to clipboard
Copied
Yes, I think the thread problem is the case. I move all the ae operation to the idle hook, and now things are working fine!
Copy link to clipboard
Copied
Hi Zhiqiang_Li,
I think i have exactly the same problem.
I wrote an AEGP plugin with the User Interface in Qt (QtGui / QtCore).
It works fine with CS6 but doesn't work on CC 2017.
The reason is AEGP_GetProjectByIndex(0, &project) return NULL.
When you say: "I move all the ae operation to the idle hook" what do you mean ?
What do i have to change or add in my code ?
Thanks for helping,
Regards
Stéphane.

