Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Use MEL or Python to auto Open Preference Window and change the setting inside it?怎样可以使用MEL 或 Python来快速打开Preference窗口,并修改里面的东西?

1 REPLY 1
Reply
Message 1 of 2
wxr_sh_666
126 Views, 1 Reply

How to Use MEL or Python to auto Open Preference Window and change the setting inside it?怎样可以使用MEL 或 Python来快速打开Preference窗口,并修改里面的东西?

[MAYA2025]

How to Use MEL or Python to auto Open Preference Window and change the setting inside it?

怎样可以使用MEL 或 Python来快速打开Preference窗口,并修改里面的东西?

I need to change the preference setting very very often: 我需要频繁的点击:

Windows>Setting and Preferences>preferences>Display>View>里的Wireframe on Shaded,to paint用来绘制Vertex Color, When i am paint the vertex color,画的时候,I want the green selected Wireframe line disappear, so I change the Wireframe on Shaded to "None"我想让绿色的Wireframe消失,and after that I change it to "Full.

Is there any MEL or Python Language to change this option in one time? And Thankyou~!

有没有MEL 或 Python脚本,可以一键修改这个设置的方法?感谢!!

wxr_sh_666_0-1715483592140.png

或者有可以写在Runtime Command Editor里的就更好了。

It will be better if It can be make to a HotKey as well.

wxr_sh_666_1-1715483921485.png

Thankyou!!

 

Tags (2)
1 REPLY 1
Message 2 of 2
brentmc
in reply to: wxr_sh_666

Hi,

You can use the script editor to find out what underlying commands are being called when you change a UI value. Just 1) open the Preferences window and navigate to the Display settings 2) in the Script editor toggle on History > Echo All Commands 3) Toggle the preference off/on 4) Disable History > Echo All Commands.

Now look at the script editor history pane and you will see these commands.

 

displayPref -wsa "none";
displayPref -wsa "full";

 


So, with this knowledge, it is simple to make a script that will toggle this preference without opening the preferences window.

 

// Toggle wireframeOnShadedActive (-wsa) display preference
displayPref -wsa (`displayPref -q -wsa` == "none" ? "full" : "none");

 

Brent McPherson
Principle Engineer

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report