Home Technical Talk

can Maya control selected edges with bezier curve

hi has anyone come across a script for maya that does this?

pretty much like this max script, but for maya
http://www.mariussilaghi.com/products/smooth-edges

thanks

Or if you know of any other fast way to do something similar like this in maya.
I did try selecting edges > convert to verts > made latice to control. but its a slow workflow.
also the wire tool deformer but that is also slow and have to adjust vertex weights :/

Replies

  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Hmmm, maybe a transfer attributes between a curve and your polygonal mesh ? This way you could use the curve to control the polygons. I'm not sure if you can constraint it to only a certain number of vertex however...
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    I have done this with one of the deformers think wire deformer but I could be wrong.

    I remember it being able to work on both verts or whole objects.

    when I get home later today I will try and find the scene I used it in so I can confirm which deformer it is, and show you the usage.

    there is also a way to create a curve from a edge selection that works well with this method too.
  • pinkbox
    Options
    Offline / Send Message
    thanks guys. i had another go with the wire tool and had some success. the process is a bit slower than that maxscript but i seem to be able to do the same thing.

    so my process was - create sphere > select a few edges > convert edges to curves DELETE HISTORY ON CURVE (could prob rebuild the curve to contain only 3 CVs) > convert curve to bezier curve > wire tool deformer -select sphere, hit enter - select curve, hit enter. BOOM it works but just a little more manual work than a script.

    I mainly want to use it for car body panels to get nice smooth edge curves instead of vert tweaking.
    tho in my testing it made some cool fabric like folds

    also a nice thing about wire tool. didnt have to weight any verts, and the envelope and drop off give some nice control on the curves influence
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    I scripted the process in python I can send you the script once I get home.
  • pinkbox
    Options
    Offline / Send Message
    Oh wow yes please that'd be so helpful and save me a lot of time. If you could post a link to it here I'm sure a lot more people would also find it useful to have
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    ya cant find my old script, but it dosnt take long to just build a new one.

    what would be your preferred usage for it? Select verts, to influence, than select the curve, or would you want some kinda UI? i cant picture it take me more than 20 minutes or so to build a new one.

    Thinking on the weekend i will build a whole tool set for this, have it convert edge selections to curves to control the orgianl edges, have the curves rebuilt with user set amount of control, points, and have options for different curve types nurbs vs bezier.
  • pinkbox
    Options
    Offline / Send Message
    well the way i imagined using it was just selecting edges you want controlled then run the script which would use those edges to create a curve.

    I really dont know scripting so i dont know whats possible. im excited to see the toolset you come up with.

    I guess like an auto wire tool deformer - select your edges, then the script pretty much would do something like my workflow above
    -convert edges to curves DELETE HISTORY ON CURVE (could have options for curves in a UI ie bezier/nurb, point count. and an option to influence only verts from that edge or whole mesh)

    Then the wire deformer part would use the object you previously selected the edges on and the curve it just made would become the wire ( maybe have option in the UI to deform only verts from the previously selected edges if thats posible) but the wire drop off might take care of that

    On another note seeing the verts influenced by the wire drop off amount would be helpful, something like a soft selection highlighting.

    then after your done tweaking the wire an option to remove it.

    dont know if all thats possible but itd be one awesome tool!
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Ok managed to spend a tiny bit of time on it, so here is the bare bones of the tool now.

    https://dl.dropbox.com/u/2360554/mayaScripts/curvyEdges.py

    install by dragging that into your maya scripts folder, and makeing a shelf button with the code.
    import curvyEdges
    curvyEdges.curvyEdgesUI()
    

    Usage:

    make a edge selection, run tool, select curve type and spans, than hit create curve.

    Im pretty busy for the next few days, but all of what you want sounds easy expect for the soft selection preview, which still might be doable once i learn about the api.

    if you dont want the UI, you could also run it like this
    import curvyEdges
    curvyEdges.curvyEdges(curveType=1, spans=2)
    

    where curveType is 1 for bezier 2 for nurbs, and spans is for the control points.
  • pinkbox
    Options
    Offline / Send Message
    woah so awesome already! im impressed, can confirm it runs perfect in maya2013x64

    cant wait to see what you get up to with a later version but so far its very useful.
    the addition of a Delete curve button would be a bonus (i think this would mean deleting your mesh history though to keep the deformation?)
    and an affect whole mesh or just selected edges.(at the moment its just selected edges?)
    either way its damn cool and very usable as is

    really appreciate the time you put on this, hope other people find this and get some use out of it
  • sculptn
    Options
    Offline / Send Message
    sculptn polycounter lvl 7
    Sounds very useful does it work in older versions of maya ?
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    well, since it is python it shouldn't matter what version, or if it's 64 or 32 bit. but I can only confirm 2012 and 2013. but in theory it should work on 2009 and later. what version do you need?
  • sculptn
    Options
    Offline / Send Message
    sculptn polycounter lvl 7
    Using 2011 at the moment that's great will definitely be experimenting with this thanks Passerby for going to the effort and sharing this :)
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    ya will add a delete history button, and a check box for controlling selection or mesh, and some additionl controls for fall off and stuff like that next.

    Will continue to make all options work from the UI and be used as arguments too, so it can be used with or with out a UI.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    still needs a lot of work, for future ideas but i made some changes, added a options for effecting selection only or whole object, and added some sliders for controlling the wire deform options, after it is created that work live.

    https://dl.dropbox.com/u/2360554/mayaScripts/curvyEdges.py

    Right now the extra options only work on the last one you created with it, but i do intend in a later version, to have it work on any selected curve that is linked to a wire defomer, and to have options for rebuilding curves, if used on existing ones.

    usage:
    put in scripts folder than run or add to a shelf button.
    import curvyEdges
    curvyEdges.curvyEdgesUI()
    

    Once i got it at a state i like thinking i will release it with a ton of other little workflow scripts i got going for maya too
  • pinkbox
    Options
    Offline / Send Message
    Awesome I'll give it a try later today. Would love to see a script pack from you too
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    ya still working on a few things but if you got more suggestions let me know.
  • pinkbox
    Options
    Offline / Send Message
    I have another idea :P based on the welder script for 3dsMax.

    is there a way to create a curve where objects intersect?
    even possibly a way to do the welder script in maya?
    Or just create a cut where objects intersect
  • sculptn
    Options
    Offline / Send Message
    sculptn polycounter lvl 7
    Handy tool thanks. You have a a ton of other little workflow scripts ! please do share :)
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    @pinkbox think I could make all of that just will take me a while to figure out the intersecting bit, the rest sounds easy. bit am pretty busy atm so will be a while till I start that.

    and ya I will realease a script pack at some point, and make a github for my stuff.
Sign In or Register to comment.