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.
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
Could you also add 'Set Vertex Normals' command in your UI ? Without it you can't see smoothing groups taking effect.
edit: http://migugi.net/mel/normalTools/
@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?
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.
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 dont 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.
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!
Thanks for this export script!
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.
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.
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.
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.
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.
scrap that I must of done somthing funky last time as it seems ok now
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)