umasteeringgroup / UMA

Unity Multipurpose Avatar
MIT License
737 stars 169 forks source link

Update UMA character before frame update #262

Closed ryan-dilili closed 5 years ago

ryan-dilili commented 5 years ago

I am trying to generate random characters and save them as images, but due to the real-time nature of the project and asynchronous loading/rendering of meshes and textures, it means that there is an arbitrary wait time to be able to take the picture.

I would like to be able to choose whether I want the character update to occur asynchronously, or before the next frame update.

I've considered using the CharacterUpdated callback, but when there is upwards of 100 characters in the scene it becomes unreasonable to wait for all of them to update, especially considering that they seem to update one by one.

Jaimi commented 5 years ago

You can control how many UMAs get generated in a frame with the "iterattions" parameter on the generator. You could conceivably manually "pump" the work through by calling the Work() function on the generator until IsIdle is true as well.

ryan-dilili commented 5 years ago

It seems to have worked! quite a funny way to get the work done, thanks!