Notifications
Clear all

[Closed] Hide viewport geometry in Unwrap_UVW modifier

I’m trying to find a way to hide viewport geometry while unwrapping an object, but the only function I’ve found ( (modpanel.getCurrentObject()).hideSelectedPolygons() ) related to it doesn’t seem to do anything? Its easy to hide/unhide the selected geometry in the floating Edit UVWs window, but that’s not nearly as useful.

8 Replies

bump. Still haven’t found a good solution to this.

use baseobject methods … for example polyop.sethiddenverts (or faces)

Sadly that method doesn’t really work…it does make the components invisible, but they still remain selectable.

hidden faces are not selectable and make their corresponding verts not-selectable as well.

if you want to make map faces not-selectable hide them with geo

If you are in the Unwrap_UVW modifier, and then run this:

 polyop.sethiddenfaces $ #{1..200}
 
 faces 1-200 will be hidden, but you can still click on them in the viewport. If however you go to the base object in the stack and run that they will become invisible AND cannot be selected. However, this will remove all your pelt seams once you go back up to the UVW modifier.
 
 Alternatively, if you go down in the stack and run:
 
 $.ButtonOp #HideSelection
 
 The faces will be hidden and when you go back up to the UVW modifier not only will they be unselectable (which is what we want), but the pelt seams will also remain intact.
 But this function doesn't work at all while the user is in the UVW modifier. You could of course have the script step down in the stack, hide the faces, and then go back up, but is certainly less then ideal.

Edit:
Looks like the selectable hidden faces issue happens with the second posted function too, but its weirdly intermittent. Sometimes if I randomly change subobject level afterwords they’ll become unselectable, and other times they refuse to do so. ugh.
Here’s the basic script (it’s terribly hacky, but there’s no good reason I can see why it shouldn’t work…):


 if (subobjectLevel == 3) do (
 	uvFacs = (modpanel.getCurrentObject()).getSelectedFaces()	
 	modpanel.setCurrentObject $.baseObject
 	subobjectLevel = 4
 	$.EditablePoly.SetSelection #Face uvFacs
 	$.ButtonOp #HideSelection
 	subobjectLevel = 0
 	modpanel.setCurrentObject $.modifiers[1]
 	subobjectLevel = 3
 	(modpanel.getCurrentObject()).unwrap6.selectFacesByNode #{} $
 )
 

i don’t understand what is the problem:

delete objects

s = sphere name:#s segments:24 radius:10 wirecolor:yellow mapcoords:on realWorldMapSize:off
converttopoly s
uvmod = Unwrap_UVW()
addmodifier s uvmod
uvmod.quick_map_preview = off
modpanel.setcurrentobject uvmod ui:on
uvmod.setTVSubObjectMode 3 --subobjectLevel = 3

faces = #{121..168}

uvmod.selectFacesByNode faces s
uvmod.breakSelected()
--uvmod.hide()
polyop.sethiddenfaces s.baseobject faces
verts = polyop.getvertsusingface s.baseobject faces
--polyop.sethiddenverts s.baseobject verts
uvmod.Edit()
update s

faces are not visible and not selectable

seams are visible

what is missed?

Well that’s weird. Seems the faces only become unselectable if the “Edit UVWs” window is opened, otherwise the modifier doesn’t properly refresh what are selectable components. So it can be done like this:

polyop.sethiddenfaces $.baseobject ((modpanel.getCurrentObject()).getSelectedFaces())
    (modpanel.getCurrentObject()).hide() --Hides faces in the Edit UVW floater window
    (modpanel.getCurrentObject()).Edit() --Must be called even if Edit UVW window already open.
    
 Thanks for the help :)

the hiding of map faces is not necessary, but you have to open uvw editor at least once. probably on open editor the unwrap_uvw modifier builds some sort of cached data for geo faces for quick pick-test. so that means we need to open editor every time we change geo visibility.

i didn’t know about this behavior. so it will be cool to find a way to update this pick-test data