volodymyrsvirhun commited on
Commit
96bb92c
·
verified ·
1 Parent(s): 8c574b0

rail: curl download flow, new-tab links

Browse files
Files changed (1) hide show
  1. index.html +7 -7
index.html CHANGED
@@ -77,9 +77,9 @@
77
  </div>
78
  <div id="joints"></div>
79
  <h2 style="margin-top:14px">Take it home</h2>
80
- <div class="meta">Same asset, full 4K, real physics — Blender one paste:</div>
81
  <pre id="oneliner"></pre>
82
- <button class="copy" id="copy">Copy one-liner</button>
83
  </aside>
84
  </main>
85
  <script type="importmap">
@@ -239,11 +239,11 @@ async function loadItem(cls, item) {
239
  `${item.mass_kg.toFixed(1)} kg · ${item.tris} tris · ` +
240
  `${item.joints.length} joints`;
241
  document.getElementById("oneliner").textContent =
242
- `blender --python-expr "import bpy,urllib.request,tempfile,os; ` +
243
- `p=os.path.join(tempfile.gettempdir(),'kaedim_asset.blend'); ` +
244
- `urllib.request.urlretrieve('${HFDS}/${cls.dataset}/resolve/main/` +
245
- `${cls.items_dir}/${item.id}/${item.id}.blend',p); ` +
246
- `bpy.ops.wm.open_mainfile(filepath=p)"`;
247
  const gltf = await loader.loadAsync(dsUrl(cls.dataset, item.glb));
248
  if (gen !== loadGen) return; // user already switched away — drop this load
249
  model = new THREE.Group();
 
77
  </div>
78
  <div id="joints"></div>
79
  <h2 style="margin-top:14px">Take it home</h2>
80
+ <div class="meta">Same asset, full 4K, real physics:</div>
81
  <pre id="oneliner"></pre>
82
+ <button class="copy" id="copy">Copy commands</button>
83
  </aside>
84
  </main>
85
  <script type="importmap">
 
239
  `${item.mass_kg.toFixed(1)} kg · ${item.tris} tris · ` +
240
  `${item.joints.length} joints`;
241
  document.getElementById("oneliner").textContent =
242
+ `mkdir -p "$PWD/projectsim-assets"\ncd "$PWD/projectsim-assets"\n\n` +
243
+ `curl --fail --location --progress-bar \\\n` +
244
+ ` "${HFDS}/${cls.dataset}/resolve/main/${cls.items_dir}/${item.id}/` +
245
+ `${item.id}.blend?download=true" \\\n --output ${item.id}.blend\n\n` +
246
+ `open -a Blender ${item.id}.blend`;
247
  const gltf = await loader.loadAsync(dsUrl(cls.dataset, item.glb));
248
  if (gen !== loadGen) return; // user already switched away — drop this load
249
  model = new THREE.Group();