Home Technical Talk

Inset Chamfer

13
interpolator
Offline / Send Message
Pinned
Swordslayer interpolator
A new separate thread stemmed from the Polyhertz's 3dsMax script - 'Quick High-Poly' discussion.

MXS modifier for download here: http://www.scriptspot.com/3ds-max/scripts/insetfix-modifier

  • InsetFix.ms is just the fixed inset-by-smoothing-groups modifier - it gives a cleaner result than simple inset but it's also slower (you won't notice that with simple models but for complex models you are better of using the regular inset)
  • InsetFixChamferStack.ms is a modifier that adds the complete inset+chamfer interactive stack
  • InsetFixQuadChamferStack.ms does the same but uses Quad Chamfer instead of max Chamfer (you need to have the Quad Chamfer modifier for it to work)
As it is a modifier, everything is procedural and you can return to the base object and change stuff any time.



If you only want a regular inset by smoothing groups modifier and don't mind its shortcomings (it's the one shown in the gif above and does basically what the original Polyhertz's script does, just as a modifier combo), you can get it here: http://www.scriptspot.com/3ds-max/scripts/inset-by-smoothing-group
For complex models I strongly suggest you use this one as it's much faster.

For those who don't mind some tinkering and playing with something that breaks easily, and want to learn MCG, here's also the original MCG modifier: http://www.scriptspot.com/3ds-max/mcg/inset-chamfer

Bear in mind that you'll be basically a betatester if you install it, as there are still quite a few unsolved issues. Any pointers, suggestions etc are welcome.
If you decide to use the Smooth modifier in the stack and you get unexpected results after enabling it, you might want to try unchecking Prevent Indirect Smoothing.
If you get an error message, please open the maxscript listener window (F11 hotkey), copy its contents (should say what happened and what the values were), send it to pastebin and insert the link here. If you are able to reproduce it on a given mesh and you are allowed to share the model, it's even better if you attach the file as well.

