Spaces:
Running
Running
Detail panel: Copy URL and Download (zip) bar like SimReady Central (part 2)
Browse filesFiles changed (4)
- style.css+19-5
- tools/build_catalog.py+6-2
- tools/isaac_thumbs.pyAdded+212
- tools/meta_cache.json+81
69 unmodified lines70717273747576777885 unmodified lines16416516616716816917017117217317417517617717869 unmodified lines@media (min-width: 1280px) { .layout.has-detail { grid-template-columns: 260px minmax(0, 1fr) 440px; } }.side { border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 14px 12px 20px; display: grid; align-content: start; grid-auto-rows: max-content; gap: 18px; }.results { overflow-y: auto; padding: 14px 16px 32px; min-width: 0; }.detail { border-left: 1px solid var(--line); background: var(--panel); min-width: 0; overflow: hidden; display: flex; }@media (max-width: 1279px) { .detail { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 15; box-shadow: -20px 0 40px rgba(0, 0, 0, 0.35); } }.detail-scroll { overflow-y: auto; overflow-x: hidden; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; gap: 16px; align-content: start; width: 100%; }.detail-scroll > * { min-width: 0; }/* Sidebar */85 unmodified lines.facts dd { margin: 0; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }.section-title { margin: 0 0 8px; font: 600 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }.note { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }.actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }.cmd { display: flex; gap: 6px; align-items: stretch; }.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font: 12px/1.5 var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; display: flex; align-items: center; }.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; border: 1px solid var(--line); background: var(--raised); border-radius: 8px; padding: 0 12px; cursor: pointer; text-decoration: none; text-align: center; font-weight: 500; white-space: nowrap; line-height: 1.2; }.btn:hover { border-color: var(--faint); }.btn.small { min-height: 28px; font-size: 12.5px; padding: 0 10px; }.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }.btn-row .btn { flex: 1 1 auto; }.more { border-radius: var(--radius); padding: 12px; background: var(--accent-soft); font-size: 13px; display: grid; gap: 8px; }.more p { margin: 0; }69 unmodified lines70717273747576777885 unmodified lines16416516616716816917017117217317417517617717817918018118218318418518618718818919019119269 unmodified lines@media (min-width: 1280px) { .layout.has-detail { grid-template-columns: 260px minmax(0, 1fr) 440px; } }.side { border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 14px 12px 20px; display: grid; align-content: start; grid-auto-rows: max-content; gap: 18px; }.results { overflow-y: auto; padding: 14px 16px 32px; min-width: 0; }.detail { border-left: 1px solid var(--line); background: var(--panel); min-width: 0; overflow: hidden; display: flex; flex-direction: column; }@media (max-width: 1279px) { .detail { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 15; box-shadow: -20px 0 40px rgba(0, 0, 0, 0.35); } }.detail-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; gap: 16px; align-content: start; width: 100%; }.detail-scroll > * { min-width: 0; }/* Sidebar */85 unmodified lines.facts dd { margin: 0; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }.section-title { margin: 0 0 8px; font: 600 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }.note { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; border: 1px solid var(--line); background: var(--raised); border-radius: 8px; padding: 0 12px; cursor: pointer; text-decoration: none; text-align: center; font-weight: 500; white-space: nowrap; line-height: 1.2; }.btn:hover { border-color: var(--faint); }.btn.small { min-height: 28px; font-size: 12.5px; padding: 0 10px; }.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }.btn-row .btn { flex: 1 1 auto; }/* Action bar fixed under the details, like NVIDIA SimReady Central: Copy URL + Download (zip) with a menu */.detail-foot { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--panel); position: relative; }.detail-foot:empty { display: none; }.detail-foot svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }.foot-copy { gap: 6px; min-height: 40px; }.dl { flex: 1; display: flex; min-width: 0; }.dl .dl-main { flex: 1; min-width: 0; overflow: hidden; min-height: 40px; gap: 8px; border-radius: 8px 0 0 8px; font-weight: 600; }.dl .dl-main:disabled { opacity: 0.85; cursor: progress; }.dl-label, .dl-size { overflow: hidden; text-overflow: ellipsis; }.dl-size { font: 500 12px/1 var(--mono); opacity: 0.75; }@media (max-width: 420px) { .dl-size { display: none; } }.dl .dl-caret { min-height: 40px; padding: 0 10px; border-radius: 0 8px 8px 0; border-left: 1px solid rgba(0, 0, 0, 0.18); }.dl-caret svg { transform: rotate(90deg); }.dl-menu { position: absolute; right: 16px; bottom: calc(100% - 4px); min-width: 210px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: grid; gap: 2px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); z-index: 5; }.dl-menu[hidden] { display: none; }.dl-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; border-radius: 6px; padding: 8px 10px; cursor: pointer; text-align: left; text-decoration: none; font-size: 13px; }.dl-item:hover { background: var(--accent-soft); }.more { border-radius: var(--radius); padding: 12px; background: var(--accent-soft); font-size: 13px; display: grid; gap: 8px; }.more p { margin: 0; }
160 unmodified lines16116216316416516616716816917050 unmodified lines221222223224225226160 unmodified linesgroups = json.load(open(args.groups))cache = json.load(open(args.cache)) if os.path.exists(args.cache) else {}sha, files = list_files(args.dataset)by_asset = {}for f in files:if "/" in f["path"]:by_asset.setdefault(f["path"].split("/")[0], []).append(f["path"])assets, todo, hidden = {}, [], hidden_assets()for asset, paths in sorted(by_asset.items()):50 unmodified lines"preview": os.path.exists(os.path.join(args.previews, f"{a}.glb")),"thumb": os.path.exists(os.path.join(args.previews, "thumbs", f"{a}.webp")),"glass": any("/simready_usd/materials/" in p for p in paths),})records += scene_records(args.previews)160 unmodified lines16116216316416516616716816917017117217350 unmodified lines224225226227228229230160 unmodified linesgroups = json.load(open(args.groups))cache = json.load(open(args.cache)) if os.path.exists(args.cache) else {}sha, files = list_files(args.dataset)by_asset, sizes = {}, {}for f in files:if "/" in f["path"]:top = f["path"].split("/")[0]by_asset.setdefault(top, []).append(f["path"])if "/.metadata/" not in f["path"]: # the Download zip leaves out the reportssizes[top] = sizes.get(top, 0) + (f.get("size") or 0)assets, todo, hidden = {}, [], hidden_assets()for asset, paths in sorted(by_asset.items()):50 unmodified lines"preview": os.path.exists(os.path.join(args.previews, f"{a}.glb")),"thumb": os.path.exists(os.path.join(args.previews, "thumbs", f"{a}.webp")),"glass": any("/simready_usd/materials/" in p for p in paths),"size": sizes.get(a, 0), # bytes in the package folder (the Download zip)})records += scene_records(args.previews)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212"""Isaac Sim (RTX) thumbnails for the Library: <out_dir>/<asset>.webp.
Renders each SimReady package with its own materials (MDL glass, liquids, OpenPBR),the way it looks in sim, instead of the simplified preview GLB: a three-quarter viewfrom the front-right (the package's simready:assetFrame:forwardDirection when it hasone, else -Y), lit by an HDRI dome that isn't visible in the image, a shadow on aninvisible floor (RTX matte object / shadow catcher) and a transparent background, sothe page supplies the backdrop in both themes.
Run on a GPU machine with Isaac Sim 6.x (pip install or /opt/IsaacSim/python.sh): python isaac_thumbs.py <assets_dir> <out_dir> <hdri.exr> [--renderer PathTracing] [asset ...]<assets_dir>/<asset>/simready_usd/<asset>.usd for every asset (a download ofprojectsim/simready-assets). Existing thumbnails are skipped unless --force."""
import argparseimport mathimport osimport sys
ap = argparse.ArgumentParser()ap.add_argument("assets_dir")ap.add_argument("out_dir")ap.add_argument("hdri")ap.add_argument("assets", nargs="*")ap.add_argument("--size", type=int, default=640, help="output size in px")ap.add_argument("--render-size", type=int, default=1024, help="rendered size before downscaling")ap.add_argument("--renderer", default="PathTracing", choices=["PathTracing", "RaytracedLighting"])ap.add_argument("--spp", type=int, default=256, help="path-tracing samples per pixel")ap.add_argument("--dome", type=float, default=1000.0, help="HDRI dome intensity")ap.add_argument("--sun", type=float, default=0.0, help="optional key light intensity (distant light)")ap.add_argument("--exposure", type=float, default=None, help="tonemapper exposure (EV) override")ap.add_argument("--fill", type=float, default=0.86, help="share of the frame the asset fills")ap.add_argument("--azimuth", type=float, default=35.0, help="degrees right of the front")ap.add_argument("--elevation", type=float, default=24.0)ap.add_argument("--fov", type=float, default=22.0, help="vertical field of view, degrees")ap.add_argument("--max-bounces", type=int, default=4)ap.add_argument("--max-spec-bounces", type=int, default=6, help="max specular and transmission bounces")ap.add_argument("--force", action="store_true")args = ap.parse_intermixed_args() # asset names may follow the flagssys.argv = sys.argv[:1] # keep our flags away from Kit's own argument parsing
from isaacsim import SimulationApp # noqa: E402
R = args.render_sizeapp = SimulationApp({"headless": True, "renderer": args.renderer, "width": R, "height": R})
import carb # noqa: E402import numpy as np # noqa: E402import omni.replicator.core as rep # noqa: E402import omni.usd # noqa: E402from PIL import Image # noqa: E402from pxr import Gf, Sdf, Usd, UsdGeom, UsdLux, Vt # noqa: E402
settings = carb.settings.get_settings()for key, value in { "/rtx/post/backgroundZeroAlpha/enabled": True, # background alpha 0 "/rtx/post/backgroundZeroAlpha/outputAlphaInComposite": True, "/rtx/matteObject/enabled": True, # floor = shadow catcher only "/rtx/post/matteObject/enableShadowCatcher": True, "/rtx/pathtracing/totalSpp": args.spp, "/rtx/pathtracing/spp": 16, "/rtx/pathtracing/maxBounces": args.max_bounces, # Tyler's settings "/rtx/pathtracing/maxSpecularAndTransmissionBounces": args.max_spec_bounces, "/rtx/pathtracing/optixDenoiser/enabled": True, # subsurface scattering (Tyler): frosted plastics, nylon, wax look flat without it "/rtx/raytracing/subsurface/enabled": True, "/rtx/raytracing/subsurface/transmission/enabled": True, "/rtx/pathtracing/maxVolumeBounces": 15,}.items(): settings.set(key, value)if args.exposure is not None: settings.set("/rtx/post/tonemap/exposure", args.exposure)
os.makedirs(args.out_dir, exist_ok=True)names = args.assets or sorted(n for n in os.listdir(args.assets_dir) if os.path.isfile(f"{args.assets_dir}/{n}/simready_usd/{n}.usd"))todo = [n for n in names if args.force or args.assets or not os.path.exists(f"{args.out_dir}/{n}.webp")]print(f"{len(todo)} thumbnails to render", flush=True)
ctx = omni.usd.get_context()ctx.new_stage()for _ in range(5): app.update()stage = ctx.get_stage()UsdGeom.SetStageMetersPerUnit(stage, 1.0)
dome = UsdLux.DomeLight.Define(stage, "/World/Dome")dome.CreateTextureFileAttr(os.path.abspath(args.hdri))dome.CreateTextureFormatAttr("latlong")dome.CreateIntensityAttr(args.dome)dome.GetPrim().CreateAttribute("visibleInPrimaryRay", Sdf.ValueTypeNames.Bool).Set(False)if args.sun > 0: sun = UsdLux.DistantLight.Define(stage, "/World/Sun") sun.CreateIntensityAttr(args.sun) sun.CreateAngleAttr(8.0)
floor = UsdGeom.Mesh.Define(stage, "/World/Floor")floor.CreatePointsAttr([(-1, -1, 0), (1, -1, 0), (1, 1, 0), (-1, 1, 0)])floor.CreateFaceVertexCountsAttr([4])floor.CreateFaceVertexIndicesAttr([0, 1, 2, 3])UsdGeom.PrimvarsAPI(floor.GetPrim()).CreatePrimvar( "isMatteObject", Sdf.ValueTypeNames.Bool, UsdGeom.Tokens.constant).Set(True)floor_xf = floor.AddTransformOp()
cam = UsdGeom.Camera.Define(stage, "/World/Cam")APERTURE = 20.955focal = APERTURE / 2 / math.tan(math.radians(args.fov) / 2)cam.CreateFocalLengthAttr(focal)cam.CreateHorizontalApertureAttr(APERTURE)cam.CreateVerticalApertureAttr(APERTURE)cam_xf = cam.AddTransformOp()rp = rep.create.render_product(str(cam.GetPath()), (R, R))rgb = rep.AnnotatorRegistry.get_annotator("rgb")rgb.attach(rp)
PURPOSES = [UsdGeom.Tokens.default_, UsdGeom.Tokens.render]half = math.tan(math.radians(args.fov) / 2) * args.fill
def basis(up_axis, forward): """Stage up vector, and the asset's front as a horizontal unit vector.""" up = Gf.Vec3d(0, 0, 1) if up_axis == "Z" else Gf.Vec3d(0, 1, 0) f = Gf.Vec3d(*forward) if forward else (Gf.Vec3d(0, -1, 0) if up_axis == "Z" else Gf.Vec3d(0, 0, 1)) f = f - up * Gf.Dot(f, up) if f.GetLength() < 1e-6: f = Gf.Vec3d(0, -1, 0) if up_axis == "Z" else Gf.Vec3d(0, 0, 1) return up, f.GetNormalized()
def corners(rng): lo, hi = rng.GetMin(), rng.GetMax() return [Gf.Vec3d(x, y, z) for x in (lo[0], hi[0]) for y in (lo[1], hi[1]) for z in (lo[2], hi[2])]
for i, name in enumerate(todo, 1): usd = f"{args.assets_dir}/{name}/simready_usd/{name}.usd" if stage.GetPrimAtPath("/World/Asset"): stage.RemovePrim("/World/Asset") app.update() src = Usd.Stage.Open(usd, Usd.Stage.LoadNone) up_axis = UsdGeom.GetStageUpAxis(src) root = src.GetDefaultPrim() fwd_attr = root.GetAttribute("simready:assetFrame:forwardDirection") if root else None forward = fwd_attr.Get() if fwd_attr and fwd_attr.HasAuthoredValue() else None if forward is not None and root.IsA(UsdGeom.Xformable): # authored in the prim's local frame forward = UsdGeom.Xformable(root).GetLocalTransformation().TransformDir(Gf.Vec3d(*forward)) UsdGeom.SetStageUpAxis(stage, up_axis) up, front = basis(up_axis, forward)
asset = stage.DefinePrim("/World/Asset", "Xform") asset.GetReferences().AddReference(usd) for _ in range(10): app.update() rng = UsdGeom.BBoxCache(Usd.TimeCode.Default(), PURPOSES).ComputeWorldBound(asset).ComputeAlignedRange() if rng.IsEmpty(): print(f"THUMB_SKIP {name}: empty bounds", flush=True) continue centre = (rng.GetMin() + rng.GetMax()) / 2 size = max(rng.GetSize().GetLength(), 1e-3)
# view direction: front turned toward the right by the azimuth, raised by the elevation a, e = math.radians(args.azimuth), math.radians(args.elevation) right = Gf.Cross(front, up) horiz = front * math.cos(a) + right * math.sin(a) view = (horiz * math.cos(e) + up * math.sin(e)).GetNormalized()
# distance: smallest that keeps every bounding-box corner inside the frame pts = corners(rng)
def fits(d): eye = centre + view * d m = Gf.Matrix4d().SetLookAt(eye, centre, up) for p in pts: q = m.Transform(p) if -q[2] <= 1e-6 or max(abs(q[0]), abs(q[1])) / -q[2] > half: return False return True
lo_d, hi_d = size * 0.3, size * 20 for _ in range(40): mid = (lo_d + hi_d) / 2 lo_d, hi_d = (lo_d, mid) if fits(mid) else (mid, hi_d) dist = hi_d eye = centre + view * dist cam_xf.Set(Gf.Matrix4d().SetLookAt(eye, centre, up).GetInverse()) cam.CreateClippingRangeAttr(Gf.Vec2f(max(dist * 0.02, 1e-4), dist + size * 20))
# floor under the asset, big enough to catch the whole shadow base = rng.GetMin()[2] if up_axis == "Z" else rng.GetMin()[1] s = size * 8 if up_axis == "Z": floor_xf.Set(Gf.Matrix4d().SetScale(Gf.Vec3d(s, s, 1)) * Gf.Matrix4d().SetTranslate(Gf.Vec3d(centre[0], centre[1], base))) else: rot = Gf.Matrix4d().SetRotate(Gf.Rotation(Gf.Vec3d(1, 0, 0), -90)) floor_xf.Set(Gf.Matrix4d().SetScale(Gf.Vec3d(s, s, 1)) * rot * Gf.Matrix4d().SetTranslate(Gf.Vec3d(centre[0], base, centre[2])))
subframes = max(1, args.spp // 16) if args.renderer == "PathTracing" else 8 rep.orchestrator.step(rt_subframes=subframes) img = np.asarray(rgb.get_data()) if img.ndim != 3 or img.shape[2] < 4: print(f"THUMB_FAIL {name}: no image", flush=True) continue out = Image.fromarray(img[..., :4].astype(np.uint8), "RGBA") if args.size != R: out = out.resize((args.size, args.size), Image.LANCZOS) out.save(f"{args.out_dir}/{name}.webp", quality=90) print(f"THUMB_OK {name} {i}/{len(todo)}", flush=True)
rep.orchestrator.wait_until_complete()print("THUMBS DONE", flush=True)app.close()19921 unmodified lines1992219923199241992519926199272612 unmodified lines225402254122542225432254422545124 unmodified lines22670226712267222673226742267519921 unmodified lines"qcode": "Q268828","rigid_bodies": 2},"simready.hf.projectsim.simready-assets.fruit_bowl.2026.11.10_00": {"benchmark": {"passed": false,2612 unmodified lines"qcode": "Q136384053","rigid_bodies": 4},"simready.hf.projectsim.simready-assets.hand_crank_pencil_sharpener.2026.11.20_00": {"benchmark": {"passed": true,124 unmodified lines"qcode": "Q193811","rigid_bodies": 4},"simready.hf.projectsim.simready-assets.hand_exercise_gripper.2026.11.20_00": {"benchmark": {"passed": true,19921 unmodified lines19922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199502612 unmodified lines2256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597124 unmodified lines227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275619921 unmodified lines"qcode": "Q268828","rigid_bodies": 2},"simready.hf.projectsim.simready-assets.forearm_crutch.2026.11.24_00": {"category": "mobility aids","class": "crutch","date": "2026-11-13","extents": [0.24239132,0.14954609,1.1953459],"joints": [{"lower": -0.07500000298023224,"name": "height_adjustment","type": "slider","upper": 0.10000000149011612}],"license": "CC-BY-4.0","mass": 0.9784,"mounted": false,"qcode": "Q268828","rigid_bodies": 2},"simready.hf.projectsim.simready-assets.fruit_bowl.2026.11.10_00": {"benchmark": {"passed": false,2612 unmodified lines"qcode": "Q136384053","rigid_bodies": 4},"simready.hf.projectsim.simready-assets.hand_crank_ice_crusher.2026.11.24_00": {"category": "Kitchen equipment","class": "Hand-cranked ice crusher","date": "2026-11-14","extents": [0.37946638,0.23688273,0.41400003],"joints": [{"lower": null,"name": "crank_rotation","type": "hinge","upper": null},{"lower": null,"name": "grip_rotation","type": "hinge","upper": null}],"license": "CC-BY-4.0","mass": 10.968,"mounted": false,"qcode": "Q136384053","rigid_bodies": 4},"simready.hf.projectsim.simready-assets.hand_crank_pencil_sharpener.2026.11.20_00": {"benchmark": {"passed": true,124 unmodified lines"qcode": "Q193811","rigid_bodies": 4},"simready.hf.projectsim.simready-assets.hand_crank_pencil_sharpener.2026.11.24_00": {"category": "Stationery","class": "Pencil sharpener","date": "2026-11-14","extents": [0.1137771,0.14500003,0.17550002],"joints": [{"lower": null,"name": "crank_rotation","type": "hinge","upper": null},{"lower": null,"name": "grip_rotation","type": "hinge","upper": null}],"license": "CC-BY-4.0","mass": 1.1301,"mounted": false,"qcode": "Q193811","rigid_bodies": 4},"simready.hf.projectsim.simready-assets.hand_exercise_gripper.2026.11.20_00": {"benchmark": {"passed": true,
style.css+19-5
tools/build_catalog.py+6-2
tools/isaac_thumbs.pyAdded+212
tools/meta_cache.json+81