Operator Inventory (v1.0)

This page lists every custom operator provided by The Violence Layer Manager. Each operator is mapped to its function. For the specific native Blender operations executed by these macros, see the Technical Appendix: Native Blender Operations at the bottom of this page.

Note

v1.0 Limitations: Some operators are marked as Non-functional or Buggy. These are documented for transparency but should not be used until fixed in v2.0.

Layer Switching Operators

These operators act as “macros” that perform a sequence of native actions: switching to Draw Mode, locking/unlocking layers, setting the brush tool, and assigning the correct material.

Stroke (Line) Operators

These switch to the “Lines” layer for a specific body part and set the appropriate brush.

Operator ID

UI Label

Primary Action

Ref Key

fred.body_lines

STROKE: Body

Switch to Body Lines, Set Ink Pen

Unlock & Activate Layer

fred.head_lines

STROKE: Head

Switch to Head Lines, Set Ink Pen

Unlock & Activate Layer

fred.eyes_lines

STROKE: Eyes

Switch to Eyes Lines, Set Ink Pen

Unlock & Activate Layer

fred.mouth_lines

STROKE: Mouth

Switch to Mouth Lines, Set Ink Pen

Unlock & Activate Layer

fred.extra_lines

STROKE: Extra

Switch to Extra Lines, Set Ink Pen

Unlock & Activate Layer

fred.foreground_lines

STROKE: FOREGROUND

Switch to Foreground Lines, Set Ink Pen

Unlock & Activate Layer

fred.background_lines

STROKE: BACKGROUND

Switch to Background Lines, Set Ink Pen

Unlock & Activate Layer

fred.layer8_lines

STROKE: LAYER 8

Switch to Layer 8 Lines, Set Ink Pen

Unlock & Activate Layer

fred.layer9_lines

STROKE: LAYER 9

Switch to Layer 9 Lines, Set Ink Pen

Unlock & Activate Layer

fred.layer10_lines

STROKE: LAYER 10

Switch to Layer 10 Lines, Set Ink Pen

Unlock & Activate Layer

Fill Operators

These switch to the “Fills” layer and set the appropriate brush.

Operator ID

UI Label

Primary Action

Ref Key

fred.body_fills

FILL: Body

Switch to Body Fills, Set Fill Brush

Unlock & Activate Layer

fred.head_fills

FILL: Head

Switch to Head Fills, Set Fill Brush

Unlock & Activate Layer

fred.eyes_fills

FILL: Eyes

Switch to Eyes Fills, Set Fill Brush

Unlock & Activate Layer

fred.mouth_fills

FILL: Mouth (Mask)

Switch to Mouth Mask, Set Fill Brush

Unlock & Activate Layer

fred.extra_fills

FILL: Extra

Switch to Extra Fills, Set Fill Brush

Unlock & Activate Layer

fred.foreground_fills

FILL: FOREGROUND

Switch to Foreground Fills, Set Fill Brush

Unlock & Activate Layer

fred.background_fills

FILL: BACKGROUND

Switch to Background Fills, Set Fill Brush

Unlock & Activate Layer

fred.layer8_fills

FILL: LAYER 8

Switch to Layer 8 Fills, Set Fill Brush

Unlock & Activate Layer

fred.layer9_fills

FILL: LAYER 9

Switch to Layer 9 Fills, Set Fill Brush

Unlock & Activate Layer

fred.layer10_fills

FILL: LAYER 10

Switch to Layer 10 Fills, Set Fill Brush

Unlock & Activate Layer

Mouth & Jaw Operators

Specialized operators for muzzle/mouth layers.

Operator ID

UI Label

Primary Action

Ref Key

fred.mouth1

MOUTH: Lines

Unlock Mouth Lines, Set Ink Pen

Unlock & Activate Layer

fred.mouth2

MOUTH: Mask

Unlock Mouth Mask, Set Fill Brush

