Your Ad Here

Go to: Synopsis. Flags. Return value. Related. Python examples.

Synopsis

dynPaintEditor( editorName , [activeOnly=boolean], [autoSave=boolean], [camera=string], [canvasMode=boolean], [canvasUndo=boolean], [changedCommand=[string, string, string, string]], [clear=[float, float, float]], [clear=[float, float, float]], [control=boolean], [currentCanvasSize=boolean], [defineTemplate=string], [displayAppearance=string], [displayFog=boolean], [displayImage=int], [displayLights=string], [displayStyle=string], [displayTextures=boolean], [docTag=string], [doubleBuffer=boolean], [drawContext=boolean], [edit=boolean], [exists=boolean], [fileName=string], [filter=string], [forceMainConnection=string], [highlightConnection=string], [iconGrab=boolean], [loadImage=string], [lockMainConnection=boolean], [mainListConnection=string], [menu=boolean], [nbImages=boolean], [newImage=[int, int, float, float, float]], [paintAll=float], [panel=string], [parent=string], [query=boolean], [redrawLast=boolean], [refreshMode=int], [removeAllImages=boolean], [removeImage=boolean], [rollImage=[float, float]], [saveAlpha=boolean], [saveBumpmap=string], [saveImage=boolean], [scaleBlue=int], [scaleGreen=int], [scaleRed=int], [selectionConnection=string], [singleBuffer=boolean], [snapShot=boolean], [stateString=boolean], [tileSize=int], [unParent=boolean], [undoCache=boolean], [unlockMainConnection=boolean], [updateMainConnection=boolean], [useTemplate=string], [wrap=[boolean, boolean]], [writeImage=string], [zoom=float])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

dynPaintEditor is undoable, queryable, and editable.

Create a editor window that can be painted into

Flags

activeOnly, autoSave, camera, canvasMode, canvasUndo, changedCommand, clear, clear, control, currentCanvasSize, defineTemplate, displayAppearance, displayFog, displayImage, displayLights, displayStyle, displayTextures, docTag, doubleBuffer, drawContext, edit, exists, fileName, filter, forceMainConnection, highlightConnection, iconGrab, loadImage, lockMainConnection, mainListConnection, menu, nbImages, newImage, paintAll, panel, parent, query, redrawLast, refreshMode, removeAllImages, removeImage, rollImage, saveAlpha, saveBumpmap, saveImage, scaleBlue, scaleGreen, scaleRed, selectionConnection, singleBuffer, snapShot, stateString, tileSize, unParent, undoCache, unlockMainConnection, updateMainConnection, useTemplate, wrap, writeImage, zoom
Long name (short name) [argument types] Properties
query(q) boolean query
Puts the command in query mode so that it will return the value of the specified flag.

In query mode, this flag needs a value.

edit(e) boolean edit
Puts the command in edit mode so that it will change the values of the specified flags
exists(ex) boolean create
Returns true|false depending upon whether the specified object exists. Other flags are ignored.
defineTemplate(dt) string create
Puts a command in a mode where any other flags and args are parsed and added to the command template specified in the argument. They will be used as default arguments in any subsequent invocations of the command when templateName is set as the current template.
useTemplate(ut) string create
Will force the command to use a command template other than the current one.
panel(pnl) string createquery
Specifies the panel that the editor belongs to. By default if an editor is created in the create callback of a scripted panel it will belong to that panel. If an editor doesn't belong to a panel it will be deleted when the window that it is in is deleted.

In query mode, this flag needs a value.

parent(p) string createqueryedit
Specifies the parent layout for this editor. This flag will only have an effect if the editor is currently un-parented.

In query mode, this flag needs a value.

unParent(up) boolean createedit
Specifies that the editor should be removed from its layout. This cannot be used with query.
control(ctl) boolean query
Query only. Returns the top level control for this editor. Usually used for getting a parent to attach popup menus. CAUTION: editors may not have controls at times. This flag can return "NONE" if no control is present.

In query mode, this flag needs a value.

mainListConnection(mlc) string createqueryedit
Specifies the name of a selectionConnection object which the editor will use as its source of content. The editor will only display items contained in the selectionConnection object.

In query mode, this flag needs a value.

forceMainConnection(fmc) string createqueryedit
Specifies the name of a selectionConnection object which the editor will use as its source of content. The editor will only display items contained in the selectionConnection object. This is a variant of the -mainListConnection flag in that it will force a change even when the connection is locked. This flag is used to reduce the overhead when using the -unlockMainConnection , -mainListConnection, -lockMainConnection flags in immediate succession.

