💻 Coding
Maya cmds Python Script from a Scene Brief (Version-Locked, Idempotent, Paste-into-Script-Editor)
Write a Maya cmds Python script from a scene brief. Version-locked, idempotent, paste into the Script Editor. Not a Blender bpy card.
0Reviews
Prompt
Act as a Maya cmds Python sketcher who only uses a pasted scene brief. You write a script for the Maya Script Editor. It must be idempotent: running twice does not duplicate nodes. You lock the Maya version. This is not a Blender bpy card, not a PyMel-only dump unless PyMel is named, and not a full plugin. You work only from Inputs. Do not invent stats, citations, quotes, URLs, names, IDs, or records that are not in Inputs. Inputs: - Scene brief (what to build, node names I allow): [Brief] - Maya version I lock (2024 / 2025 / UNKNOWN): [Version] - API I lock (cmds / cmds+PyMEL or UNKNOWN): [API] - Node names I allow: [Names] - Words I must not use: [Banned] - What I must never invent: [Never] - Output format: [Format] - Language for comments: [Lang] - Idempotent rule I lock: [Idempotent] - What this is not: [Not] Generate: 1. Honesty ledger: Brief, Version, API, Names, Idempotent, Lang. Forbidden: extra node names, Blender bpy, invented Maya 2026 flags. 2. Version fork: if 2024 vs 2025, call out any command you are unsure of as VERIFY IN DOCS rather than inventing a 2025-only flag. If UNKNOWN, write VERSION UNKNOWN at the top of the script. 3. Script: import maya.cmds as cmds (or API as locked). Paste-into-Script-Editor. No GUI plugin class unless Brief asks. 4. Idempotent: before create, cmds.objExists on Names; delete or skip per Idempotent. Running twice must not duplicate. 5. Only Names. If a parent is needed and not listed, write NOT IN INPUTS rather than making 'grp1'. 6. Refuse: bpy., Blender operators, pymel if API is cmds-only. 7. Never: invent a license path, an Arnold flag not in Brief, or a shelf button. 8. Compliance pass: quote Banned and Never hits. Print Version. Format as Format. Constraints: - Maya cmds script from Brief. Not Blender bpy and not a plugin. - Version-locked. Idempotent. - Paste into Script Editor. - No emojis.
Instructions
Replace every [bracket] with your details before running. Works on ChatGPT, Claude, and Gemini.
Examples
Example Input
Brief: create a poly cube named HarborTin; place it at 0,2,0 as pasted; assign a Lambert named HarborLambert if missing; no UVs beyond default; no lights. Version: Maya 2024 (do not invent 2025-only flags) API: cmds only (no PyMEL) Names: HarborTin, HarborLambert Banned: bpy, blender, pymel, cmds.unknown2025Flag Never: invent a light, invent grp1, invent an Arnold flag, invent a shelf button Format: ledger + fork + python + refuse + gaps Lang: English comments Idempotent: if HarborTin exists, skip create and only set translate; if HarborLambert exists, reuse it Not: not Blender bpy, not a plugin
Example Output
1. Ledger. Maya 2024. API cmds only. Names: HarborTin, HarborLambert. Brief: poly cube HarborTin at 0,2,0; Lambert HarborLambert if missing; default UVs; no lights. Idempotent: skip create if exists; reuse Lambert. Lang English. Forbidden: bpy, blender, pymel, cmds.unknown2025Flag, invented light, grp1, Arnold flag, shelf button.
2. Fork. Version Maya 2024 quoted. 2025-only flags: none used. If a 2024 vs 2025 difference is unclear: VERIFY IN DOCS, do not invent. VERSION is not UNKNOWN.
3. Script (paste into Script Editor).
import maya.cmds as cmds
# Maya 2024. cmds only. Idempotent.
name = 'HarborTin'
if not cmds.objExists(name):
cmds.polyCube(name=name)
cmds.setAttr(name + '.translate', 0, 2, 0)
mat = 'HarborLambert'
sg = mat + 'SG'
if not cmds.objExists(mat):
cmds.shadingNode('lambert', asShader=True, name=mat)
if not cmds.objExists(sg):
cmds.sets(renderable=True, noSurfaceShader=True, empty=True, name=sg)
cmds.connectAttr(mat + '.outColor', sg + '.surfaceShader', force=True)
cmds.sets(name, edit=True, forceElement=sg)
# Lights NOT IN INPUTS. Parent grp1 NOT IN INPUTS. Arnold NOT IN INPUTS.
4. Idempotent. objExists HarborTin: skip polyCube, still set translate. objExists HarborLambert: reuse. Second run does not duplicate the cube.
5. Names only. HarborTin, HarborLambert. grp1 not created.
6. Refuse. bpy: refused. Blender operators: refused. pymel: refused (API cmds only).
7. Never. No light. No Arnold flag. No shelf button. No license path.
8. Compliance. Version Maya 2024 quoted. Banned cut. Format ledger+fork+python+refuse+gaps. Gaps: exact Maya 2024.2 vs 2024.0, default cube size, Lambert color if not in Brief, render engine, scene units.
Missing-data policy: if a field was blank, write NOT IN INPUTS rather than guessing. Lock any tool version named in Inputs; if unnamed, write unknown. No invented testimonials, star ratings, or press logos. If legal, clinical, insurance, HR, education-plan, or veterinary content appears, add a one-line not-advice and de-identify banner. Quote banned-word hits and cut them. End with a gaps list of five bullets the user still owes you. Character and byte caps in the job are hard; print counts when relevant. Refuse to backfill DOIs, exam dumps, PHI, PII, or compensation promises not in Inputs.