Specific component selection mode

290 views
Skip to first unread message

João Victor

unread,
Aug 10, 2021, 1:40:47 PM8/10/21
to Python Programming for Autodesk Maya
Hello there, somebody would know how can I enable a specific component selection mode? Just like right-click + edge (upward).

thanks a lot.

TTw TTa

unread,
Aug 11, 2021, 4:52:02 AM8/11/21
to Python Programming for Autodesk Maya

```mel

doMenuComponentSelectionExt("pCube1", "meshComponents", 0);

doMenuComponentSelectionExt("pCube1", "edge", 0);

doMenuComponentSelectionExt("pCube1", "facet", 0);

doMenuComponentSelectionExt("pCube1", "vertex", 0);

```

João Victor

unread,
Aug 20, 2021, 1:44:07 PM8/20/21
to python_in...@googlegroups.com
Sorry for the delay! Some emails from groups are going to spam..
I tried it but I received: // Error: line 1: Cannot find procedure "doMenuComponentSelectionExt". //
Any suggestion? thanks a lot!

--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/795ea4c3-2d9f-414f-9f81-322cc59ce16bn%40googlegroups.com.

TTw TTa

unread,
Aug 22, 2021, 10:59:29 PM8/22/21
to Python Programming for Autodesk Maya
after my test, if you what to use it ,you must change selection mode manually first ,then you can use it,,I will find a better way to finish it,please  take a minute 

TTw TTa

unread,
Aug 23, 2021, 12:54:56 AM8/23/21
to Python Programming for Autodesk Maya
import maya.cmds as cmds
import maya.mel as mel

current_model_panel = cmds.playblast(ae=True)


current_model_panel += "|" + current_model_panel.rsplit("|")[-1]

object_name = "pCube1"
cmds.setParent(current_model_panel + "ObjectPop", menu = 1)
mel.eval("""buildObjectMenuItemsNow "{model_panel}ObjectPop";""".format(model_panel = current_model_panel))
mel.eval("""dagMenuProc("{model_panel}ObjectPop", "{dag_name}");""".format(model_panel = current_model_panel, dag_name = object_name))
# mel.eval("maintainActiveChangeSelectMode pCube1 0;")  object mode
mel.eval("""source "C:/Program Files/Autodesk/Maya2020/scripts/others/dagMenuProc.mel" """)
mel.eval("""doMenuComponentSelectionExt("{dag_name}", "vertex", 0);""".format(dag_name = object_name))


it us the finally code

在2021年8月11日星期三 UTC+8 上午1:40:47<joaovi...@gmail.com> 写道:

João Victor

unread,
Aug 23, 2021, 7:13:36 AM8/23/21
to python_in...@googlegroups.com
Thanks a lot man!
I will try that! 

Joao Victor

On 23 Aug 2021, at 01:54, TTw TTa <wwn150...@gmail.com> wrote:


--
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_m...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages