I’m just testing new functions on rh6 and suddenly I’ve got this problem when trying to connect some of the materials used in the rhino file and reference them in grasshopper. In fact i was trying to reference all the materials at once and automatize this procedure to avoid charging and define them manually each time…
Thanks Nathan, you’re right, I can’t upload the rhino file, in which the material appears referenced like that, I upload through this link:
The problem is that I have created several materials in rhino for another file in gh and then, open this same gh in a rhino file with the same materials and doesn’t work…
The .3dm file you attached doesn’t contain the GO_1 material your .gh file references. But when I change to any of the materials that do exist it all works just fine:
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.
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.
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:
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.
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?
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?