Files
2026-11-17 23:59:41 +03:00

8 lines
579 B
Python

import bpy,os,json
D=r'C:\roblox\Ornament-Generator-RNG\3d model\furniture';os.makedirs(D,exist_ok=True)
for name,label in [('Bench_0','bench'),('Lamp_1','lamp')]:
root=bpy.data.objects[name]
obs=[o for o in root.children_recursive if o.type in {'MESH','CURVE'} and not o.hide_render and not o.hide_get()]
bpy.data.libraries.write(os.path.join(D,label+'_source.blend'),set([root]+obs),fake_user=True)
print(label,json.dumps({'parts':[o.name for o in obs],'materials':{m.name:[n.type for n in m.node_tree.nodes] for o in obs for m in o.data.materials if m and m.use_nodes}}))