Home Technical Talk

3dsmax UV Editor Transfer Edge Selection to Edit Poly?

The selection of whatever faces I have selected in the UV Editor carries over to Edit Poly no problem, but I can't seem to find a way to get edge or vert selection to carry over, does anyone know of a way?

It's simple enough to select the boarders of UV shells in the 3dsmax editor window, bind Open Edge Mode or Open Edge Select to a key and bam you're selecting the boarder edges of UV shells. However there doesn't seem to be a way to transfer that selection to Edit Poly.

What I'm trying to do is break the actual geometry along UV boarders, sort of a way to quickly force hard edges without having to monkey with smoothing groups. If the engine is going to break the geometry along smoothing and UV boarders anyway it would be helpful to see what that will look like without having to export/import and update. I think there might be a problem with max then displaying the normals "incorrectly" but there are half a dozen shaders floating around that probably correct this?

I've played around with renderhjs's UV<->3D tool but I can't really get it to work like I need. It always seems to merge things back together...

Long post short: Transfer Edge selection from UVW Unwrap to Edit Poly, Go...

Replies

  • Bal
    Offline / Send Message
    Bal polycounter lvl 17
    Yeah I looked around quite a bit and never found a way to do this either, would be nice. I don't understand why it's not in by default since they did it for face selections...
  • renderhjs
    Offline / Send Message
    renderhjs sublime tool
    I assume this won't work for you?
    textoolssmoothinggroups.jpg
    It monkeys with the smoothing groups though though I think its what you after in the end.
  • Mark Dygert
    Ah cool that will sort of help it gets it closer and work for somethings but it's not quite as ideal as being able to break the edges. Breaking the edges would allow me to select by element and give results more like like what would actualy go in game?
  • renderhjs
    Offline / Send Message
    renderhjs sublime tool
    maybe I will have a look tonight, see if I can wrap a script together that will add a editPoly modifier with outer edges of the UV shells converted to geo edges selected in the editPoly modifier ready to do stuff with.
  • Mark Dygert
    That would rock HJS! And thanks for textools tip that will come in handy for quite a few things.

    Maybe if it's impossible to transplant the edge selection, you might be able to expand on what you have and create elements based on the smoothing groups after transferring the UV shells to smoothing groups? I looked around for a script that could do it and didn't find any on script spot, I also tried creating it myself and holy balls are smoothing groups confusing...
  • Eric Chadwick
    Technically though most engines do not break the model into elements the way Max does. Only the vertex data that has to be duplicated actually _is_ duplicated. The vertex normals along the edge are not broken.

    Splitting your model "manually" is actually a bad thing, if you're keeping it like that, as it may force your exporter to keep all that extra vertex data around, in an attempt to preserve the artist's intent.

    Your mileage may vary of course. :)
  • renderhjs
    Offline / Send Message
    renderhjs sublime tool
    almost there (warning not yet complete or working!! with newer versions than max 9)
    function selectUVOuterEdges = (
    	
    	if (selection.count > 0)then(--at least an object selected
    		local obj = selection[1]; 
    		local uv = modPanel.getCurrentObject();
    		if( classof(uv) == Unwrap_UVW)then(
    			
    			print("yes UV modifier is there");
    			
    
    			uv.unwrap2.setTVSubObjectMode 2;
    			--get a list of all Shells filled with the Bitarary selections for each shell
    			uv.selectFaces #{1..uv.unwrap.numberPolygons()};
    			uv.facetoedgeselect();--all edges are selected
    			local allEdgesSelection = uv.unwrap2.getSelectedEdges();
    			local edgeElemArray = #();
    			for ed in allEdgesSelection do (
    				edgeElemArray[ ed ] = 0;
    			)
    			local elem = #();
    			with redraw off;
    			for ed in allEdgesSelection do (
    				if edgeElemArray[ ed ] == 0 then (
    					uv.unwrap2.selectEdges  #{ ed };
    					uv.unwrap2.selectElement();
    					local elemEdges = uv.unwrap2.getSelectedEdges() as array;
    					if elemEdges.count > 2 then (-- Ignore elements with less than 3 UV vertices.
    						append elem (uv.unwrap2.getSelectedEdges());
    						for i in elemEdges do (
    							edgeElemArray[ i ] = elem.count; -- Mark these vertices with their element number in vertElemArray.
    						)
    					)
    				)
    			)
    
    			--now get all the open Edges for all shells (elem = shell)
    			local openEdgesSelection = #{};--the final open Edges selection
    			for e in elem do(
    				local selections = #();
    				local selectionsNum = #();
    				local maxNum = 0;
    				for ed in e do(
    					uv.unwrap2.selectEdges  #{ ed };
    					uv.unwrap2.openEdgeSelect();
    					if ((uv.getselectededges()).numberset > 1)then(
    						local sel = ((uv.unwrap2.getSelectedEdges()) - #{ ed });--substract the original edge, kinda a bug in the openEdgeSelect method
    						openEdgesSelection+= sel;--add it to the bitarray (only not yet switched bits will be drawn)
    					)
    				)	 
    			)
    			
    			
    			uv.unwrap2.selectEdges openEdgesSelection;
    			local openEdgesGeo = uv.unwrap5.getSelectedGeomEdges();--convert the UV edges to Geo Edges bitarray
    			
    			print("edge sel "+openEdgesGeo as string);
    			
    			modPanel.addModToSelection (Edit_Poly ()) ui:on;
    			subobjectLevel = 2;
    			obj.modifiers[#Edit_Poly].SetSelection #Edge openEdgesGeo;
    		)
    	)
    )
    clearListener();
    selectUVOuterEdges();
    
    getSelectedGeomEdges is still broken on Autodesks side, I reported this alreayd last year to them but they are ignoring me.
    http://area.autodesk.com/forum/autodesk-3ds-max/maxscript/maxscript-function-uvgetselectedgeomedges-broken-/
    So I have to find another way to use a way to get the GeoEdges, will look into it further later. But the script is more or less done - except it fails because of AUtodesk, should work with max 9 though I guess because thats the last version it was not broken.
  • Mark Dygert
    Eric, yea fancy engines like Unreal are great at preserving normals, but not everyone is blessed to be working with software so awesome heh. The only way for me to get my normals to match is to break the geometry and bake with a welded cage. Confusing as hell but it gets rid of the seams in my case. Just a long process of selecting outer edges of the UV shells.

    I've contemplated installing my old copy of Maya just to get it done quickly... It's a 2 command process in Maya. Select, break done.

    HJS, YES!!! I've got 9 installed, along with every release since then, it seems to work fine in 9 so I thank ya for that! It's kind of weird opening up 9 and seeing my old UI layout.

    I submitted it as a legacy bug to Autodesk, I won't hold my breath there are about 6 or 7 legacy maxscript bugs I wish they would fix and never have. But one more complaint in the bucket never hurts to tip the scale.

    Thanks buddy, your awesome!
  • driewald
    I noticed in the original post that converting UV face selection to edit poly was easy, but edge conversion is something more difficult. Well i'm newish to max and I need to know how to convert Uv face selection to editable poly. Appreciate any help. thanks guys
  • uncle
    Time for a little revival.

    I've been searching for similar answer but found none. I want to transfer vertex selection from UVs to editable poly mode. Selecting faces and then converting to vertex selection is no-go this time.

    A picture to illustrate what I want to achieve... If anyone has something I'll be very glad :).
    Untitled-1.jpg
  • respawnrt
    Offline / Send Message
    respawnrt polycounter lvl 8
  • uncle
    Yes! It does exaclty what I want. Thanks respawnt, you saved me lot of tedious work! Much obliged.
  • oXYnary
    Offline / Send Message
    oXYnary polycounter lvl 18
    Its convoluted but here is what you need to do for hardening uv islands.

    Download Matts Turbo tools
    http://www.matthewlichy.com/turboTools.html
    Download Pier J's Edgesmooth
    http://edgesmooth.pjanssen.nl/

    Install both.


    Under Customize User Interface in the UV tools, look for one called "Open Edge Select". Add that to one of your quad menus when in UV mode.

    So.
    1. UV Edit, select one of the edges of the island, then hit the open Edge Select button. This will select the island (you can select more than one island at once by selecting an edge from each island).
    2. Turn your selection in to a vertex selection (ctl click on the vertex icon).
    3. Use Turbo Tools as shown above to make this into an Vertex selection on your mesh.
    4. Turn this selection under edit poly into an edge selection (ctl click on the edge icon).
    5. Shrink the Selection by one.
    6. Choose the Edge Harden.

    *If the edge is only one ring wide, shrinking by one will select the ring as well, so you have to deselect the ring manually before edge Harden.

    Is there any easier way to do this?
  • Eric Chadwick
  • Mark Dygert
    Even if they are crazy at least there are work arounds. Still it would be nice if they finally got their act together and incorporated something much simpler in max.
  • oXYnary
    Offline / Send Message
    oXYnary polycounter lvl 18
    Is there another method of hard edges that actually works with the vertex? All Harden edge does is make smoothing groups, and fades out the edge with two smoothing groups one poly out.

    This is leading to wacky results with things like triangles being one polygon out.
  • Eric Chadwick
    Can you post an example?

    Smoothing Groups are really just an abstraction of vertex normals. If you want to see what they're doing, add an Edit Normals modifier. A vertex on a hard edge has two vertex normals, one for each side's polygon. A vertex at the end of one of those hard edges, where the poly share SGs, just has a single vertex normal.
  • oXYnary
    Offline / Send Message
    oXYnary polycounter lvl 18
    I'm not on the computer right now. I discovered if I exported the model (after applying the hard edges script), as an obj with its normals checked, then reimported. These errors were gone as it "locked" the normals for the model along the hardened edges versus using smoothing groups. So the visual errors that having smoothing groups fade in and out, (ie polyies with more than one smoothing groups one ring out from the seam), disappeared.

    The only problem with this:
    1. That of course there is the extra step to export/import.
    2. The normals for each vertex are locked in place. Smoothing groups have no effect on the model. While resetting the normals to average will still lockout the smoothing groups. The only way I have found to "reset" the model is export/import again with export normals off.
  • Eric Chadwick
    What errors? There are some viewport-only smoothing errors after using the EdgeSmooth script, which aren't present when rendering or exporting. Is that what you're talking about? I kill them by adding an Edit Normals modifier, then collapsing the stack.
  • oXYnary
    Offline / Send Message
    oXYnary polycounter lvl 18
    Yea, those ones. I didn't realize that an edit normals would solve this without export/reimport. Is this workflow noted somewhere?
  • Eric Chadwick
  • oXYnary
    Offline / Send Message
    oXYnary polycounter lvl 18
    Sigh* Google fails again. This thread came up when I was searching about hard edges and selections.
  • jazznazz
    Offline / Send Message
    jazznazz polycounter lvl 13
    Hi there, on roughly the same topic: is there an easy way to transfer via MaxScript the edge selection from edit poly object to unwrap UVW modifer? I'm a masxcript newbie, and want to hack a quick tool that helps with UVing:

    1. select the edges that are going to be seams in EDIT POLY (NOT Uwrap UVW, I hate it's selection tools - slow as hell )
    2. add Unwrap UVW to the object, transfer the selected edges.
    3. convert the selection to pelt/peel seams, do quick peel, voila :)
    This wonderful tool had the same workflow - http://www.luxinia.de/index.php/ArtTools/3dsmax#lscm , but it's not working with Max 2012/13 ...
  • copenhagenjazz
    Offline / Send Message
    copenhagenjazz polycounter lvl 14
    Jazznazz; Did you find a way to carry over your Edit Poly edge selection to your unwrap modifier?

    I found this thread in which they discuss the same matter; http://forums.cgsociety.org/archive/index.php?t-1256804.html
  • jazznazz
    Offline / Send Message
    jazznazz polycounter lvl 13
    Heh, I didnt find a way, but I helped Miauu create the Easy Peel, part of these scripts: http://miauumaxscript.blogspot.bg/p/miauus-script-pack-vol2.html . Basically It does what i've described in the previous comment. 
    This should work imho: 
    Yes it's possible. The EDGE ID is always the same, because the edge under the ID stores the mapping data (UV coordinates in this case) in the Mapping channel. So currently you just have to store the selection in a global variable and pass it to the unwrap uvw modifier. 

Sign In or Register to comment.