PDA

View Full Version : What's the command for highlighting border edges?


DeadlyNightshade
07-20-2012, 10:09 AM
...and texture borders?

I use the custom polygon display a lot but 90% of the time it's for turning on/off border edges (to search for corrupt geometry and holes) and for turning on/off texture borders (for unwrapping). I have this as a hotkey but I think things would be faster if I could directly hotkey these two commands.

And instead of making a new thread:
What's the command for turning on/off backface culling?

depakeen
07-20-2012, 11:11 AM
This should work :

global proc SwitchBorderEdges ()
{
string $objList [] = `ls -sl`;

if (`size $objList`)
{
for ($obj in $objList)
{
int $oldValue = `getAttr ($obj + ".db")`;

if ($oldValue)
$value = 0;
else
$value = 1;

setAttr ($obj + ".db") $value;
}
}
else
warning "You must select an object!";
}

SwitchBorderEdges ();

rgkovach123
07-20-2012, 11:03 PM
i would use the 'polyOptions' command. It can operate on the scene as a whole without having to loop through each mesh and check attributes.

import maya.cmds as cmds
cmds.polyOptions(gl=True, displayMapBorder=True)

backface culling is a little trickier. There is Viewport-based Backface Culling and Object-based Backface Culling.

I am going to assume you are referring the Viewport based backface culling.

# You'll have to jump through some hoops to find the actual active panel.
# by default, the perspective camera is usually hooked up to 'modelPanel4'.
editor = 'modelPanel4'
cmds.modelEditor(editor, edit=True, backfaceCulling=True)

If you are looking for MEL examples, goto the Hotkey Editor and use the Seach feature. You can find all kinds of MEL code to control UI options that don't have default key-assignments.

DeadlyNightshade
07-21-2012, 09:07 AM
i would use the 'polyOptions' command. It can operate on the scene as a whole without having to loop through each mesh and check attributes.

import maya.cmds as cmds
cmds.polyOptions(gl=True, displayMapBorder=True)

backface culling is a little trickier. There is Viewport-based Backface Culling and Object-based Backface Culling
...

If you are looking for MEL examples, goto the Hotkey Editor and use the Seach feature. You can find all kinds of MEL code to control UI options that don't have default key-assignments.
Your first script gives me an error: //Error: Invalid use of Maya object "True".
I tried adding quotation marks to "true" but that gives me the same error but on the gl-attribute.

I found this on the web though and it works (as a toggle):
polyOptions -r -displayMapBorder 1 -activeObjects
...for border edges and
polyOptions -r -displayMapBorder 2 -activeObjects
...for texture borders

As for your last tip:
I'm well aware of that and to be perfectly honest, I do not know why I don't look around a bit more. I have this impression that many functions that I want is not there.
I did find a very good culling toggle in the hotkey editor though:
setPolygonDisplaySettings("culling")

And another command:
setPolygonDisplaySettings("vertexCulling"); (maybe is that object culling you talked about?)

CGTalk Moderation
07-21-2012, 09:07 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.