Home Technical Talk

misc. maxscript UV scripts/tools

1246714

Replies

  • Titus
    Options
    Offline / Send Message
    Titus polycounter lvl 14
    i agree with glib , this script is awesome, and you make a great job for all 3dsmax users :)
  • Joshua Stubbles
    Options
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    One small gripe I have is that the functions don't work when you're editing multiple objects. Like if you have 2 separate objects unwrapped in the same window, you can't use the edge/island aligner, etc.
    Otherwise it's top notch! I use it every day at work.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    One small gripe I have is that the functions don't work when you're editing multiple objects. Like if you have 2 separate objects unwrapped in the same window, you can't use the edge/island aligner, etc.
    he he just fixed that now (sorry no release yet),it was a bit tricky though as it did not worked for multiple objects using $ and doing things in a loop wouldn't make sense here either so I found a way of doing it just using the modifier stack object
    [php](modPanel.getCurrentObject()).unwrap.edit();[/php]
    which is now nice as it smartly assigns only new uv-unwrap modifiers if they are not present, not present at one of the objects of the selection (it then ads a instance uv-modifier to booth)- and it really works well.
    Of course this only goes well if you use max2008+ at max9 it should however still work with just 1 object selected,- it might puke errors though if you accidently select multiple objects in max9.

    Another important switch would be to actually support the custom UV-channel support that you can define at the top of the toolbar. Sadly because I was lazy at first it's not implemented everywhere where it can be applied- it then automaticly uses channel 1. So that might be a next target to get fixed.

    For booth issues I have been updating the information page on my domain.
    http://www.renderhjs.net/textools/
    I added a few columns in the table that indicate if the current development supports any UV-channel, multiple Objects and if it supports macroscripts e.g mapable scripts to your shortcuts. The state of that page reflects my current development build- not the one you can download.

    Because there are so many changed recently deep down to the core of many functions it's hard to quickly release a sub version without screwing up some parts or disabling some things. So I will try to wrap it soon into something that is inbetween and a little bit experimental.


    oh and thx for the charming words and feedback guysm, really appreciated
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    update release

    http://www.renderhjs.net/bbs/polycount/texture_maxscript_tools/uv_toolbox_0.98.mzp

    screenshot:
    uv_tex_tools_ui_0.89.gif




    changes since last public release:
    - macroscripts support for 7 functions atm.
    uv_tex_tools_ui_0.89_macroscripts.gif
    right now my key suggestions are in front of the name I'll wait for some comments about that (guess some wont like it at all :D )

    - stack shells (explained already before, I have some ideas for improvement there but no time yet to test it out)

    - info page update, lists buggy, supported, unsupported and non working features
    http://www.renderhjs.net/textools/

    - smaler interface (less buttons, nudge stuff is gone for now, same as AO settings)

    - partly multiple objects Unwrap support for max2008/2009, including: open/close editor, render uv template and uv selected faces, smart extend selection

    - new function: 'smart extend selection' though only available atm. as macroscript. It extends you selection of either faces or edges to that extend that when in face mode: it selects the whole shell that belongs to the faces. When one or more edges are selected it tries to edge-loop extend the selection (well as good as max can do).




    as for multiple object unwrap operations,- dont get your hopes to high- it seems autodesk fucked up again:
    http://area.autodesk.com/index.php/forums/viewforum/59/
    in short, the commands
    [php]unwrap.getSelectedVertices();[/php] and [php]unwrap2.getSelectedEdges();[/php] work not everywhere when editing multiple UVW`s- its somewhat random and its not logically related to multiple object- uv`s it even fails if I select the verts of just 1 UV or a edge.
  • Joshua Stubbles
    Options
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    nice! :D
    Will give it a run in a few.
  • Muzzoid
    Options
    Offline / Send Message
    Muzzoid polycounter lvl 10
  • Kovac
    Options
    Offline / Send Message
    Kovac polycounter lvl 18
    Killer stuff renderhjs! The one thing I'm having problems with is getting the AO map button to work at all... Every time I use it it will hang at:
    ao_bake.backgroundColor = color 0 0 0 0;

    The exception is -- Unknown property: "backgroundColor" in ReferenceTarget:Ambient_Occlusion__MR

    Am I missing something or is this a known issue?

    Thanks

    EDIT: Max 9 SP2 32bit with WinXP Pro
  • Wells
    Options
    Offline / Send Message
    Wells polycounter lvl 18
    This has been working great for me. Made my life much easier.

    I don't know if you're still working on it or not, but some tweaks I'd like to see:

    always on top > every time it opens up the editor, the window completely covers it and I have to move it. to the right a bit. Annoying! Better yet, if you could somehow get max to remember the position of the uv editor window I would love you for life. with mouth!

    opening up the uv editor tends to unselect my angle snap toggle.

    everything else is the tits dude!
  • glib
    Options
    Offline / Send Message
    Sectaurs wrote: »
    This has been working great for me. Made my life much easier.

    I don't know if you're still working on it or not, but some tweaks I'd like to see:

    always on top > every time it opens up the editor, the window completely covers it and I have to move it. to the right a bit. Annoying! Better yet, if you could somehow get max to remember the position of the uv editor window I would love you for life. with mouth!

    Open uv window and move to right position.
    Options -> Save current settings as default.
    Close window.
    Re-open window.


    Solved?
  • Wells
    Options
    Offline / Send Message
    Wells polycounter lvl 18
    ha. thanks. I can't believe nobody here[work] knew that!
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    neither did I at the beginning until someone here pointed me that out >.< and thats why I came up with that script somewhat in the beginning.
    Sadly I cant set the window position - I posted about that on other maxscript focused forums but sadly no answer yet so far.
    Kovac wrote: »
    ... problems with is getting the AO map button to work at all... Every time I use it it will hang at:
    ao_bake.backgroundColor = color 0 0 0 0;

    The exception is -- Unknown property: "backgroundColor" in ReferenceTarget:Ambient_Occlusion__MR
    Am I missing something or is this a known issue?
    Thanks
    EDIT: Max 9 SP2 32bit with WinXP Pro
    oh thats not nice,- will have a look at it - not yet know to me ...switches to max tries out....nope works perfectly here. It's odd because here it works in Max 9 (no service pack) and max2009.
    I put that line however in a try()catch(); state like this
    ...
    ao_bake.autoSzOn              = false;
    		ao_bake.bright                      = color 255 255 255 0;
    		ao_bake.dark                      = color 0 0 0 0;
    		try(
    			--crashed for Polycount member Kovac on max9 SP 2, winXP -> Unknown property: "backgroundColor" in ReferenceTarget:Ambient_Occlusion__MR
    			ao_bake.backgroundColor		= color 0 0 0 0;
    		)catch();
    		ao_bake.elementName          = "Ambient Occlusion";
    		ao_bake.falloff                      = 1.0;
    ..
    
    so that it should be ignored on your system and still work for you. The be honest the backgroundColour has not really that much effect its often black by default anyway.
    I uploaded the fix @:
    http://www.renderhjs.net/bbs/polycount/texture_maxscript_tools/uv_toolbox_0.98.mzp
    just remove the fomer one and use this one and perhaps tell me if it now works for you?


    regarding progress- lately I have been kinda under pressure - but here is a screenie on where I am atm.
    tex_tools_1.0_development_state.jpg
    main changes are:
    - far bigger icons (+ 28 % while maintaining the same toolbar size)- I need this to better use color codings for grouped functions (e.g render, straighten, orientating, view,...)
    - options panel to edit/store settings for the tool

    some other things I'd like to include (will contact some of the authors if I can edit/use their scripts in my collection)
    http://scriptspot.com/3ds-max/photoshop-tool-open-image-maps-in-photoshop
    http://scriptspot.com/3ds-max/loadbitmapinphotoshop
    http://scriptspot.com/3ds-max/uvw-2-xyz
    http://scriptspot.com/3ds-max/unwrap-mesh
    http://scriptspot.com/3ds-max/pits-peaks (in combination with some render projection stuff)
    http://scriptspot.com/3ds-max/reloadallbitmaps
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    You can set the window position, if you're using a rollout floater use:
    <rolloutFloater>.pos Point2
    
    If it's a dialog window you can use:
    SetDialogPos <Rollout> <Point2>
    
    You should probably be able to get the position of the Unwrap UVW through script too, if you want to offset your floating window from, say, the top left of the UVW window.

    Also you could write this value to an .ini or .txt file and read it back every time the script is run if you want it to "remember" the position.

    I like the bigger icon size without increasing the size of the toolbar.
    However I really don't like your options window, there is no need for it to be so tiny - surely it's just something you pop open, change the options then close it again? It's not like it's eating up screen space all the time, and it's much more user friendly to pad out UI elements more and generally follow Windows UI layout conventions (not to mention capital letters at the start of sentences and controls!) ... without that it just feels a bit "cheap" to me, I dunno.
    I agree with keeping the toolbar light and small since it's open all the time and shouldn't take up loads of space, but cramming the options into a tiny space like that is just ugly and not user-friendly. Also it means you have to shorten the checkbox/menu labels for no reason, so it's not as clear as it could be either. Really I see no reason to do this.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    MoP: will look at it but I was refering to this:
    http://www.scriptspot.com/forums/3ds-max/general-scripting/unwrap-editor-window-setwindowxoffset-not-working
    so what I did not got running was:
    selection[1].modifiers[#unwrap_uvw].unwrap5.setWindowXOffset 64;
    
    there is another one for get position and get width which you btw. used in your normalize script ;) But if that what you wrote would work how would I get the uvw-unwrap window id - assuming it runs in the same flow as maxscript which I doubt at some point.

    regarding the ini file that is already planned with the additional options floater. Regarding the options floater its merely temporary and work in progress atm. I agree its somewhat smal. I want to use several rollouts in it to seperate render settings better from others and perhaps agroup for the checker maps.
    So dont worry it will be bigger and using Capitals :)
  • SHEPEIRO
    Options
    Offline / Send Message
    SHEPEIRO polycounter lvl 17
    some awsome tools there, cant wait to use these suckers,

    was someone talking about a relax in one axis tool...
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    yup- just click right mouse button on that interface button - click again on it (left or right) to stop easing. THough it't not yet exactly relaxing more of a equal spacing script that gives equal distances between the verts on the line. I want to change or add real object world relax at some point with easing.
  • Kovac
    Options
    Offline / Send Message
    Kovac polycounter lvl 18
    Sorry I didn't see this, renderhjs. It now gets passed the script error but it'll now just hang at 0% progress when it starts to sample the object. I set the image to a low res in the textools dialog so I'll assume that carries over to the rendered AO map? Thanks for attempting that fix though!

    Also, I didn't happen to notice a button for flipping faces. I know it's an easy click in the menu bar but I found it very efficient to have it as a side button when working with maps with a lot of stacked UVs on them.

    Thanks again.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    @Kovac: do you have:
    - MR as current render engine applied in the render settings [F10]?
    - selected poly/mesh an object?
    or maybe the rendering pass just really needs along time on your computer? - I really don't know
    right now. Will try to look over the code for the next release see if I can make out some lines that could be potential errors.

    As for flipping stuff - my philosophy is to basicly drop stuff in the toolbar that is not yet available. The flipping buttons are already available so there is no need imo. for it. I agree that the max sub-element mode often sucks as it eats up xtra time for something that one needs quite often. I am more into some new mirror flip tools - like something that detects mirror the axis in shell (symmetry axis).


    been working a little bit on the new GUI with bigger icons:
    tex_tools_1.0_development_state_2.jpg
    what I think is better now is that I have a color coding and a text context with each icon so that it should be even easier to understand at first - and probably recognize back. The colors are basicly groups that give you a hint of what the parent icons are related to.
  • zOffTy
    Options
    Offline / Send Message
    zOffTy polycounter lvl 16
    realy better!

    Just an idea, but, perhaps it will be a good idea (or not :poly136:) if you add this kind of tool
    like uv selection to photoshop selection
    I realy like to use it

    keep up!
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    zOffTy: will try that if there is an easy way (without additional *.exe depending or the need of administrator rights on a system). I already added a photoshop button- so I want to include it somehow.
    Another interesting thread and script I found is
    http://boards.polycount.net/showthread.php?t=46242
    which is something I had in mind before but now I have a script template for that idea



    update to 1.0
    uv_tex_tools_ui_1.00_gui.gif
    http://www.renderhjs.net/bbs/polycount/texture_maxscript_tools/uv_toolbox_1.00.mzp

    changes:
    - new GUI +23% bigger colored buttons while staying with the same tools size
    - channel support: if you assign a new channel number e.g 2 and hit 'open Editor' the script will automaticly open for you the UV channel you selected in the panel. Other functions that were changed for this: render UV, AO, Faces
    - new explode button: will basicly unwrap autoamticly all the selected faces (usefull when starting from scratch)
    - rewrote a few things (some things crashed on non- english max installations)


    minor updates can be seen here as well:
    http://www.renderhjs.net/textools/
  • zOffTy
    Options
    Offline / Send Message
    zOffTy polycounter lvl 16
    nice update!

    some ideas
    - is it possible to have an option "always on top"?
    - fetch texture dosn't work if the mat is a dxshader?

    Thanks again!
  • Tumerboy
    Options
    Offline / Send Message
    Tumerboy polycounter lvl 17
    awesome, thanks for the update man!
  • Wells
    Options
    Offline / Send Message
    Wells polycounter lvl 18
    the new look is great, and the explode works well.

    would it be possible to have a button that resets xform then collapses the stack? i find myself having to do that to fix shapes not unwrapping correctly.
  • Mark Dygert
    Options
    Offline / Send Message
    Hey look at that, nice looking UI!
  • Mark.N
    Options
    Offline / Send Message
    I've been using this toolkit for a few months now and I have to say that you've done an excellent job. Sure has helped to really streamline my UV unwrap work flow and I really like having so many different useful tools all rolled in to one package, thanks again for the latest release.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    thanks for the feedback guys

    Sectaurs:
    would it be possible to have a button that resets xform then collapses the stack? i find myself having to do that to fix shapes not unwrapping correctly.
    I actually do that myself alot too using another script collection. That collapse script basicly adds XForm Reset and colapses everything to a poly. I do think however that it does not belong in this collection. The script is basicly just these 2 lines
    ResetXForm($);
    macros.run "Modifier Stack" "Convert_to_Poly"
    
    copy the code - goto your maxscript listener [F11], create a new script [ctrl]+[N] paste the code, select it and drag the code selection into your 3dsmax main toolbar. A new button should be added. You can right click customize it (icon, label,...). Each time you hit that button it will resetXform your selection and colapses the object to a simple polyObject.

    zOffTy:
    could you provide me with a sample scene or file with such a dxshader material. My script relies atm. on a difuse channel or something like that so it searches for that. It was my idea to extend the script later on so that it smartly recognizes other typical materials as well.
    Whats nice however right now is that you can simply drag any image right in your viewport (from windows e.g) to your object, That script will that automaticly fetch the resolution from that texture.
    As for always on top not sure yet how - I haven't seen yet other scripts done something like that- often they more behaved like floater that could be docked to a side.



    here is a last word about the last release as I did not mentioned everything that was changed:

    ico_uv_editor_open.gif: incoorperates switches to another UV channel each time you re-open the UV editor. I just noticed that I need to fix a little part here - as it will really reset current UV changes if you leave a UVunwrap modifer on the object, then change in the toolbar to a different channel and hit 'open editor' again...
    edit: fixed with ver. 1.01
    ico_relax_line.gif: now uses the 3dsmax intern relax by angle method- it's not so special but it might come in usefull when you want to relax edges or loops. Ditched my earlier version of equal spaces
    ico_crop_uvlayout.gif: still needs to be fixed - its currently under construction as I noticed some general flaws in earlier versions
    ico_quick_flatten.gif on right click (not left click) it will simulate (constantly) a relax on the selection similar to UVLayout's flattening behaviour. Right or left click on it again to stop the simulation. It's a nice way of letting the computer quickly run a relax simulation over your selection without any dialogue windows.
    ico_checker_maps.gif: uses now a default itling of 8 (+8 = 16 if you have the 3dsmax checker map)


    the fix regarding the uvUnwrap window when still having a modifier with a former UV channel while wanting to switch to a new one reset, can be downloaded here:
    http://www.renderhjs.net/bbs/polycount/texture_maxscript_tools/uv_toolbox_1.01.mzp
    (just remove the older one and use this one instead)
  • SHEPEIRO
    Options
    Offline / Send Message
    SHEPEIRO polycounter lvl 17
    possible feature request but probably quite hard!!

    could we get some sort of FFD for UVs, i have to unwrap lots off organic shapes but keep horizontal lines running in the same direction, it would be really useful to be able to just bend it back using a few points rather than fiddling with rotating sections and then re-relaxing....

    much love ;-)
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    SHEPEIRO wrote: »
    possible feature request but probably quite hard!!
    could we get some sort of FFD for UVs, i have to unwrap lots off organic shapes but keep horizontal lines running in the same direction, it would be really useful to be able to just bend it back using a few points rather than fiddling with rotating sections and then re-relaxing....
    much love ;-)
    oh I think that is veeery likely to be added soon - and very possible :D
    the concept is basicly this:
    http://www.scriptspot.com/3ds-max/uvwxyzswap

    What it does:
    it simply exports your texture UVW coordinates to world vertex XYZ coordinates. Once you have it as a XYZ world model you can assign any modifier including FFD, bend,... to tweak things from the top view and hit the button again (my version) to get it back into the UV space- and the model in the 3d space.

    but instead of porting the UVvertex point 1:1 to the real world I would scale it to the bounding box size of your current mesh (so its roughly the same scale/size) and the same back when getting it back to your UV space.
  • SHEPEIRO
    Options
    Offline / Send Message
    SHEPEIRO polycounter lvl 17
    yeah i heard about this but hadnt thought about it, cool well i cant wait
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    here is actually a progress strip:
    uvw2poly_progress.jpg
    it seems that whenever you unique faces or created an object for the first time the converted UVW 2 Object looks ok but sometimes I ended up with version like in the screenshots where only the vertex points make sense.

    will release a update soon, got the open texture in Photoshop working too
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    I fixed the uvw2xyz thingy it seems that internally channels in 3dsmax including poly can only be copied and pasted in a mesh format. Which sometimes turns into garbage if you treat it as a poly. Each time you export the UV out to the 3d space it converts the object to a mesh- once you put it back it converts it back to a poly. But more about how it works below:


    update v1.10
    texTools_1.10_gui.gif
    download
    http://www.renderhjs.net/bbs/polycount/texture_maxscript_tools/uv_toolbox_1.10.mzp
    additional informations:
    http://www.renderhjs.net/textools/

    changes:

    edit_in_photoshop.gif opens all associated textures of the selected objects in photoshop. This works without any confuguration right out of the box if you have photoshop installed. And no I wont port it to msPaint or whatever - I assume you all have Photoshop.

    ico_crop_uvlayout.gif hopefully now fully fixed. There was some issues with Floating values not beeing propper recognized and chopping off my scale calculations. The way it now behaves is that the alignment is towards the upper left corner (just like any texture is stored, and really almost any application works these days)
    texTools_crop_uv.gif(just on a sidenote: 3dsmax and many other 3d standards handle UV coordinates from bottom to top - which is often confusing when working usually the other way around)

    ico_swap_uvw2xyz.gif swaps your UVlayout model with your XYZ world model. This allows to use modifers and other tools to alter your UVlayouts in max. Simply hit the button and it will convert your model a swaps the 2. If you hit it again it will basicly return the original model back as the XYZ world model.
    IMPORTANT: this merges your object to a single Poly or Mesh (depending on the direction [is detected automaticly])
    texToos_uvMesh_swap.gif
    I do to some extend recognize which way around you swap the data through a little trick I thought of. THe way other attempts of this worked was that data was swapped witout any changes which often caused tiny micro object (hardly visible in the viewport) because the 3d vertex coordinates would range from 0 till 1 just like UV data does.
    Now what I did was whenever the base Object was not scaled ahead (e.g $.scale == [1,1,1]) and remembered that and scaled it afterwards up to the bounding box size of the former object. The result is a switch with about the same size in the 3d view booth when swapped from the UVlayout or back from the original 3d world.
  • glib
    Options
    Offline / Send Message
    Oh my god! There was such a long break for a while there between updates and now you're drowning us in awesome features!

    Sweet.
  • Funky Bunnies
    Options
    Offline / Send Message
    Funky Bunnies polycounter lvl 17
    holy shit, this is even awesomer
  • Tumerboy
    Options
    Offline / Send Message
    Tumerboy polycounter lvl 17
    Damn dude. . . all you need is whipped cream and a cherry on top, and it's golden.
  • CodeFather
    Options
    Offline / Send Message
    CodeFather polycounter lvl 15
    Man, this is amazing !!! :))) I just 've use polyboost polyshift brush with your UVW2XYZ swap feature to tweak UVs, just like the move brush in UVLayout :))) Thank you !
  • IxenonI
    Options
    Offline / Send Message
    IxenonI interpolator
    thank you :) good stuff
  • Holi
    Options
    Offline / Send Message
    Holi polycounter lvl 16
    your tool become essential, thanks!
  • SHEPEIRO
    Options
    Offline / Send Message
    SHEPEIRO polycounter lvl 17
    awsome tool, got anothe request if possible, this is an env. mapping thingy.

    coulw we get a button that would sort out your mapping sizes. so say you had a relaxed peice geometry, it would work out the average size of the shells mapping and scale it to tile as many times as needed to get a certain texel density, so say the shell is 50 metres and your using a 512 texture, you would type in a texel density of 256 (texels per metre) and it would scale the shell so that it tiled 25 times or there abouts. would have to do it by bounding box or is there a more acurate way of doing it.it would be extra awsome to get a min, max and average setting, so that you could have at least 256 pixels per metre etc.


    cheers you *
  • Tumerboy
    Options
    Offline / Send Message
    Tumerboy polycounter lvl 17
    Oooh! I like that idea! Do that one!
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    would have to do it by bounding box or is there a more acurate way of doing it
    my first thought would be yes by bounding box size and calculating a average square pixel's size. Depending on the target Texel size (pixe / maxCurrentUnits) it would then scale it. The thing is that you propably would not want to squieze or deform your shells in a way that it transforms into something different. So the bounding box method would be the safest way I guess. Also regarding precision I would rotate the shells ahead to a minimal compact bounding box height with this ico_rotate_compact.gif that way you should get very good results.

    A personal thought on this is that personally I HATE other unit setups as internal ones because they often fuck up the math, calculations and precission if you want to predict things. After all all you really read out in max are internal units except you use the classes to transform calculations.
    So my question: Do your really work with metric units for game engines?, the ones I worked with always worked brave with internal units like Unreal 1,2,3 or HL/Source 1,2.
    would be extra awsome to get a min, max and average setting, so that you could have at least 256 pixels per metre etc.
    I did not grasped that one perfectly maybe you can illustrate what you mean there?, because math is math or do you mean some presets for common texel sizes?
  • SHEPEIRO
    Options
    Offline / Send Message
    SHEPEIRO polycounter lvl 17
    "precision I would rotate the shells ahead to a minimal compact bounding box height with this that way you should get very good results."

    personnally im not sure id want the shells rotated if i had alot all rotated to folow a texture direction could be a pain to redo

    I was just using the units as example, so use the internal one, thats usually what studios use as a metre anyway in my experience

    and by MIN/MAX/AVERAGE i meant take the smallest or largest mapped triangle and make the mapping size acurrate to that, and an average would be jusrt that
  • glib
    Options
    Offline / Send Message
    I'd like to third this request. Being able to set texel density easily would be awesome. Perhaps right-click gives you a popup window where you enter your density per meter, then left click scales selection to that value. Env art oftne as the need to make a bunch of shells at say 512px/4m for the first floor of a building, then 256px/4m for upper floors.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    ok again is this 4m really 4 meters or just a term people stick to because they just dont say units?, I am getting confused here - the way you guys set up your units is still internal units right? So technical speaking 512px/4m is wrong and it should therefore be 512px/4units.

    Maybe I have a different background here but I was grown up with the early unreal engines where as a meter was roughly 128 units and a door about 96 units and a ceiling 128 units. THese units represented geometry size - so they had nothing to do with texture size.
    Although in the early days of Quake/ HL and even Unreal texture sizes in pixels were equal to the units of the geometry. I did the same for engines I wrote some time ago too- setting the target texel density to 1:1 to the units of the geometry. Meters is irritating because the 3dsmax meters is a whole different story and it depends on other variables as well.
    So how do you export and would be sure that your 'meter' units is the one you call in your engine 'meter' as well.
  • glib
    Options
    Offline / Send Message
    Oh sorry. Yes, generic max units. I'm just very conditioned into thinking 1 unit = 1m.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    I have some promising news:
    I researched today on the net and found some various scripts (all somewhat uncomplete) but good pointers to what I needed to know to calculate the texelDensity with a face or triangle precision (and not some area or bounding box).
    As it seams max has a method that returns area size of a set of faces (e.g a converted UV shell selection to 3d world mesh face selection) using
    meshop.getFaceArea <Mesh mesh> <facelist> 
    --Returns the area of the specified faces as a float ( as internal units :D )
    
    I assume the same method is available for polyMethods - I just hope they did included the same for UV spaces - otherwise I would have to swap channels a not so nice xtra step.

    This is what I have GUI wise for now
    texTools_texelDensity_concept.gif
    but I think it needs to improve because its not clear right away what the input fields are for (a.: texture size sample b.: per unit)

    just in case others are interested in the resources I dug up today:
    http://www.devmaster.net/forums/showthread.php?t=11739
    http://scriptspot.com/3ds-max/normalizeuvw
    http://scriptspot.com/3ds-max/normalize-uv-elements
    http://boards.polycount.net/showthread.php?t=35204
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    a little teaser before I update to the next release

    as you can see in the following screenshot is the texel size in each object equal even though the objets were created with different scales and different shapes:
    texTools_texelDensity_wip.jpg
    I got it so far running I just need to bend the scale math a little bit right (it's a bit try and error right now because I was tired and drunk yesterday) but I will fix that today. Also I need to add multi object support so that the script can loop though multiple objects, a single object, or just selected shells in the UV editor (so 3 modes).

    It is very accurate - it calculates the real face surface area of each shell in 3d space and in UV space and applies proportional scales on each selected shell based on the difference of the target texel value. So the advantage is that you keep your UV shells the way they were - it just that each of them gets scaled seperately - so scaling is not done on a face level but on a UV shell level.
  • shadows
    Options
    Offline / Send Message
    shadows polycounter lvl 18
    These are really handy tools .
    Id like to suggest a 4th mode for the texel size tool, which I think would be a good time saver for keeping the same texture density throughout a project.

    Instead of averaging out the texel size between all or the selected objects , you could use an object which has the correct density as a source to define the texel size of the objects in your selection.
    Would be handy when you want to keep the same texture density throughout multiple scenes, you could simply have a dummy object(s) that has the correct density and apply it to the other objects.

    I should have read a few post before posting.
    SHEPEIRO already suggested something similar, so don't mind me.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    wow good thougt , will do that - kind of like a pipette or so
  • Junkie_XL
    Options
    Offline / Send Message
    Junkie_XL polycounter lvl 14
    This is a big thread. I just wanted to ask you renderhjs if your tool can constrain UV points to move along edges, like edge constraints in Editable Poly?
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    not not yet- perhaps you have an idea on how to implement such? After all I can't place visual markers in the UV editor.
    But you can align a set of edges e.g a loop or a set of vertex points to a straight line with one key using ico_straighten.gif

    Perhaps you can provide a screenshot or illustrate a bit better where you would use it for?
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    this is good stuff - i wrote a very similar thing at work for maya, our env artists use it all the time. very useful tools :)
1246714
Sign In or Register to comment.