I’m not sure what you’re after - is it either something like a live directory, where you examine a folder for .vrmat files every time a solution runs, or a lazier way to get all .vrmat files in a directory without going thought selecting them.
And all of the geometry in vray grasshopper requires preloaded material
that is not true. If you don’t set a material a default material will be used on-the-fly. This won’t work with RenderInProject component though, it requires a real material
There are ways to do it for both.
The “MaterialFromFile” component do accepts input. In fact it is not a component but a floating parameter, and so it acts just like a regular parameter. Just stick the incoming wire somewhere in where is supposed to be an input bump (which is not drawn)…:
Though this works, it won’t do file searching for you. You have to pass one or more .vrmat file paths, not a folder path.
There a numerous ways to do this.
- If you want to pass a folder name and get all .vrmat files in it (the order is not guaranteed), you’d need a small script component. Here is a C# example, but the python code would also be a oneliner
private void RunScript(object Path, object y, ref object A)
A = System.IO.Directory.GetFiles(Path as string, "*.vrmat", System.IO.SearchOption.TopDirectoryOnly);
You can select multiple files in the Path component and feed the result into a MaterialFromFile parmeter:
You can select multiple files in the Mtl File Path components:
It depends on what your goal is…