pymel.core.context.greasePencilCtx

greasePencilCtx(*args, **kwargs)

This is a tool context command for the grease pencil tool. In query mode, return type is based on queried flag.

Flags:

Long Name / Short Name Argument Types Properties
autoCreateFrames / acf bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Should frames be automatically created when drawing?
canDraw / cd bool ../../../_images/query.gif
  Check to see if drawing is allowed
createOrEditFrame / cef int ../../../_images/query.gif
  Frame number for create or edit
exists / ex bool ../../../_images/create.gif
  Returns true or false depending upon whether the specified object exists. Other flags are ignored.
exportArchive / eac unicode, unicode ../../../_images/edit.gif
  Modify names of export archive
fileTextureSize / fts int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Both width and height dimensions of the file texture (they are square).
greasePencilType / gpt int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Grease pencil type. 1 = Pencil, 2 = Marker, 3 = Soft Pencil, 4 = Eraser
image1 / i1 unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  First of three possible icons representing the tool associated with the context.
image2 / i2 unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Second of three possible icons representing the tool associated with the context.
image3 / i3 unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Third of three possible icons representing the tool associated with the context.
importArchive / iac unicode ../../../_images/edit.gif
  Modify name of import archive
makeStroke / mst int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Stroke point values.
removeFrame / rf int ../../../_images/edit.gif
  Remove the given frame
resetBrushes / rb bool ../../../_images/query.gif ../../../_images/edit.gif
  Should the brushes reset?
rgbcolor / rgb float, float, float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Color of the grease pencil
sequenceNodeName / snn unicode ../../../_images/query.gif
  Query the name of the sequence node Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.greasePencilCtx

Example:

import pymel.core as pm

# Create a new grease pencil context, then switch to it
pm.greasePencilCtx('greasePencilCtx1')
# Result: u'greasePencilCtx1' #
pm.setToolTo('greasePencilCtx1')