Skip to content

Conversation

panzergame
Copy link
Contributor

Previously only scene supported asynchronous libloading.
But the loading of meshes and scenes are similar in the point
that they both use a scene converter but with a different
procedure on the data to convert and register to this scene
converter.

This commit introduce a more flexible KX_LibLoadStatus
with the usage of a lambda function which receive as argument
one of the scene converted listed in KX_LibLoadStatus and
process the conversion.

This lambda is created in BL_Converter::LinkBlendFile
in the same time than a list of scenes used to create the
scene converters is built. KX_LibLoadStatus is constructed
passing the function and the scene list.

BL_Converter also replaced the usage of blender task scheduler
by TBB. A tbb::task_group and a std::mutex is now hold.
The function BL_Converter::ConvertLibraryTask is in charge to
call the conversion function and this function can be called
by a task group or manually which help to reuse code.
As before BL_Converter::LinkBlendFile, is reponsible to
do a direct conversion or launch a conversion asynchronous task.

Fix issue: #533.

Previously only scene supported asynchronous libloading.
But the loading of meshes and scenes are similar in the point
that they both use a scene converter but with a different
procedure on the data to convert and register to this scene
converter.

This commit introduce a more flexible KX_LibLoadStatus
with the usage of a lambda function which receive as argument
one of the scene converted listed in KX_LibLoadStatus and
process the conversion.

This lambda is created in BL_Converter::LinkBlendFile
in the same time than a list of scenes used to create the
scene converters is built. KX_LibLoadStatus is constructed
passing the function and the scene list.

BL_Converter also replaced the usage of blender task scheduler
by TBB. A tbb::task_group and a std::mutex is now hold.
The function BL_Converter::ConvertLibraryTask is in charge to
call the conversion function and this function can be called
by a task group or manually which help to reuse code.
As before BL_Converter::LinkBlendFile, is reponsible to
do a direct conversion or launch a conversion asynchronous task.

Fix issue: #533.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant