Why some materials don't preview on rendered mode in RH6?

any news?

Was about to start on this one, but the files are gone.
Can you upload them to discourse so they aren’t on an automatic deletion schedule?

This may not be related (or even specific to R6?) but I discovered that a Group component inserted in a geometry flow prevented the grouped objects from appearing in R6 ‘Rendered’ or ‘Raytraced’ modes. The custom Preview ignored the contents of the group, unlike ‘Shaded’ or ‘Ghosted’ where the same objects appear colored as expected. Problem solved by skipping the Group, which wasn’t needed anyway.

On the plus side, I have to say that the integration of an UNBAKED GH model (the steps in the foreground below) into ‘Rendered’ and ‘Raytraced’ modes with Rhino geometry (someone else did the boat) is stunning!! Will be even more so with true materials applied to the GH model surfaces, not just colors.


Ah thanks. Groups are indeed skipped when adding render meshes. Logged under RH-45900 (round number!).

Hoping to get around to this soon, as I’m rewriting the custom display -> rendered content logic now.

Try some (: just add them to the Rhino document, then select them as input to the preview component.

I’ll get around to that, and may well revisit your GhShaderNodes plugin when rendering becomes my highest priority. Speaking of that, let me suggest (again?) that to make an impressive demo, the GH file needs to show some rendered geometry. Seeing it work is to understand the possibilities instantly. It provides motivation to seek out the details of “how to”.

I love R6 but… there is a lot of trepidation and anxiety exploring the new ground. Concern about R5 compatibility is chief among them, but many other distracting issues too.

RH-45900 is fixed in the latest Service Release Candidate

I’m interested now in understanding this better and have questions.

When I right-click the ‘M’ (Material) input of Custom Preview, the “Set one material” option is disabled unless I have defined materials in the Rhino file. So in Rhino, I define a material corresponding (and assigned to) each layer where I intend to bake the parts and set that material on each of the custom preview components in GH. Later, if I open the GH file without also opening the Rhino file where I created the materials, “Set one material” is disabled but all modes of the rendered preview still look correct? How/why does that work?
Q1: Are the materials assigned to Custom Preview components saved in the GH file?

Q2: This thread (above) and others show a text panel connected to the ‘M’ (Material) input of Custom Preview but that fails for me, every possible which way, whether or not the Rhino file has the material defined, giving a rather nasty error message:


It doesn’t matter whether or not geometry is supplied:


How is the ‘M’ input supposed to be used?

The name should be exactly as in the Rhino document. Not sure why you’d get that exception. That is something for @DavidRutten to know. When setting a material through the Set One Material, I guess the component essentially internalizes a ‘simulated’ version of the material. You’ll find that those that have a textual input through say a Value List don’t retain the (simulated) material info. Exactly how and why it works like that is also something @DavidRutten can tell you more about.

IOW for Q1 it depends how the assignment is made.

Q2, I don’t know.

Are you on latest Rhino 6 when playing with this?

Yes I am. Portability of the GH file is the critical issue for me, preferably without sending a Rhino file with it. I’ve tried everything with a text panel connected to the ‘M’ input and can’t get it to work at all??? Is that input nothing more than a well hidden right-click feature?

Hacking still required to make R6 useful after all these years?

Please attach a GH with definition that fails in your case, along with 3dm with materials you are trying to reference.

The contents of the .3dm file were baked Custom Preview components with the ‘M’ inputs right-clicked and set to materials created in the Rhino file. The materials persist in the GH file that created them (not attached) and render correctly with or without the .3dm file.

I have never seen a text panel with a material name work.

I have connected panels to Preview without getting the ‘Component Exception’ error.
AHA! Just noticed that the exception is caused by having parentheses in the text panel. If the .3dm file is open, the error persists regardless of which panel is connected. When the .3dm file is closed, the exception goes away until the .3dm file is reopened or the “gasket (Plastic)” panel is connected. Very confusing because again, “dogs” and “gasket” without “(Plastic)” should work when the .3dm file is open?

custom_preview_2020Jan12a.gh (10.1 KB)
custom_preview_2020Jan12a.3dm (1.4 MB)

Nice Cat Joe! Damned thing still isn’t built yet and the slick ladder you proofed in GH hasn’t even been started either!

Here is a fairly recent shot of the bow section you show still upside down. The other hull is flipped and waiting for its mate.

1 Like

Your file doesn’t have a material called gasket (Plastic), only gasket. What you input there is the name of the material. Since there is no gasket (Plastic) in the document you get the exception you see.

I guess once the exception has been thrown once something goes awry in GH and any further attempts make it cry.

@DavidRutten you may want to fix that :slight_smile:

Yeah, I was desperate so added “(Plastic)”, not realizing it was the parentheses in the panel that caused the exception. It doesn’t throw the error for “dogs” or “yada-yada” when using a ‘New’ .3dm file without those materials defined, but “()” will always throw the exception. The persistence of the error when the file is open adds to the confusion.

Can you see any effect with “dogs” or “gasket” (without “()”) in the panels? At times I see a wireframe representation of the hoop (gasket) which returns to the default pink when disconnected. Other times, the persistent exception is thrown over and over. Never do I see the expected material applied.

Can anyone please show me a working model using a text panel to pass a material name (defined in a Rhino file?) to the ‘M’ input of Custom Preview?

It’s hard to fathom why I have to even ask this question, I’ve tried many things and searched for answers. The fact is, I’d rather not have my GH model be dependent on a Rhino file at all.

@nathanletwory @Joseph_Oster

Hi Nathan and Joseph. I was reading the forum and maybe this problem can be solved without the installation of additional plugins. The custom preview node in GH is great for solid materials, but I was curious what I would need to do in order to achieve a gradient material effect.

I have seen tutorials for previewing surfaces, but none for solid Brep’s with multiple geometry. I was wondering what I would need to do in order to custom preview geometry with a gradient?

I see there is a gradient node in your plugin @nathanletwory but I have no idea where to start with it.

Best regards,

01122020_Gradient_CustomPreviewTest.3dm (149.0 KB) 01122020_Gradient_CustomPreviewTest.gh (9.9 KB)

I guess I could easily import to Keyshot, but I wanted to see if I could visualize data within the current interface I’m working in. :slight_smile:

Parentheses will work if you have a material with them in the name (I just tested).

Attached a model and definition that has M assigned in three different ways: text panel, right-click Set One Material, and a Value List. Open the 3dm file, then the gh file.

rhino_gh_materialsfromdoc.3dm (3.6 MB)

@cole.masuno, I don’t see my plug-in being used in the grasshopper definition you attached. I see a gradient component though, but that is from grasshopper.

Please consider this carefully because when I’m reporting anomalies and bugs, I’m working unpaid for McNeel instead of getting my own work done. OK?

First thing is that if I open your GH file without first opening the .3dm file, I immediately see the exception error that I mentioned yesterday. I am absolutely certain that I’m not the first person to encounter that error since R6 has been out for ~3 years now? How many more years will it be before that OBVIOUS bug is fixed?

Second thing is that you haven’t explained why it fails for me? I gave you files that demonstrated the issue so let’s look more closely at that please? I’m not the only one who has banged their head over this “anomaly” (FLAW) either. This is the Materials panel from your .3dm file on the left and mine on the right. See the difference?

My materials show an extra icon treatment, perhaps because they were created differently from yours? I created mine from the Layers tab, clicking on the Material column. Is that the reason that passing a material name to the ‘M’ input for Custom Preview fails in the example I posted?

That’s good to know, if true, but whatever the reason, my bug report is real. Please don’t ignore it.

Finally, Value List isn’t a third way, it’s only a trivial variation of using a text panel instead of right-click to choose a material defined in Rhino. Glossed over in this discussion is the surprising fact that Grasshopper apparently retains material definitions internally because the original .3dm file isn’t necessary after assignment with right-click. THIS IS NOT A SMALL POINT!! Granted, it is practical to have the GH file work without the .3dm file that has the material definitions but is highly unintuitive. And inconsistent with materials assigned by name, which fail when the .3dm file isn’t open, as we have demonstrated above. It makes me wonder about possible related bugs, like the GH definition being aware of changes to the material in the .3dm file?

A third way of assigning materials, besides right-click and text to the ‘M’ input, is using the C# component from @DavidRutten because the Create Material component still doesn’t work correctly:

I’ve spent more than an hour writing this single post. Please take it seriously.