Hey there,
I found several posts regarding appending with python. I’ve given my best shot to append a blend or it’s objects/Groups to the current blend via python. Nothing I tried worked. I’m getting the “Look in the console for now” error. The console says that the file to append is not a library, no matter what blend i tried with.
I’m on Mac OS 10.8 btw, using Blender 2.63.
My goal is to add cars from external blends to the racing environment by an empty object. The best would be to append it’s whole group or the entire blend file.
EDIT: This is the key:
Code:
import bge
bge.logic.LibLoad("//cars/car1/car1.blend", “Scene”, load_actions=True, verbose=True)
This imports all scenes to the blend. Well, that was easy.
/EDIT
Things I tried out:
import bpy
bpy.ops.wm.link_append(filepath="//cars/car1/car1.blend", directory="/Users/marv/Desktop/RV BLender/cars/car1", filename="car1.blend")
or
...
bpy.ops.wm.link_append(filepath="//cars/car1/car1.blend/Object/Body_car", directory="/Users/marv/Desktop/RV BLender/cars/car1.blend/Object", filename="Body_car")
and some other varieties.
I.e. my questions are:
How to i append…
-a group
-an object
-an entire blend file
… to my current project in BGE?
I’m really looking forward to your help.
-Marv