Hello I search how to made a swap button for smooth wireframe
I've those command line
-the first to put on smooth:
///////////////////////////////////////////////////////////////////////////////////////
setAttr hardwareRenderingGlobals.lineAAEnable true; modelEditor -e -smoothWireframe true modelPanel4;
updateModelPanelBar MainPane|viewPanes|modelPanel4|modelPanel4|modelPanel4;
dR_setModelEditorTypes;
///////////////////////////////////////////////////////////////////////////////////////
The second to put off smooth
///////////////////////////////////////////////////////////////////////////////////////
setAttr hardwareRenderingGlobals.lineAAEnable false; modelEditor -e -smoothWireframe false modelPanel4;
updateModelPanelBar MainPane|viewPanes|modelPanel4|modelPanel4|modelPanel4;
dR_setModelEditorTypes;
///////////////////////////////////////////////////////////////////////////////////////
Thanks for your help
If anyone can explain me what the following command line does
updateModelPanelBar MainPane|viewPanes|modelPanel4|modelPanel4|modelPanel4;
dR_setModelEditorTypes;
Solved! Go to Solution.
Solved by sean.heasley. Go to Solution.
Solved by sean.heasley. Go to Solution.
Hi @Anonymous
I almost have this figured out
The only issue is that smooth preview only works when a model is selected. In this case, the MEL script looks for a name "mymesh". So in your scene whatever object you're working with you'd want the name to match the script.
To turn on the wireframe and smooth the mesh use this:
setWireframeOnShadedOption true modelPanel4;
setAttr mymesh.displaySmoothMesh 2;
And to turn off the wireframe and the smooth preview use this:
setWireframeOnShadedOption false modelPanel4;
setAttr mymesh.displaySmoothMesh 0;
I'm going to test a little bit more and see if I can figure out how to get around the naming so all you have to do is have the object selected.
All the best,
Sean Heasley
Technical Support Specialist
Autodesk Here to Help | My Screencasts | Autodesk Virtual Agent | How To Reset User Settings | Installation and Licensing Forum | Maya Certified Hardware |
Hi @Anonymous
I'm just checking in again to see if you need more help with this. Did the suggestion I provided on Friday work for you?
If so, please click Accept as Solution on the posts that helped you so others in the community can find them easily.
All the best,
Sean Heasley
Technical Support Specialist
Autodesk Here to Help | My Screencasts | Autodesk Virtual Agent | How To Reset User Settings | Installation and Licensing Forum | Maya Certified Hardware |
I assume you mean the Smooth Wireframe feature of the Legacy Viewport?
viewPanels = cmds.getPanel( type='modelPanel' ) if viewPanels: v = cmds.modelEditor(viewPanels[0], q=True, smoothWireframe=True) cmds.modelEditor(viewPanels[0], e=True, smoothWireframe=not v)
Is the Smooth Wireframe option of VP2 (lineAAEnable) doing anything for anybody?
I realize that I was not very clear in my question. I'm just trying to make a button for the shelf to switch between wireframe on and off
So, it's just about Wireframe vs Shading, not about the "Smooth Wireframe" viewport renderer option?
But what about the buttons on the view panel toolbar or the hotkeys (4, 5) which are supposed to fulfill this task? What are you missing with those?
Hi @Anonymous
Ah in that case there is a button by default at the top of the viewport that looks like this:
Please let me know if this helps or if you need any more assistance!
If one or more of these posts helped answer your question, please click Accept as Solution on the posts that helped you so others in the community can find them easily.
Kudos are greatly appreciated. Everyone likes a thumbs up!
All the best,
Sean Heasley
Technical Support Specialist
Autodesk Here to Help | My Screencasts | Autodesk Virtual Agent | How To Reset User Settings | Installation and Licensing Forum | Maya Certified Hardware |
Hi @Anonymous
I'm just checking in again to see if you need more help with this. Did the suggestion I provided yesterday work for you?
If so, please click Accept as Solution on the posts that helped you so others in the community can find them easily.
All the best,
Sean Heasley
Technical Support Specialist
Autodesk Here to Help | My Screencasts | Autodesk Virtual Agent | How To Reset User Settings | Installation and Licensing Forum | Maya Certified Hardware |
Hi @Anonymous
Okay then the code I linked before should work:
Add this code to a button to turn Wireframe ON:
setWireframeOnShadedOption true modelPanel4;
Add this code to a button to turn Wireframe OFF:
setWireframeOnShadedOption false modelPanel4;
So add these two lines to two separate buttons for a shelf and then you'll have two options on your custom marking menu to turn wireframe on/off.
Please let me know if this helps or if you need any more assistance!
If one or more of these posts helped answer your question, please click Accept as Solution on the posts that helped you so others in the community can find them easily.
Kudos are greatly appreciated. Everyone likes a thumbs up!
All the best,
Sean Heasley
Technical Support Specialist
Autodesk Here to Help | My Screencasts | Autodesk Virtual Agent | How To Reset User Settings | Installation and Licensing Forum | Maya Certified Hardware |
Hi! I've already done this two button thanks.
I just want to know if it's possible to make a single on/off button.
I know I'm really annoying.
Hi @Anonymous
You aren't annoying at all don't worry!
I think I know what will work for you!
I just created a button and have the command set to turn on the wireframe. So naturally when you press the button the wireframe turns on and if you press it again nothing happens.
I then added the turn off code to the double click section so if you double click the button the wireframe turns off.
Now, when I have the marking menu, if I highlight over it the wireframe turns on, and if I go to highlight again, there's a little option box and if I hover over that it turns off!
Please try this and let me know if it works for you!
If one or more of these posts helped answer your question, please click Accept as Solution on the posts that helped you so others in the community can find them easily.
Kudos are greatly appreciated. Everyone likes a thumbs up!
All the best,
Sean Heasley
Technical Support Specialist
Autodesk Here to Help | My Screencasts | Autodesk Virtual Agent | How To Reset User Settings | Installation and Licensing Forum | Maya Certified Hardware |
Hi @Anonymous
I'm just checking in again to see if you need more help with this. Did the suggestion I provided yesterday work for you?
If so, please click Accept as Solution on the posts that helped you so others in the community can find them easily.
All the best,
Sean Heasley
Technical Support Specialist
Autodesk Here to Help | My Screencasts | Autodesk Virtual Agent | How To Reset User Settings | Installation and Licensing Forum | Maya Certified Hardware |
Also, in addition to the wireframe toggle, I found this thread on Polycount with with a wireframe on shaded toggle as well. Really nice, I got my F3 and F4 keys back
https://polycount.com/discussion/148884/maya-hotkeying-shading-wireframe-on-shaded
Hope this helps for those coming over learning Maya
Can't find what you're looking for? Ask the community or share your knowledge.