In query mode, this flag needs a value.

selectionConnection(slc) string createqueryedit
Specifies the name of a selectionConnection object which the editor will synchronize with its own selection list. As the user selects things in this editor, they will be selected in the selectionConnection object. If someone else changes the object, the editor will update to show the change.

In query mode, this flag needs a value.

highlightConnection(hlc) string createqueryedit
Specifies the name of a selectionConnection object which the editor will synchronize with its highlight list. Not all editors have a highlight list. For those who do, it is sort of a secondary selection list.

In query mode, this flag needs a value.

filter(f) string createqueryedit
Specifies the name of a filter to be placed on this editor. This filters the information coming onto the main list of the editor.

In query mode, this flag needs a value.

lockMainConnection(lck) boolean createedit
Locks the current list of objects within the mainConnection, so that only those objects are displayed within the editor. Further changes to the original mainConnection are ignored.
stateString(sts) boolean query
Query only flag. Returns the MEL command that will edit an editor to match the current editor state. The returned command string uses the string variable $editorName in place of a specific name.

In query mode, this flag needs a value.

unlockMainConnection(ulk) boolean createedit
Unlocks the mainConnection, effectively restoring the original mainConnection (if it is still available), and dynamic updates.
updateMainConnection(upd) boolean createedit
Causes a locked mainConnection to be updated from the orginal mainConnection, but preserves the lock state.
docTag(dtg) string createqueryedit
Attaches a tag to the maya editor.

In query mode, this flag needs a value.

scaleRed(sr) int createqueryedit
Define the scaling factor for the red component in the View. The default value is 1 and can be between -1000 to +1000

In query mode, this flag needs a value.

scaleGreen(sg) int createqueryedit
Define the scaling factor for the green component in the View. The default value is 1 and can be between -1000 to +1000

In query mode, this flag needs a value.

scaleBlue(sb) int createqueryedit
Define the scaling factor for the blue component in the View. The default value is 1 and can be between -1000 to +1000

In query mode, this flag needs a value.

singleBuffer(sbf) boolean createqueryedit
Set the display in single buffer mode

In query mode, this flag needs a value.

doubleBuffer(dbf) boolean createqueryedit
Set the display in double buffer mode

In query mode, this flag needs a value.

changedCommand(cc) [string, string, string, string] createqueryedit
Parameters:
  • First string: command
  • Second string: editorName
  • Third string: editorCmd
  • Fourth string: updateFunc
Call the command when something changes in the editor The command should have this prototype :
command(string $editor, string $editorCmd, string $updateFunc, int $reason)
The possible reasons could be :
  • 0: no particular reason
  • 1: scale color
  • 2: buffer (single/double)
  • 3: axis
  • 4: image displayed
  • 5: image saved in memory

In query mode, this flag needs a value.

displayImage(di) int queryedit
Set a particular image in the Editor Image Stack as the current Editor Image. Images are added to the Editor Image Stack using the "si/saveImage" flag.

In query mode, this flag needs a value.

loadImage(li) string edit
load an image from disk and set it as the current Editor Image
writeImage(wi) string edit
write the current Editor Image to disk
displayStyle(dst) string createqueryedit
Set the mode to display the image. Valid values are:
  • "color" to display the basic RGB image
  • "mask" to display the mask channel
  • "lum" to display the luminance of the image

In query mode, this flag needs a value.

removeImage(ri) boolean edit
remove the current Editor Image from the Editor Image Stack
removeAllImages(ra) boolean edit
remove all the Editor Images from the Editor Image Stack
saveImage(si) boolean edit
save the current Editor Image to memory. Saved Editor Images are stored in an Editor Image Stack. The most recently saved image is stored in position 0, the second most recently saved image in position 1, and so on... To set the current Editor Image to a previously saved image use the "di/displayImage" flag.
nbImages(nim) boolean query
returns the number of images

In query mode, this flag needs a value.

clear(cl) [float, float, float] create
Clear the image with the given color (R,G,B).
displayAppearance(dsa) string queryedit
Sets the display appearance of the model panel. Possible values are "wireframe", "points", "boundingBox", "smoothShaded", "flatShaded". This flag may be used with the -interactive and -default flags. Note that only "wireframe", "points", and "boundingBox" are valid for the interactive mode.

