Can Maya's Paint Script Tool take python scripts as input

Hello all,

I am embarking on a new challenge to create a tool using artUserPaintCtx. I have found a couple of good example mel scripts in the maya C folder and have played around with them a little (mainly the spherePaint.mel script)

I am trying to write a custom tool in PyMel and am rather confused about a few things. With the spherePaint script you go into the Paint Scripts tool setup and in the Tool Setup Cmd field you specify the global proc that initializes the tool. The fields are then auto filled.

When I try to do the same thing with my PyMel script I get the (Error: line 1: Cannot find procedure “superStitcher”). Is this because it has to specifically be mel scripts in these fields?

Also when I evaluate and run the script using ctrl+enter with the following mel evaluation it seems to work but nothing is happening?

My code at the moment is as follows:

from pymel.all import *
import pymel.core as pm
import maya.mel as m

def superStitcher():
	pm.artUserPaintCtx("artUserPaintCtx")
	print "Global process initialized"
	pm.artUserPaintCtx("artUserPaintCtx", 
		e = True, 
		ic = "initializeCommand", 
		fc = "finalizeCommand", 
		svc = "setValueCommand", 
		gvc = "getValueCommand")

def initializeCommand():
	print "Initialized"

def finalizeCommand():
	print "Finalized"

def setValueCommand():
	print "Set value command"

def getValueCommand():
	print "Get value command"

#superStitcher()
mel.eval("global proc superStitcher(){}")
mel.superStitcher()


If anyone has any idea where to point to I’d be hugely grateful

I am just about to embark on the same quest sir - I will chime in here with any discoveries.

MEL procedures and python are not the same thing.

mel.eval(“global proc superStitcher(){}”)

this will not work because superStitcher is a python function, not a MEL script.