Home Technical Talk

Lightning fast LP / HP workflow with one catch: Need to create sets based on smoothing groups!?

Dawsky
polycounter lvl 9
Offline / Send Message
Dawsky polycounter lvl 9

Hi,

I kinda asked this before, but i wanted to elaborate on this, as i think this could be of interest for other Maya modelers as well.
So, i am basically looking for an automated way in Maya to create sets, based on smoothing groups.

Here is some backstory of why i try to figure this out:

There is this new, or actually not so new boolean workflow everyone gets all excited about these days. While this workflow is pretty usable with Max, due to its more or less reliable layering system, i do not trust Maya at all. It’s habit of corrupting the construction history, doesn’t get me excited to use tons of boolean operations on complex meshes, while keeping construction history, to be able to access the boolean input nodes later down the line.

As i am currently working on a large project, with little workforce, but tons of models to create, i need a way to speed things up.

There is this video on YT https://www.youtube.com/watch?v=Fg6QPJ7XirE&t where at some point they show how they convert complex, triangulated CAD meshs, to perfect highpoly models in zbrush, with only a few clicks. So i had an idea.

Why not build the lowpoly, as you would use it in game. Optimized, cleaned up, with triangles and pretty much ready to be imported to your game engine. Then use this lowpoly mesh zbrush to create the highpoly.
In some cases this doesn’t work perfectly, as triangles may mess up shading slightly, but for the most part, this works like a charm.

So, I tested building a lowpoly first the other day.
I built a model, made of a few individual pieces, some of them more complex, some less, but all ready to be implemented in a game.  For modeling i used any method i could think of, with only one criteria. Speed.
I cared about nothing else, Not about construction history, nor topology or anything else that i would usually care about when working with high/low poly model for baking maps. The only exception, i kept all meshes closed. For a game ready object, i would delete backfaces that will never be visible, but keeping those faces in for now, makes things easier later. You could also use the close holes option within zbrush.
I deleted those faces once i exported a copy to zBrush.

These next steps are pretty much common knowledge by now.
I imported the model and all it's parts to zbrush, so i had each piece as a separate subtool.
For each subtool, i then used the option to create poly groups by normal angle.
Next, i used the crease by poly group option. This way, when dividing the subtool its shape stays unchanged.
Next i divide the subtool a few times with the smooth option enabled, so round shapes get rounded even more.
Then i used dynamesh on the subtool and used some polish options to soften edges. Keep polycount high during these steps. like 1 - 2 million depending on the complexity of the subtool. Increase subtool size if dynamesh wont give you high enough polycount through deformation pallet.
In the end i reduced polycount with the decimation master. Then exported all subtools
Note, if you bake by name, it makes sense to rename the lowpoly in Maya before exporting to zbrush, so all you have to do, once importing the highpoly back to Maya, is to delete namespaces and voila, high and lowpoly meshes are named correctly.
Use a naming script for _low / _high suffix, profit.

At this point i was done with the highpoly. Ready to be baked down onto the lowpoly and the best part, it only took a few minutes. No cleanup needed. Currently i use a script to create smoothing groups by normal angle, then i bevel all hard edges and clean up the result a little so the mesh can be smoothed and be used as a highpoly. On less complex meshes this works pretty well, but on complex meshes, bevels can take quite some time to fix.

Anyway, here is the catch.
Creating poly groups by normals, doesn’t always work out great, as in a lowpoly, more often than not, you have many different angles, and using a single angle to define what should stay sharp and what shouldn’t, isn’t always working out. So you have to manually select faces, or groups of faces, isolate them, then create a poly group manually. This can get pretty tedious on complex models.

So i tested some more.
I found out, zbrush supports importing selection sets as poly groups.
Maya however, supports creating hard edges by normal angle, as i mentioned earlier.
Yes, you end up with the same problem, as you only have a single value to control the angle at which edges are hardened, but harden or soften a few edges manually in Maya is way easier and a lot faster than doing it in zbrush.

So, when using these steps to prepare the model in Maya, all there is left to do, is create selection sets, so when importing the model to zbrush, you don't need to worry about poly groups.
If it would be possible to automate the process of creating sets based on smoothing groups in maya, it would be literally a few minutes to create a complex highpoly in zbrush.

This concludes my thoughts and brings me back to my initial question.
Is there any way, anyone can think of, to automate the process of creating sets based on smoothing groups?

I have very little python and no coding knowledge, so i can’t help myself.

It would be awesome if anyone had an idea, or would even be willing to put together a few lines of code. This would be a massive help and may help others as well, as i think this workflow is pretty cool and its lightning fast.

Here is the model i created when testing this. As you can see, the result it very much usable, and except for creating poly groups manually, this was done within a few clicks.




Replies

  • Zalek4
    Options
    Offline / Send Message
    Zalek4 polycounter lvl 5
    This is what I use to convert my smoothing groups/hard edge splits to polygroups in zBrush when I import my meshes:
    http://archive.zbrushcentral.com/showthread.php?199290-Smooth-Group-Import-updated-for-ZBrush-2018

    It'll automatically crease by polygroups on import too.

    I use Max and many boolean ops for most of my assets these days. Having said that, I did try to figure it out in Maya a while back too but didn't come up with anything quite as non-destructive. I did find a similar technique using Maya layers and the live boolean feature in zBrush though. The link if you want a read:
    https://80.lv/articles/modeling-a-gun-with-zbrush-maya-and-toolbag/
  • Dawsky
    Options
    Offline / Send Message
    Dawsky polycounter lvl 9
    Thanks you.That is pretty much what i was lookig for. Yet its not..

    It only reads OBJs. Dont know about Max, but Mayas OBJ exports do wierd stuff.
    Meshes get merged into a single mesh, meaning names get merged too.
    Importing the same OBJ back to maya, you can import the individual meshes and their names, kind of at least. Tho zbrush cannot. Also, Groups Split in ZBrush results in incorrect naming. As i bake by name, this results in tedious comparing between low and highpoly meshes and renaming them accordingly once the highpoly gets imported back to maya.

    While the zPlugin solves one problem, for me, it's just swapping one time cosuming task with another.






  • Zalek4
    Options
    Offline / Send Message
    Zalek4 polycounter lvl 5
    I'm not too familiar with Maya so I'm not sure how smoothing group exports work in it, but I did just have a thought. This method would use the "smooth group import" script I linked earlier. Couldn't you batch export your model as separate obj files, and then append them all together in zBrush as you work through smoothing each of them? You wouldn't really be adding any time to your pipeline since you have to smooth each object one by one anyway. You would still end with a single HP mesh with retained names which you could then export as an FBX.
  • Dawsky
    Options
    Offline / Send Message
    Dawsky polycounter lvl 9
    Well that works. Its not as intiutive, but it works. Still hoping for a smoothing groups -> Sets feature Though.
    The zPlugin does a good job in creating polygroups on import and creasing those polygroups, but, it doesnt really show these groups.
    So not all individual smoothing groups are also shown as seperate polygroups, yet they are creased. wierd. But for easy selection that doesnt help.
Sign In or Register to comment.