Message 1 of 2
Why my code not working? Line width switch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I'm making code about switch line width. here's the code.
# -*- coding: utf-8 -*- my code
import maya.cmds as cmds
currentPanel = cmds.getPanel( wf =True )
panelType = cmds.getPanel( to=currentPanel )
if( panelType == "modelPanel" ):
lineWidth = cmds.modelEditor( currentPanel, q=True, lw=True )
if lineWidth > 1:
cmds.modelEditor( currentPanel, e=True, lw=4 )
else:
cmds.modelEditor( currentPanel, e=True, lw=1 )To switch anything use if-else right? why it does not work?
image
Line width default 1.0
Line width thick