Skip to content

feat: Add MAXScript AI Agent for Autodesk 3ds Max - #1

Open
qq676628 wants to merge 1 commit into
masterfrom
feature/maxscript-ai-agent
Open

feat: Add MAXScript AI Agent for Autodesk 3ds Max#1
qq676628 wants to merge 1 commit into
masterfrom
feature/maxscript-ai-agent

Conversation

@qq676628

@qq676628 qq676628 commented Jul 3, 2025

Copy link
Copy Markdown
Owner

🎯 Overview

This PR introduces a comprehensive MAXScript AI Agent specialized in writing MAXScript code for Autodesk 3ds Max versions 2018-2024. The agent provides intelligent code generation, debugging, and best practices for professional 3ds Max workflows.

✨ Key Features

🤖 AI-Powered Code Generation

  • Functions: Reusable MAXScript functions with proper syntax
  • Rollouts: UI dialogs and panels with controls and event handlers
  • Macros: Toolbar buttons and menu items
  • Structs: Object-oriented data structures
  • Utilities: Complete utility scripts with optional UI
  • Batch Scripts: File processing and automation scripts

🧠 Intelligent Analysis

  • Syntax Validation: Detects common MAXScript errors
  • Code Debugging: Intelligent error analysis and fixes
  • Best Practices: Enforces MAXScript coding standards
  • Version Support: 3ds Max 2018-2024 compatibility
  • Error Handling: Robust try/catch block generation

📚 Comprehensive Knowledge Base

  • 50+ Built-in Functions with examples and syntax
  • Complete Object Hierarchy for all 3ds Max object types
  • Common Patterns and reusable code snippets
  • Version Features for version-specific functionality
  • Intelligent Search for function discovery

🛠️ Template System

  • Modeling: Object creation, distribution, randomization
  • Animation: Keyframes, paths, camera orbits, effects
  • UI: Rollouts, dialogs, object pickers
  • Utility: Batch operations, scene cleanup, export tools
  • Workflow: File processing, auto-backup systems
  • Rendering: Batch rendering, camera sequences

💻 User Interfaces

  • Command-Line Interface with multiple commands
  • Interactive Mode for real-time script generation
  • Python API for programmatic access

📁 Files Added

File Description
maxscript_agent.py Main AI agent implementation
maxscript_knowledge.py Knowledge base with functions and patterns
maxscript_templates.py Pre-built code templates
main.py Command-line interface
examples/modeling_examples.ms Comprehensive modeling examples
examples/animation_examples.ms Animation and keyframe examples
README_MAXSCRIPT_AGENT.md Complete documentation
test_agent.py Test suite and demonstrations
demo.py Complete feature demonstration
requirements.txt Python dependencies
.gitignore Git ignore patterns

🚀 Usage Examples

Generate MAXScript Code

# Generate a function
python main.py generate "Create 10 boxes in a row" --type function

# Generate a UI rollout
python main.py generate "Object selection tool" --type rollout --ui

# Generate a macro
python main.py generate "Hide selected objects" --type macro

Access Templates

# List modeling templates
python main.py template modeling

# Get specific template
python main.py template modeling create_primitive_array

Validate and Debug

# Validate syntax
python main.py validate my_script.ms

# Debug with error message
python main.py debug my_script.ms --error "undefined variable"

Interactive Mode

python main.py interactive

🎯 Use Cases

The agent handles requests ranging from simple one-line commands to complex multi-function scripts:

  • Automation scripts for repetitive modeling tasks
  • Custom tools and utilities for 3ds Max workflow
  • Scene setup and batch processing scripts
  • Animation and rigging automation
  • Import/export utilities
  • Custom UI creation with rollouts and dialogs

✅ Testing

The agent has been thoroughly tested with:

  • ✅ Function generation for various operations
  • ✅ UI rollout creation with proper event handlers
  • ✅ Syntax validation and error detection
  • ✅ Template retrieval and code generation
  • ✅ Knowledge base search functionality
  • ✅ Interactive mode operations
  • ✅ Best practices enforcement

📖 Documentation

Complete documentation is provided in README_MAXSCRIPT_AGENT.md including:

  • Installation and setup instructions
  • Comprehensive usage examples
  • API reference
  • Best practices guide
  • Template library documentation

🔧 Technical Details

  • Language: Python 3.7+
  • Dependencies: None (uses only Python standard library)
  • Architecture: Modular design with separate components
  • Compatibility: 3ds Max 2018-2024
  • Code Quality: Comprehensive error handling and validation

🎉 Ready for Production

The MAXScript AI Agent is fully functional and ready to assist with professional 3ds Max scripting needs. It provides complete, runnable MAXScript code with proper syntax, error handling, and comprehensive documentation.


Note: This agent generates MAXScript code based on descriptions and patterns. Always test generated scripts in a safe environment before using them on important projects.


Pull Request opened by Augment Code with guidance from the PR author

This commit introduces a comprehensive AI agent specialized in writing MAXScript code for Autodesk 3ds Max versions 2018-2024.

## Features Added:

### Core Components:
- MAXScript AI Agent with intelligent code generation
- Comprehensive knowledge base with 50+ built-in functions
- Template system with 15+ pre-built code templates
- Full-featured command-line interface
- Interactive mode for real-time script generation

### Code Generation Capabilities:
- Functions: Reusable MAXScript functions with proper syntax
- Rollouts: UI dialogs and panels with controls and event handlers
- Macros: Toolbar buttons and menu items
- Structs: Object-oriented data structures
- Utilities: Complete utility scripts with optional UI
- Batch Scripts: File processing and automation scripts

### Technical Features:
- Syntax validation and error detection
- Code debugging with intelligent suggestions
- Best practices enforcement
- Version-specific compatibility (3ds Max 2018-2024)
- Comprehensive error handling with try/catch blocks
- Automatic code documentation and commenting

### Knowledge Base:
- 50+ built-in MAXScript functions with examples
- Complete 3ds Max object hierarchy
- Common coding patterns and idioms
- Version-specific feature documentation
- Intelligent function search capabilities

### Template Library:
- Modeling: Object creation, distribution, randomization
- Animation: Keyframes, paths, camera orbits, effects
- UI: Rollouts, dialogs, object pickers
- Utility: Batch operations, scene cleanup, export tools
- Workflow: File processing, auto-backup systems
- Rendering: Batch rendering, camera sequences

### User Interfaces:
- Command-line interface with multiple commands
- Interactive mode for real-time assistance
- Python API for programmatic access

### Examples and Documentation:
- Comprehensive modeling examples (grid creation, spiral stairs, etc.)
- Animation examples (bouncing ball, camera orbit, wave effects)
- Complete documentation with usage examples
- Best practices guide with 10 key recommendations

## Files Added:
- maxscript_agent.py: Main AI agent implementation
- maxscript_knowledge.py: Knowledge base with functions and patterns
- maxscript_templates.py: Pre-built code templates
- main.py: Command-line interface
- examples/: Complete example scripts
- README_MAXSCRIPT_AGENT.md: Comprehensive documentation
- test_agent.py: Test suite and demonstrations
- demo.py: Complete feature demonstration
- requirements.txt: Python dependencies
- .gitignore: Git ignore patterns

## Usage Examples:
- Generate functions: python main.py generate "Create 10 boxes" --type function
- Create UI tools: python main.py generate "Object selector" --type rollout --ui
- Get templates: python main.py template modeling create_primitive_array
- Validate syntax: python main.py validate script.ms
- Interactive mode: python main.py interactive

The agent handles requests from simple one-line commands to complex multi-function scripts for professional 3ds Max workflows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant