LumaPictures / pymel

Python in Maya Done Right
Other
490 stars 131 forks source link

Python Callback inside scriptCtx does not work #324

Open pmolodo opened 9 years ago

pmolodo commented 9 years ago

From theonlyd...@hotmail.com on November 01, 2012 05:42:40

Doing anything other than a mel string callback inside of "scriptCtx" doesn't seem to work.

I am using Maya 2013 64-bit on Windows 7 64-bit

I am using pymel version 1.0.4

Here is some basic code to reproduce the problem:


from pymel.core import *

def custom_print(*args): print(args)

custom_select = scriptCtx( title="custom_select", fcs=custom_print, locator=True, totalSelectionSets=1, setAutoToggleSelection=True, setSelectionCount=1, setAutoComplete=True, cumulativeLists=True, expandSelectionList=True)

setToolTo(custom_select)


The result is this:

select -r locator1 ; { string $Selection1[]; $Selection1[0] = "locatorShape1"; <function callback at 0x000000001052C668>; }; // Error: <function callback at 0x000000001052C668>; }; // // Error: Line 2.1: Syntax error //

Original issue: http://code.google.com/p/pymel/issues/detail?id=290