How to set trusted plugin location and other security preferences globally

How to set trusted plugin location and other security preferences globally

asi.sudai
Participant Participant
672 Views
1 Reply
Message 1 of 2

How to set trusted plugin location and other security preferences globally

asi.sudai
Participant
Participant

Hi!

 

How can we change Maya's new security preferences settings programmatically or better yet, vie environment variables, so changes can be made on a studio level?

 

Specifically asking about these settings A, B and C:

asisudai_0-1634244477217.png

 

Thank you in advance,

Asi

673 Views
1 Reply
Reply (1)
Message 2 of 2

adam_sirrelle5RTYF
Community Visitor
Community Visitor

You can use the cmds.optionVar()

plugin_paths = [r"C:/my_projects/tools/plugins"]

for each_plugin_path in plugin_paths:
    if each_plugin_path not in cmds.optionVar(q="SafeModeAllowedlistPaths"):
        cmds.optionVar(category="Security", stringValueAppend=("SafeModeAllowedlistPaths", each_plugin_path))

 
This will trigger an alert once for the user telling them they are changing their security preferences, but after that they should receive no more alerts.

0 Likes