// Play → снимки с заданных точек камеры → стоп. node tools/mcp/shots.js "||" ... // Например: node tools/mcp/shots.js assets/reference/lobby_wide "0,140,0|0,0,1|70" "0,55,95|0,2,0|60" // Персонаж уносится далеко в сторону, чтобы не мешал кадру. Пишет _1.jpg, _2.jpg, … const fs = require('fs'), path = require('path'), os = require('os'), { execFileSync } = require('child_process'); const [prefix, ...views] = process.argv.slice(2); const cam = (eye, target, fov) => `local RunService = game:GetService("RunService") local eye, target = Vector3.new(${eye}), Vector3.new(${target}) pcall(function() RunService:UnbindFromRenderStep("ToolShot") end) RunService:BindToRenderStep("ToolShot", Enum.RenderPriority.Last.Value, function() workspace.CurrentCamera.CFrame = CFrame.lookAt(eye, target) workspace.CurrentCamera.FieldOfView = ${fov || 60} end) return "cam"`; const steps = [ { tool: 'start_stop_play', args: { is_start: true }, waitAfter: 20000 }, { tool: 'execute_luau', args: { datamodel_type: 'Server', code: 'local c = game.Players:GetPlayers()[1].Character c:PivotTo(CFrame.new(0, 3, 2000)) c.HumanoidRootPart.Anchored = true return 1' }, waitAfter: 1500 }, ]; for (const v of views) { const [eye, target, fov] = v.split('|'); steps.push({ tool: 'execute_luau', args: { datamodel_type: 'Client', code: cam(eye, target, fov) }, waitAfter: 3000 }); steps.push({ tool: 'screen_capture', args: { capture_id: 'Shot' } }); } steps.push({ tool: 'get_console_output' }, { tool: 'start_stop_play', args: { is_start: false } }); const tmp = path.join(os.tmpdir(), 'fishing-shots-' + process.pid + '.json'); fs.writeFileSync(tmp, JSON.stringify(steps)); const res = execFileSync('node', [path.join(__dirname, 'run.js'), tmp], { encoding: 'utf8', maxBuffer: 1 << 26 }); fs.unlinkSync(tmp); let n = 0; for (const m of res.matchAll(/IMAGE (.+\.jpe?g)/g)) { n += 1; fs.renameSync(m[1].trim(), `${prefix}_${n}.jpg`); } console.log(res.split('\n').filter(l => !/^IMAGE|MaterialVariant|TexturePack|LowPolyFlat|not authorized|81504106|203785492/.test(l)).join('\n')); console.log(`saved ${n} shots as ${prefix}_N.jpg`);