Home Technical Talk

misc. maxscript UV scripts/tools

2456714

Replies

  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    I read somewhere that one can drag mzp files in the viewport- maybe that was then wrong. Just put the script in your /scripts/Startup/ folder and it should work
    sorry about that
  • Yozora
    Options
    Offline / Send Message
    Yozora polycounter lvl 11
    You can drag .mzps into viewport, it can notify you that it installed the script (for example with http://www.scriptspot.com/3ds-max/outliner, its a mzp that you can drag and see for yourself :) Or it can just install exactly like a .ms file would for example this one:
    http://www.scriptspot.com/3ds-max/pen-auto-material


    using 64 bit vista;

    tested AO button and it works fine, although the AO map quality (on high) looks quite noisy compared to how I usually do it with the scanline renderer and skylight :s
    It looks more detailed than my old method, just noisier.

    How much padding is there on this AO map? I'm guessing 2? Maybe add an option to define padding? I personally dont need it though, just an idea :p

    I noticed that the UV editor button keeps applying new unwrap UVW modifiers~ Is that intentional? I thought it was just a shortcut to open the UVW editor and apply the unwrap uvw once if the existing model doesn't have it, not a shortcut to keep applying new ones.

    Can we change the checkermap to some other one in a specific directory on our systems? Not that I have anything against the black and white checker, I'm just used to having this rainbow coloured one with numbers

    All the other buttons seem to work fine, but if you go flat shaded theres no shortcut to go back to smooth shaded mode so maybe make that button into a toggle from flat to smooth.

    I have 2 macros in my quad menu that does edged faces+flat and edged faces+smooth so I can quickly toggle between smooth, flat, edged smooth and edged flat with the same 2 buttons - I didnt add a "edged faces" button because the important thing is I can jump from non-edged smooth straight to edged flat in 1 button instead of 2.

    Normalize UV is cool, not sure why I havent seen this script until now :s Thanks mop!

    When using your script to align UV shells and align UVs, it takes several undo's to get back to original state (brought this problem up earlier, aligning 20 UVs requires 20 undos).
    But if you copy the UV shell script and make a hotkey of it, things can be undone in just 1 undo.
    I couldnt copy the aligning UV script to make a hotkey though so couldnt try that one. I think its because the old script relied on the angle you input into the box or something, and I dont know how to edit it myself to make a hotkey-compatible :p



    Anyway thanks again for this! I cant wait for the hotkeyable version!
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    can we change the checkermap to some other one in a specific directory on our systems? Not that I have anything against the black and white checker, I'm just used to having this rainbow coloured one with numbers
    that would be possible - though what I like about the current soloution is that you can tweak it if you want,- and it works out of the box without a specific texture.
    On the other hand I could add a texture in the maxscript-zip file (*.mzp) and the installation of the script would still require just the single *.mzp file. If you have some favourites please link to them here and I will consider it.
    When using your script to align UV shells and align UVs, it takes several undo's to get back to original state (brought this problem up earlier, aligning 20 UVs requires 20 undos).
    not sure if this should be adressed to me or autodesk,- I will try to read up some info regarding that but right now its how I know to do it. Maybe there is a snapshot feature that lets me define in maxscript what the state was before the operation and after it - so the max undo system goes to that state.



    I fixed meanwhile:
    - "keeps applying new unwrap UVW modifiers" ,- now just uses the existing modifer if its already on top
    - "flat shaded theres no shortcut to go back", changed it now so that it assumes that smooth with visible edges is the default- so it switches between the 2.

    will release a next update as soon as I added some other features

    I couldnt copy the aligning UV script to make a hotkey though so couldnt try that one. I think its because the old script relied on the angle you input into the box or something, and I dont know how to edit it myself to make a hotkey-compatible :p
    try this version (created it for you temporary,- I will work on a propper whole solotion myself sometime)
    [php]macroScript UV_alignToLine category:"renderhjs_texTools" toolTip:"aligns your selected edges or vertex points to either a horizontal or vertical line flow"
    (
    _angleSnap =45;
    if classof (modPanel.getCurrentObject()) == Unwrap_UVW then(
    -- check if vertex points are selected. otherwise convert

    _uvBase = $.modifiers[#unwrap_uvw];
    _uv1 = $.modifiers[#unwrap_uvw].unwrap;
    _uv2 = $.modifiers[#unwrap_uvw].unwrap2;
    _uv5 = $.modifiers[#unwrap_uvw].unwrap5;

    local _mode = _uv2.getTVSubObjectMode();
    if (_mode == 2)then(
    _uv2.edgeToVertSelect();
    )else if (_mode == 3)then(
    _uv2.faceToVertSelect();
    )


    _array = _uv1.getSelectedVertices();
    _selection = #();--new array
    _maxX;_maxY;_minX;_minY;

    _nr=1;
    for i in _array do (
    local _pt = _uvBase.getVertexPosition 1 i;

    if (_nr > 1) then(
    local _pt2 = _uvBase.getVertexPosition 1 _maxX;
    if (_pt.x > _pt2.x)then(
    _maxX = i;
    )
    _pt2 = _uvBase.getVertexPosition 1 _minX;
    if (_pt.x < _pt2.x)then(
    _minX = i;
    )

    _pt2 = _uvBase.getVertexPosition 1 _maxY;
    if (_pt.y > _pt2.y)then(
    _maxY = i;
    )
    _pt2 = _uvBase.getVertexPosition 1 _minY;
    if (_pt.y < _pt2.y)then(
    _minY = i;
    )
    )else(
    _maxX = i;
    _maxY = i;
    _minX = i;
    _minY = i;
    )
    _selection[_nr] = i;
    _nr+=1;
    )

    if (_nr > 1)then(
    --determine if horizontal or vertical flow
    local _a = _uvBase.getVertexPosition 1 _minX;
    local _b = _uvBase.getVertexPosition 1 _maxX;
    local _w = (_b.x - _a.x);
    _a = _uvBase.getVertexPosition 1 _minY;
    _b = _uvBase.getVertexPosition 1 _maxY;
    local _h = (_b.y - _a.y);

    local A=1;
    local B=1;

    _sel = #{};
    if (_w > _h )then(
    A = _minX;
    B = _maxX;
    )else(
    A = _minY;
    B = _maxY;
    )
    _sel = #{};
    _sel[A] = true;
    _sel = true;
    --_uv1.selectVertices _sel;


    if (_selection.count > 2)then(
    local ptA = _uvBase.getVertexPosition 1 A;
    local ptB = _uvBase.getVertexPosition 1 B;

    local dx = ptB.x - ptA.x;
    local dy = ptB.y - ptA.y;
    local _a = mod ((atan2 dy dx)+4*360) 360;--the angle in degrees
    local _snap = (mod _a 90) as integer;
    if (_snap > 45)then(
    _snap = 90 - _snap;
    )
    if (_snap <= _angleSnap)then(
    --snap to axis
    if(_w > _h )then(
    ptA.y = ptA.y + dy/2;
    ptB.y = ptA.y;
    )else(
    ptA.x = ptA.x + dx/2;
    ptB.x = ptA.x;
    )
    _uvBase.SetVertexPosition 1 A ptA;
    _uvBase.SetVertexPosition 1 B ptB;
    )
    --_angleSnap
    print("angle "+_a as string+" %90= ("+_snap as string+")");

    for i = 1 to _selection.count do(
    if (_selection != A and _selection != B)then(
    local _pt = _uvBase.getVertexPosition 1 _selection;

    if(_w > _h )then(
    local _m = (ptB.y - ptA.y) / (ptB.x - ptA.x);
    local _x = _pt.x - ptA.x;
    _pt.y = _x * _m + ptA.y;
    )else(
    local _m = (ptB.x - ptA.x) / (ptB.y - ptA.y);
    local _y = _pt.y - ptA.y;
    _pt.x = _y * _m + ptA.x;
    )
    _uvBase.SetVertexPosition 1 _selection _pt;
    )
    )
    )else if (_selection.count == 2) then(
    --align just 2 verts
    local ptA = _uvBase.getVertexPosition 1 A;
    local ptB = _uvBase.getVertexPosition 1 B;

    local dx = ptB.x - ptA.x;
    local dy = ptB.y - ptA.y;
    local _a = mod ((atan2 dy dx)+4*360) 360;--the angle in degrees
    local _snap = (mod _a 90) as integer;
    if (_snap > 45)then(
    _snap = 90 - _snap;
    )
    if (_snap <= _angleSnap)then(
    --snap to axis
    if(_w > _h )then(
    ptA.y = ptA.y + dy/2;
    ptB.y = ptA.y;
    )else(
    ptA.x = ptA.x + dx/2;
    ptB.x = ptA.x;
    )
    _uvBase.SetVertexPosition 1 A ptA;
    _uvBase.SetVertexPosition 1 B ptB;
    )
    )
    )
    )else(
    print("you are not in UV-edit mode!");
    )
    )[/php]
  • Yozora
    Options
    Offline / Send Message
    Yozora polycounter lvl 11
    yay thanks, this script is perfect :D Fixes the undo problem too once its hotkeyed, just like the shell aligning one.

    I think the problem is simple, in your script you have a button that does all the actions in your script individually so each time that button is pushed it calls all the script actions 1 by 1, instead of as a whole, whereas with the hotkey, max considers the whole script to be 1 command.
    So to fix the undo problem you'd just have to make these align tools into separate scripts which get called upon when pushing the buttons.


    Edit: Actually its not completely perfect. It does not undo at all if you align edges instead of UVs.


    I use this checker map (cant remember where I got it from, pretty sure it was somewhere on polycount);

    grid.png
  • Michael Knubben
    Options
    Offline / Send Message
    I haven't tried the new version yet, but is it still possible to just get the script? I just copied the text in the script and put it in a button in my interface. I don't really want this to start at startup every time.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    atm. its all put into a zip file (the script and 1 bitmap) and renamned to *.mzp. If you wanted to run just the script (e.g copy the text from the code editor and drag it to the toolbar)- you would need to put the image holding the icons to the /images working folder, e.g
    C:Documents and SettingsmyusernameDocuments3dsmaxsceneassetsimages
    
    it should then work the way you want it

    at some point (not yet) I have to think about things like that and the key stuff - its just that I am experimenting with features and fighting with maxscript - hopefully once it all works stable I will get down to that (propably v. 1.0)
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    regarding undo levels,- found the soloution:
    http://www.kxcad.net/autodesk/Autodesk_MAXScript_Reference_9/undo.htm
    now it works flawless lets me undo each operation - will add that to the functions that rely on it
  • Yozora
    Options
    Offline / Send Message
    Yozora polycounter lvl 11
    Just noticed that mops normalize UV scale script also has the undo problem.

    When it runs from your script, it undos each step individually like the UV aligning thing, but when using mops script and hotkeyed, it doesnt seem to have any undos at all :(

    Did you change something in mops script?
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    no,- its like you said- but thanks to that undo keyword in maxscript it undos excatly all thats written within the scope- so its fixed here. Might upload another version this evening - thx again for the testing
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    udpate to 8.5

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

    changes:

    - changed the order of buttons, grouped items by using seperators (bitmap slice from the logo). pad means pixel padding that is used in some functions like: 'crop' and 'pack UV'

    - added propper undo support,- if you now hit align or any other UV modifying keys it will let you undo the operation with 1 3dsmax undo call- no need to hit it multiple times now.

    - reuses existing uv-unwrap modifer if its already on top, adds one if there is noone present

    - [UV editor]- button closes the uv-editor panel (using a hack) if its already open, opens it again on the same position if you hit the button again- in other words it works as a switch.

    - flat shaded button switches between #flat and #smooth with showing edges. It does not yet read out the previous setting but its a next step

    - added crop button: what this does is that it crops all UV verts to the minimum UV space it needs and incorporates the pixel padding around it. It does not pack,rotate or move individual shells so your layout is not destroyed- instead it scales the whole proportional so that it fits into the texture space plus the pixel padding on the borders.


    interface screenshot:

    texTools_ss_v8.5.gif
  • Japhir
    Options
    Offline / Send Message
    Japhir polycounter lvl 16
    looks great so far! it messed up my uv editor though ;) (looks different, and turning it back to default in the options panel does change some things, but the grid stays awkward ;).) could you make it so you can hide or unhide it with a shortcut key or something? it's kindof annoying to have it in your view all the time, and not being able to get it back when you click the cross :).

    thanks again!
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    oh I am sorry for that,- regarding the grid its:

    options > preferences... > Misc. Preferences > Grid Size:
    and set it to 0.1 (every 10th interval a grid line out of 1.0)

    alternativly put this code in the scriptListener with the object selected and hit return:
    [php]$.modifiers[#unwrap_uvw].unwrap2.setGridSize 0.1;[/php]

    I set it to 1.0 so that I can better see the neighbor cells just like in uvLayout - it helps alot when working with complex uv-sets that need to be splitted into multiple quads or prepared for sorting.


    I have 2 ideas regarding this:
    - a general reset key to common default settings- like the grid setting to 0.1 because perhaps other things might follow
    - a reset of the former grid settings each time you close the uv-edit panel with my panel using the 'UV editor' key. So it basicly will reset it each time you leave it this way but it would have to be through my script and not using the windows x key at the upper corner because I would not be able to track that.
  • Japhir
    Options
    Offline / Send Message
    Japhir polycounter lvl 16
    bug:
    if i hit the tool that does the "rotate cluster to align with edge" thingie, it says:
    --Unknown property: "unwrap6" in Unwrap_UVW:Unwrapu UVW
    and then after that, whatever button i press, it makes the error sound and doesn't do a thing...
    the make planar thingie does work properly, just like the uv'editor button, the checker button and the flat shaded view. the rest i didn't test yet ;).
    i think it must be a typo or something :)
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    if i hit the tool that does the "rotate cluster to align with edge" thingie, it says:
    --Unknown property: "unwrap6" in Unwrap_UVW:Unwrapu UVW
    ah its because you have a max version below 2008 (propably 9). I fixed it :)

    will update later this evening
  • Joshua Stubbles
    Options
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    -- Uknown property: "width" in undefined

    (max2008 SP1)

    highlighted line 855: " local _w = src.width;"
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    Vassago: are you sure that you either used the latest version the one that comes as a single *.mzp file or if you have the older version (with the 2 files) that you placed the bitmap in the propper folder?
    As far as I understood it basicly means that the Bitmap holding the icons could not be loaded on your system- it should not be the case if you have just the *.mzp file running.
    In any case I added a last instance security method that will display by default a flood filled bitmap instead of the icons if ist not accessable.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    This is cool stuff, renderhjs. My main critique would be that I think you've needlessly made everything really packed and tiny in the UI.
    It's only 65x415 pixels - I think it would be a lot more comfortable and easy to use if it was more like 80x600 or something, then you wouldn't have to squeeze everything so close together, which can make mis-clicking on icons more likely, and also it's harder to read.

    There are a lot of functions in there, so I don't think you should try to cram this all into such a small space - it's not like everyone's running on a single 800x600 monitor these days. The icon images don't even have to change size, you could just have 2-3 pixels padding between each one, I think it'll help it look more natural and less overloaded - especially since your spinners are already getting cut off with regular size values.
  • Mark Dygert
    Options
    Offline / Send Message
    Really great stuff, I agree with MoP on the UI.

    Tooltips for everything. Icons are great but its hard to learn what does what and most people aren't willing to do trial and error.

    Even without redoing the UI you should make the padding box able to display at least 2 digits maybe 3. 12px padding isn't unheard of.

    Change the shaded button to a check button, so you can tell when its off and on. I think you can specify a icon for each state. It would probably be helpful visually to use a solid shaded gray cube as an icon and have the shading disappear in the down state. It looks too much like the texture preview icon, too easy to get confused.

    The apply checker pattern creates a new checker each time you click it even if a checker is already applied. Also no way of getting the previous material back? That's kind of destructive... Maybe put the old material and the checker in a blend material and change the blend %. Could be cool to have it be a slider that way you could dial in the opacity of the checker, kind of like a toggle but more subtle? Or store the old material and reapply when its clicked again, or do the check button idea?
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    thx guys,- I will consider some of the poits you made. Personally I like the minimalistic GUI its about the same size PS comes with (and people there usually like it because of its smal size). I understand that learning and understanding Icons can be a pain even more if its all compressed down to 1 tiny block.
    I was thinking about a help button that will popup another floater with a overview picture of the toolbar and explaining the functions and propably all the associated macro shortcut names (so its easier to spot the right tools you want to bind to a key in some future release).
    Tooltips for everything..
    in most cases this should already be present
    12px padding isn't unheard of.
    for maya users propably yes :p (and I hate its GUI because of it), ah well maybe a switch key that switch between a more bloated interface and a rather compact one, but not on my scedule right now.
    Change the shaded button to a check button
    is considered - will think about a visual state design that makes it clear to read - as there are other buttons as well that have switch functionality.
    The apply checker pattern creates a new checker each time you click it even if a checker is already applied. Also no way of getting the previous material back? That's kind of destructive...
    I was already thinking about similar soloutions like storing it as temporary meta data into the node. But maybe a sub-material switch is a good idea.
    Personally I think default checker materials work just fine but people like Yozora wanted custom ones- so I am not yet sure what this key will do exactly (swapping, switching, replacing, instancing,...).
    There are a lot of functions in there, so I don't think you should try to cram this all into such a small space
    a major design key I have in mind is to propably later merge multiple functions into a few smart ones that combine in a logical way mutliple operations. Depending on the context it will behave then differently - so perhaps it will not be that massive in key/button amount.



    haven't got the time to create a build today so this is rather a preview:
    this is what I have been working this evening:

    I finished my distribute function
    maxscript_uv_tools_distribute_evenly_static.gif
    it distributes the t-vertex points evenly on a flow line
    maxscript_uv_tools_distribute_evenly.gif
    I added a easing behaviour so that you can keep more of the original flow and making things not to geometrical.

    tiny interface changes:
    maxscript_uv_tools_interface_8.6.gif
    I think the #Flat view mode works alot better this way, the seperators are more crisp and the different render modes have a single character hint (Wireframe, Faces, Ambient occlusion).
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Hmm, the "easing" thing is pretty cool, however did you look at my "UV Line Relax" script? It looks like yours doesn't preserve world-space edge length, it just averages all vertices along the line to evenly space them.

    The way I did mine is that it preserves the percentage of the overall line per edge, so that if you have irregular geometry, it will not get distorted since the UVs get spaced "correctly" rather than "evenly".

    The "easing" function is a good idea though, maybe I will add that to mine :)
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    I thought about that too a variation that preserves the angles of the edges - propably what you mean but I havent come yet to it. Another variation could then ease those angles making smooth curves.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Not the angles of the edges, the length of the edges. So if I have geometry like this (where . is vertex, _ is connecting edge):
    ._.____.____.
    
    then it will relax to that length in a straight line, whereas yours looks like it'd end up like this (evenly spaced):
    .___.___.___.
    
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    got the variation working I meant:
    maxscript_uv_tools_distribute_evenly_curves.gif
    it is still evenly spaced but it keeps the curviness compared to the straight line one:
    maxscript_uv_tools_distribute_evenly.gif

    a third variation and that might be the same as yours MoP will be one that keeps the distances but eases the curves to a more straight line - that one is next
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    This is pretty interesting. What do you imagine people will use the "easing with curve" for? It seems like most of the time a standard Relax on those verts will do a similar thing in many cases, except also preserve appropriate edge length instead of losing it.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    well with all those quad topologies I think more and more people try to keep the faces at a equal size. Having thus a qual length relax tool might not be so useless.
    But honestly I was thinking at the beginng more about tools that provide better methods for looping textures around things - so that their pixels loop perfectly for example around a tube or cylinder and not having them shift slightly and because of that rather cause a seam on the texturized model.
  • commander_keen
    Options
    Offline / Send Message
    commander_keen polycounter lvl 18
    Could you make a horizontal UI? I want to cover the animation and viewport controls with it. Also it doesnt seem to save its location on the screen :(
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    Could you make a horizontal UI?
    no,- I started vertical changing everything to horizontal would be a big deal. My idea was to have a toolbar that fits aside to the uv-editor, since already quite a few toolbars are horizonzal (even more in max 2010 and its ribbon interface) I thought it would be a good idea to have it vertical.

    You can however if you want change the script at some time edit the rollout in the visual maxscript editor and place all the buttons and icons yourself to a different layout.
    Regarding saving the position - that might be a nice idea will have to investigate about that how to do that propper.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    smal update 0.87
    download:
    http://www.renderhjs.net/bbs/polycount/texture_maxscript_tools/uv_toolbox_0.87.mzp
    ver_0.87_new.gif

    changes:
    - statistics message box: displays various UV-related statstics and some ratings about how good or bad that particular value is (can be). If you dont have a uvw-unwrap modifier on your poly (requirement) it adds one temporarily and removes it afterwards. It messes abit with the selections I will fix that at some point.
    The used UV-space is based on zOffTy idea by rendering the filled faces into a temporary bitmap and counting the white pixels and compare it with the black ones. So speed things up I only calculate this within a size of 32*32 pixels which means 1024 pixels to check (maxscript loops can be slow). This percentage value is rather a basic indicator for your uv-space usage not a super accurate science, so in other words the quality scale is between 0 and 1024.
    Tiles shells are shells that overlap the borders of your base square. Overlapping faces are the faces that overlap other faces.

    - fixed --Unknown property: "unwrap6" in Unwrap_UVW:Unwrapu UVW for max9 users when hitting the align UV shell to edge



    zOffTy:
    in case you might still follow this, back then regarding your post:
    http://boards.polycount.net/showpost.php?p=893895&postcount=17
    I mentioned some time ago that your script crashed for me,- it seemed that:
    [php]theBitmap = theImage.FromFile theFileName --get the saved image from file as bitmap[/php]
    did not loaded the bitmap in time for maxscript (which is what I assume) so I mainly fixed it for me using the usual mascript method:
    [php]theBitmap = openBitMap theFileName;[/php]and maxscript propper responds then
    I used your idea and simplified the code abit for me,- will add your credits later
  • commander_keen
    Options
    Offline / Send Message
    commander_keen polycounter lvl 18
    You can save and load the position like this:

    [php]
    global KT_Pos = [100,100]
    fn CloseRollout = (
    PosStr = "KT_Pos = "
    PosStr += (GetDialogPos KT_Rollout) as string
    f = createFile ((getDir #maxRoot)+"Scripts/MyScript/MySettings.ini")
    format PosStr to:f
    close f
    )
    fn CreateRollout = (
    filein ((getDir #maxRoot)+"Scripts/MyScript/MySettings.ini")
    createDialog KT_Rollout pos:KT_Pos
    )
    [/php]
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    commander_keen, surely if you're saving out the position to a file, then there's no need for it to be a global variable?
  • zOffTy
    Options
    Offline / Send Message
    zOffTy polycounter lvl 16
    thanks renderhjs :poly121:

    could you make the "assign map checker to object" button like a switch ?
    click => checker map ( possibility to use external checker map?)
    re click => original material

    textools don't works with non square texture?

    :thumbup:
  • Rob Galanakis
    Options
    Offline / Send Message
    You can save and load the position like this:

    Actually we have a good utility for this at TAO:
    http://tech-artists.org/hg/tao_official/mxs_uimgr/

    All you need to do is use:
    uiMgr.load <rollout>
    in your open event handler and
    uiMgr.save <rollout>
    in your close event handler.

    This sort of thing is exactly why I posted what I did on the first page. Loading and saving a UI has nothing to do with UV tools, why would they possibly be part of the same tool/script?
    no,- I started vertical changing everything to horizontal would be a big deal.
    Again, my comments on the first page haunt what is stated later. The code is actually nice and clean enough that it wouldn't be a big deal to create an alternative UI. It would be much, much nicer if everything were in a struct, though.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    commander_keen: thx for the info,- will try to include that somehow - also with other options
    zOffTy wrote: »
    could you make the "assign map checker to object" button like a switch ? ...textools don't works with non square texture?
    will do that,- and no not at the moment. I have a engine that supports only square textures and besides that all my texture work has been on squares so far. That would actually be a task for the next major version (v2 or so) but before that I need to reach 1.0 (with map able key support).

    Rob Galanakis: I understand that you want to guide me into a propper way without falling into pitfalls because of buggy workflow ect lack of common standards/workflows. But its my kind of character that I want to try it at least myself hence the reason why I want to avoid 3rd party classes ect. for this one. I think I need to make some mistakes in order to propper learn from them. your uimgr looks nice but it is abit over the top for me right now- so instead I will try the snippet from commander_keen.
    The code is actually nice and clean enough that it wouldn't be a big deal to create an alternative UI. It would be much, much nicer if everything were in a struct, though.
    the visual maxscript editor destroys acutally each time some code (in max 2009) mainly those bitmaps I placed because he messes up the bitmap parameter of the bitmaps. So whenever I use it and go back to my script I have to fix 7-8 lines that vis.maxscript corrupted. I have the same sometimes with spinners and their pt3 values.



    just a smal progress update:

    I finally got the smart align script working which in this case rotates the shell into the smalest size of its bounding box which results into horizontal aligned rotations.

    uv_tools_smart_rotate.gif
    the script is inspired by a maya update (some uv xtra tools for subscribers or so). The script itself has some iterations to run through to optimize the final result- within each iteration it tries to find the angle that results into a bounding box of the verts with the smalest height possible.
    Personally I usually prefer to align most elements horizontal which it forces right now but that could be changed easily or just +90° swap rotated with 1 click.
    I try to apply it to shells only ,- atm. it supports any selection type (so even multiple shells for example scattered around). All that matters atm. is the bounding box. It would be nice however if I could select several shells hit the button and the script will loop through the shells and smart-rotate allign them all individually, - which is what I plan.


    I have also a buggy orientate to 3d selection prototype that will align shells or selected faces based on their 3d position on the mesh/poly. Often unwrapped faces in max tend to be flipped 180° or some other angle you simply cant spot right away which often results into errors which I often notice when I already paint on my UV- rendering.
  • Michael Knubben
    Options
    Offline / Send Message
    Could this script be made to work with 2009's multi-unwrap? If there's an Unwrap UVW modifier applied to multiple models, the script complains about not being able to find the modifier. Any ideas? I'm really liking the script, by the way. Nice interface, as well.
    Thanks for the all the work you're putting into this
  • Tumerboy
    Options
    Offline / Send Message
    Tumerboy polycounter lvl 17
    nice work man, I'm glad you keep updating this!
  • DEElekgolo
    Options
    Offline / Send Message
    DEElekgolo interpolator
    Had to revive this. This script saved my life just now with a little UV problem I was having.
  • Titus
    Options
    Offline / Send Message
    Titus polycounter lvl 14
    Last feature is very cool , can't wait script update :))) Light it up!!
  • sirnaut
    Options
    Offline / Send Message
    nice set of tools
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    thx for the comments,

    MightyPea: I havent thought about that yet,- and yes that would be possible,- though I would have to rewrite some functions and add some kind of checker that makes sure that depending on the max version the right one is used. It might not happen so soon though.


    update 0.9

    tex_tools_0.9_overview.jpg

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


    to this date known main issues/bugs:
    - ch# (uv channel) gets ignored,- everything is operated on channel 1
    - no map-able macro keys
    - no multiwrap support yet (sets selection[1] as UV-edit)


    changes:
    - realtime easing simulatation with right click on 'align edge' or 'distribute vertices', left click or again right click to stop simulation. A regular left click will result in a absolute result
    - distribute verts on flow key
    - smart rotate selection to minimum vertical bounding box space
    - nudege up,down,left,right with parametric input
    - spin 180° of current selection
    - interface smal changes - a little bit more minimalistic
    - checker map swap. If a previous material (before the click on that button) was found it will be stored as previous map and reused on a second click. Materials are not stored per object- so if you leave it as a checkermap and hit the button on another object changes might be that the previous material track is lost of the previous one.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    This is really cool :)

    Something I thought you could maybe do for the checkermap swap, is just store the old material index/name as a property of the object, then just look for that property when trying to un-assign the checkermap. That way it can be used on as many objects as you like, and you don't have to have crazy global arrays or anything. Just a thought.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    MoP: is that were custom object properties can be stored? ,- like this?:
    [php](selection[1]).renderhjsValue = "a string to be stored";[/php]
    if so I didnt knew that,- will change it that way if that works like this because yes that would be easier and cleaner.
  • Tumerboy
    Options
    Offline / Send Message
    Tumerboy polycounter lvl 17
  • Mark Dygert
    Options
    Offline / Send Message
    This just keeps getting better and better. Thanks for the overview and updated icons. I'm sure that will help quite a bit.

    Nice suggestion MoP!

    I still think the UI is packed too tight and its annoying to have text bleed outside of the spinners, especially when there is room for another digit (still looking at you padding). I think if you went with a slightly bigger UI you could come up with some bigger icons and make them all easier to associate with.

    For example if the icons for render UV layout to Clipboard, actually had a little clipboard in it (universally used in a lot of apps) it would be much more understandable. Even with the arrows, its still easy to get it confused with the render AO button(s) in the same area.

    If you're really concerned about the UI eating up room, there is some redundancy that can be removed.

    UnwrapOptionsPannel.jpg
    - The Spin 180 is already in 3dsmax with a little more functionality too.
    - Use Rotate +90 or -90 on the far right to spin your selection either direction in 90 degree increments.


    UnwrapUVWCoords.jpg
    - Turn on #1 and type 1 in #2, to nudge the selection 1 unit over.
    - Using this interface enabled you to move it in V space also.
    - Use the spinner arrows to nudge the selection incrementally.
  • Neox
    Options
    Offline / Send Message
    Neox godlike master sticky
    wow this going to be tested soon :)
    but one question is it possible to use a custom checker? i always use my good old unwrapchecker, as it's not hurting the eyes too much and makes it possible to work with the real pixel density
  • DEElekgolo
    Options
    Offline / Send Message
    DEElekgolo interpolator
    When I render a bitmap to my clipboard at 2048x2048 it doesn't work.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    DEElekgolo wrote: »
    When I render a bitmap to my clipboard at 2048x2048 it doesn't work.
    cant reproduce the same effect here,- worked here even with 4096 wireframe clipboard render, same with selected faces. 2048 MB RAM here on winXP and max200932bit. I assume anything below it works?

    Vig: bummer,- :) well I did knew some of them at least- thx anyway. I will think of some other ways to include proportional transformation like transforming into different canvas sizes (reverse transformation) for example if one would like to increase the texture map without changing the base layout dramaticly instead it would be scaled down in the upper left corner - the same could then be simply archived in photoshop using ctrl+alt+c (canvas size).
    MoP wrote: »
    Something I thought you could maybe do for the checkermap swap, is just store the old material index/name as a property of the object, ...
    sadly not that easy possible,- I had a lookup and it seems that only strings can be stored - no materials or other complex objects
    http://www.kxcad.net/autodesk/Autodesk_MAXScript_Reference_9/Node_User_Defined_Properties_and_Methods.htm

    update 9.2

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

    9.1_toolbar.gif

    changes:
    - clipboard mini icons on the render to clipboard buttons
    - new button:
    9.1_quickflatten.gif quick flatten: makes from your current texture face selection a single UV-shell without the need of xtra seam marking and pelt mapping,- or stitch things together by hand. The secondary mode (right click instead of left click) opens the relax dialogue.
    here is a smal animation (not perfect timed) of how quick and usefull the quick flatten button can be:
    mov_quick_flatten.gif
    it took me literally a few clicks to unwrap those elements. Its esspecially usefull in combination with select element mode or slect by angle (default 20° in my 'UV editor' mode).

    - checker material swap recode with 2 custom checker maps:
    mov_material_swap.gif
    if you left click on the button it will cycle though the checker maps and the default material (1 = max checker map, 2 = custom PNG texture A, 3 = custom PNG texture B). THe textures can be found in the *mzp file - just open it with winrar or 7zip and replace one of the 2 PNG images in it.
  • Tumerboy
    Options
    Offline / Send Message
    Tumerboy polycounter lvl 17
    that's fuckin sweet! Nice work man. Thanks again!
  • dejawolf
    Options
    Offline / Send Message
    dejawolf polycounter lvl 18
    found this thing to remap missing or broken texture assignments after you've moved to a new computer:

    http://www.scriptspot.com/3ds-max/relink-bitmaps
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    doesnt that already shift+t do? (asset tracking) never had issues with it and it works perfectly,- lets you even fix relative and absolute paths of anything.
  • Mark Dygert
    Options
    Offline / Send Message
    Great update! I really like the checker switcher now, totally useful, nice work!

    I think the point of the relinking script was so that you could run it on a bunch of files without having to open them? I didn't look at the script but I think its been linked before.
2456714
Sign In or Register to comment.