💻 Coding

Houdini 20.5 hou Python Script, Version-Locked, Idempotent, Paste-into-Python-Source-Editor

Write a Houdini 20.5 hou Python script from a scene brief. Version-locked, idempotent, paste into the Python Source Editor. Not Maya cmds and not Blender bpy.

0.0
0Reviews
P
August 27, 2026

Prompt

Act as a Houdini hou Python sketcher who only uses a pasted scene brief. You write one script for Houdini 20.5 (or the locked version). The script is idempotent: running it twice does not duplicate nodes. It is meant to paste into the Python Source Editor. This is not Maya cmds, not Blender bpy, and not a full HDA publish.
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 nodes to create or set): [Brief]
- Houdini version I lock (20.5 / 20.0 / UNKNOWN): [Version]
- Node type names I allow: [Types]
- Node names I allow: [Names]
- Parameter names I allow: [Parms]
- Words I must not use: [Banned]
- What I must never invent: [Never]
- Output format: [Format]
- Language for comments: [Lang]
- Context I lock (Sop / Object / UNKNOWN): [Context]

Generate:
1. Honesty ledger: Brief, Version, Types, Names, Parms, Context, Lang. Forbidden: extra node types, Maya cmds, bpy, extra parms.
2. Version fork: if 20.5, use 20.5 hou. If 20.0, do not use 20.5-only APIs. If UNKNOWN, write VERSION UNKNOWN.
3. Script: import hou. Paste-into-Python-Source-Editor. Idempotent: if Names already exist, set parms instead of creating a second copy.
4. Nodes: only Types and Names. If a node is needed and not listed, write NOT IN INPUTS.
5. Refuse: maya.cmds, bpy.ops, hou.node('/obj') invent of extra children not in Names.
6. Comments: Lang. Each parm quoted from Parms.
7. Never: invent an HDA path, a farm job, or Houdini 21 API if Version is 20.5 or 20.0.
8. Compliance pass: cut Banned and Never. Print Version quoted or UNKNOWN. Format as Format.

Constraints:
- Houdini hou Python from Brief. Not Maya cmds and not Blender bpy.
- Idempotent. Paste into Python Source Editor.
- Only Types, Names, and Parms named in Inputs.
- No emojis.

Instructions

Replace every [bracket] with your details before running. Works on ChatGPT, Claude, and Gemini.

Examples

Example Input

Brief: in /obj create a geo node named harbor_strainer; inside it create a grid SOP named table_grid; set rows 2 as pasted; no shader; no camera.
Version: Houdini 20.5 (do not invent 21.0; 20.0 fork is not this lock)
Types: geo, grid as pasted
Names: harbor_strainer, table_grid
Parms: rows 2 as pasted. Other grid parms UNKNOWN.
Banned: maya.cmds, bpy.ops, mantra invent, 21.0 API
Never: invent a camera, invent a shader, invent extra SOPs, invent an HDA path
Format: ledger + fork + script + refuse + gaps
Lang: English comments
Context: Object / Sop as pasted

Example Output

1. Ledger. Brief: /obj geo harbor_strainer; inside, grid SOP table_grid; rows 2 as pasted. No shader. No camera. Version Houdini 20.5. Types: geo, grid. Names: harbor_strainer, table_grid. Parms: rows 2. Context Object/Sop. Lang English. Forbidden: maya.cmds, bpy.ops, mantra invent, 21.0 API, invented camera, invented shader, extra SOPs, invented HDA path.

2. Fork. Version 20.5 quoted. 21.0 API refused. If this were 20.0: same hou.createNode pattern; skip any 20.5-only viewport comments; that fork is NOT THIS LOCK. VERSION is not UNKNOWN.

3. Script (paste into Python Source Editor). Idempotent: reuse Names if present.
import hou  # Houdini 20.5 as pasted
obj = hou.node('/obj')
geo = obj.node('harbor_strainer')
if geo is None:
    geo = obj.createNode('geo', 'harbor_strainer')  # type geo as pasted
grid = geo.node('table_grid')
if grid is None:
    grid = geo.createNode('grid', 'table_grid')  # type grid as pasted
if grid.parm('rows') is not None:
    grid.parm('rows').set(2)  # rows 2 as pasted
else:
    # parm name rows NOT found: do not invent cols or sizex
    pass
# shader NOT IN INPUTS. camera NOT IN INPUTS. extra SOPs NOT IN INPUTS.

4. Nodes. harbor_strainer (geo). table_grid (grid). No extra children.

5. Refuse. maya.cmds: refused. bpy.ops: refused. Extra /obj child: refused.

6. Comments. English. Parm rows quoted. Other grid parms UNKNOWN: not set.

7. Never. No HDA path. No 21.0 API. No camera. No shader.

8. Compliance. Version 20.5 quoted. Idempotent if/None guards present. Format ledger+fork+script+refuse+gaps. Gaps: cols parm, display flag, network box, parent other than /obj, hip file name.

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.

Reviews (0)

Please login to leave a review.
Loading reviews...