Sel objects by color shading settings


Good morning,

Any way: Sel objects by color shading settings?

Thanks for your attention,

Leandro

Hello,

Your screenshot shows backface shading color. That is a global display setting for all “backwards” facing surfaces, that color is not specifically applied to objects.

What is it you are trying to do?

I want to select all surfaces that are oriented “Z” to one side and change them all at once, without them being joined and without me having to join in the process.
Do you understand?

That requires inverting the surface normals of the ‘back-facing’ surfaces. I have a few scripts for that.

For planar surfaces:
UnifyNormalsZ.py (1.4 KB)
UnifyNormalsPoint.py (1.6 KB)
UnifyNormalsView.py (1.3 KB)

For non planar surfaces:
UnifyNormalsViewNP.py (1.9 KB)

If you open the scripts in a text editor, the comment section at the top explains what each one does.

SelColor command selects all objects of a specified display color or material diffuse color depending on the display mode of the active viewport.

Automatic selection of surfaces oriented in the same direction is much more difficult.

Yes, I understand, and that’s why I’m here asking for help.
I do some command optimizations using rhino’s own commands, but this I can’t access, I imagine it needs a programming language.

Thanks, I’m going to test it, but I need to automatically select the surfaces that have the inverted z flip.
I imagined using the rhino color presentation feature, for this type of selection, you know?

That’s what the scripts do.


Error
The .py extension does not appear in the option to load the script, however if . loads, it gives an error in the execution.
Any tips or procedures?

Hi -

You have to use the RunPythonScript command for python scripts.
-wim

Ok, I ran the script, but the solution I need is: automatically identify the surfaces with inverted z, it doesn’t happen…

What the script does (in the case of UnifyNormalsZ.py) is that it checks the surface normals of all selected surfaces, then it automatically flips the normals of those that are facing the opposite direction from World Z (by more than 90°). So there is no need to ‘identify’ anything, the script does that. If you have a display mode set up that has backface colors set to a different color than the surface display color, you should see the color change.

If you think that it is not working correctly, please post a sample here. If you are only needing to select the surfaces and not automatically flip the normals, I can modify the script to do that.

you:
“If you think that it is not working correctly, please post a sample here. If you are only needing to select the surfaces and not automatically flip the normals, I can modify the script to do that.”

Please, if you can have a version that just leaves selected, thank you.base - modela - one.7z (2.2 MB)

if you can also select the polysurfaces…

Here are a couple:

Note these only work reliably with planar surfaces - so your example above won’t work.
SelInvertedNormalsViewZ.py (1005 Bytes)
SelInvertedNormalsWorldZ.py (998 Bytes)

That’s more complicated as polysurfaces can have normals pointing in any direction - non planar surfaces too actually, as you can see from your example. Which way is “up”?

Please use normal .zip and not .7z here so people don’t need to use Winrar or similar…

You:
“non planar surfaces too actually, as you can see from your example. Which way is “up”?”

I thought it was possible, with programming, to create a dot or solid of small size in the center of the 3d model. and reverse direction with respect to this base object.

But as I don’t know how to program, I just imagine.

So I thought that identifying the surfaces with “backface settings” would be easier with programming.

but…

That is in principle possible with joined closed models - where you can actually define a boundary that separates inside from outside. With individual unjoined surfaces, no way to know really where that “center point” should be, and even if that could be determined more or less, there may still be tons of ambiguous situations.

Thanks!

Incidentally the term “backface” in Rhino has nothing to do with the view nor the relation to other surfaces, it simply indicates the side of the surface that is facing the opposite direction from the surface normal. So selecting objects according to backface shading will not necessarily get you what you want in this case either. The best is to try to Join and then re-Explode if you really need consistent normals.