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.
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 bpy.data.libraries.load(blend_filepath) 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:
bpy.context.scene.objects.link(obj)
print("Imported Object:", obj.name)
else:
print("Error importing object")
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) ?