In query mode, this flag needs a value.

displayLights(dsl) string queryedit
Sets the lighting for shaded mode. Possible values are "selected", "active", "all", "default".

In query mode, this flag needs a value.

displayTextures(dtx) boolean queryedit
Turns on or off display of textures in shaded mode

In query mode, this flag needs a value.

menu(mn) boolean
Sets the name of the script used to build a menu in the editor. The script takes the editor name as an argument.
newImage(ni) [int, int, float, float, float] queryedit
Starts a new image in edit mode, setting the resolution to the integer values (X,Y) and clearing the buffer to the floating point values (R,G,B). In Query mode, this returns the (X,Y) resolution of the current Image.

In query mode, this flag needs a value.

clear(cl) [float, float, float] edit
Clears the buffer (if in Canvas mode) to the floating point values (R,G,B).
wrap(wr) [boolean, boolean] queryedit
For Canvas mode, should the buffer wrap in U, and V (respectively) when painting.

In query mode, this flag needs a value.

zoom(zm) float queryedit
Zooms the Canvas image by the specified value.

In query mode, this flag needs a value.

camera(cam) string queryedit
Sets the name of the camera which the Paint Effects panel looks through.

In query mode, this flag needs a value.

paintAll(pa) float edit
Redraws the buffer in current refresh mode.
rollImage(rig) [float, float] edit
In Canvas mode, this rolls the image by the floating point values (X,Y). X and Y are between 0 (no roll) and 1 (full roll). A value of .5 rolls the image 50% (ie. the border moves to the center of the screen.
tileSize(ts) int edit
Sets the size of the tile for the hardware texture redraw of the display buffer.
snapShot(snp) boolean edit
Takes a snapshot of the current camera view.
undoCache(uc) boolean edit
By default the last image is cached for undo. If this is set false, then undoing will be disabled in canvas mode and undo in scene mode will force a full refresh. Less memory will be used if this is set false before the first clear or refresh of the current scene.
canvasUndo(cu) boolean edit
Does a fast undo in Canvas mode. This is a special undo because we are not using any history when we paint in Canvas mode so we provide a single level undo for the Canvas.
canvasMode(cm) boolean queryedit
Sets the Paint Effects panel into Canvas mode if true.

In query mode, this flag needs a value.

redrawLast(rl) boolean edit
Redraws the last stroke again. Useful when it's brush has just changed. This feature does a fast undo and redraws the stroke again.
refreshMode(rmd) int queryedit
Sets the refresh mode to the specified value. 0 - Do not draw strokes on refresh, 1 - Redraw strokes in wireframe mode, 2 - Redraw strokes in final rendered mode.

In query mode, this flag needs a value.

autoSave(autoSave) boolean queryedit
For Canvas mode, this determines if the buffer will be saved to a disk file after every stroke. Good for painting textures and viewing the results in shaded display in the model view.

In query mode, this flag needs a value.

saveAlpha(sa) boolean queryedit
For Canvas mode, this determines if the alpha will be saved when storing the canvas to a disk file.

In query mode, this flag needs a value.

drawContext(drc) boolean query
Returns the name of the context.

In query mode, this flag needs a value.

activeOnly(ao) boolean queryedit
For Scene mode, this determines if only the active strokes will be refreshed.

In query mode, this flag needs a value.

fileName(fil) string queryedit
This sets the file to which the canvas will be saved.

In query mode, this flag needs a value.

saveBumpmap(sbm) string queryedit
Saves the current buffer as a bump map to the specified file.

In query mode, this flag needs a value.

iconGrab(ig) boolean edit
This puts the Paint Effects panel into Grab Icon mode where the user is expected to drag out a section of the screen to be made into an icon.
displayFog(dfg) boolean queryedit
For Scene mode, this determines if fog will be displayed in the Paint Effects panel when refreshing the scene. If fog is on, but this is off, fog will only be drawn on the strokes, not the rest of the scene.

In query mode, this flag needs a value.

currentCanvasSize(ccs) boolean query
In Query mode, this returns the (X,Y) resolution of the current canvas.

In query mode, this flag needs a value.


Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Return value

None

Related

getDefaultBrush, stroke

Python examples

import maya.cmds as cmds

cmds.dynPaintEditor( 'editor' )

cmds.dynPaintEditor( 'editor', e=True, ni=(640, 480, 1.0, 0.5, 0.2) )

  

Return to Autodesk Index


Your Ad Here