Home Technical Talk

Shell Modifier equivalent for Maya...

MoP
polycounter lvl 18
Offline / Send Message
MoP polycounter lvl 18
OK, so I love the workflow of Max's modifier stack, especially with stuff like having a simple planar mesh, dropping a Shell modifier on it with a spline to bevel the outline, then a Turbosmooth on top to make it all pretty.

The best thing about this (to non-Max users who might not understand!) is that it leaves the underlying "simple" mesh editable all the time, and so is the profile curve editable, so you can tweak away like mad and never, ever destroy any data. This non-destructive workflow is, in my opinion, one of the simplest and clearest ways to work. You never get bogged down in dense mesh data unless you really want to! :)

So I need to replicate this in Maya. I'm sure it's possible, even if it means I end up writing a plugin.

Initially I'm going to start prototyping using basic Maya tools, and not touching scripting or programming at all, and just going to see how far I can get without breaking everything or generating horrible workflows.

Here's the starting point. The end result of this gives me almost the same thing that a Shell modifier and a Turbosmooth in Max does.

shell_equivalent_01.jpg

The main issues here are:
  • Problem: This is a destructive workflow. I can't go back to the "bottom of the stack" and edit the plane from which this final mesh was generated.
    • Potential Solution: These extrudes and bevels are in the Inputs of the object's history - if I have them in the Outputs going to a separate object then I can leave the original object editable. The down-side to this is that I will have to have two objects in the scene for every "single" mesh I want to do this to. That's nasty workflow IMHO. I just want the one object with all the modifiers on it, no extra fluff floating around in the scene.
  • Problem: The "profileCurve" (shown in the image) doesn't seem to take a true spline for input like Max's. I would have thought it possible, but haven't found an easy way yet, which is strange. This means I can't easily use the same curve for multiple different "Shell" extrusions.
    • I don't know of any solution to this yet. Either I'm blind, or Maya is hiding away a special option somewhere to enable the use of a Curve object instead of the result of the profile curve editor. I need to look into this more - if anyone knows how to do this, let me know!
  • Problem: The profileCurve points don't map directly to the edge splits created by the polySplitRing1 node. It seems to only allow you to set a number of equidistant edge loops which then get deformed by the curve. Max's method is to actually use each curve point as a new vertex in the extrusion profile, which means you can get more optimal results without having to slap a ton of subdivisions on the extrusion.
    • Solution: I have a feeling I'm going to have to write a plugin or clever script somehow to determine how to match up the points of the edge cuts with the points of the profile curve. There doesn't seem to be a way to do this by default in Maya. Again, if anyone knows, please tell me!
So yeah. Quite a few issues already.
However, this is the result of only 5-10 minutes messing around and learning a couple of the Maya features I hadn't examined before (such as the profile curve for edge splitting, never knew that existed before!).

If some Maya veterans can help me on my way with this, that'd be cool. Maybe we'll all learn something.

I'll keep working away on this today and post progress as I hit on more elegant and flexible solutions to this problem.

In case anyone doesn't know what the Shell modifier is, or how it works, here's a video I found through Google which explains what I'm trying to achieve:
[ame]http://www.youtube.com/watch?v=aWh0p6Kq19M[/ame]

Cheers!

