[Closed] Select UV's Element mode?
Im trying to select uv’s in element mode and the code doesnt seem to work.
Again, it works when i setp through the code, but when i run the script nothing happens…
--mySelection is currently selected face in edit poly
subobjectLevel = 0
modPanel.addModToSelection (Unwrap_UVW ()) ui:on
subobjectLevel = 3
myObj.modifiers[#unwrap_uvw].unwrap2.setTVElementMode true
--myObj.modifiers[#unwrap_uvw].unwrap.selectPolygons mySelection --select original selection
myObj.modifiers[#unwrap_uvw].unwrap2.selectFaces mySelection
myObj.modifiers[#unwrap_uvw].unwrap2.selectElement()
does something similar work for anyone else?
The line “subobjectLevel = 3” change the sub object mode of the base of your object, not the mode of the modifier unwrap, Gibbz
to change the unwrap sub object mode, use this:
myObj.modifiers[#unwrap_uvw].unwrap2.setTVSubObjectMode 3
I think that does work like this
ok max 8 is a little difrent, they sem to change the modifier and the TV selection (ie they are the same in max 8 it seems).
I did try that extra code, it didnt help.
The problem is when i select the face(via script), it selects just the face, not the element.
A work around i think is to use “[b]expandGeomFaceSelection/b” and just loop through say 100times. This should select all the faces. Its a pretty dodgey work around…
Here is how I select one cluster.
for example the cluster which contain face 1:
obj=plane length:100.0 width:100.0
objUnwrapMod=Unwrap_UVW()
addModifier obj objUnwrapMod
modPanel.setCurrentObject objUnwrapMod -- useful for update below
objUnwrap2=objUnwrapMod.unwrap2
objUnwrap2.setTVSubObjectMode 3
objUnwrap2.setTVElementMode true
f=1
objUnwrap2.selectFaces #{f}
objUnwrap2.selectElement()
currentCluster=objUnwrap2.getSelectedFaces()
format "currentCluster = %
" currentCluster
I would be really astonished that it does not work with 3DSmax8.
Keep me informed about the compatibility
Yeah im not shure if its me or something im doing, but ive noticed maxscript for unwrap uvw modifier is really buggy. I am in contact with someone at autodesk, so hopefully i can find if its a bug or something im doing wrong.
Thanks
The unwrap modifier is not buggy but it is true that it’s hard to use.
It is very dependent of the context.
Currently when I want to make something with an unwrap modifier I set the right context with this function:
fn setUnwrapContext obj objUnwrapMod =
(
if modPanel.getCurrentObject()==undefined do max modify mode
if selection.count!=1 do select obj
if selection[1]!=obj do select obj
if modPanel.getCurrentObject()!=objUnwrapMod do modPanel.setCurrentObject objUnwrapMod
)
where “obj” is your object and “objUnwrapMod” the modifier of this object ( something like objUnwrapMod=obj.modifiers[1] or objUnwrapMod=Unwrap_UVW() )
You can also use “modPanel.setCurrentObject objUnwrapMod” to update the modifier if it’s necessary…
I actually think its buggy in max 8. As some stuff that works at home, doesnt work at work, and some stuff that works at work, doesnt work at home.
Either that or my max install has gone astray