import bpy, json, os HERE = os.path.dirname(os.path.abspath(__file__)) out = {} for me in bpy.data.meshes: if not me.users or not (me.name.startswith("DoorArm") or me.name.startswith("Showroom | floor")): continue sf = me.attributes.get("sharp_face") se = me.attributes.get("sharp_edge") nsharpf = sum(1 for d in sf.data if d.value) if sf else 0 nsharpe = sum(1 for d in se.data if d.value) if se else 0 out[me.name] = dict(faces=len(me.polygons), sharp_faces=nsharpf, edges=len(me.edges), sharp_edges=nsharpe, custom_normals=me.has_custom_normals, attrs=[a.name for a in me.attributes if not a.name.startswith(".")]) mods = {} for ob in bpy.data.objects: if ob.type == 'MESH' and ob.modifiers: mods[ob.name] = [(m.type, getattr(m, 'node_group', None) and m.node_group.name) for m in ob.modifiers] out["_objects_with_modifiers"] = mods json.dump(out, open(os.path.join(HERE, "crit1_shading.json"), "w"), indent=1) print("[crit1] shading done", flush=True)