build3d / app /agents /rendering.py
dellweb3's picture
发布 Build3D 当前建模与一镜到底展示
fa53282
Raw History Blame Contribute Delete
794 Bytes
"""Apply catalog materials and render the completed geometry without changing it."""
from gateways import geometry
def run(scene,analysis,project,out,render):
catalog={m['id'] for m in scene['materials']}
bindings=[dict(room=r['id'],material=r['material']) for r in scene['rooms']]
if any(b['material'] not in catalog for b in bindings):raise ValueError('材料映射未通过登记校验')
args=['--json',out/'input.json','--out',out,'--project',project]+(['--render'] if render else [])
geometry.execute('render_fitout.py' if scene.get('schemaVersion')==2 else 'render_interior.py',args,out,'render.log')
return dict(bindings=bindings,issues=[i for i in analysis.get('issues',[]) if i['kind']=='material'],rendered=render,geometry_changed=False,analysis_reused=True)