Unlock & Activate Layer

fred.mouth3

MOUTH: Upper Jaw/Teeth

Unlock Upper Teeth, Set Ink Pen

Unlock & Activate Layer

fred.mouth4

MOUTH: Lower Jaw/Teeth

Unlock Lower Teeth, Set Ink Pen

Unlock & Activate Layer

Sculpt & Isolation Operators

These operators isolate specific body parts for “butterknifing” (nudging lines). Briefly enters Sculpt Mode to set the Push Brush, then return to Draw Mode. Unlocks appropriate layers.

Operator ID

UI Label

Primary Action

Ref Key

fred.sculpt1

SCULPT: Body

Unlock Body (Lines+Fills), Set Push Brush

Sculpt Mode & Push Brush

fred.sculpt2

SCULPT: Head

Unlock Head (Lines+Fills), Set Push Brush

Sculpt Mode & Push Brush

fred.sculpt3

SCULPT: Eyes

Unlock Eyes (Lines+Fills), Set Push Brush

Sculpt Mode & Push Brush

fred.sculpt4

SCULPT: Mouth

Unlock Mouth (Lines+Mask), Set Push Brush

Sculpt Mode & Push Brush

fred.sculpt5

SCULPT: Extra

Unlock Extra (Lines+Fills), Set Push Brush

Sculpt Mode & Push Brush

fred.sculpt6

SCULPT: FOREGROUND

Unlock Foreground, Set Push Brush

Sculpt Mode & Push Brush

fred.sculpt7

SCULPT: BACKGROUND

Unlock Background, Set Push Brush

Sculpt Mode & Push Brush

fred.sculpt8

SCULPT: LAYER 8

Unlock Layer 8, Set Push Brush

Sculpt Mode & Push Brush

fred.sculpt9

SCULPT: LAYER 9

Unlock Layer 9, Set Push Brush

Sculpt Mode & Push Brush

fred.sculpt10

SCULPT: LAYER 10

Unlock Layer 10, Set Push Brush

Sculpt Mode & Push Brush

Effects & FX Operators

Specialized tools for shadows, highlights, and applying noise.

Operator ID

UI Label

Primary Action

Ref Key

fred.shadowfills

FX: Shading

Unlock Shadow Layer, Set Large Brush

Unlock & Activate Layer

fred.highlights1

FX: Highlights 1

Unlock Highlights, Set Material

Unlock & Activate Layer

fred.highlights2

FX: Highlights 2

Unlock Highlights, Set Material

Unlock & Activate Layer

fred.highlights3

FX: Highlights 3

Unlock Highlights, Set Material

Unlock & Activate Layer

fred.applynoise

FRED: Apply Noise

Dialog Box. Selects random vertices, applies noise transform.

Select Random & Apply Noise

Keyframe & Frame Management

Operators to prepare layers for animation or duplicate frames.

Operator ID

UI Label

Primary Action

Ref Key

fred.frames1

FRAMES: Mouth & Mask

Unlock Mouth & Mask layers

Unlock & Activate Layer

fred.frames2

FRAMES: Mouth, Mask, Lower Jaw

Unlock Mouth, Mask, Lower Jaw

Unlock & Activate Layer

fred.addkeyframes

KEYFRAMES: Add keyframes

Duplicate current frame on all unlocked layers

Duplicate Frame

Utility & Custom Operators

Tools for brush settings, randomization, and system toggles.

Operator ID

UI Label

Primary Action

Ref Key

fred.op1

STROKE STRENGTH: 0%

Set brush strength to 0

Set Brush Strength

fred.op2

STROKE STRENGTH: 100%

Set brush strength to 1

Set Brush Strength

fred.op3

Join and Smooth Strokes

Join 2 selected strokes, smooth them

Join & Smooth Strokes

fred.op4

Previous Keyframe

Jump to previous keyframe

Jump Keyframe/Marker

fred.op5

Next Keyframe

