3dsmax-scripting
БесплатноБез исполняемых скриптовНе проверенCovers scripting Autodesk 3ds Max, the 3D modeling and rendering application, with MAXScript and Python (pymxs): scene manipulation, object creation, material…
Об этом скилле
3ds Max Scripting
Overview
3ds Max has two scripting interfaces. MAXScript is the built-in language; its reference (the MAXScript Help) documents the classes, properties and functions used below. Python talks to the same runtime through the pymxs module, so the classes and functions in the MAXScript reference are available as pymxs.runtime.<name> (max ... commands are not; run them with pymxs.runtime.execute("max quick render")). Python 2 and the MaxPlus API were removed in 3ds Max 2022.
| 3ds Max | Python | Qt binding |
|---|---|---|
| 2022 | 3.7 | PySide2 5.15 |
| 2023 | 3.9 | PySide2 |
| 2024 | 3.10 | PySide2 |
| 2025, 2026 | 3.11 | PySide6 6.5 |
| 2027 | 3.13 | PySide6 6.8 |
Instructions
Run a script
- Listener (F11): type an expression and press Enter; switch the prompt to Python by choosing the Python radio button (there, Ctrl+Enter runs multi-line input).
- MAXScript Editor: Tools > Evaluate All (Ctrl+E), or Shift+Enter for the selected lines. Set Language > Python for
.pyfiles. - From MAXScript:
python.ExecuteFile "D:/tools/scene_audit.py". - Headless:
3dsmaxbatch.exe(see Batch Operations) runs.msand.pyfiles without the UI.
Objects and Scene
-- Parentheses create a local scope; undeclared variables at the top level are globals
(
local b = Box width:100 height:50 length:100 pos:[0, 0, 0] name:"Plinth"
local s = Sphere radius:25 pos:[200, 0, 25] segs:32
local p = Plane width:500 length:500 pos:[0, 0, 0]
-- Access objects
local obj = getNodeByName "Plinth" -- by name; $Plinth is the path-name form
-- objects, geometry, lights, cameras and selection are live scene collections
-- Transform
obj.pos = [100, 200, 0]
obj.rotation = eulerAngles 0 0 45 -- degrees
obj.scale = [2, 2, 2]
-- Properties
obj.wirecolor = color 255 0 0
obj.renderable = true
obj.isHidden = false
for o in objects where classOf o == Box do
format "Box: % at %\n" o.name o.pos
)
Materials
Physical Material is the default material type since 3ds Max 2021.
(
local wood = PhysicalMaterial name:"Oak Floor"
wood.base_color = color 180 140 100
wood.roughness = 0.45
wood.base_color_map = BitmapTexture filename:"D:/textures/oak_diffuse.jpg"
wood.bump_map = BitmapTexture filename:"D:/textures/oak_bump.jpg"
wood.bump_map_amt = 0.3
$Plinth.material = wood
local glass = PhysicalMaterial name:"Glass" transparency:1.0 roughness:0.02
)
Other properties follow the same pattern: metalness, roughness_map, metalness_map, refl_color_map, transparency_map, displacement_map. Emission is emission (weight) with emit_color.
Cameras and Lights
(
-- Physical camera aimed at a target object
local cam = Physical_Camera name:"Cam_LivingRoom" pos:[500, -300, 150] \
target:(TargetObject pos:[-200, 500, 120])
cam.specify_fov = true
cam.fov = 65.0
cam.f_number = 8.0
cam.exposure_gain_type = 0 -- 0 = manual ISO, 1 = target EV
cam.iso = 400
cam.white_balance_type = 1 -- use the Kelvin value below
cam.white_balance_kelvin = 5500
-- Sun for daylight (pairs with the Physical Sun & Sky environment map)
local sun = Sun_Positioner name:"Sun"
sun.mode = 0 -- 0 manual, 1 date/time/location, 2 weather file
-- Photometric light: ceiling downlight
local spot = Free_Light name:"Downlight_01" pos:[150, 300, 270]
spot.intensityType = 1 -- unit shown in the UI: 0 = lm, 1 = cd, 2 = lx at
spot.intensity = 800 -- always candelas, whatever intensityType says
spot.useKelvin = true
spot.kelvin = 3000
spot.castShadows = true
)
File I/O
-- Append a line to a log file ("a" creates the file when it is missing)
fn writeLog path msg = (
local f = openFile path mode:"a"
if f != undefined do (
format "% | %\n" localTime msg to:f
close f
)
)
-- Read a text file line by line
fn readLines path = (
local f = openFile path
local result = #()
if f != undefined do (
while not eof f do append result (readLine f)
close f
)
result
)
-- Scene files
loadMaxFile "D:/projects/harbor-loft/scenes/kitchen.max" quiet:true -- returns false on failure
saveMaxFile "D:/projects/harbor-loft/scenes/kitchen_v02.max"
importFile "D:/models/furniture.fbx" #noPrompt
exportFile "D:/export/kitchen.fbx" #noPrompt selectedOnly:true
For JSON or CSV, use Python's json and csv modules through pymxs instead of parsing in MAXScript.
Python (pymxs)
"""scene_audit.py — report heavy meshes, objects without a material and missing textures."""
import os
from pymxs import runtime as rt
def audit_scene(max_faces=500_000):
issues = []
for obj in rt.geometry:
faces = rt.g
Установить 3dsmax-scripting в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл 3dsmax-scripting?
Covers scripting Autodesk 3ds Max, the 3D modeling and rendering application, with MAXScript and Python (pymxs): scene manipulation, object creation, material assignment, camera and light setup, batch operations, and file I/O. Use when tasks involve automating repetitive 3ds Max workflows, batch processing scenes, running scripts headless with 3dsmaxbatch, creating custom tools, or scripting scene setup for archviz, product visualization, or VFX.
Как установить скилл 3dsmax-scripting?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл 3dsmax-scripting запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic