View Full Version : Select UV's Element mode?
Gibbz 11-17-2005, 11:39 PM 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?
|
|
prettyPixel
11-18-2005, 12:25 AM
--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].unwrap2.selectFaces mySelection
myObj.modifiers[#unwrap_uvw].unwrap2.selectElement()
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
Gibbz
11-18-2005, 11:35 AM
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 "expandGeomFaceSelection()" and just loop through say 100times. This should select all the faces. Its a pretty dodgey work around....
prettyPixel
11-18-2005, 12:15 PM
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 = % \n" currentCluster
I would be really astonished that it does not work with 3DSmax8.
Keep me informed about the compatibility
Gibbz
11-18-2005, 12:44 PM
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 :D
prettyPixel
11-18-2005, 01:56 PM
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...
Gibbz
11-18-2005, 02:06 PM
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 :)
CGTalk Moderation
11-18-2005, 02:06 PM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.