Copy link to clipboard
Copied
Hello, and best wishes for 2016.
I have an issue with a thread process in a plugin.
Before calling a thread task,
functions like :
ERR(suites.LayerSuite8()->AEGP_GetActiveLayer(¤t_layerH));
ERR(suites.ProjSuite6()->AEGP_GetProjectByIndex(0, &projH));
ERR(suites.ProjSuite6()->AEGP_GetProjectRootFolder(projH, &root_itemH));
err = suites.CompSuite10()->AEGP_CreateComp( startedParentFolder,
u16str,
700,
900,
&comp_parRt,
&durationT,
&fps,
&new_compH);
are working.
But after calling a basic function using thread, like
static void myFunc(){
for(int i = 0; i<100; i++){
cout << i << endl;
//std::cout << "I " << i << " " << std::this_thread::get_id() << std::endl;
}
}
std::thread t(myFunc);
t.join();
ERR(suites.LayerSuite8()->AEGP_GetActiveLayer(¤t_layerH)); ===> works
but
ERR(suites.ProjSuite6()->AEGP_GetProjectByIndex(0, &projH)); ==== >doesn't. projH return NULL
My question is how can I use (If it is possible) threads in a plugin, and manipulate AE UI (Plugin Effect panel, TimeLine ...)
I have to say that my main thread id is the same before and after my process.
Cheers Jim
i don't know what you're doing wrong, but launching and joining threads is
entirely possible.
ae does behave weirdly if you use it's calls from any other thread (with
very few exceptions). you say the thread id is the same, so i don't know
what you did wrong there.
i can only say i launch threads (using boost) often, and as long as calls
are made only from the main thread, all is ok.
perhaps you made some calls to AE from the other thread? if you did, AE can
become a bit of a "zombie" afterwards, even i
...Copy link to clipboard
Copied
i don't know what you're doing wrong, but launching and joining threads is
entirely possible.
ae does behave weirdly if you use it's calls from any other thread (with
very few exceptions). you say the thread id is the same, so i don't know
what you did wrong there.
i can only say i launch threads (using boost) often, and as long as calls
are made only from the main thread, all is ok.
perhaps you made some calls to AE from the other thread? if you did, AE can
become a bit of a "zombie" afterwards, even if the process has already
returned to the main thread.
Copy link to clipboard
Copied
Thanks Shachar,
I'm actually a lot of testing, I will resume my code and simplify.
it's true that my post is confused, and I try to do many things, I'm going back to zero and find the right solution.
Thank you to confirm that this is possible, which seems to me obvious.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now