协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
3dsmax-mcp【开发与工程】Tool choices, workflows, and MAXScript pitfalls for controlling 3ds Max via MCP.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Each tool's description documents its parameters, modes and limits. This guide covers what no single tool can: routing, tool choice, cross-tool workflows, safety rules and MAXScript pitfalls.
query_scene and create_object are advertised directly; call them by name.list_toolsets, describe_toolset and call_tool are advertised, never call an operational name as a top-level tool. Pick a capability with list_toolsets, load only that group with describe_toolset, then invoke it through call_tool(name=..., arguments=...). If the exact tool and arguments are already known, call_tool can dispatch directly.get_bridge_status or get_session_context as a preamble.query_scene(action="delta"), re-inspection or a capture.list_max_instances, select_max_instance(pid), get_selected_max_instance and release_max_instance. MCP_MAX_PIPE or MCP_MAX_PID pins the startup target (the pipe takes precedence); release also clears it.query_scene (overview/filter/class/property/selection/delta), get_hierarchy, get_instances, get_dependencies, walk_references. resolve_node_refs gives canonical handle/name/path identity. scene_qa checks naming, transforms, hierarchy and timeline only; it never judges meshes or visuals, and its fix repairs naming only (preview with dry_run=true unless approved).inspect_object, inspect_properties, analyze_node_orientation (before rig, vehicle or camera transforms). For unfamiliar plugin APIs: introspect_class, introspect_instance, discover_plugin_classes, map_class_relationships, inspect_plugin_class. Arnold materials such as ai_standard_surface may be missing from class discovery; use inspect_plugin_class or introspect_osl.manage_layers, manage_groups, manage_selection_sets) and viewport tools. Use scene_patch for a preflighted batch of renames, relative transforms, flags or parenting committed as one undo step.execute_maxscript, or execute_python (pymxs, needs safe mode off), only when no dedicated tool exists.manage_scene (hold/fetch/reset/save/info). inspect_max_file, search_max_files, merge_from_file and batch_file_info work without loading a scene.watch_scene follows the user's actions.name or path, and refresh after a reset or load.expected_scene_seq from resolve_node_refs to scene_patch when stale targeting matters; selection changes do not invalidate it.expected_mesh, expected_view, curve_token, expected_style, expected_controller, plugin schema/state tokens, expected_dialog. A refused token means inspect again, never bypass the guard.inspect_mesh or an AGENT VIEWPORT capture → pick_component with the capture's view_token as expected_view → mesh_edit(expected_mesh=...) → verify with inspect_mesh, geometry_qa or a capture.create_mesh for computed vertex/face arrays; loft_mesh for parameterized section lofts; curve_model, inspect_curve and edit_curve for curve-driven forms (read curve-construction.md first); draw_spline plus Lathe/Extrude/Bevel_Profile/Sweep through add_modifier, refined with spline knot edits or edit_vertices conform.convert=true, collapse_modifier_stack) happens only when requested.boolean_operation: prefer inline cutters (named, atomic, no scene litter). Non-live operands are consumed, so never consume a node other tools still reference by name.contact_check and judge reported depth against the design intent.assign_material, create_material_from_textures, smart_import, palette_laydown. They default to OpenPBR; pass material_class for another renderer. Share an existing material with assign_material(names=[...], source_name=...).set_material_property, set_material_properties, set_sub_material, create_texture_map, set_texture_map_properties. Switch pipelines with create_shell_material, replace_material and batch_replace_materials.get_material_slots (prefer slot_scope="map"), get_materials, and material_roles (follow next_offset; check complete and truncated).write_osl_shader, then introspect_osl before wiring. The shader name must match shader_name; OSLMap lowercases parameter names.material_class is the material's own class name: PhysicalMaterial, not Physical (the camera).lighting_capabilities → create_lights → inspect_lights → edit_lights. Never infer integer enum meanings. RGB is linear in the rendering color space, Kelvin is explicit, and EXR/HDR inputs get no extra gamma.inspect_plugin_class or inspect_plugin_instance with schema_version=2, then plugin_patch with the returned schema and state tokens. Shared or animated resources need deliberate handling.agent_viewport(action="open") before inspection captures. Navigation and captures then default to it and never redirect into the user's view; source="active" targets the user's view explicitly. Release and reopen after a scene load.set_viewport aims by eye and target without creating a camera. Use capture_viewport, capture_multi_view or capture_screen(enabled=True) for stills and frame-buffer crops.agent_viewport(action="render")) and production renders (render_automations) only on request. A capture never certifies convergence or finished denoising.script_controller inspect → validate → apply with expected_controller. A controller that returns zero at every frame has failed; inspect it with sample_frames.assign_controller, inspect_controller, inspect_track_view, set_controller_props, add_controller_target. Pass list_wireable_params paths, including their [#Parameters] levels, to wire_params unchanged; get_wired_params and unwire_params read and remove wiring.keyframe_tracks: timeline reads or sets frame rate, current frame and range. list inspects keys; parent numKeys is often 0 because keys live on Bezier Float sub-controllers. Retimes need time/times or both from_time and to_time. bake and resample skip list, constraint, expression, script and motion-capture controllers. Use loop, or match with order=hierarchy, for parented rigs. tracks takes exact tokens only: all, position/pos, rotation/rot, scale/scl, transform/tm.keyframe_tracks; transform_object rewrites keys at the current frame.get_railclone_style → edit the XML → set_railclone_style(expected_style=...) → verify with get_railclone_output. Read railclone.md first.scatter_forest_pack, then hide the source meshes.cosmos_search → cosmos_download → cosmos_import. Repeating a completed import adds another instance.discover_plugin_surface, get_plugin_manifest, and resource://3dsmax-mcp/plugins/{name}/manifest|guide|recipes|gotchas.execute_maxscript and tool scripts run in Max's quiet mode: prompts such as queryBox, overwrite or missing-file warnings silently take their default answer. Pass execute_maxscript(quiet=False) when the user wants to be asked.BLOCKED_BY_DIALOG with its title, text and buttons. The call keeps running inside Max: never repeat it. Other replies warn while any dialog is open.max_dialogs. respond presses a button by label or index and returns the interrupted call's result.MAX_DIALOG_ERROR. Callback errors appear just after the triggering call returns; the next reply warns, so read the error and acknowledge it.ToolEnvelope dict (ok/result/error/hint), not a JSON string. Tool-authored hints win over automatic ones; hint.suggested_tools may list alternatives.error, code or status=error|failed, never by message alone.USER_BUSY: Max has an open undo operation and the write was rejected before any change. Continue read-only and retry after it finishes; never bypass it with MAXScript.Only when changing the bridge's native C++ handlers; ordinary sessions never need it. reload_native_core (full and progressive profiles) swaps a rebuilt core into the running Max.
reload_native_core(action="status") tells you whether reload applies: layout="hot" reloads. static, the shipped layout, cannot; a native change there applies only after the rebuilt plugin is installed and Max restarts.reload_native_core(action="reload"), check that build changed (a warning flags an unchanged one), then verify the changed behavior through its real tool, not just the status.CORE_STATIC: static layout. Do not retry.CORE_BUSY (retryable; with wait_ms up to 20000 the tool already retried): native calls were still running (including one waiting on a dialog), Max's main thread was busy (a render), or another reload was running. Let long calls finish or answer the dialog with max_dialogs, then reload, or raise wait_ms (up to 600000).CORE_LOAD_FAILED: the DLL is missing, is not a core build, or would not load or initialize. Fix the cause and rebuild; never retry unchanged.CORE_VERSION_MISMATCH: the core does not match the running shell's interface, SDK, compiler or build configuration. Rebuild Release from the same tree; a change to the shell itself cannot be reloaded.build, reloads and last_error from status.watch_scene and drops its events; start it again if needed. query_scene(action="delta") positions, dialogs, the agent viewport, armed render jobs and undo history survive. Calls that arrive mid-swap get a retryable CORE_BUSY.code is JSON-unescaped once before MAXScript parses it. A BAD_PARAM parse error without a line number almost always means escaping corruption, not bad logic:
"C:/assets/tex/") or derive paths at runtime; \" and \U break literals.\n or \t inside string literals.;.try (...) catch (getCurrentException() as string)) and adding pieces back.#noPrompt to importFile, e.g. importFile @"C:/assets/model.fbx" #noPrompt using:FBXIMP; configure importer options first.Box width:10, not Box() width:10. Box width is X, length is Y, height is Z.try (...) catch (ex) (ex).Noise is a texture map; Noisemodifier is the modifier.getDir #temp is Max's temp folder, not the OS temp folder.snapshotAsMesh returns a world-space TriMesh: read vertices in coordsys world without reapplying node.objectTransform, then delete it. Base-cage poly vertices still need the object transform.[#Z Position] becomes [#z_position].getClassInstances Material is invalid because Material is not a MAXClass; use sceneMaterials.getHandleByAnim returns values like 12345P; quote them when building JSON.$Box001.modifiers[#Unwrap_UVW].edit(), not only the OpenUnwrapUI macro.Read the relevant file before writing unfamiliar MAXScript:
| File | Covers |
|---|---|
maxscript-core-syntax.md | Variables, scope, types, operators, control flow |
maxscript-common-patterns.md | Undo/animate blocks, callbacks, file I/O |
maxscript-3dsmax-objects.md | Nodes, transforms, hierarchy, properties |
maxscript-mesh-poly-ops.md | Sub-object mesh/poly ops |
maxscript-materials-textures.md | Materials, texmaps, PBR |
maxscript-animation-controllers.md | Controllers, constraints, wire params |
maxscript-rendering-cameras.md | Render settings, cameras, environment |
maxscript-splines-shapes.md | Splines and shapes |
maxscript-scripted-plugins.md | Scripted geometry, modifiers, utilities |
maxscript-ui-rollouts.md | Rollout UIs and dialogs |