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<[email protected]> 写道:
> Hello there, somebody would know how can I enable a specific component
> selection mode? Just like right-click + edge (upward).
>
> 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/96eef561-7026-4852-a060-2ba51d2028f1n%40googlegroups.com.