Script : Blender Herman Hertzeberger interpretation

Hello guys I have a few question regarding creating a model with my script.

First of all its an architectural reinterpretation of the building Centraal Beheer from Herman Hertzeberger. I did this script with the help of a few forum members back in 2015 ( I think). It was done in a rush so the result might not be the best as expected.

Anyways I know there is 100 options to run this script more smooth and easier, and thats the point why I am posting this over here.

But one question I have right from the start :
What do I have to do import a model with a script from another blender file in the current one? (I am pretty sure if you see the two attached files you will understand.

The Script : Hermann Hertzeberger Module .blend (1.07 MB)

I am eager to learn more about the script so if you want to help me out on this one, I would appreciate it alot!

Best regards,
Fortes Odair


Hermann Hertzeberger 7.blend (3.28 MB)

Hello Rodod,

BlendDataLibraries in the Blender Python API can be used to import data from another .blend file.

Example for how the ‘Base’, ‘Body’, and ‘Roof’ objects can be appended to the scene:

import bpy

blend_filepath = "//Hermann Hertzeberger Module .blend"
model_names = ["Base", "Boy", "Roof"]

with as (data_from, data_to):
    data_to.objects = [name for name in data_from.objects if name in model_names]
for obj in data_to.objects:
    if obj is not None:
        print("Imported Object:",
        print("Error importing object")

Hope this helps!

Thank you very much RLGUY, I will try it tonight and see if I can do something with it.

I’ll let you know if I manage.

Thanks it worked, but as for to create a pyramid with the “Body”, do I have to Define the base in order to create the loop ( like in script No2 line 274) ?

Hermann Hertzeberger 7.blend (1.94 MB)