this seems to work better, and it doesn't remove all the mel from your
previous history in the panel, just the bit you don't want.



from pymel.core import *

def quietThis(this):
    myRep = mel.eval('$temp = $temp = $gCommandReporter ')
    origText = cmdScrollFieldReporter (myRep, query = True , text = True)
    cmdScrollFieldReporter (myRep, edit = True , clear=True)
    cmdScrollFieldReporter (myRep, edit = True , filterSourceType = "mel")
    exec(this)
    niceText = cmdScrollFieldReporter (myRep, query = True , text = True)
    cmdScrollFieldReporter (myRep, edit = True , filterSourceType = "")
    cmdScrollFieldReporter (myRep, edit = True , text = (origText+niceText))


quietThis("shader, shaderSG=createSurfaceShader('surfaceShader')")





On Tue, Mar 23, 2010 at 9:17 PM, John Creson <[email protected]> wrote:
> this might help, but it needs a better way to grab the name of the history 
> panel
>
> from pymel.core import *
>
> cmdScrollFieldReporter (
> 'scriptEditorPanel1Window|TearOffPane|scriptEditorPanel1|formLayout37|formLayout39|paneLayout1|cmdScrollFieldReporter1',
> edit = True, fst = "mel")
>
> shader, shaderSG=createSurfaceShader('surfaceShader')
>
> myText = cmdScrollFieldReporter (
> 'scriptEditorPanel1Window|TearOffPane|scriptEditorPanel1|formLayout37|formLayout39|paneLayout1|cmdScrollFieldReporter1',
> query = True, text=True)
>
>
> cmdScrollFieldReporter (
> 'scriptEditorPanel1Window|TearOffPane|scriptEditorPanel1|formLayout37|formLayout39|paneLayout1|cmdScrollFieldReporter1',
> edit = True, fst = "")
> cmdScrollFieldReporter (
> 'scriptEditorPanel1Window|TearOffPane|scriptEditorPanel1|formLayout37|formLayout39|paneLayout1|cmdScrollFieldReporter1',
> edit = True, text = myText)
>
>
>
>
>
> On Tue, Mar 23, 2010 at 1:31 PM, Chad Dombrova <[email protected]> wrote:
>> that output is caused by the mel script renderCreateNode. there's probably
>> some evalEcho's in there.
>>
>> try this:
>> renderCreateNode("-asShader","surfaceShader", "surfaceShader", "",
>> 0,0,0,1,0,"" )
>>
>> -chad
>>
>>
>> On Mar 23, 2010, at 9:47 AM, Chris G wrote:
>>
>>> Is there a way to suppress the mel code which is echoed to the history
>>> pane for something like:
>>> from pymel.core import *
>>> shader, shaderSG=createSurfaceShader('surfaceShader')
>>>
>>> Which results in:
>>> shadingNode -asShader surfaceShader;
>>> // Result: surfaceShader9077 //
>>> sets -renderable true -noSurfaceShader true -empty -name
>>> surfaceShader9077SG;
>>> // Result: surfaceShader9077SG //
>>> connectAttr -f surfaceShader9077.outColor
>>> surfaceShader9077SG.surfaceShader;
>>> // Result: Connected surfaceShader9077.outColor to
>>> surfaceShader9077SG.surfaceShader. //
>>>
>>> Thanks
>>>
>>> --
>>> http://groups.google.com/group/python_inside_maya
>>>
>>> To unsubscribe from this group, send email to
>>> python_inside_maya+unsubscribegooglegroups.com or reply to this email with
>>> the words "REMOVE ME" as the subject.
>>
>> --
>> http://groups.google.com/group/python_inside_maya
>>
>> To unsubscribe from this group, send email to
>> python_inside_maya+unsubscribegooglegroups.com or reply to this email with
>> the words "REMOVE ME" as the subject.
>>
>

-- 
http://groups.google.com/group/python_inside_maya

To unsubscribe from this group, send email to 
python_inside_maya+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to