Replies

  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    OK, next step:

    shell_equivalent_02.jpg

    I have partially solved the "non destructive" issue. However, as suspected, I now have two objects in the scene instead of one.
    A potential solution to this would be to have a MEL scriptJob watching for objects that are "shelled" to be selected, and then auto-hide the Shell version, reveal the "editable" mesh, then when it's deselected, re-hide the "editable" mesh and reveal the Shell version again.

    Also it's a case of one step forward, two steps back - I now can't use the "Insert Edge Loop" method to have a profile curve on the edges of the Shell. This is because since the ExtrudeFace node is taking the input geometry of f
    [*] (all faces), if the source object changes topology at all then the polySplitEdgeLoop node would no longer receive the correct input list of edges to split, and the mesh goes horribly wrong.

    The question of the profile spline maaaaaay be solved by feeding in a curve to the "Taper" setting of the extrudeFace node, but this only becomes active if you're extruding along a curve for some reason... (it should be active all the time, there's no reason why it shouldn't be!). Using a curve to extrude also means you lose the settings like how far you want to extrude, and it becomes a simple world-space offset rather than a "push" along normals, which is not how the Max "Shell" modifier behaves (although this may still be a useful result).

    So, this method is fine if you don't mind cluttering up your scene a bit and hacking around with MEL in a minor fashion - it'd be easy enough to make a simple UI for this procedure so that anyone could make a "Shell" object from their selected poly mesh.

    However this means I still haven't found a proper non-destructive, simple method which will extrude an object and use a profile spline!

    So, uh... one step forward, two steps back?

    Anyone else feel like joining in, I'm sure there must be a way!
  • Entity
    Options
    Offline / Send Message
    Entity polycounter lvl 18
    There has to be a way, the fate of the world depends on it ( or atleast for those forced to use Maya at work :) )
  • throttlekitty
    Options
    Offline / Send Message
    How about tossing some birail into the mix to alleviate the profile curve problem? That would most certainly go into multiple objects, but I'm wondering if aspects of that can be pulled and applied to a plugin instead.
    edit: eh, that's just no. I never realized you could do that with edge loops either, I'll have to look into that tonight.

    For the sake of conversation, Basic workflow there would be:
    *Make sexy plane, select boundary edges.
    *Modify>Convert>Polygon Edges to Curve, setting degree to 1.
    *Duplicate new curve to desired location. (Don't know a way to do a good 'extrude' type function here, aside from actually extruding back on the model, and doing another polyEdgeToCurve, then deleting the extrude, but again, messy)
    *Draw profile curve and birail it.

    This should keep connections between all the objects, but my scene is acting up right now and invalidating the birail'd surface when I modify the plane again. (oh, the profile is probably becoming detached from the rail, duh.)

    ShellmodIdea1.jpg
  • Frump
    Options
    Offline / Send Message
    Frump polycounter lvl 12
    You've found some interesting stuff, I never realized that insert edge loop tool has an option for a profile curve. Generally though, in maya, when you are creating curves you do it with the create EP or CP curve tools which are under the create menu. After that, to do work with them you have to go to the surfaces menu set and there's an edit curves menu and a surfaces menu that has a lot of curve and nurbs related operations.

    Also to take a destructive step out, in Maya 2008+ you can turn on a smooth mesh preview using the 3 key and return to the control using the 1 key.

    Theoretically you could do this all non-destructive, but it's not pretty. I'd just make sure I liked what I had for my base plane before moving on.

    So one way I came up with would be to make an instanced version of your plane, move it up or over, as it would be if it were extruded. Create curves from the edges of both and parent constrain them to their corresponding planes. Create a profile Curve and then Birail between the two curves. Now even then you might not be able to move the two planes around too much or it will disconnect the birail unless you manage to get the profile curve to stick to the rails as the move...

    Even scripted this is a lot of nonsense going on for one simple thing. Even with a simpler way, personally I would settle for destructive if I couldn't switch over to max and back.

    Edit: Basically the exact same thing as throttlekitty and the problem created now is that the rails detach if you move the planes or curves. I could come up with a way using locators and ugly stuff to maybe get it stretching but seriously, doesn't seem worth it.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Frump wrote: »
    You've found some interesting stuff, I never realized that insert edge loop tool has an option for a profile curve. Generally though, in maya, when you are creating curves you do it with the create EP or CP curve tools which are under the create menu. After that, to do work with them you have to go to the surfaces menu set and there's an edit curves menu and a surfaces menu that has a lot of curve and nurbs related operations.
    Yep, thanks for the pointers, but I'm well aware of Maya's default methods to create curves. However, my initial point was that there doesn't seem to be any way to attach an EP or CP Curve object to the Insert Edge Loop method. It appears that the only way to add a curve is through the Attribute Editor, using the Profile Curve rollout of the polySplitRing node. I can't see any easily accessible way of assigning an external Curve object to that value, even though it seems like it should be a sensible thing to do.
    Having a curve selected at the same time as the edges when splitting the ring seems to have no effect either.
    Do you know how to attach an EP Curve object to the Profile Curve setting of the polySplitRing node? This is part of what I'm trying to find out.
    Frump wrote: »
    Also to take a destructive step out, in Maya 2008+ you can turn on a smooth mesh preview using the 3 key and return to the control using the 1 key.
    Again, something I'm well aware of, but thanks for writing it up :)
    I actually have a custom script that toggles between the default "1" and "3" modes, since this is more like the "Show End Result" toggle in Max, and is a lot faster and more sensible for me. No need to take up 2-3 hotkeys (Maya default) when one will do the trick. I still don't know why they don't make it a cycle or a toggle, it seems wasteful to have one key per action, especially when they're pretty much mutually exclusive.
    Also it doesn't help that in Maya2008 this "smooth mesh preview" isn't actually renderable or exportable until you do a "convert smooth preview to polys", which is another stumbling block in the workflow, one which should really not exist at all (eg. Max's Turbosmooth has settings for viewport subdivisions and rendering subdivisions separately, why can't Maya do this?).

    I actually ended up writing a script that will automatically convert all selected mesh's polySmooth nodes back to Smooth Preview just so that I can keep a whole scene in Smooth Preview until I need to export or render, then just convert the whole thing to polySmooth nodes using the Smooth Preview settings, and then convert all those polySmooth nodes back to Smooth Preview at any point.
    Frump wrote: »
    Theoretically you could do this all non-destructive, but it's not pretty. I'd just make sure I liked what I had for my base plane before moving on.
    Sure, and that's how I work at the moment, because Maya forces me to do it the destructive way. But destructive is not a good way, and I'm sure there's the capability to reach the same result non-destructively (even if it means I have to write a damn plugin! :) )
    Frump wrote: »
    So one way I came up with would be to make an instanced version of your plane, move it up or over, as it would be if it were extruded. Create curves from the edges of both and parent constrain them to their corresponding planes. Create a profile Curve and then Birail between the two curves. Now even then you might not be able to move the two planes around too much or it will disconnect the birail unless you manage to get the profile curve to stick to the rails as the move...
    Interesting... I haven't really messed around much with Birail before, I'll try it out tomorrow and see what results I get.
    Frump wrote: »
    Even scripted this is a lot of nonsense going on for one simple thing. Even with a simpler way, personally I would settle for destructive if I couldn't switch over to max and back.
    I really don't mind writing a simple script to do the legwork of this procedure, since most of it is pretty straightforward. Anyway, you say "for one simple thing", but I find that this modifier is insanely handy for highpoly modelling in Max, I use it all the time and it saves me a ton of work, and still stays flexible all the way till the end of the modelling, so I want to be able to reach that level of efficiency in Maya too.

    I already have at least two ideas in my head that would be easy to do in script and produce at worst a workable, non-destructive result... although the quality would not be as high as what I'm used to in Max.

    I guess it's time to dig around in the API documentation for MFnMesh :)
  • Marine
    Options
    Offline / Send Message
    Marine polycounter lvl 18
    There's a python script to mimic shell, but I've no idea how well it works or compares since I haven't used Max in years and the script is for 2008/2009.
    http://highend3d.com/maya/downloads/mel_scripts/modeling/poly_tools/P3D-solidify-5727.html there's a video in there too
  • Frump
    Options
    Offline / Send Message
    Frump polycounter lvl 12
    Well, MoP, Power to you. :)

    If you get it to work I will definitely use it.

    There's also another interesting option to note. Under surfaces, Bevel Plus, it does the same as Max's bevel but as far as I know doesn't allow custom curve input, only presets.
  • tacit math
    Options
    Offline / Send Message
    tacit math polycounter lvl 17
    i don't and never have used max though of course recognize the power of the modifier stack thing. would be such a no brainer for autodesk to drag that functionality over to maya's modelling kit. i commend your efforts here MoP. and wish you all the best in finding a good solution
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Marine, thanks for the link. Unfortunately that just looks like (from the video) a glorified Extrude. It seems like just a slightly cleaner method of keeping the extruded shape matching the underlying surface. Also it appears to be a regular history object so not much use in a non-destructive workflow other than as a replacement for Maya's default Extrude :(
  • ivars
    Options
    Offline / Send Message
    ivars polycounter lvl 15
    This is indeed interesting.

    Trying out your latest method but using a * in the extrude command gives me a syntax error....

    Edit: I've found the taper curve can still be edited through MEL on a regular extrude but it's still not using it.....
  • rebb
    Options
    Offline / Send Message
    rebb polycounter lvl 17
    Hmm, looks like you can drop the whole ".f[...]" from the polyExtrudeFacet altogether and it will work like you had done ".f[*]".

    Neat, when i tried similar setups in the past i was getting problems with things like doing extrudes on the base-mesh, which ended up garbling the extruded final mesh.

    Dropping the ".f[...]" part actually fixes that :D.
  • ivars
    Options
    Offline / Send Message
    ivars polycounter lvl 15
    Hey here´s an idea:

    instead of using extrude, I first use DuplicateFace without extracting the faces. The LocalTranslateZ will be your offset. Then selecting the border edges of both shells/elements and using Bridge with a smooth path to connect them (this will require the normals to be facing away from each other on both shells). In the Bridge node you will have number of divisions and a functioning taper-curve.
  • rebb
    Options
    Offline / Send Message
    rebb polycounter lvl 17
    Yeah, i think thats how the ticket01 Shell Modifier does it ( you can toggle the bridge option of it on and off and it looks like a face duplicate ), but it has no support for a profile curve yet.

    Maybe he adds that at some point because it's apparently still beta.
  • ivars
    Options
    Offline / Send Message
    ivars polycounter lvl 15
    I'll take that back :(
    I get really weird results because of the whole "smooth" thing, but again if I set it to "linear" I loose the taper-options (aargh!)

    Using "smooth+curve" creates a degree 5 curve, but rebuilding that curve to linear didn't help.

    Edit again: Just found this: http://www.highend3d.com/maya/downloads/mel_scripts/polygon/ekBridgeUI-mel-5209.html

    And again: If I actually had read that, it just did what I was trying, converting to linear path :(
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Hmm, thanks for posting that, ivars! Interesting solution, and it does seem to work alright.

    Again though, this "profile curve" thing - lots of poly modelling tools in Maya seem to have it, but you can't connect up an EP Curve object to that? It seems like an insane oversight. That's one of the best things about the Shell modifier - you can instance the Curve object into any Shell modifier, then just tweaking that single curve updates all the Shells.

    With this Maya method it seems like it'd be really hard to get consistent extrusion outlines unless there's an easy way to copy profile curve settings (seems like a job for a script?).

    And again having the "divisions" setting completely separate to the profile curve, seems like an oversight too - you'd get far more predictable results if it would just cut a new edge at every control point, but there's no way to do that :(
  • ivars
    Options
    Offline / Send Message
    ivars polycounter lvl 15
    You can use "Transfer attributes values" (in the edit-menu) to copy and link the values between two input nodes, like an extrude for example. That way, any changes on the subdivisions, offset or whatever can be changed from one master and applied to all connected nodes. I would guess it also copies the taper-curve
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    ivars: google chrome thinks that your image links are dangerous. If I call this page I get a warning because of your post.
    If I go to your domain it tells me that some "updatedate.cn" stuff is trying to harm my computer. perhaps your webspace got hacked? - maybe check that and change your passwords.

    edit: its probably some injection hacking through some php or mySQL security holes,- so if its your own server update those server software stuff.
  • ivars
    Options
    Offline / Send Message
    ivars polycounter lvl 15
    renderhjs: Wow indeed. Thanks for pointing it out.
  • ivars
    Options
    Offline / Send Message
    ivars polycounter lvl 15
    Also: that Transfer attribute values... I might have gotten that a bit wrong... didn't work as I expected it, but might be interesting non the less. :P
  • throttlekitty
    Options
    Offline / Send Message
    MoP, care to share any results with that ekBridge script? I can't get anything useful out of it, modifying the curve it creates just makes a real big mess of things.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Oh, sorry, I was referring to his post about the Extract and Bridge, rather than that script.
    I will try out the script tonight and see if anything good will come of it.
  • throttlekitty
    Options
    Offline / Send Message
    Also, I got a curve to partially control the polySplitRing, but i think we're limited by the input types of the node. Once I shed a little noobishness, I'll post my findings.

    Edit: Yeah ok, I don't really think polySplitRing can take a curve without being rewritten. The curve can control the ramp 'profile', but it's no different than using the ramp. I don't see a way to get anything other than an array of equidistant loops during the cut.

    Have you tried the birail yet?
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Oh right, yeah, I just got the same result here, using:
    connectAttr curveShape.controlPoints polySplitRing.profileCurve;
    
    Strange how they don't really make that easily accessible through the UI, since it seems to work fine.

    I guess I may be able to script something simple that takes the curve points and does a polySplitRing per point. Sounds pretty hacky though.

    I'll give the birail a shot now :)

    Edit: Wait, no, that connectAttr method doesn't work at all, I'm talking nonsense!
    However the fact that it accepts inputs nicely should mean that it's not hard to plug in the right connections to get a good result.
  • throttlekitty
    Options
    Offline / Send Message
    I plugged the CVs in directly. Kind of wonky, since you'd need first create the entries on the profile ramp so they're available for connection for each CV on the curve. But it would be fantastic if 'weight' was used per each loop, rather than ignored. (but then maybe the tool might work as expected in the first place, since it would be trivial to connect weight to the ramp's horizontal positions)
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    For the sake of conversation, Basic workflow there would be:
    *Make sexy plane, select boundary edges.
    *Modify>Convert>Polygon Edges to Curve, setting degree to 1.
    *Duplicate new curve to desired location. (Don't know a way to do a good 'extrude' type function here, aside from actually extruding back on the model, and doing another polyEdgeToCurve, then deleting the extrude, but again, messy)
    *Draw profile curve and birail it.

    OK, I'm trying this now, it seems like it's going to work pretty well. I mean, doing a birail on curves with a profile spline produces the right sort of results, so it should be fine following this plan.

    However, maybe I'm missing something? I'm in Maya 2008 here, and my Modify -> Convert menu doesn't have a "Polygon Edges to Curve" command. Is that somewhere else, or are you on a newer version of Maya?

    Anyway, assuming I'm just blind, and I can create this new curve from the edges, it'd probably be pretty easy to get them duplicated and birailed with a spline, although then the problem is you now have about 4 objects in the scene when really you only want one!

    Again, it'll also mean that the only way you can make this non-destructive is by scripting something or setting up a crazy node hierarchy to watch for mesh changes in the original plane shape, and update the curves generated from the "boundary edges" of the original plane.

    This should work, in theory, but it seems pretty messy to me. I'll hack around with it a bit more tonight and see if I can get somewhere nice with it :)

    Edit: Sorry, missed your last post. Interestingly, I found that you don't have to create a new curve point for the profileCurve of the polySplitEdge node - simply plugging in a value to profileCurve[1] for example, adds a new point.

    Edit2: Just realised, the birail thing will produce results that are actually more complex than I thought. Since the birail only produces the "surrounding" mesh, you'll have to merge the "top" and "bottom" cap meshes back with the "surrounding" mesh, and merge all the border verts, before you can subdivide it successfully.
    While this can be done, it does seem to make things a lot more complicated than some of the other processes.
  • throttlekitty
    Options
    Offline / Send Message
    Ah, I thought edge to curve was added in 2008. I haven't gone back yet to check if it handles topology changes. (maybe the 'Select Border Edge' tool has that kind of functionality?) Is it possible to create a normal curve with linear interpolation? I've never tried, but Edge2Curve allows for it, so it's available somewhere.

    The birail does make things more complicated, but it does yield the 'best' result so far, but messy as you noticed. Plus, a wrap would be needed to keep the second rail in check, as well as making sure the profile curve always sticks to the rails.

    Really, I brought it up for the sake of keeping the gears cranking
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Oh, totally - it was a great suggestion! I had good results for the profile spline in the birail (much more like the Max method of Shell profile), so now I guess I need to figure out how to use the same logic on polygon edges, and that would be halfway there. I wish I had the source code for birail! :)
  • Frump
    Options
    Offline / Send Message
    Frump polycounter lvl 12
    MoP, you can have Birail give you polygon results. Go into the options then check on, polygons, quads, general, per span # isoparms and put them both at 1. Those are the magic settings. It will create it with the verts where your control points are. Of course, it is still just the same as getting nurbs results and converting, but it saves steps.

    As with other stuff I've mentioned, you might already be aware of this, but posting just in case. :)
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Yep, I'm already using that method, but thanks for posting :)
  • Whargoul
    Options
    Offline / Send Message
    Whargoul polycounter lvl 18
    If you want the "go back in history and edit base object" thing without using a duplicate object, just disable the nodes above it.

    ie in your first example, set the "node state" to "no effect" for these:
    polySmoothFace
    polySplitRing
    polyExtrude

    in that order (working backwards). The node state is under "node behaviour" in the attribute editor.

    You'll be left with your base object which you can edit, then re-enable those nodes. A script could do it very quickly as well. Just remember the edits above reference the faces/edges by number, so changing the topology will do wacky things, unless it happens to always reference all, like .f
    [*]. Obviously the split ring won't though.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Whargoul: Well, yeah, and I mean that is the problem. If you do any edits to the base topology then the split ring etc. will get messed up because the number of edges (and indices) will change.
    This is what is so good about Max's system, and it's what I'm trying to replicate - what you described here is why I want a solution in the first place :)

    Basically in Max I don't need to worry about my geometry changing index down at the base level, because all the modifier does is "Extrude all faces, and bevel the profile of all border edges" ... so in order to do this in Maya I need either a script or plugin solution to constantly check if the underlying geometry has changed, and update the results above that.

    It's the whole point of the "non-destructive" workflow thing :)
Sign In or Register to comment.