Files
workinf_Blender_Wasm/web/probes/shot-depth.mjs
mes123456 63db6caf1f
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled
feat(web): studio worlds, camera-view/offscreen environment parity, material and undo coverage
Environment lighting:
- ship all eight desktop studiolights/world datasets (WBENV1 float32) and a
  shared loader used by both the main viewport and the offscreen worker
- add the N-panel "studio 环境" selector
- rotate the world background together with the environment
  (backgroundRotation/backgroundIntensity), so camera view and offscreen
  renders match the desktop Mapping-node behaviour

Verification (Chromium, OPFS, NOT_CLAIMED):
- environment lighting + 8 world pixel identity
- camera-view rotation correspondence (camera matrices, 207 samples)
- offscreen vs on-screen background parity after hiding geometry (1305 samples)
- metals case extended with material-field OPFS roundtrip
- material Principled edits and rename undo/redo
- eight studio worlds: pairwise frame differences + luminance rank correlation
- undo history depth capped at 64 steps and undo across OPFS save/reopen

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 09:27:47 +08:00

24 lines
1.4 KiB
JavaScript

import { createRequire } from 'node:module';
const WEB='/home/mes123456/workinf_Blender_Wasm/web';
const { chromium }=createRequire(WEB+'/package.json')('playwright');
const BASE='http://127.0.0.1:5184';
const args=['--no-sandbox','--use-gl=angle','--use-angle=gl','--ignore-gpu-blocklist'];
const browser=await chromium.launch({headless:false,args,executablePath:'/usr/bin/google-chrome'});
const page=await browser.newPage({viewport:{width:1400,height:900}});
await page.goto(BASE+'/?ui=web',{waitUntil:'domcontentloaded'});
await page.waitForTimeout(22000);
const canvas=page.locator('canvas.viewport-canvas').first();
await canvas.click({position:{x:420,y:320}}).catch(()=>{});
await page.waitForTimeout(900);
for(let i=0;i<5;i++){
const s=await page.evaluate(()=>document.querySelector('canvas.viewport-canvas')?.dataset.shadingMode);
if(s==='solid')break;
await page.locator('[aria-label="着色模式"]').click().catch(()=>{});
await page.waitForTimeout(900);
}
await page.evaluate(`(()=>{const el=document.querySelector('[aria-label="空腔"]');const s=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'checked').set;s.call(el,true);el.dispatchEvent(new Event('click',{bubbles:true}));el.dispatchEvent(new Event('change',{bubbles:true}));})()`);
await page.waitForTimeout(2500);
await canvas.screenshot({path:WEB+'/probes/out-depth.png'});
console.log('shot saved');
await browser.close();