Rule
0 installs · 0 said it worked
Rules for writing safe, well-structured Blender Python add-ons
Cursor rules guiding an AI assistant to build Blender Python add-ons with proper registration, operators, panels, properties, safe scene handling, and testing.
People use this for
- blender python addon cursor rules
- blender add-on operator panel template
- blender addon registration unregister best practices
- write blender python addon with ai
- blender python plugin structure guidelines for ai assistant
- Name
rules-for-writing-safe-well-structured-blender-python-add-ons- Works with
- Cursor
- License
- CC0(as observed at the source)
- Version
- v1 · updated Nov 29, 2026
Imported on Nov 29, 2026 from github.com . License observed at the source on Nov 29, 2026: CC0.
Are you the author?Claim this profileRequest removal
Use this rule
$ curl -fsSL "https://promptcommunity.dev/api/v1/posts/rules-for-writing-safe-well-structured-blender-python-add-ons-nms3/export/mdc" -o .cursor/rules/rules-for-writing-safe-well-structured-blender-python-add-ons.mdcThen open a new session; Cursor picks it up from .cursor/rules/.
Manual install
Save rules-for-writing-safe-well-structured-blender-python-add-ons.mdc as .cursor/rules/rules-for-writing-safe-well-structured-blender-python-add-ons.mdc for this project or ~/.cursor/rules/rules-for-writing-safe-well-structured-blender-python-add-ons.mdc for every project, then start a new session.
Rule
description: Blender Python add-on rules for operators, panels, properties, registration, testing, and API-safe scripting globs: ["**/*.py", "blender_manifest.toml", "init.py"] alwaysApply: false
Blender Python Add-on Rules
Add-on Structure
- Keep add-on entry points in
__init__.pywith clearregister()andunregister()functions. - Group operators, panels, properties, preferences, and utilities into separate modules for non-trivial add-ons.
- Use
bl_infoorblender_manifest.tomlaccording to the Blender version and packaging target. - Keep UI labels concise and user-facing text translatable where appropriate.
API Usage
- Use
bpy.types.Operatorfor actions,bpy.types.Panelfor UI, andbpy.types.PropertyGroupfor grouped settings. - Define
bl_idname,bl_label, andbl_optionsexplicitly. - Validate context in
poll()before enabling operators. - Use
invoke()for interactive setup andexecute()for the actual operation. - Return
{'FINISHED'}or{'CANCELLED'}consistently. - Use dependency graph updates and evaluated objects when reading final scene state.
Data and Properties
- Register custom properties through
PropertyGroupclasses instead of loose global state. - Store add-on preferences in
AddonPreferences. - Use
PointerProperty,CollectionProperty, and typed properties with names and descriptions. - Clean up custom properties and handlers during
unregister().
Safety and Performance
- Do not run destructive scene operations without explicit user action.
- Avoid blocking UI work in modal operators; use timers or modal state machines for long operations.
- Batch mesh changes and use
bmeshwhen editing mesh data programmatically. - Avoid repeatedly scanning large scenes in draw methods.
- Keep file paths configurable and use Blender path utilities.
Testing and Debugging
- Test scripts in a clean Blender profile and a representative production scene.
- Add smoke tests that import the add-on, register it, run core operators, and unregister cleanly.
- Log actionable messages with
self.report()for user-facing operator feedback. - Keep version-specific API differences isolated behind helper functions.
Common Mistakes
- Do not forget to unregister classes, handlers, timers, and keymaps.
- Do not mutate Blender data from panel
draw()methods. - Do not assume an active object, selected object, or mode without checking context.
- Do not hardcode absolute asset paths.
No result recorded yet. Added it? File a Tried-it report so the next person knows how it went in your editor.
Tried it
Reports from people who added this rule to their editor. They roll up into the badges above.
No one has filed a report yet. Try the prompt and be the first.
Related rules
- Cursor rules for writing and testing Xian smart contracts in Python
A Cursor rules file that guides the assistant through writing Xian blockchain smart contracts in Python, covering naming, state, context variables, events, error handling, and unittest-based testing with security checks.
Coding · @patrickjs
- Quality engineering agent role for risk-based test strategy and CI quality gates
A senior quality engineering role prompt that guides an assistant through risk-based test strategy, test automation architecture, CI/CD quality gates, edge-case analysis, and defect management, writing results to a TODO checklist file.
Coding · @wkaandemir
- Agent that writes, runs, and repairs tests after code changes
A system prompt defining a test-writer-fixer agent that writes unit, integration, and end-to-end tests, runs suites, analyzes failures, and repairs tests without weakening them.
Coding · @ersinyilmaz
- Security guardrails that keep an AI email assistant from being hijacked by malicious messages
A full system prompt giving an AI assistant that reads or manages email a security mindset: treat email as untrusted data, require approval for outward actions, avoid leaking private data, and report phishing and injection attempts calmly.
Productivity · @thanos0000
- Nginx config security review with fixes and checker script
Agent skill that reviews nginx configs for TLS, header, alias traversal, admin exposure and rate-limit problems, runs a stdlib checker, and returns a minimal route-preserving fixed config with reload and curl test steps.
Coding · @f
License: CC0v1 · published Nov 29, 2026
Comments
No comments yet. If you tried this prompt, say how it went.