[Closed] Need help: UV Loop selection
Hello,
I am trying to make a function to select the next adjacent loop in the unwrap modifier.
i have:
(
local uv = modpanel.getcurrentobject() -- the unwrap modifier
local cursel = uv.getSelectedEdges() -- get edge selection
uv.uvEdgeSelect() -- select the loop
SelNextLoop() -- ???? HOW ???
)
If it were within Editable_Poly, that would be easy:
$.SelectEdgeLoop()
$.setRingShift 1 true false -- select next loop using the ringshift method
But How to do this within Unwrap mod ?
I have tried to pass the edge selection to the baseobject(editable_poly) to be able to use the editable_poly methods with no success...
Thanks for any advice
Cheers
max 2010:
–Loop Selection
unwrap_uvw.uvLoop 0
–Loop Grow
unwrap_uvw.uvLoop 1
–Loop Shrink
unwrap_uvw.uvLoop -1
–Ring Selection
unwrap_uvw.uvRing 0
–Ring Grow
unwrap_uvw.uvRing 1
–Ring Shrink
unwrap_uvw.uvRing -1
Hi,
Thanks Denis, I already know these functions.
But this doesn’t really help me. I don’t want to grow or shrink a loop, I would like to select the adjacent one… How can I select the next loop using those ?
Cheers
i didn’t read your original post carefully. well…
there are no methods in unwrap interfaces to select next(previous) edge loop. and there are not methods similar to edatblepoly setRingShift.
but if your unwrap modifier applied to editable poly you can use editablepoly.setRingShift method to change geom edges selection and synchronize geom edge selection and uvw edge selection.
here is a scenario:
$.setRingShift 1 on off
$.ConvertSelection #edge #vertex
geoverts = $.getselection #vertex
mapverts = <convert geoverts to mapverts> – your function
$.unwrap_uvw.selectvertices mapverts
$.unwrap_uvw.vertToEdgeSelect()
Thanks a bunch denis,
I finally managed to do it !!!
fn uvLoopShift val =
(
local uv = modpanel.getcurrentobject() -- the unwrap modifier
local selMode=uv.getTVsubobjectmode()
if selMode == 1 or selMode == 2 do --works in vert or edge subobject mode
(
if selMode == 2 do uv.edgeToVertSelect() -- convert sel to vert
local uvgeomVerts=uv.getSelectedGeomVerts() -- get the geom verts
$.setselection #Vertex uvgeomVerts -- pass selection to the baseobject
$.ConvertSelectionToBorder #Vertex #Edge -- convert the selection to edges
$.setRingShift val on off -- shift the loop
$.ConvertSelection #Edge #Vertex -- convert selection back to vert
local geoverts = ($.getselection #vertex) as bitarray -- get the vert selection
uv.setSelectedGeomVerts geoverts -- select the uv geom verts
uv.syncTVSelection() -- update the Uv verts selection in unwrap mod
if selMode == 2 do uv.verttoedgeSelect() -- convert to original subobject mode
uv.setTVsubobjectmode selMode -- set subobject to original
)
)
Note: I did try with edge selection, but uv.getSelectedGeomEdges() always returns undefined as uv.getSelectedGeomVerts() works fine... weird ... any ideas ?
Cheers ;)
You may copy the mapping data onto the actual geometry which results in an UV-layout in the viewport where you can apply an Edit Poly modifier and use all it’s tools.