Jump to next keyframe

Jump Keyframe/Marker

fred.op6

Previous Marker

Jump to previous marker

Jump Keyframe/Marker

fred.op7

Next Marker

Jump to next marker

Jump Keyframe/Marker

fred.op8

Randomize Line Art (Small)

Select random vertices, apply noise

Select Random & Apply Noise

fred.op9

Eraser Point

Set brush to “Eraser Point”

Set Eraser Brush

fred.op10

Eraser Stroke

Set brush to “Eraser Stroke”

Set Eraser Brush

fred.op11

Create GP (Fox)

Create new GP object with Fox materials

Create GP Object

fred.op12

Randomize Selected Vertices

Select random vertices, apply noise

Select Random & Apply Noise

fred.op13

Lock Non-Character Layers

Lock all, then unlock character layers

Lock All Layers

fred.op14

ALL MOUTH LAYERS

Unlock all mouth-related layers

Unlock & Activate Layer

fred.op15

NON-FUNCTIONAL

Bug: Code incomplete. Does nothing.

N/A

fred.op16

Enable Automerge

Enable automerge strokes

Toggle Automerge

fred.op17

Disable Automerge

Disable automerge strokes

Toggle Automerge

fred.op18

Toggle Fade Inactive Layers

Toggle fade layers overlay

Toggle Overlay

fred.op19

Toggle Onion Skins

Toggle onion skin overlay

Toggle Overlay

fred.op20

Remove All Vertex Paints

Clear vertex colors on all GP objects

Clear Vertex Colors

fred.op21

Enable Draw on Back

Enable draw on back

Toggle Draw on Back

fred.op22

Disable Draw on Back

Disable draw on back

Toggle Draw on Back

fred.op23

Randomize Line Art (Large)

Select random vertices, apply large noise

Select Random & Apply Noise

fred.op24

Smooth Stroke

Smooth selected stroke

Smooth Stroke

fred.op25

Create GP (Fox McCloud)

Create full Fox rig

Create GP Object

fred.op26

Set Active Material

Set active material

Set Material

fred.op27

View Selected Frame

View selected frame

View Frame

fred.op28

Set Brush “01 PEN”

Set brush to “01 PEN”

Set Brush

fred.op29

Set Brush “01 PEN STRENGTH P”

Set brush to “01 PEN STRENGTH P”

Set Brush

fred.op30

CRASH RISK

Bug: Syntax error. Do not use.

N/A

fred.op31

Toggle GP Material Visible

Toggle material visibility

Toggle Material Visibility

fred.op32

Reveal Material

Reveal material

Reveal Material

fred.op33

Hide All Fills

Hide all fill layers

Hide All Fills

fred.op34

Set Fill Draw Mode: Control

Set fill draw mode to Control

Set Fill Draw Mode

fred.op35

Set Fill Draw Mode: Both

Set fill draw mode to Both

Set Fill Draw Mode

Warnings & Known Bugs

fred.op15

Marked as Non-functional in the code. It currently only pushes an undo message.

  • Intended: Unlock and clear Mouth/Head frames via hotkey (Ctrl+Alt+Shift+4).

  • Bug: The code fails to make invisible layers visible before unlocking them. (V1.0)

  • Workaround: Manually ensure layers are visible and unlocked in the Outliner.

fred.op30

Marked as Crash Risk. The code contains a syntax error in v1.0. But there’s no way for the user to get to it anyway.

fred.applynoise

This is a Dialog Box operator. It will open the dialog window rather than perform the operation. (This is fine, but a hotkey assigned to it won’t technically perform an operation, is all.)

Technical Appendix: Native Blender Operations

This section details the specific native Blender operations used by the operators above. Click the Ref Key in the tables to jump to the relevant section here.

Note

API Links: Links prefixed with Blender API: point to the Blender API Reference. If a link targets a class, navigate to the specific attribute mentioned in parentheses (e.g., see active).

