Hello!
When I start Maya and when I switch workspaces, Multisample Anti-Aliasing in Viewport 2.0 is turned off. How to make it default? Maya 2017 Update 3, DirectX 11 engine for Viewport2.0.
Solved! Go to Solution.
Solved by sibleon. Go to Solution.
Solved by morten_bohne. Go to Solution.
import pymel.core as pm hwr = pm.PyNode("hardwareRenderingGlobals") try: hwr.multiSampleEnable.set(1) except: print("Couldn't set Anti-aliasing")
there was a thread with a similar question some time ago, maybe that can help you with a way of running the code every time you open a scene: https://forums.autodesk.com/t5/maya-programming/load-python-script-on-startup/m-p/7148208/highlight/...
as far as i remember that solution there creates a scriptjob on SceneOpened from the usersetup.py, and in there you can throw all your settings (or even load different settings depending on the file)
You can add the following MEL to your userSetup.mel file. This will enable AA whenever you open a file or create a new scene. See the documentation on the userSetup.mel file
global proc enableAA() { setAttr hardwareRenderingGlobals.multiSampleEnable 1; print "Enabled anti-aliasing\n"; } scriptJob -event "SceneOpened" enableAA; enableAA();
This doesn't seem to work in Maya 2020...I have tried creating a userSetup.mel file in the script folder (using Windows notepad) but it doesn't do anything..Any ideas?
Just tested it in Maya 2020.4 (Windows) and it works fine.
Things to check:
I have attached my userSetup.mel for you to try.
Do you know the code for multisampling, so it will be i.e. 16 each time?
Can't find what you're looking for? Ask the community or share your knowledge.