runtime commands

73 views
Skip to first unread message

David Mwangi

unread,
Dec 20, 2017, 8:17:43 AM12/20/17
to Python Programming for Autodesk Maya
I am looking to incorporate a runtime command in a small custom script I made and I cant find any information on how to query one. At least one I can understand that is.

Basically I want to use 'AttachBrushToCurves' to the script below or if need be depending on what the runtime command is really made up of: 


import pymel.core as pm
shapes = [s.getShape() for s in pm.ls(sl=1)]

for curves in :
    setAttr(curves + 'AttachBrushToCurves', 1)

I'm also just getting into this but Im sure the runtime command needs some work before just being incorporated into the script. 


Tim Fowler

unread,
Dec 20, 2017, 9:38:44 AM12/20/17
to python_in...@googlegroups.com
The MEL I'd use to kind of figure out what is what...

Confirm it's a runTimeCommand...
whatIs AttachBrushToCurves
// Result: Run Time Command //

Query what command it calls when you call it...
runTimeCommand -q -command AttachBrushToCurves
// Result: convertCurvesToStrokes // 

Figure out what that is...
whatIs convertCurvesToStrokes
// Result: Script found in: C:/Program Files/Autodesk/Maya2018/scripts/paintEffects/convertCurvesToStrokes.mel // 

Then you can go open that .mel file to see what it does exactly.  It does quite a bit, and I'm not sure what you want to do with it, so you might have to poke around there and see if you can pull out whatever it is you're looking for.

-Tim


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/8cdbd8a9-099f-45fc-91c0-e09112a6a74b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Mwangi

unread,
Dec 20, 2017, 10:42:34 AM12/20/17
to Python Programming for Autodesk Maya
Thanks Tim,

I will. I found a "brute force" workaround but I need to know what it does. 

Thanks again.

Andres Weber

unread,
Dec 20, 2017, 8:32:22 PM12/20/17
to Python Programming for Autodesk Maya
Whoa I didn't know about the runTimeCommand -q -command flags.  Learn something new every day!
Reply all
Reply to author
Forward
0 new messages