Home Technical Talk

raul's tools

polycounter lvl 11
Offline / Send Message
raul polycounter lvl 11
I've decided to start being active around here again. As part of this i will be practicing scripting on my time off. To make a few tools to speed up my workflow. My workflow will focus on Modo to Unreal.

So here is the first treat! A smoothing Groups interface! Modo has had smoothing groups for a long time, but its all over the interface. and a lot of people are a bit confused on how to use it. As per request of a few of my coworker and friends. I decided to make a quick UI.

TOOL : Smoothing Groups Interface for modo
UPDATE : 1. Rearranged the window layout.
2. Added high rez buttons.

smoothingGroup_zps2a3564b1.jpg

Download Here


Here are the instructions to installs, im sorry that you are having issues with this. It works fine in windows.

1. Move the contents of ra_SGmini ( 3 files ) into
C:\Users\YOURUSERNAME\AppData\Roaming\Luxology\Scripts
2. Import the config to modo. ra_SGmini.cfg
3. Open up the preseted layout using
layout.createOrClose 811 ra_SGmini title:"Smoothing Groups" width:478 height:142 persistent:true
4. Map this to a hotkey if you wish. Or add it to your current UI.

To enable the smoothing angle options, you must first select the material of the selected polygon. A quick way to do it is through using hotkey "4" for selecting materials.

