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 Should frames be automatically created when drawing? canDraw / cd bool Check to see if drawing is allowed createOrEditFrame / cef int Frame number for create or edit exists / ex bool Returns true or false depending upon whether the specified object exists. Other flags are ignored. exportArchive / eac unicode, unicode Modify names of export archive fileTextureSize / fts int Both width and height dimensions of the file texture (they are square). greasePencilType / gpt int Grease pencil type. 1 = Pencil, 2 = Marker, 3 = Soft Pencil, 4 = Eraser image1 / i1 unicode First of three possible icons representing the tool associated with the context. image2 / i2 unicode Second of three possible icons representing the tool associated with the context. image3 / i3 unicode Third of three possible icons representing the tool associated with the context. importArchive / iac unicode Modify name of import archive makeStroke / mst int Stroke point values. removeFrame / rf int Remove the given frame resetBrushes / rb bool Should the brushes reset? rgbcolor / rgb float, float, float Color of the grease pencil sequenceNodeName / snn unicode 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')