Blender Manual Links: Links prefixed with Blender Manual: point to the User Manual for Blender’s explanation of its use.

Unlock & Activate Layer

Used by: All Layer Switching, Mouth, Jaw, Effects, Keyframe operators

Unlock Layer

bpy.ops.wm.context_toggle(data_path="object.data.layers['" + layer_name + "'].lock")

Blender API: Layer Unlock

Blender Manual: Layers (see #Layers List - Lock)

Applies a toggle to the lock state of a specific layer.

Set Active Layer

bpy.context.active_object.data.layers.active = bpy.context.active_object.data.layers[layer_name]

Blender API: GreasePencil (see layers.active)

Blender Manual: Set Active Layer (see #Active Layer)

When the code runs bpy.context.active_object.data.layers.active = …, it is doing three specific things simultaneously:

  1. ‘Setting’ the “Target” for drawing: In Blender, you can have 18 layers, but you can only draw on one at a time.

  2. Chages the visual (UI) focus:

    Outliner: The layer name in the Outliner (the list on the right) becomes highlighted. Properties Panel: The “Layer” tab in the sidebar updates to show the settings (opacity, lock status, color) for that specific layer.

  3. Context for Other Operations:

    Many other Blender operations (like “Delete,” “Duplicate,” or “Lock”) operate on the enitre active layer by default if no specific selection is made.

Fred’s use case: “I want to lock all layers except the one I’m working on.” The tool does this by unlocking the active one and locking the rest.

Set Brush Tool

bpy.ops.wm.tool_set_by_id(name='builtin_brush.Draw') and name='builtin_brush.Fill'

Blender API: Set Tool by ID (see name)

Blender Manual: Brush Settings (see #Selecting-a-brush-and-material)

Switches the active brush tool to either Fill or Brush, depending on the layer selected.

Set Brush Size

bpy.context.tool_settings.gpencil_paint.brush.size = 13

Blender API: In 4.1 Brush (see gpencil_settings.pen_size)

Blender Manual: Brush Settings

Sets the brush radius to one specified by the layer materials.

Set Brush Strength

bpy.context.tool_settings.gpencil_paint.brush.gpencil_settings.pen_strength = 1

Blender API: Brush (see gpencil_settings.pen_strength)

Blender Manual: Brush Settings

Sets the stroke opacity/strength to the one specified by the layer materials.

Set Material Active

bpy.ops.gpencil.material_set(slot=m.name)

Blender API: Set Material

Blender Manual: Materials

Assigns the layer’s material to the active stroke/layer. (I think?)

Sculpt Mode & Push Brush

Used by: All Sculpt Isolation operators

Enter Sculpt Mode

bpy.ops.object.mode_set(mode='SCULPT_GPENCIL')

Blender API: Mode Set

Blender Manual: Sculpt Mode

Switches to Sculpt Mode.

Set Push Brush

bpy.ops.wm.tool_set_by_id(name='builtin_brush.Push')

Blender API: Set Tool by ID

Blender Manual: Sculpt Mode

Sets the active brush to “Push” (used for “butterknifing”).

Return to Draw Mode

bpy.ops.object.mode_set(mode='PAINT_GPENCIL')

Blender API: Mode Set

Blender Manual: Draw Mode

Returns to Draw Mode.

Select Random & Apply Noise

Used by: fred.applynoise, fred.op8, fred.op12, fred.op23

Select All

bpy.ops.gpencil.select_all(action='SELECT')

Blender API: Select All

Blender Manual: Selecting Strokes

Selects all vertices on unlocked layers.

Deselect Random

bpy.ops.gpencil.select_random(ratio=0.995, action='DESELECT', ...)

Blender API: Select Random

Blender Manual: Random Selection

Selects everything, then randomly deselects 99.5%, leaving 0.5% selected.

Apply Noise (Translate)

bpy.ops.transform.translate(value=(mynoisex, mynoisey, 0), ...)

Blender API: Translate

Blender Manual: Array Modifier

Moves selected vertices randomly.

Apply Thickness (via Shrinkfatten)

bpy.ops.transform.transform(mode='GPENCIL_SHRINKFATTEN', ...)

Blender API: Transform

Blender Manual: Build Modifier

Changes stroke thickness.

Duplicate Frame

Used by: fred.addkeyframes

Duplicate Frame

bpy.ops.gpencil.frame_duplicate(mode='ALL')

Blender API: Duplicate Frame

Blender Manual: Duplicating Frames (see #Duplicate Active Keyframe (All Layers))

Duplicates the current frame on all unlocked layers.

Set Brush Strength

Used by: fred.op1, fred.op2

Set Brush Strength

bpy.context.tool_settings.gpencil_paint.brush.gpencil_settings.pen_strength = 0 (or 1)

Blender API: Blender 4.1 Brush (see gpencil_settings.pen_strength)

Blender Manual: Brush Strength (see #Strength)

Sets the stroke opacity/strength to 0% or 100%.

Join & Smooth Strokes

Used by: fred.op3, fred.op24

Join Strokes

bpy.ops.gpencil.stroke_join(type='JOIN')

Blender API: Join Strokes

Blender Manual: Joining Strokes (see #join)

Joins two selected strokes into one.

Smooth Strokes

bpy.ops.gpencil.stroke_smooth(repeat=10, factor=0.5, ...)

Blender Manual: Smoothing Strokes (see #smooth)

Smooths the position and thickness of selected strokes.

Blender API: Smooth Strokes

Jump Keyframe/Marker

Used by: fred.op4, fred.op5, fred.op6, fred.op7

Jump Keyframe

bpy.ops.screen.keyframe_jump(next=False) (or True)

Blender Manual: Markers (see #selecting keyframes)

Jumps the playhead to the previous or next keyframe.

Blender API: Keyframe Jump

Jump Marker

bpy.ops.screen.marker_jump(next=False) (or True)

Blender Manual: Markers

Jumps the playhead to the previous or next marker.

Blender API: Marker Jump (see #Jump to next/previous marker)

Set Eraser Brush

Used by: fred.op9, fred.op10

bpy.context.scene.tool_settings.gpencil_paint.brush = bpy.data.brushes["Eraser Point"]

Blender Manual: Eraser Brushes (see #Point Erasing, #Stroke Erasing)

Sets the active brush to “Eraser Point” or “Eraser Stroke”.

Blender API: Brush

Create GP Object

Used by: fred.op11, fred.op25

Create Data

bpy.data.grease_pencils.new("ANIM_FOX")

Blender Manual: Creating Grease Pencil Objects (see #Data Block)

Creates a new Grease Pencil data-block.

Blender API: GreasePencil

Create Object

bpy.data.objects.new("GP_FOX", gp_data)

Blender Manual: Creating Grease Pencil Objects (see #Sroke)

Creates a new object using the GP data-block.

Blender API: Object

Create Material

bpy.data.materials.new("1 I LINE")

Blender Manual: Materials (see #Setting Up Materials)

Creates a new material with Grease Pencil properties.

Blender API: Material

Lock All Layers

Used by: fred.op13

Lock All

bpy.ops.gpencil.lock_all()

Blender Manual: Layers (see #Layer Specials - Lock All)

Locks all Grease Pencil layers at once.

Blender API: Lock All

Toggle Automerge

Used by: fred.op16, fred.op17

Set Automerge

bpy.ops.wm.context_set_value(data_path='scene.tool_settings.use_gpencil_automerge_strokes', value='True')

Blender Manual: Automerge (see #Drawing Options, Automerge)

Enables or disables automerge toggle for stroke endpoints.

Blender API: ToolSettings

Toggle Overlay

Used by: fred.op18, fred.op19

Toggle Fade Layers

bpy.ops.wm.context_toggle(data_path="space_data.overlay.use_gpencil_fade_layers")

Blender Manual: Fading Layers (See Visibililty)

Fades layers that are not currently active.

Blender API: SpaceView3D

Toggle Onion Skins

bpy.ops.wm.context_toggle(data_path="space_data.overlay.use_gpencil_onion_skin")

Blender Manual: Onion Skinning (See #Display - Fade)

Toggles onion skin visibility for adjacent frames.

Blender API: SpaceView3D

Clear Vertex Colors

Used by: fred.op20

Iterate GP Objects

for gp in bpy.data.grease_pencils:

Blender Manual: Selecting First/Last

Iterates through all Grease Pencil data-blocks in the file.

Blender API: GreasePencil

Clear Vertex Color

point.vertex_color = [0.0, 0.0, 0.0, 0.0]

Blender Manual: Vertex Colors (see #Reset Vertex Color)

Resets vertex color data to transparent black on all strokes and points.

Blender API: GPencilStrokePoint

Toggle Draw on Back

Used by: fred.op21, fred.op22

Set Draw on Back

bpy.ops.wm.context_set_value(data_path='scene.tool_settings.use_gpencil_draw_onback', value='True')

Blender Manual: Draw on Back (see #Drawing Options, Draw-on-back)

Enables or disables drawing strokes behind existing geometry.

Blender API: ToolSettings

Smooth Stroke

Used by: fred.op24

Smooth

bpy.ops.gpencil.stroke_smooth(repeat=2, factor=0.5, ...)

Blender Manual: Smoothing Strokes (see #Smooth)

Smooths the position, thickness, and strength of selected strokes.

Blender API: Smooth Strokes

Set Material

Used by: fred.op26

Set Material

bpy.ops.gpencil.material_set(mat)

Blender Manual: Materials

Assigns the active material to selected strokes.

Blender API: Set Material

View Frame

Used by: fred.op27

bpy.ops.action.view_selected()

Blender Manual: View Frame (see #Frame Selected, Numpad .) Zooms the Dope Sheet to show selected keyframes.

Blender API: View Selected

View Frame

bpy.ops.action.view_frame()

Blender Manual: View Frame (see #Go to Current Frame, Numpad 0)

Centers the Dope Sheet on the current frame.

Blender API: View Frame

Set Brush

Used by: fred.op28, fred.op29

Set Brush

bpy.context.scene.tool_settings.gpencil_paint.brush = bpy.data.brushes["01 PEN"]

Blender Manual: Data Block Menu

Sets the active brush to a named brush preset.

Blender API: Brush

Toggle Material Visibility

Used by: fred.op31

Toggle Visibility

obj.hide = True (or False)

Blender Manual: Materials (see Common Settings, Viewport/Render Visibility)

Toggles the visibility of the active Grease Pencil material.

Blender API: MaterialGPencilStyle

Reveal Material

Used by: fred.op32

Reveal

bpy.ops.gpencil.material_reveal()

Blender Manual: Materials

Makes all Grease Pencil materials visible.

Blender API: Reveal Material

Hide All Fills

Used by: fred.op33

Toggle Modifier

bpy.ops.wm.context_toggle(data_path="object.grease_pencil_modifiers['HIDE ALL FILLS'].show_viewport")

Blender Manual: Viewport Visibility

Toggles the viewport visibility of the “HIDE ALL FILLS” modifier.

Blender API: Modifier (see show_viewport)

Set Fill Draw Mode

Used by: fred.op34, fred.op35

Set Mode

bpy.data.brushes["Fill Area"].gpencil_settings.fill_draw_mode = 'CONTROL' (or 'BOTH')

Blender Manual: Fill Draw Mode (See #Fill Brushes)

Sets the fill brush to react to control lines only, or both control lines and strokes.

Blender API: Brush (see gpencil_settings.fill_draw_mode)