import .blend file into existing scene script

Hi all,
I’m quite new to the blender “scene” (sorry for the bad pun) and I was wondering if it was possible to import or open a .blend file to a scene I am currently working on using the Python/Blender API? For example, I’ve added some Mesh Objects to the scene and I found other models (saved as .blend files) which I want to add to the existing scene.

TIA!

Hello andoo.

Yes you can.

Using SHIFT+F1 you can append or link objects. By linking, the objects will be referenced into your file. Referenced objects cannot be edited. Appended objects are fresh copies.

http://www.blender.org/development/release-logs/blender-242/library-linking/
http://wiki.blender.org/index.php/Manual/Library_and_Data_System
http://wiki.blender.org/index.php/Manual/Using_Linked_Libraries

Also, you can use the Blender Python API’s Library module to add objects in other blender files to your “scene”.

http://www.zoo-logique.org/3D.Blender/scripts_python/API/Library-module.html

Hope this helps!!!

Thanks, that helped a lot!!

I’ve successfully loaded objects from another .blend file into my scene. However, in the console, there is a warning displayed after adding one object (calling the function Library.Load(obname, ‘Object’, 0): “Warning: only one material per object handled”.
Is it possible to load an object from another blend file into the scene having more than one material to that object?

you can by first importing the scene and then copying whatever you want from that sence into your main whatever sence you want and can then delete the imported scene if you wish found this thread because Im trying to import all scenes from all .blend files at once from command line im sure there is a way to

hi, I wrote an addon here:
Add_Petunia Model
The system I used appends the model & rig & materials into your current scene.
be careful to make the file paths correct. :slight_smile: