当我们使用link,从别的blend文件中链接一个collection过来的时候
其实是创建了一个empty物体,并且把它的instancing设置为collection
代码
使用Jsonfile 来储存参数
import json
json_fname = bpy.path.abspath('//assets.json')
with open(json_fname) as infile:
link_info = json.load(infile)
json_colls = link_info['collections']
location_y = 0
step_y = 2.0
for coll_name , coll_info in json_colls.items():
link_to = ensure_collection_exist(content.scene,coll_name)
for file_and_prifix in coll_info['link']:
filepath = file_and_prefix['file']
prefix = file_and_prefix['prefix']
link_to_scene(filepath,prefix,link_to,location_y)
location_y += step_y;