How to access values within a 2nd, closed .blend-file?


(chrissie) #1

I am working in a .blend. Can I access (through Python) a 2nd, closed .blend-file?
I would like to access values like object-positions (I know the names of the objects).


(-HENDRIX-) #2

You will have to open the file, one way or another. I assume you don’t want to manually decode the whole blend file into python just to get to the values.

You could use the the linking API: https://docs.blender.org/api/blender_python_api_current/bpy.types.BlendDataLibraries.html

So link an obj (you can link only the ones with the names you want) from your other file into the current file, and then get the location from that.


(SterlingRoth) #3

I often will link in a whole scene if I need to reference a lot of external objects