PDA

View Full Version : Apply Poly Backface Color?



spherical
01-10-2016, 11:13 PM
Been working with a number of SketchUp models recently and converting to LWO. WOW, what a bunch of CRAP modeling!!!!... mostly because SU is "Easy To Use", so you have gobs of absolute dummies making junk. I'm tediously correcting the crap in the process by various means, depending upon said crap. In some cases, I eventually learn that it would have been far better to have just started from scratch in a proper modeler.

By far, the biggest pain in the butt is flipped normals. The ubiquitous use of double-sided to cheaply evade correct physical modeling is second. Mostly, a given object will have some of its normals flipped; not all, and not in a uniform pattern. The latter would make it easy, but NNNNnnnnOOOOOoooooooo. Do you get the idea that I hate SketchUp; not to mention the huge uptake in plugins written to interface with it, but LightWave gets completely ignored!? But I digress....

The Request:
In all of the LightWave Modeler display modes, flipped polys are not easily identified. When seen from the opposite of the normal, they are "not there". So, either they are flipped or actually not there; each requiring a different remedy. Align Tool most often does zip, BTW.

Problem is, the geometry seen through said opening is the same color as the front-facing polys, so oscillating the model in Perspective View and seeing edges moving through the opening is the only way I have found to locate them. Yes, you can see the odd display of the "inside of an object" in some of the modes; where the lighting of the surface is backward, but selecting discreet polys in those modes is not efficient—nor is identifying individual polys in a field of correctly facing ones. Further, sometimes the lighting looks correct, so you gloss over it! PAIN IN THE BUTT!

Solution?
Some applications have a setting to color backfaces something garishly different, so that they can be readily identified and dealt with in the manner required by the condition at hand. With this feature, not only are the flipped polys explicitly displayed as being different from the rest of the model, they are also differentiated from absent polys. Is there a plugin that provides this functionality? G2 has a backface color that is used for the old "air polys" trick to generate proper refraction in transparents; but it only works in Layout, so not a solution in Modeler where the corrections need to be applied in order to produce a clean model in the first place.

Thanks for any ideas.

Sensei
01-10-2016, 11:22 PM
Double Sided turned on,
then Spot Info > Polygon Side, plug to Gradient, or Mixer, with f.e. red, and blue colors picked,
then to Diffuse Shading.

This will immediately show which are front which are back.

Proton made video tutorial how to do it. Search YouTube.

spherical
01-11-2016, 02:19 AM
Cool! Thanks. Will try it first thing in the AM. But, if I'm grokking correctly, this would require this to be done per-surface; not for the entire model mesh itself independent of surface? Most of these models have 30+ different surface textures defined for a simple model. More complex models even worse. Why? Because they don't know what they're doing and are applying textures with reckless abandon (read: "ignorance"); a lot of it duplicated and most of them are "Color_0A1", "Color_0C5", "Material_D34"... etc. No identification whatsoever. You have to select by surface to see what is what. Like I said, better to just bite the bullet, reinvent the wheel and model it from scratch.

BTW, search, not directly on YT, turned up zip that was even remotely relevant. Did that first or I wouldn't be asking.

Sensei
01-11-2016, 02:23 AM
Cool! Thanks. Will try it first thing in the AM. But, if I'm grokking correctly, this would require this to be done per-surface; not for the entire model mesh itself independent of surface?

Yes, per-surface. But don't you have Global Materials? IIRC you have..
Spread GM to all surfaces, and connect above setup to GM input to override all.

Or set up in one Node Editor, and Spread Surface.

spherical
01-11-2016, 02:32 AM
GM is Layout, yes?

Sensei
01-11-2016, 02:48 AM
GM is Layout, yes?

Yes... Node Editor and set up using Spot Info, Polygon Side, is Layout too.. Nodes don't render in Modeler.
I want you just give idea how to identify which polygons to flip..

BeeVee
01-11-2016, 04:58 AM
Also Spherical, Normals are turned off in Modeler by default now. Hit d, and turn on Show Normals. If you don't want them in the Perspective view, so as to not distract from seeing the overall model you are working on, go into the Viewports Tab, turn on "Independent Visibility" and switch "Show Normals" off where you don't want them :)

B

spherical
01-11-2016, 07:13 PM
Yes... Node Editor and set up using Spot Info, Polygon Side, is Layout too.. Nodes don't render in Modeler.
I want you just give idea how to identify which polygons to flip..

Well, it's a workaround but I'll take it. Thanks. Just would be more direct if Modeler could simply do this. I mean, it now shows them as transparent. Seems that they could be set to NOT be transparent as easily when needed. Perhaps a selection in the GL panel for what to display. Heck, I'd think that having a display of polys that Align thinks it should flip, because "some of these are not like the others" would suffice.


Also Spherical, Normals are turned off in Modeler by default now. Hit d, and turn on Show Normals.

