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 |
|---|---|---|---|
|
STROKE: Body |
Switch to Body Lines, Set Ink Pen |
|
|
STROKE: Head |
Switch to Head Lines, Set Ink Pen |
|
|
STROKE: Eyes |
Switch to Eyes Lines, Set Ink Pen |
|
|
STROKE: Mouth |
Switch to Mouth Lines, Set Ink Pen |
|
|
STROKE: Extra |
Switch to Extra Lines, Set Ink Pen |
|
|
STROKE: FOREGROUND |
Switch to Foreground Lines, Set Ink Pen |
|
|
STROKE: BACKGROUND |
Switch to Background Lines, Set Ink Pen |
|
|
STROKE: LAYER 8 |
Switch to Layer 8 Lines, Set Ink Pen |
|
|
STROKE: LAYER 9 |
Switch to Layer 9 Lines, Set Ink Pen |
|
|
STROKE: LAYER 10 |
Switch to Layer 10 Lines, Set Ink Pen |
Fill Operators¶
These switch to the “Fills” layer and set the appropriate brush.
Operator ID |
UI Label |
Primary Action |
Ref Key |
|---|---|---|---|
|
FILL: Body |
Switch to Body Fills, Set Fill Brush |
|
|
FILL: Head |
Switch to Head Fills, Set Fill Brush |
|
|
FILL: Eyes |
Switch to Eyes Fills, Set Fill Brush |
|
|
FILL: Mouth (Mask) |
Switch to Mouth Mask, Set Fill Brush |
|
|
FILL: Extra |
Switch to Extra Fills, Set Fill Brush |
|
|
FILL: FOREGROUND |
Switch to Foreground Fills, Set Fill Brush |
|
|
FILL: BACKGROUND |
Switch to Background Fills, Set Fill Brush |
|
|
FILL: LAYER 8 |
Switch to Layer 8 Fills, Set Fill Brush |
|
|
FILL: LAYER 9 |
Switch to Layer 9 Fills, Set Fill Brush |
|
|
FILL: LAYER 10 |
Switch to Layer 10 Fills, Set Fill Brush |
Mouth & Jaw Operators¶
Specialized operators for muzzle/mouth layers.
Operator ID |
UI Label |
Primary Action |
Ref Key |
|---|---|---|---|
|
MOUTH: Lines |
Unlock Mouth Lines, Set Ink Pen |
|
|
MOUTH: Mask |
Unlock Mouth Mask, Set Fill Brush |
|
|
MOUTH: Upper Jaw/Teeth |
Unlock Upper Teeth, Set Ink Pen |
|
|
MOUTH: Lower Jaw/Teeth |
Unlock Lower Teeth, Set Ink Pen |
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 |
|---|---|---|---|
|
SCULPT: Body |
Unlock Body (Lines+Fills), Set Push Brush |
|
|
SCULPT: Head |
Unlock Head (Lines+Fills), Set Push Brush |
|
|
SCULPT: Eyes |
Unlock Eyes (Lines+Fills), Set Push Brush |
|
|
SCULPT: Mouth |
Unlock Mouth (Lines+Mask), Set Push Brush |
|
|
SCULPT: Extra |
Unlock Extra (Lines+Fills), Set Push Brush |
|
|
SCULPT: FOREGROUND |
Unlock Foreground, Set Push Brush |
|
|
SCULPT: BACKGROUND |
Unlock Background, Set Push Brush |
|
|
SCULPT: LAYER 8 |
Unlock Layer 8, Set Push Brush |
|
|
SCULPT: LAYER 9 |
Unlock Layer 9, Set Push Brush |
|
|
SCULPT: LAYER 10 |
Unlock Layer 10, Set Push Brush |
Effects & FX Operators¶
Specialized tools for shadows, highlights, and applying noise.
Operator ID |
UI Label |
Primary Action |
Ref Key |
|---|---|---|---|
|
FX: Shading |
Unlock Shadow Layer, Set Large Brush |
|
|
FX: Highlights 1 |
Unlock Highlights, Set Material |
|
|
FX: Highlights 2 |
Unlock Highlights, Set Material |
|
|
FX: Highlights 3 |
Unlock Highlights, Set Material |
|
|
FRED: Apply Noise |
Dialog Box. Selects random vertices, applies noise transform. |
Keyframe & Frame Management¶
Operators to prepare layers for animation or duplicate frames.
Operator ID |
UI Label |
Primary Action |
Ref Key |
|---|---|---|---|
|
FRAMES: Mouth & Mask |
Unlock Mouth & Mask layers |
|
|
FRAMES: Mouth, Mask, Lower Jaw |
Unlock Mouth, Mask, Lower Jaw |
|
|
KEYFRAMES: Add keyframes |
Duplicate current frame on all unlocked layers |
Utility & Custom Operators¶
Tools for brush settings, randomization, and system toggles.
Operator ID |
UI Label |
Primary Action |
Ref Key |
|---|---|---|---|
|
STROKE STRENGTH: 0% |
Set brush strength to 0 |
|
|
STROKE STRENGTH: 100% |
Set brush strength to 1 |
|
|
Join and Smooth Strokes |
Join 2 selected strokes, smooth them |
|
|
Previous Keyframe |
Jump to previous keyframe |
|
|
Next Keyframe |
Jump to next keyframe |
|
|
Previous Marker |
Jump to previous marker |
|
|
Next Marker |
Jump to next marker |
|
|
Randomize Line Art (Small) |
Select random vertices, apply noise |
|
|
Eraser Point |
Set brush to “Eraser Point” |
|
|
Eraser Stroke |
Set brush to “Eraser Stroke” |
|
|
Create GP (Fox) |
Create new GP object with Fox materials |
|
|
Randomize Selected Vertices |
Select random vertices, apply noise |
|
|
Lock Non-Character Layers |
Lock all, then unlock character layers |
|
|
ALL MOUTH LAYERS |
Unlock all mouth-related layers |
|
|
NON-FUNCTIONAL |
Bug: Code incomplete. Does nothing. |
N/A |
|
Enable Automerge |
Enable automerge strokes |
|
|
Disable Automerge |
Disable automerge strokes |
|
|
Toggle Fade Inactive Layers |
Toggle fade layers overlay |
|
|
Toggle Onion Skins |
Toggle onion skin overlay |
|
|
Remove All Vertex Paints |
Clear vertex colors on all GP objects |
|
|
Enable Draw on Back |
Enable draw on back |
|
|
Disable Draw on Back |
Disable draw on back |
|
|
Randomize Line Art (Large) |
Select random vertices, apply large noise |
|
|
Smooth Stroke |
Smooth selected stroke |
|
|
Create GP (Fox McCloud) |
Create full Fox rig |
|
|
Set Active Material |
Set active material |
|
|
View Selected Frame |
View selected frame |
|
|
Set Brush “01 PEN” |
Set brush to “01 PEN” |
|
|
Set Brush “01 PEN STRENGTH P” |
Set brush to “01 PEN STRENGTH P” |
|
|
CRASH RISK |
Bug: Syntax error. Do not use. |
N/A |
|
Toggle GP Material Visible |
Toggle material visibility |
|
|
Reveal Material |
Reveal material |
|
|
Hide All Fills |
Hide all fill layers |
|
|
Set Fill Draw Mode: Control |
Set fill draw mode to Control |
|
|
Set Fill Draw Mode: Both |
Set fill draw mode to Both |
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 UnlockBlender 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(seelayers.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:
‘Setting’ the “Target” for drawing: In Blender, you can have 18 layers, but you can only draw on one at a time.
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.
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(seename)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(seegpencil_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(seegpencil_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 MaterialBlender 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')
Set Push Brush¶
bpy.ops.wm.tool_set_by_id(name='builtin_brush.Push')
Blender API:
Set Tool by IDBlender Manual: Sculpt Mode
Sets the active brush to “Push” (used for “butterknifing”).
Return to Draw Mode¶
bpy.ops.object.mode_set(mode='PAINT_GPENCIL')
Select Random & Apply Noise¶
Used by: fred.applynoise, fred.op8, fred.op12, fred.op23
Select All¶
bpy.ops.gpencil.select_all(action='SELECT')
Deselect Random¶
bpy.ops.gpencil.select_random(ratio=0.995, action='DESELECT', ...)
Blender API:
Select RandomBlender 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), ...)
Apply Thickness (via Shrinkfatten)¶
bpy.ops.transform.transform(mode='GPENCIL_SHRINKFATTEN', ...)
Duplicate Frame¶
Used by: fred.addkeyframes
Duplicate Frame¶
bpy.ops.gpencil.frame_duplicate(mode='ALL')
Blender API:
Duplicate FrameBlender Manual: Duplicating Frames (see
#Duplicate Active Keyframe (All Layers))Duplicates the current frame on all unlocked layers.
Set Brush Strength¶
Set Brush Strength¶
bpy.context.tool_settings.gpencil_paint.brush.gpencil_settings.pen_strength = 0 (or 1)
Blender API: Blender 4.1
Brush(seegpencil_settings.pen_strength)Blender Manual: Brush Strength (see #Strength)
Sets the stroke opacity/strength to 0% or 100%.
Join & Smooth Strokes¶
Join Strokes¶
bpy.ops.gpencil.stroke_join(type='JOIN')
Blender API:
Join StrokesBlender 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¶
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¶
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")
Lock All Layers¶
Used by: fred.op13
Lock All¶
bpy.ops.gpencil.lock_all()
Toggle Automerge¶
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¶
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¶
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¶
Set Brush¶
bpy.context.scene.tool_settings.gpencil_paint.brush = bpy.data.brushes["01 PEN"]
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()
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(seeshow_viewport)
Set Fill Draw Mode¶
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(seegpencil_settings.fill_draw_mode)