Replies

  • Zelenkov
    Options
    Offline / Send Message
    Zelenkov polycounter lvl 9
    Pure badassery! Works like a charm! Hi rez...he he. Thanks buddy!
  • MrOneTwo
    Options
    Offline / Send Message
    MrOneTwo polycounter lvl 12
    Smoothing groups based on uv shells ibegyoupleeeeeeesae???! Thanks for this one!

    Could you also add 'Set Vertex Normals' command in your UI ? Without it you can't see smoothing groups taking effect.
  • Mark Dygert
    Options
    Offline / Send Message
    Woa... smoothing groups in modo? That seems kind of cool for max users crossing over. Does modo do hard/soft edges like Maya (not a modo user) that would be really cool too I bet.
  • WarrenM
    Options
    Offline / Send Message
    BAD ASS, Raul!
  • Gheromo
    Options
    Offline / Send Message
    Gheromo polycounter lvl 11
    Hey raul, its great plugin. Even tho im not a modo user I believe there is a gap for improvement. People at work love this plugin because it allows you to edit vertexes directions manually and fake Hi poly like smoothings on edges and so on. Look at "fillet" option and type in dialog is really useful too.

    edit: http://migugi.net/mel/normalTools/
  • igi
    Options
    Offline / Send Message
    igi polycounter lvl 12
    Thanks for the tool!It's lovely.Could you create a button for groups from uvshells ,don't know what kind of sorcery behind it,just asking :)
  • fullofclovers
    Options
    Offline / Send Message
    fullofclovers polygon
    Thanks for putting this together and sharing!
  • raul
    Options
    Offline / Send Message
    raul polycounter lvl 11
    Thank you everyone for commenting and giving the UI a try :). So, smoothing groups by uv island huh? I dont know what voodoo i would need for that, but sure ill give it a shot! It actually sounds like something i would use on my stuff as well.

    @Mark, yeah thats why i decided to make this tool. Got a few friends who starting using modo. And wanted them to feel a bit more control. Modo does what maya does, but a little different.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    raul wrote: »
    Thank you everyone for commenting and giving the UI a try :). So, smoothing groups by uv island huh? I dont know what voodoo i would need for that, but sure ill give it a shot! It actually sounds like something i would use on my stuff as well.

    @Mark, yeah thats why i decided to make this tool. Got a few friends who starting using modo. And wanted them to feel a bit more control. Modo does what maya does, but a little different.

    if modo is working with smoothing groups like max, it wont be that hard just need to figure out how to get a list of the UV shells and iterate through them and select the corresponding faces, and apply different smoothing groups, if in the back end it uses a system more like maya with soft and hard edges, it is a bit harder, but still possible just need to mess with the selection a little more.

    what language are you using python or pearl?
  • Bryan Cavett
    Options
    Offline / Send Message
    Bryan Cavett polycounter lvl 19
    Nice work Raul,

    I made a smoothing group tool for modo a while back. (http://forums.luxology.com/topic.aspx?f=37&t=67974)

    You can just select polys and it sets a random smoothing group but makes sure it doesnt assign a smoothing group that is on any of the surrounding faces.

    It didnt seem to get much love on the modo forums but I find its the fastest way of setting smoothing groups in modo. Works similar to the "smooth selection" tool in the latest versions of max.

    Feel free to hack it up and take what you want from it. Im a noob at modo scripting since I dont really get to use it everyday at work. Just doesnt fit well in our pipeline right now.
  • raul
    Options
    Offline / Send Message
    raul polycounter lvl 11
    @Bryan Cavett - Thanks a lot for pointing me to your scripts. I had not seen them before. Ive been studying them quiet a bit! :)

    So i got some really awesome tips and help from seneca menard on how to approach some of the things i wanna do for smoothing groups by uv island. He even wrote the whole script for me! Very helpful! Thank you Seneca! But he left it to where i can go in and see how some things are done, and build from there. The script currently assigns smoothing groups by UVisland, but it doesnt know what smoothing groups the faces around are. So i will work on getting that working! :)

    At the same time i didnt want to be stuck doing that, so decided to continue trying to learn more and come back to it later on. In the mean time i wrote a cool script that will export your selected layer, into fbx format. More info below. I know of a couple different scripts that do this already, but i really wanted to try to make my own. Just to get a bit of practice.

    ExportUFBX.pl
    Script description:
    1. Assumes that everything parented to the selected layer is an unreal collision object. If nothing is parented it will just export the selected layer alone.
    2. Supports super layz collision naming. If the selected layer has children. It will check if the names are “UCX_nameofParent_#”. You don’t have to worry about naming the collision layers anymore.The script will take care of all that for you.
    3. Spits out the selected files, to the same directory where your scene lives. Will use the name of your scene and append the name of the layer exported to the name. IE nameofscene_nameofexportedlayer. Deadtrees_oldroot.
    4. This script ensures that smoothing groups, smoothing angles, uvs and the name of the material are kept within. And are properly exported into FBX.

    You may download it here

    A few notes
    1. Did this in a hurry, so let me know if you run into problems.
    2. The first time you run the script you will get a bunch of warnings. Just disable those as you get them. I will work on getting those warnings turned off.
    3. When importing into unreal, make sure that “One Convex Hull Per UCX” is checked on. Else it will collapse your collision meshes into one.
    4. To use it, put it in your scripts folder. And use "@exportUFBX.pl" to launch it. You may set this to a hotkey or add it to an existing menu.
  • Snefer
    Options
    Offline / Send Message
    Snefer polycounter lvl 16
    aw yea! Will give this a try : D
  • Zelenkov
    Options
    Offline / Send Message
    Zelenkov polycounter lvl 9
    Sweet script man! :)
  • Bek
    Options
    Offline / Send Message
    Bek interpolator
    Smoothing groups by uv islands (So hard edge by uv islands / seams) would be fucking fantastic to have in Modo, and I would probably love you forever if you get it working. I'm not a programmer, is the current problem you're having getting the hard edge where (for example, on a cylinder) where the faces that share an edge have a uv border? When I asked a python savvy friend to have a quick look at this he said it doesn't seem easy to do, as we assumed in modo edges don't have the property of being hard or soft.

    if it makes a little more sense, here's the image I sent to explain the problem to him: http://i.imgur.com/HYwJKC3.png

    so how could a script know to set sg's for polygons where the shared border gets a sg that smooths with everything but the other border polygon? Anyway good luck with it and thanks for the sg UI, should come in very handy!
  • MrOneTwo
    Options
    Offline / Send Message
    MrOneTwo polycounter lvl 12
    I would imagine you could create list of uv islands and apply different smoothing group to each uv island. It would create smoothing groups number = to uv islands number. Or is there limited number of smoothing groups ? In modo you name them so I don't think so. It's not like in 3ds max where you select them from 32 groups (and probably in 3ds max you can use more smoothing groups just not from UI). Can't you just use 'for' to apply new smoothing group to each island ? Or did I miss the point ?

    Thanks for this export script!
  • Bek
    Options
    Offline / Send Message
    Bek interpolator
    If you can iterate through islands and apply different smoothing groups to each island, that would be helpful, but it isn't the same as setting hard edges by uv islands, which is what would be REALLY cool (and I imagine what most people would want for game art). If you look at the image I linked, imagine that the top and bottom caps of the cylinder are separate islands, and that the sides are one uv island. To set hard edges by UV islands in modo, what I have to do is:

    Choose two characters for my main smoothing group (AB - remember it's not a unique group AB, but a combination of A and B, so polygons in A and B will smooth with AB)
    Set all polygons but the ones on the boundary (Where there is a uv split) to AB
    Set one of the boundary polygons to A, the other to B (So A smooths with everything else (AB) and B smooths with everything else too, but A and B do not smooth together, creating the hard edge I want.

    This gets more tedious the more complex a model gets, and I have absolutely no idea how you'd do something like this through a script (max is polygon based sg's though and textools can do sg by uv islands though I believe??). Again I'm not a programmer but if it can be done then I would be in awe of supposed programmers wizardry and dashing looks.
  • MrOneTwo
    Options
    Offline / Send Message
    MrOneTwo polycounter lvl 12
    If we are talking about having different smoothing groups on each uv islands for baking and viewing in engine won't just iterating through islands and applying unique smoothing groups suffice ? In the example you showed in the picture wouldn't you just apply one smoothing group to caps and another one to the polygons running around the cylinder ? Will this hard edge make a difference ? I never worked with hard edges. I only used smoothing groups.

    BTW pipeline IO uses custom hard edges script http://www.arielchai.com/tutorials/resources.html so maybe Ariel willl have some answers ? I can't get pipeline IO to work properly unfortunately.
  • Bek
    Options
    Offline / Send Message
    Bek interpolator
    Depends, but the hard edge is 'free' when it's already on a uv seam so you get the benefits of using a hard edge without the negative extra cost. As EQ points out in his baking thread the benefits are for (tangent space) normalmaps, by lessening gradients. With the cylinder, sg's via islands would get you almost exactly the same result, just not that hard edge. The practical difference here is the two border faces will have less gradients, and depending on the model it might be worth your time to set hard edges for the benefits, but if a script can do it then there's no real reason not to. (A cylinder isn't the best practical example but it easily shows the current problem with doing this method in modo)

    I'll take a look at that IO script, I think I mayyyy I have tried it in the past, probably also to no luck.

    edit: hell's horses pipeline IO does work and is indeed magic. I am a happy internet user today. It's a perl script if raul is using perl and wants to take a look at it. If you're having trouble getting it working MrOneTwo Pm me and maybe I can help you figure it out?

    editx2: On closer inspection, (and I might be missing something) this script takes the uv border selection and duplicates those edges. I'm trying to think, will this have any negative aspects compared to using SG's? They would (to my limited knowledge) have the same performance cost, but does having doubled edges screw with animation or anything? It will cause problems if you try to use mesh cleanup scripts or something like that, but since you only need to do this before exporting thats not really a problem.

    editx3: I was missing something, just had to use the V (vertex normal) tag instead of S (split) when exporting. So it does both.
  • raul
    Options
    Offline / Send Message
    raul polycounter lvl 11
    This week i realized that the exporter script i wrote, doesnt export the fbx properly. Does anyone have any experience on that? Ive spent most of my day trying to figure it out.

    At the end there is a line to tell it to export. And i did this.

    lx("!!scene.saveAs {$originalSceneName} $fbxType true");

    Where $fbxType is a variable containing the string FBX_2006.11. But i dunno, i dont think its reading it properly.
  • igi
    Options
    Offline / Send Message
    igi polycounter lvl 12
    I got no luck with pipelineIO,tried every letter combination until burnt out.I want clickable options to see in real time whatever I just made.

    Raul,your export script simply doesn't export smoothing groups,using modo 501 and it gave me flat shaded meshes with custom imported_normals.SG's assigned with your tool. Looks like a very nice tool,if only exports the smoothing correctly,thanks man.
  • nicocabbalero
    Options
    Offline / Send Message
    nicocabbalero polycounter lvl 15
    I used the script you wrote, but it did seem to rotate the model 90 degrees

    scrap that I must of done somthing funky last time as it seems ok now
  • Bek
    Options
    Offline / Send Message
    Bek interpolator
    igi wrote: »
    I got no luck with pipelineIO,tried every letter combination until burnt out.I want clickable options to see in real time whatever I just made.

    Just throw a unit cylinder into a empty scene, and (you may have to have UV map selected in the list of uv maps), run

    @pipelineIO.pl B V E OBJ F filepath.obj

    B tells it to set hard edges by selected uv map borders, V tells it to use vertex normals, E to export, OBJ to use the custom obj exporter, and f for filepath. Works for me in 501 with pipelineIO 2.7 (although I can't get the custom hard edge menus working that are described in the documentation pdf)
  • BadgerEatHoney
    Options
    Offline / Send Message
    BadgerEatHoney polycounter lvl 5
    pipelineIO doesn't work for me in 601. I've tried numerous times and never got it to do much but export a cloud of verts.
  • BadgerEatHoney
    Options
    Offline / Send Message
    BadgerEatHoney polycounter lvl 5
    Raul, I am not entirely sure what it is your script does? Are each smooth group a custom angle or is this just another way of firing "vertMap.normals" with the smoothing value in the material properties?
  • WarrenM
    Options
    Offline / Send Message
    Hey, no smoothing group improvements in Modo 701. We need these tools more than ever! Please Raul!! :)
Sign In or Register to comment.