-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPBGE: Handle non-threadable libloading data.
As python is badly managing threading, it is better to delay any python call to the main thread. This situation happen in case of libload is python components are registered. The component conversion is moved into the function BL_PostConvertBlenderObjects which can later manage more than just the components. This function is called by BL_Converter::PostConvertScene based on a scene converter. Because the post conversion needs to iterate over all the objects, the scene converter expose a list of all the objects registered (active and inactive). The introduction of this new function helped to clarify the process of scene or data conversion. For a simple scene conversion without merge: - scene creation - conversion (BL_Converter::ConvertScene) - post conversion (BL_Converter::PostConvertScene) - finalizing data (BL_Converter::FinalizeSceneData) This procedure can be find in KX_KetsjiEngine::ConvertScene, FinalizeSceneData does less work than before as it is calling KX_BlenderMaterial::InitShader to create the shaders and so assume that all the data are using the correct scene. In consideration during a merge of scene an extra step is required to set the destination scene in the mesh and material. This is an effect of the BL_Converter::MergeSceneData which also merge to the destination SceneSlot the scene converter of the scene to merge. To summarize, in case of libload, the procedure is: - scene creation (optional) - conversion - post conversion (optional) - merging data (BL_Converter::MergeSceneData) - merging scene (KX_Scene::MergeScene) (optional) - finalizing data FinalizeSceneData is still called after the merging of the scene because the material shaders are depending of the scene state and especially the lamps contained by the scene used to generate the shader.
- Loading branch information
1 parent
a7c5a5f
commit 8765a15
Showing
13 changed files
with
143 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.