# Shortcut for Sphere brush

**URL:** <https://discourse.slicer.org/t/shortcut-for-sphere-brush/13460>\
**Category:** Support\
**Created:** [September 12, 2020, 3:00pm UTC](https://discourse.slicer.org/t/shortcut-for-sphere-brush/13460 "2020-09-12T15:00:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [September 12, 2020, 3:00pm UTC](https://discourse.slicer.org/t/shortcut-for-sphere-brush/13460/1 "2020-09-12T15:00:40Z")

</div>

I’m trying to set up a key shortcut in python to enable/disable sphere brush in PaintEffect. The first step is code to set that parameter, which I’m doing like this:

```
segmentEditorWidget = slicer.qMRMLSegmentEditorWidget()
paintEffect = segmentEditorWidget.effectByName("Paint")
paintEffect.setCommonParameter("BrushSphere", False)
paintEffect.updateGUIFromMRML()

```

The parameter does not seem to change the brush behavior and I don’t get any changes reflected in the GUI. What am I doing wrong here?

Thanks!!!

-Hollister

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [September 17, 2020, 3:37am UTC](https://discourse.slicer.org/t/shortcut-for-sphere-brush/13460/2 "2020-09-17T03:37:32Z")

</div>

Instead of creating a new widget, refer to the Segment Editor module’s widget:

```auto
segmentEditorWidget = slicer.modules.segmenteditor.widgetRepresentation().self().editor
paintEffect = segmentEditorWidget.effectByName("Paint")
paintEffect.setCommonParameter("BrushSphere", 1) # enable
paintEffect.setCommonParameter("BrushSphere", 0) # disable

```

---

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [September 17, 2020, 12:26pm UTC](https://discourse.slicer.org/t/shortcut-for-sphere-brush/13460/3 "2020-09-17T12:26:04Z")

</div>

Oh, I see - I didn’t realize that I was creating a new widget (rather than finding the existing one).

THANKS!

-Hollister