Replies

  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    And what's the difference in practice - could somebody show two pictures side by side with the same base mesh (insetFix applied, please) showing it?
  • OccultMonk
    Offline / Send Message
    OccultMonk interpolator
    Maybe I misunderstood. You have two different stacks: one using Quad chamfer and one Chamfer. Why create two different versions?
  • CompanionCube
    Offline / Send Message
    CompanionCube polycounter lvl 12
    Maybe I misunderstood. You have two different stacks: one using Quad chamfer and one Chamfer. Why create two different versions?
    i think because some may prefer one over the other. it's great there is the option to you either. 
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    The thing is, is there even a reason to prefer quadchamfer in this particular case? I'm thinking about ditching the quadchamfer version completely, but I might reconsider if someone shows what the difference when used on top of insetFix is.
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    The main difference I can see with QC plugin is that it has an 'edge weights' option that is unfortunately missing from the Max stock version.

    Other than that your time would be better served concentrating on one version. And you should really be selling this on GR. :) It's your time and hard work. Why not get compensated?

    Fansub and WAYWO have created brilliant toolkits with this function at their cores and are doing very well. Have you considered expanding the tool to an entire workflow toolkit like they have done in Maya?
  • OccultMonk
    Offline / Send Message
    OccultMonk interpolator
    I get an error when trying the normal Chamfer stack. Only the quad Chamfer stack works for me.
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    I get an error when trying the normal Chamfer stack. Only the quad Chamfer stack works for me.
    Weird? Chamfer stack works perfectly for me. I have QC plugin from years back but haven't bothered installing it since it was added to Max.
  • OccultMonk
    Offline / Send Message
    OccultMonk interpolator
    I use Quad Chamfer plugin because it supports smoothing groups. Is there a good solution for the chamfer modifier? I am not talking about an extra Edge crease/weight modifier. I want to just change smoothing groups and Max build in Quad chamfer should use those. That is the main reason I kept using quad chamfer.
  • OccultMonk
    Offline / Send Message
    OccultMonk interpolator
    Sorry to go a bit off-topic :-)
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    The main difference I can see with QC plugin is that it has an 'edge weights' option that is unfortunately missing from the Max stock version.
    Yeah, well, for a while I was thinking of expanding it to a complete chamferFix modifier so that it would do the weights, but as it was already too slow as it is, I abandoned the idea.
    Other than that your time would be better served concentrating on one version. And you should really be selling this on GR. :) It's your time and hard work. Why not get compensated?
    I'm thinking about setting patreon instead, I have loads of unfinished scripts so for me it's more about having some incentive to finish and polish them. Plus this one is quite slow with complex models. Which would also mean some extras and discussion boards for suggestions and stuff. What do you think about that? The resulting tools would be free and unencrypted, just like now.
    Fansub and WAYWO have created brilliant toolkits with this function at their cores and are doing very well. Have you considered expanding the tool to an entire workflow toolkit like they have done in Maya?
    Well, if you want it to work that way, make a suggestion with some examples. I don't follow their progress and tools from other software packages so I don't really know what else is there.
    I use Quad Chamfer plugin because it supports smoothing groups. Is there a good solution for the chamfer modifier? I am not talking about an extra Edge crease/weight modifier. I want to just change smoothing groups and Max build in Quad chamfer should use those. That is the main reason I kept using quad chamfer.
    In this case, everything will be one smoothing group in the end, which means that for this use case, there's no difference. That's all I was asking. The error is a big issue, though, could you post a screenshot with a pastebin link containing the maxscript listener output?
  • kary
    Offline / Send Message
    kary polycounter lvl 18
    Two differences with quad chamfer:  It has an option to quad intersections and quad ends that results in different geo than the default chamfer modifier -- can make for less manual cleanup.  It can also do a face weighted normals on a chamfer.    

    Very neat script!  Tyvm.
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    kary said:
    Two differences with quad chamfer:  It has an option to quad intersections and quad ends that results in different geo than the default chamfer modifier -- can make for less manual cleanup.  It can also do a face weighted normals on a chamfer.    

    Very neat script!  Tyvm.
    Does this apply when used on top of the insetFix modifier? If so, could you post a picture showing the difference?
  • kary
    Offline / Send Message
    kary polycounter lvl 18
    Does this apply when used on top of the insetFix modifier? If so, could you post a picture showing the difference?
    Should have realized that with InsetSGFix applied those functions won't actually do anything.  Whoops, sorry about the misdirect there.


  • Synaesthesia
    Offline / Send Message
    Synaesthesia polycounter
    For the quad chamfer inset script, is it possible to lock the values so that the inset value can't exceed the chamfer value? When working in default meters, the inset immediately tends to explode the mesh with enormous inset/chamfering values that are beyond the bounds of the actual geometry being worked with.

    Worth noting also that there's no way to set the inset value to 0 within the modifier without going down to the quad chamfer modifier and setting that value to 0 - is it possible to set the modifier to allow a value of zero for making quick low-poly bakeable objects?

    Cheers :)
  • skitnik
    Offline / Send Message
    skitnik vertex
    Folks, what is the workflow if we have messy topology (triangles, n-gons, vertice with many edges, etc), and have to finish it up with smooth surfaces and no sharp edges:
    A. messy topo -> InsetFixChamferStack
    B. messy topo -> cleaned topo - > InsetFixChamferStack
    C. messy topo -> cleaned topo - > InsetFixChamferStack -> Turbosmooth
    D. messy topo -> InsetFixChamferStack -> Turbosmooth

    So my questions are:
    1. Is this script intended to be applied on messy topology, eliminating the need of cleaning the model?
    1.1. If we have to clean the topology then why don't we just use regular chamfer instead of this script?

    2. Is this script intended to finish the model by chamfering the sharp edges or to prepare model for Turbosmooth?
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    In general, it's A; with a relatively clean topo, you can indeed use the Chamfer modifier and there would be no reason to use this. Using Smooth chamfered faces only, 180 as angle and Smooth to adjacent on wll give you quite a nice result; also don't forget to turn Limit Effect off - if you want, I may share the 'customized' chamfer modifier so you don't have to change those values every time. Chamfer will have problems wherever more than four edges meet at smoothing group border, though, it creates unexpected dents there.

    That's the main reason the 'inset first-chamfer after that' workaround exists, as insetting pushes these poles from the edge which can then be chamfered without issues. However, it also introduces additional edges on corners where more than two SGs meet - and Chamfer again doesn't like it - which is why I also made a 'fix' version of the modifier that rebuilds topology of those corners.

    However with complex geometry, it will be painfully slow (it's just a scripted modifier and I have to find all these corners and build them again face by face, three vertices at a time). So if you are in that situation and don't mind sligthly uneven resulting chamfer radius, use InsetBySG instead (same workflow, if you want the automated inset+chamfer stack, use InsetChamferStack.ms). That way, the edge dents are avoided, and if the mesh is not viewed up close, the slight 'pinch' on the corners is not that noticeable.

    Neither of these is inteded to be used with Turbosmooth but you can use it that way if the original geometry lends itself to it (obviously, big uneven polygons and extreme tris are not suitable).
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    As a sidenote, I've added a Transition parameter to InsetFixChamferStack (direct link to the file), that offers two different transition types, Smooth and Fast (and there's also the possibility to zero out the spinners as @Synaesthesia requested and other small fixes).
  • Synaesthesia
    Offline / Send Message
    Synaesthesia polycounter
  • skitnik
    Offline / Send Message
    skitnik vertex
    Yes, please share the customized chamfer with us, I hope it is set to "Unsmoothed edges" and Tension = 0.5 o:)

    By the way the scripts insetfixchamferstack_0.ms and insetfixquadchamferstack_0.ms when present together in max stdscripts folder trow errors when their modifiers are used (on different polys). The first that is used builds it's stack, the second trows error. The same is true for insetchamferstack.ms and insetquadchamferstack.ms. Output for the first pair you can see here.

    I'm about to test if Quad Chamfer modifier makes any sense in this script, and in first glance it looks like that QC modifier loses its advantages over Chamfer modifier in the stack, so better ignore above mentioned errors until I'm done.

    Here is the firs test model, and the results:



    The biggest problem for the script is in the upper left corner where one edge is interfering with the chamfer area, but you can also see that the script handles the cut differently than QC modifier too, and in this case it manages to smooth the cut right, but in little more extreme scenario the whole edge gets distorted while QC modifier manages to smooth it right.
    The reason for the success of QC modifier in this case is that it dares to move vertices along the chamfered edge as you can see.
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    That's a great example - and I would like to add that the InsetFix has even more problems than that given that it also uses max inset which kinda goes haywire with non-planar polygons. At the same time, handling these corner cases in a scripted modifier that's already barely usable would make it only usable on low poly meshes where a quick cleanup is faster anyway. I suggest you (and anyone else reading this, too) log the chamfer modifier issues and improvement ideas in the chamfer improvement ideas topic (and same with vertex chamfer if you care about that).
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    Oh, almost forgot, here's the modifier that overrides chamfer defaults (really simple, so customizing it to your liking should be easy).
  • skitnik
    Offline / Send Message
    skitnik vertex
    I do have registration in scriptspot, but I can't access the file for some reason
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    Sorry about that, try now. Thought it'd be clever to upload the file there without submitting, and that apparently only worked for a while. I had to make a page for it.
  • Cathodeus
    Offline / Send Message
    Cathodeus polycounter lvl 15
    Hi Swoardslay,

    Can you explain us how do we save the value inside your script ? Is it by saving and modifying the ms itself ? Or is there a way to change default values within max ?

    Another things what is the transition optionm standing for ??? Fast and smooth ? I'm bit confused as i can't find the differences.

    Thanks for your efforts.
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    Yes, you have to modify the values in the script. And when you want to do the same with max modifiers, you can use the chamfer file from previous post as a template. The way it works is that it's extended scripted plugin that contains the modifier instance it's extending, sets its parameters on creation and replaces itself with it (so that it's the 'pure' non-extended modifier you're used to again).

    The Transition changes smoothing settings:



  • skitnik
    Offline / Send Message
    skitnik vertex
    The new function was confusing to me too until I discovered that it controls the output smooth of the Chamfer modifier between "Smooth Entire Object" (Smooth) and "Smooth Chamfers only" (Fast)
    For example radio button Smooth: [Entire Object] / [Chamfers only] or similar will be more intuitive.
    There is already "Smooth" option under "Tweaks", so for clarity one/both of them can be renamed to something like PreSmooth, PostSmooth, etc.

  • Spoon
    Offline / Send Message
    Spoon polycounter lvl 11
    Just checked your site, @Swordslayer
    Amazing!  Lot of good stuff going on. Thank you so much!
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    Well, the chamfers are also set to smooth to adjacent so technically not chamfers only. The effect you get depends on the difference of chamfer vs inset value, with some values it won't be really noticeable. But I agree about the PreSmooth, probably should rename the Tweaks group to PreSmooth as it handles only that. Naming things ain't easy... I don't like the 'Basic' group name either. Still, I consider this modifier just a temporary fix until the max Chamfer gets better so I'm not all that invested in it.
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    Spoon said:
    Just checked your site, @Swordslayer
    Amazing!  Lot of good stuff going on. Thank you so much!
    Thanks, glad that you find it useful. I'm always happy to get new suggestions for primitives/modifiers so any time you get an idea, be sure to let me know :) Although I'm busy most of the time so it may take time before I create something.
  • skitnik
    Offline / Send Message
    skitnik vertex
    Agree that the real solution is to be improved the build-in chamfer, so just wanted to share quickly my thoughts about available methods  (apart of fixing the topology and chamfer it).
    1. QuickHighPloy is not considered, because it is not modifier, and have restriction about one face can't be in 2 smoothing groups, not to mention that the end result is not better than the rest of the methods described below.

    2. Quad Chamfer Modifier has powerful function "Quad Intersections" that fixes geometry and produces nice results.
    Other good option is the ability to use the weight of the edges as amount of the chamfer, so every edge can have different chamfer amount (B). Unfortunately in this mode the "T" intersection between chamfered and not chamfered edge is distorted (A). This can be fixed by using chamfer by smoothing groups (losing the individual control of the amount of the chamfer) or by connecting the T vertices somewhere.
    The strengths of the QC modifier are lost in the stack because of  the InsetFix modifier, so using it in the stack instead of the Chamfer modifier is pointless. QC modifier is standalone solution, with stable results most of the time.

    3. InsetFixChamferStack in some parts can produce cleaner results than QC modifier, but tends to produce glitches (C) and also visible some post above,  in my first experiment with it. Retopo must be done to fix them, because they are too obvious when they occur.

    4. Quadify Mesh + Chamfer. This method lacks the solving capabilities of the above methods, but with "Quad Size %"  set to 60-100% can produce very clean results (D). This method is best for cleaning large areas of unnecessary edges, but can lead to loss of detail in some areas.

    In every particular case one of this methods will have an edge over the others, so if your favorite method fails, you can try another.
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    @skitnik great analysis, could you also post it to the chamfer topic in 3ds max ideas? That way the adsk guys are likely to see it, too. If you include the test mesh, that would be even better.

    As fo the chamferfix script, did you put it in the stdscripts folder? There's no reason it shouldn't work - and I actually use it that way an it is persistent:


  • Cathodeus
    Offline / Send Message
    Cathodeus polycounter lvl 15
    @skitnik... The topology you're showing here is crappy crap ! A such amount of T vertices on the same mesh is evil ... i never had any issue with ChamferStack you just need to know how does it work technically underneath and work accordingly.
  • skitnik
    Offline / Send Message
    skitnik vertex
    It was in \Scripts\Startup\, now all is OK.
    I doubt if this research can be helpful for devs to improve the Chamfer modifier, because it is more about workarounds of its weaknesses, than suggestions how to improve it.
    In the autodesk forum already are mentioned some feature requests, the thing that is lacking there is more technical ideas/code, that can be given by people like you and creators of QC modifier, rapidTools, etc, that developed algorithms for handling problematic areas of the chamfer.

  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    skitnik said:
    It was in \Scripts\Startup\, now all is OK.
    I doubt if this research can be helpful for devs to improve the Chamfer modifier, because it is more about workarounds of its weaknesses, than suggestions how to improve it.
    In the autodesk forum already are mentioned some feature requests, the thing that is lacking there is more technical ideas/code, that can be given by people like you and creators of QC modifier, rapidTools, etc, that developed algorithms for handling problematic areas of the chamfer.
    It's a useful comparison, and the example mesh poses a challenge to tackle - it's always nice to have more objects to test stuff on, and this one is wicked :)
  • skitnik
    Offline / Send Message
    skitnik vertex
    Yes, this mesh is adorable, here are some more comparison
    The Grey one is InsetFixChamferStack,  The Green one is Chamfer modifier



    In first 2 examples Stack fails, in next 4 is better than Chamfer

    Here you can see that the Stack fails when more than 1 smoothing group is applied to a face
    The test mesh is attached if someone wish to test something on it.

    I made some Christmas wishes in the autodeks forum too, will be happy to see them implemented


  • macoll
    Offline / Send Message
    macoll polycounter lvl 14
    @Swordslayer just checked your site, really big thanks for your scripts man !  Ninja Script Skillz !  ^^
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    @macoll thanks! Happy to know they're useful :smile:
  • monster
    Offline / Send Message
    monster polycounter
    Not to take away from SwordSlayer's awesome work here, but a small update made it into Max 2018.
    There is a new Quad Intersection option for the Chamfer mod. In the gif below the more rounded versions are 2017 and older behavior.

  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    @monster that alone doesn't do it justice. It now makes the chamfer results cleaner when more edges meet at the same point:



    In some cases (where then angle between the edges is sharper), it results in even more reduced bevel amount though:



  • LaurentiuN
    Offline / Send Message
    LaurentiuN polycounter
    @Shinigami

    Did you set the smoothing groups?
  • OccultMonk
    Offline / Send Message
    OccultMonk interpolator
    The Quadchamfer modifier supports UVW. The inset modifier does not change the UVW unwrap. It would be far more useful if the modifier would insert the topology in the UVW too.  Then you can:

    1) Unwrap the base object (without rounded corners)
    2) Use inset chamfer + quad chamfer

    This would result in a much faster unwrap and better-aligned geometry instead of relaxing the UVW afterward.
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    Assuming swordslayer does the same thing I do in my single modifier version of this he's at the mercy of what max does when you extrude faces as part of edit poly. Fixing UVs on extruded faces is a whole other project and given that this is intended to be a tool for quickly bevelling shit geometry it seems a little outside the remit
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    Pretty much, although there'll also be a version rebuilt from the ground up to work around all the issues this approach has, where I could add it. The main constraint is time and energy, though.
  • OccultMonk
    Offline / Send Message
    OccultMonk interpolator
    Pretty much, although there'll also be a version rebuilt from the ground up to work around all the issues this approach has, where I could add it. The main constraint is time and energy, though.
    I think it's worth it though, in my opinion :)
  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    Speaking of the rebuilt version, InsetSG which is a part of the KeyHydra toolset, there's now a playlist with a short feature walkthrough. The enhancements include up to 100x speedup, support for multiple SGs per face, preserved SGs, matIDs and selections, as well as options to select edge faces. There are also additional smoothing modes, one SG per whole mesh, explicit normals or smooth by threshold. Another addition is the option to have a consistent radius width so sharp corners are now rounded properly. Last but not least, custom round and flat profile options are present now. Here it is compared with max chamfer modifier:





    And as the Chamfer's Quad Intersection option added in 2018 was also mentioned above, here's a comparison turning it on and off (long story short, it's not always an improvement), compared to InsetSG on the right:



    And if you find yourself setting the values of the modifier to the same values over and over again, there's now a Preset rollout where you can save the current values as default ones and next time you add the modifier, it will use those:


13
Sign In or Register to comment.