Page MenuHome

AttributeError: 'GreasePencil' object has no attribute 'draw_mode'
Closed, ResolvedPublic


System Information
Ubuntu 15.10 x86_64 / i7 5820k / 16GB RAM / GTX 980 Ti

Blender Version
Broken: 2.76.5 90250f8
Worked: 2.76.2

Short description of error
When I try to use the Ice Tools addon, I got this error in the API regarding GreasePencil not having attribute draw_mode.

Traceback (most recent call last):
  File "/home/ebrain/.config/blender/2.76/scripts/addons/", line 157, in execute
    context.object.grease_pencil.draw_mode = 'SURFACE'
AttributeError: 'GreasePencil' object has no attribute 'draw_mode'

Exact steps for others to reproduce the error
Just use the addon Ice tools, and the first button Set Up Retopo Mesh will produce this bug.

Event Timeline

Mickaël Guédon (ebrain) raised the priority of this task from to Needs Triage by Developer.
Mickaël Guédon (ebrain) updated the task description. (Show Details)
Mickaël Guédon (ebrain) set Type to Bug.
Joshua Leung (aligorith) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.Jan 12 2016, 12:14 PM

This setting is no longer a per-datablock setting, but is instead stored in the per-scene "Tool Settings" instead. Specifically, old addons need to be modified to use:


I've updated the release notes to draw attention to this fact so that other addon authors can make suitable changes. In the meantime, we'll look into patching up the addons bundled in the official releases.

Ok, just found out that this addon isn't actually one that's bundled with Blender. Officially, we don't support external addons in the bug tracker. I've left a note on the BlenderArtists thread for this addon about these issues so that the author can update the addon.

In the meantime, to resolve this error, open the file in a text editor, and change line 157 from:

context.object.grease_pencil.draw_mode = 'SURFACE'


context.tool_settings.gpencil_stroke_placement_view3d = 'SURFACE'

Sorry for the inconvenience, but we'll just have to wait for the addon developer to update the tool in response to these changes.

Joshua Leung (aligorith) closed this task as Archived.Jan 12 2016, 12:36 PM
Joshua Leung (aligorith) claimed this task.