Normals On are in my default settings when installing a new version. Having them off by default hacked me off, but it's easily dealt with. Using them is one of the indications in addition to being "not there" in a surface display mode. Still is a pain in the butt to sort these out, select them and correct the situation.

madno
01-11-2016, 11:21 PM
Far from being perfect but maybe at least of some help in Modeler?

131860

spherical
01-12-2016, 12:18 AM
I'll give it a go. Thanks!

Too bad it doesn't have a Select by Polys Facing In. :)

JoePoe
01-12-2016, 07:47 AM
Have you tried Normal Corrector and Unify Normals?
(in that order. Best if the geometry is broken down into maneageable sections)
Work pretty well .... most of the time.
Can't promise they will catch everything, but it could take a massive bite out of what's needed.

Edit: Normal corrector took this 131866 to this 131867 in one click.

Andy Webb
01-12-2016, 10:03 AM
spherical I feel your pain, hours wasted fiddling with Sketchup models. :(

spherical
01-12-2016, 04:57 PM
spherical I feel your pain, hours wasted fiddling with Sketchup models. :(

Good to learn that I'm not alone. It's inevitable when something is made for the masses (easy to use) that you get a bunch of drek. Thingiverse is a festering pool of it for 3D printing. They hand some model to a slicer that actually knows what it is doing and it barfs on it. Then complain that the slicer has a bug. Uhhhh... no.

Sensei
01-12-2016, 05:52 PM
Can somebody attach example SketchUp models?
I will see what is wrong with it.
Maybe there will be a way to automatically fix by plugin.

spherical
01-12-2016, 07:44 PM
Have you tried Normal Corrector and Unify Normals?

I had DL'd Normal Corrector last month but the description says it's for correcting non-planars. From that, I didn't extrapolate that it would flip anything. After pasting an entire model into one layer and running Merge Trigons (NC won't work if not at least quads) it does a partial job, but leaves some untouched or incorrectly flips ones that were correct.

Unify Normals (Why the hell is it placed THERE in the menus? Had to search for it.) produces the same amount of chaotic confusion that Align does, so not as good as NC. Thansk for the tip. It gets me way farther along than the alternatives.

Sensei
01-12-2016, 08:05 PM
Unification of normals, aligning of normals,
from programming point of view (and mathematics),
require mesh that has edges with 1 or 2 polygons attached to.
If 3 or more polygons are using same pair of points (edge), they cannot function properly.

Which for end user means that they require first merge points,
then unify polys, to get rid of duplicated polygons,
then remove 1-2 point polygons.
Then (and only then) you can run Unify Normals/Align Normals etc. type of tool (no matter if 3rd party of native).

Möbius strip
https://en.wikipedia.org/wiki/M%C3%B6bius_strip
is example of geometry on which normal fixing tools will permanently fail.

spherical
01-12-2016, 08:07 PM
Can somebody attach example SketchUp models?
I will see what is wrong with it.
Maybe there will be a way to automatically fix by plugin.

THAT would be super-cool. Here's three versions of the same model, in case one may work better for you:

Delta_46-715_Lathe_original.lwo is as-converted from .skp format. Has 61 layers! Only thing done to it after conversion is turned off Double-sided for the surfaces.
Delta_46-715_Lathe_original_1layer.lwo is the above, but all polys pasted into one layer to allow subsequent operations.
Delta_46-715_Lathe_original_1layer_quads.lwo is the above but ran MergeTrigonsX to convert most of the tris, so that Normal Corrector would work.

In all of the files, nothing has been done to correct normal direction. Just wanted to provide a choice for you, based upon what I've found to be needed along the way.
131869

spherical
01-12-2016, 08:19 PM
Unification of normals, aligning of normals,
from programming point of view (and mathematics),
require mesh that has edges with 1 or 2 polygons attached to.
If 3 or more polygons are using same pair of points (edge), they cannot function properly.

Yes. I run into that all the time when debugging stuff that others have made for 3D printing and they wonder why the slicer barfs.

What would be the best (I think) is to color the backfaces then have a Select By Color (having chosen something garish that isn't in the surfaces already) and then just "f". This would correct them all without having to otherwise modify the mesh. After that, merge, unify or else. Sometimes, I like to leave various sections unmerged with other sections, so that they are more easily dealt with when modifying the mesh. Merging too early can have bad consequences.

Thanks for looking at this. :)

Sensei
01-12-2016, 08:31 PM
Delta_46-715_Lathe_original_1layer.lwo
after merge points, unify polygons,
there is still 822 edges with 3+ polygons.
Which are problematic for automatic fixing normal tools.

If you take good model, it has this value in Edge Statistics 0.

spherical
01-12-2016, 11:34 PM
Granted. I'll try to find one that doesn't have as many anomalies but has only the flipped polys issue. Still, this is a ubiquitous situation that is encountered with stuff created by people who don't know that they're doing using "easy to use" modelers.