LibLoad to scene

Hey, I use LibLoad to import objects to my scene.

While I do this I’ve a overlay scene that says ‘loading’.

But now the objects will be imported to the overlay scene instead of the ‘normal’ scene.

How can I determine in which scene the objects will be imported?

Thanks.

Just make sure the libload script is on a python controller in the scene you want the loaded data to be in.

From the overlay scene, grab the main scene:

scenes = bge.logic.getSceneList()

main_scene = None
main_controller = None

for scene in scenes:
    if scene.name == "main_scene":
        main_scene = scene

then get the object doing the loading:


if main_scene:
    main_controller = [ob for ob in main_scene.objects if ob.get("main_controller")][0]

set a property on the main_controller and check it to see if the libload is finished:

if main_controller['finished']:
    loading_finished()

Thanks, I’ll take a look to it.

Another random question:

For fun I used this

<b>print</b>("Library (<i>%s</i>) loaded in <i>%.2f</i>ms." % (status.libraryName, status.timeTaken))

(found here) to see in the console how much time it took to load the blend.

example:

Library (F:\Blender\Desperate Times\game\data\worlds emp.dtDat) loaded in 2.40ms.

I guess this took 2-3 seconds to load, but this says 2.40 ms… but that is really fast, shouldn’t that be just seconds instead of milliseconds?