Home Technical Talk

Another 'how would you maxscript that' : StraightenEdgesView

grand marshal polycounter
Offline / Send Message
pior grand marshal polycounter
Hey all, I kept finding myself having to deal with that kind of scenario today hence I though I'd ask.

I use StraightenEdge alot (Thank you CrazyButcher!!) but many times I wish I could straighten my edges only in one direction. I end up placing my camera perpendicular to that desired edge direction (often tilted compared to the ground), modify my object pivot to be running along the desired direction, then scale stuff down in screenspace parent mode.

I understand I could use a temp grid but they break the modeling flow just as much ...

It's quite a few steps! especially for something that I am sure can be scripted easily (it's very similar to straighten UV scripts, except in 3D). Also I am sure many would benefit from that, either in Max or in Maya.

Here's my current workflow :

StraightenEdgesView.jpg

Thanks if you can help!!

Replies

  • Millah
    Options
    Offline / Send Message
    Millah polycounter lvl 18
    I know this isn't a maxscript solution pior, and it really only fits your example pictured, but couldn't you just:

    1. make selection planar in whatever axis you want (Z in the picture)
    2. rotate selection using the screen axis gizmo (not sure if that's the correct term for it).

    Please forgive me if this doesn't achieve exactly what you want, just trying to help you out while you wait for a sweet script. :)
  • SyncViewS
    Options
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi Pior, you can already do "almost" exactly what you need with IC.Shape AxisProject. It is sensitive to current reference coordinate system, so if you put it in Screen, you can align along X and Y relative to current view direction. It is currently limited to X and Y axis or normal to current selection, so you should roll the camera if you want to align elements that are rotated relative to horizon or a vertical line. I can add an option for free direction alignment relative to Screen space.

    EDIT: Otherwise, you can use the IC.Shape Pivot to instantly set the working pivot perpendicular to the flattening direction, then use AxisProject in WorkingPivot space along Z axis.
  • renderhjs
  • Joshua Stubbles
    Options
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    well that's certainly cool.
  • CodeFather
    Options
    Offline / Send Message
    CodeFather polycounter lvl 15
    SyncViewS wrote: »
    Hi Pior, you can already do "almost" exactly what you need with IC.Shape AxisProject. It is sensitive to current reference coordinate system, so if you put it in Screen, you can align along X and Y relative to current view direction. It is currently limited to X and Y axis or normal to current selection, so you should roll the camera if you want to align elements that are rotated relative to horizon or a vertical line. I can add an option for free direction alignment relative to Screen space.

    EDIT: Otherwise, you can use the IC.Shape Pivot to instantly set the working pivot perpendicular to the flattening direction, then use AxisProject in WorkingPivot space along Z axis.


    The AxisProject feature is just awesome , Once again ICShape amazed me! :) I would love to have an option that allows me to straighten selections in screen space using some predefined angles, something like this:

    AxisProjectIdea.jpg
  • Peris
    Options
    Offline / Send Message
    Peris polycounter lvl 17
    renderhjs wrote: »

    woah!! That is something really useful :)
  • CodeFather
    Options
    Offline / Send Message
    CodeFather polycounter lvl 15
    renderhjs wrote: »


    Polyboost , also has such feature along with many others. It's under the Loop Tools, and its called straighten
  • Mark Dygert
    Options
    Offline / Send Message
    CodeFather wrote: »
    The AxisProject feature is just awesome , Once again ICShape amazed me! :) I would love to have an option that allows me to straighten selections in screen space using some predefined angles, something like this:

    AxisProjectIdea.jpg
    This would be pretty awesome. hopefully its less clicks than the previously suggested work arounds.
  • SyncViewS
    Options
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hey Vig, my workaround is actually 4 clicks and 2 drags

    With elements selected:

    - left click to activate Pivot instrument
    - drag to set Working Pivot
    - right click to exit Pivot instrument

    - left click to activate Axis Project instrument
    - drag along Working Pivot Z to flatten the selection
    - right click to exit Axis Project instrument

    Is it really too much? :D
  • Mark Dygert
    Options
    Offline / Send Message
    No I haven't tried your method, there are parts of IC I have yet to explore (shame) heh

    I've used the polyboost method and it works pretty good. It flattens everything between two points so first you have to make sure those points are in the right place which is more prep work.

    Launching graphite modeling tools in 2010 is a huge chore, takes a few seconds sometimes for me and unloading/loading the tools when I switch modes it lags. What a let down the ribbon was...

    Does the make planar XYZ operate on the local axis or in world space? It might be just as fast to map "affect pivot only" and flatten that way if it does. But I suspect it works on world space? Don't have max open otherwise I would check...

    I get the feeling Pior is after a one click solution. Highlight the edges, click and its properly flattened. A bit like the flatten UV buttons they added in 2010.
  • SyncViewS
    Options
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Well, 1 click solution is possible only if you have a nice plug in your head, wired to the usb(!?!) port, or if you prefer neater hi-tech solution, let's say you got a wireless neural interface :D

    Jokes aside, you need to specify the minimum amount of information to make the tool figure out what you need. Anyway, what CodeFather illustrated, was what I got in mind plus the "snapping" to certain degrees. I think it is feasible in IC.Shape Axis Align, but I prefer to let its orientation free, and make it angle constrained only when the default "Angle Snap Toggle" is active, inheriting its setting (default 5 degs).

    I know someday I'll die stabbed by a transform matrix normal vector :D

    About IC.Shape, it's just another toy, play with it if and when you like, maybe after I swept out every bug (hopefully very soon)
  • Mark Dygert
    Options
    Offline / Send Message
    heh, I agree I'm not sure there is a one click solution. I've given the IC method a try and I like it I can see it being pretty handy for all kinds of things not just this.
    I know someday I'll die stabbed by a transform matrix normal vector :D
    Ha I had a good laugh at that...
Sign In or Register to comment.