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

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)
rhino_gh_materialsfromdoc.gh

@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.