Mixamo-Animations-Characters / scripts /mixamo_console_download.js
Linzhan's picture
Add files using upload-large-folder tool
12b5ac7 verified
Raw
History Blame Contribute Delete
3.25 kB
/* ============================================================
Mixamo page downloader — paste into YOUR OWN Chrome console.
(Downloads only persist in a normal browser tab, not automation.)
SETUP:
1. chrome://settings/downloads -> turn OFF "Ask where to save
each file before downloading" (else 10 Save-As prompts).
2. Go to: https://www.mixamo.com/#/?page=52&type=Motion%2CMotionPack
Wait for the character + grid to finish loading.
3. Open console: Cmd+Option+J (Mac). Paste this whole file, Enter.
4. First download triggers a "Allow multiple downloads?" bar -> Allow.
Files land in your Downloads folder named "<Animation Name>.fbx".
============================================================ */
(async () => {
const MAX = 10; // how many animations to grab (0 = whole page)
const SKIN = false; // false = animation only (no character mesh)
const sleep = ms => new Promise(r => setTimeout(r, ms));
const $ = (s, r=document) => r.querySelector(s);
const $$ = (s, r=document) => [...r.querySelectorAll(s)];
const products = $$('.product');
if (!products.length) return console.error('No .product tiles — is the grid loaded?');
const n = MAX ? Math.min(MAX, products.length) : products.length;
console.log(`Downloading ${n} of ${products.length} animations…`);
const waitFor = async (fn, tries=60, gap=500) => {
for (let i=0;i<tries;i++){ const v=fn(); if(v) return v; await sleep(gap); } return null;
};
for (let i = 0; i < n; i++) {
const name = (products[i].querySelector('.product-name,.text-center')||{}).textContent?.trim() || `#${i}`;
products[i].click(); // load anim onto character
// wait for the main Download button to be ready
const dl = await waitFor(() => $$('.btn-block.btn.btn-primary').find(b => /download/i.test(b.textContent)));
if (!dl) { console.warn(`[${i}] ${name}: no Download button, skipping`); continue; }
dl.click(); // open the format modal
// modal ready when a second .btn-primary (the confirm) exists
const confirm = await waitFor(() => { const b=$$('.modal .btn-primary, .btn.btn-primary'); return b.length>1 ? b[b.length-1] : null; });
if (!confirm) { console.warn(`[${i}] ${name}: no modal, skipping`); continue; }
// set Skin = Without Skin
const skinSel = $$('select').find(s => [...s.options].some(o => /skin/i.test(o.textContent)));
if (skinSel) {
const want = [...skinSel.options].find(o => (SKIN ? /with skin/i : /without/i).test(o.textContent));
if (want && skinSel.value !== want.value) {
skinSel.value = want.value;
skinSel.dispatchEvent(new Event('change', {bubbles:true}));
await sleep(300);
}
}
confirm.click(); // trigger the download
console.log(`[${i+1}/${n}] ${name}`);
// wait for the progress bar to appear then clear
await waitFor(() => $('.progress-bar'), 8, 250);
await waitFor(() => !$('.progress-bar'), 60, 500);
await sleep(1200); // breathing room between files
}
console.log('DONE. Check your Downloads folder.');
})();