Maya and Blender Prompts: How 3D Artists Automate Modeling, Rigging, and Rendering with Neural Networks

Introduction

As a 3D artist, you've likely spent hours writing repetitive scripts for Blender or Maya. What if you could describe what you need in plain English and get a working script instantly? That's where neural networks come in. In this article, we'll explore 10 prompts that leverage AI to automate modeling, rigging, UV mapping, lighting, and rendering in Blender and Maya. Each prompt is a template you can adapt, complete with example code that you can paste into the script editor and run immediately.

1. Procedural Geometry Generation in Blender

Task: Generate a parametric staircase with adjustable steps and dimensions.

Prompt:

Write a Blender Python script that creates a staircase with 10 steps, each 0.2 units high and 1 unit wide, using a loop to generate the steps and join them into a single mesh.

Example Result:

import bpy

# Clear existing mesh objects
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_by_type(type='MESH')
bpy.ops.object.delete()

# Parameters
steps = 10
step_height = 0.2
step_width = 1.0
step_depth = 0.3

# Create steps
for i in range(steps):
    bpy.ops.mesh.primitive_cube_add(size=1, location=(0, 0, i * step_height))
    step = bpy.context.active_object
    step.scale = (step_width/2, step_depth/2, step_height/2)
    step.name = f"Step_{i}"

# Join all steps
bpy.ops.object.select_all(action='DESELECT')
for obj in bpy.data.objects:
    if obj.name.startswith("Step_"):
        obj.select_set(True)
bpy.context.view_layer.objects.active = bpy.data.objects["Step_0"]
bpy.ops.object.join()

2. Auto-Rigging in Maya with MEL

Task: Automatically create a basic humanoid rig with joints.

Prompt:

Write a MEL script for Maya that creates a basic humanoid skeleton with joints for spine, arms, and legs, naming them appropriately.

Example Result:

// Create spine
joint -p 0 0 0 -n "root";
joint -p 0 1 0 -n "spine";
joint -p 0 2 0 -n "chest";
joint -p 0 3 0 -n "neck";
joint -p 0 3.5 0 -n "head";

// Create left arm
joint -p 0.5 2.5 0 -n "shoulder_L";
joint -p 1.5 2.5 0 -n "elbow_L";
joint -p 2.5 2.5 0 -n "wrist_L";

// Create right arm
joint -p -0.5 2.5 0 -n "shoulder_R";
joint -p -1.5 2.5 0 -n "elbow_R";
joint -p -2.5 2.5 0 -n "wrist_R";

// Create left leg
joint -p 0.5 0 0 -n "hip_L";
joint -p 0.5 -1 0 -n "knee_L";
joint -p 0.5 -2 0 -n "ankle_L";

// Create right leg
joint -p -0.5 0 0 -n "hip_R";
joint -p -0.5 -1 0 -n "knee_R";
joint -p -0.5 -2 0 -n "ankle_R";

3. UV Optimization in Blender

Task: Automatically unwrap a complex mesh with smart UV project.

Prompt:

Write a Blender Python script that selects all mesh objects and applies Smart UV Project with an angle limit of 66 degrees and island margin of 0.02.

Example Result:

import bpy

# Select all mesh objects
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_by_type(type='MESH')

# Apply Smart UV Project
bpy.ops.uv.smart_project(angle_limit=1.15192, island_margin=0.02)  # 66 degrees in radians

4. Lighting Setup in Maya

Task: Create a three-point lighting setup.

Prompt:

Write a MEL script for Maya that creates a three-point lighting setup: key light, fill light, and back light, with intensities 1.0, 0.5, and 0.8 respectively.

Example Result:

// Key light
spotLight -intensity 1.0 -position 5 5 5 -name "keyLight";

// Fill light
spotLight -intensity 0.5 -position -5 3 5 -name "fillLight";

// Back light
spotLight -intensity 0.8 -position 0 5 -5 -name "backLight";

5. Batch Rendering in Blender

Task: Render all cameras in the scene to separate files.

Prompt:

Write a Blender Python script that iterates over all cameras in the scene, sets each as active, and renders to a file named after the camera.

Example Result:

import bpy
import os

# Output directory
output_dir = "//renders/"
os.makedirs(bpy.path.abspath(output_dir), exist_ok=True)

# Iterate cameras
for cam in bpy.data.cameras:
    bpy.context.scene.camera = bpy.data.objects[cam.name]
    bpy.context.scene.render.filepath = os.path.join(output_dir, cam.name + ".png")
    bpy.ops.render.render(write_still=True)

6. Procedural Texturing in Blender

Task: Create a procedural noise texture for a material.

Prompt:

Write a Blender Python script that creates a new material with a Noise Texture node connected to the Base Color of a Principled BSDF.

Example Result:

import bpy

# Create material
mat = bpy.data.materials.new(name="NoiseMat")
mat.use_nodes = True
nodes = mat.node_tree.nodes
links = mat.node_tree.links

# Clear nodes
nodes.clear()

# Add nodes
output = nodes.new('ShaderNodeOutputMaterial')
bsdf = nodes.new('ShaderNodeBsdfPrincipled')
noise = nodes.new('ShaderNodeTexNoise')

# Link nodes
links.new(noise.outputs['Color'], bsdf.inputs['Base Color'])
links.new(bsdf.outputs['BSDF'], output.inputs['Surface'])

7. Rigging Automation in Blender

Task: Automatically parent mesh to armature with automatic weights.

Prompt:

Write a Blender Python script that selects a mesh and an armature, then parents the mesh to the armature with automatic weights.

Example Result:

import bpy

# Assume mesh and armature are selected
mesh = bpy.context.selected_objects[0]
armature = bpy.context.selected_objects[1]

# Set active object
bpy.context.view_layer.objects.active = armature

# Parent with automatic weights
bpy.ops.object.parent_set(type='ARMATURE_AUTO')

8. Animation Curve Editing in Maya

Task: Apply ease-in and ease-out to all keyframes of selected objects.

Prompt:

Write a MEL script that sets the tangent of all keyframes to auto with ease-in and ease-out.

Example Result:

string $selected[] = `ls -sl`;
for ($obj in $selected) {
    string $keys[] = `keyframe -query -timeChange $obj`;
    for ($key in $keys) {
        keyTangent -edit -inTangentType auto -outTangentType auto $key;
    }
}

9. Scene Optimization in Blender

Task: Reduce polygon count for selected objects.

Prompt:

Write a Blender Python script that applies a Decimate modifier with ratio 0.5 to all selected mesh objects.

Example Result:

import bpy

for obj in bpy.context.selected_objects:
    if obj.type == 'MESH':
        mod = obj.modifiers.new(name="Decimate", type='DECIMATE')
        mod.ratio = 0.5

10. Export Automation in Maya

Task: Export selected objects as FBX.

Prompt:

Write a MEL script that exports the selected objects to an FBX file with the name based on the current date.

Example Result:

string $date = `date -format "YYYYMMDD"`;
string $filename = "export_" + $date + ".fbx";
file -force -options "v=0;" -typ "FBX export" -pr -es $filename;

Conclusion

These prompts demonstrate how neural networks can accelerate your 3D workflow by generating ready-to-use scripts. Whether you're a Blender or Maya user, integrating AI into your pipeline can save hours of manual coding. Try adapting these prompts to your specific needs, and explore further automation possibilities. For more AI-driven tutorials, visit asibiont.com/blog.

← All posts

Comments