So i have just sat and edited a load of PBR materials in another file and added the file to my library’s folder. But i cant seem to import the actual material files i have created, into another document. Here is the library i have made. But looking at the little example images, it doesn’t look like any of the textures are actually there either. just the colours
I just spent ages creating these materials how i wanted them. Id imagine i might be able to just copy and paste the blocks i made in the original file, but i could really do with figuring out how to work these library’s.
So is this something im doing wrong when im creating and saving the materials in the original file? Im making them by editing some PBR materials iv downloaded from polyhaven
This is how iv been saving them from the file i tweaked the originals in
Ah, yeah i did this originally but still run into the same issue. It exports all the Bitmaps/ displacement files ect as a separate file which i can see in the library. But when i try to import the rhino material file, i still get the same error message.
So, I have a kit of custom materials. For some reason, embedding the HDRs did not work (Rhino 6 and Rhino 7). The data was in the material, but it was like “I can’t find the image file” and I didn’t know what else to do. So, I tried putting relative file paths to my HDRIs directly in the rmtl files (which are just xml files). Like I opened up the rmtl file in Notepad++ and directly replaced anywhere I saw the HDRs path with a relative path (which I had to ensure in the file structure)…and it seems like there’s three or four places in each file where the image’s path is.
I was pleasantly surprised when it worked.
My particular kit has a complex file structure, so the relative path is complex. It’s relative to the location of the material file, btw. In this case, it goes up three parent directories and down two child directories to get to the HDR.
I’m not sure this would work on a Mac. It works in windows, though.
A benefit was a my kit’s file size was massively reduced as I only needed to include the HDR data once instead of inside each material definition.
I can’t remember if I manually edited them or if I ran them through a python script to do some text replacement.
If you want to experiment with this, though, you absolutely want to first make a COPY of the folder your materials are in. You don’t want to mess up your material files.
When you save a material as RMTL file that you move to a different location you need to save all support files. Keeping them in ZIP files is not going to work. You can create the inital PBR from the ZIP file you download from polyhaven.com - but make sure you say yes to embed support files to the RMTL (or RENV) file.
Once saved as RMTL with all support files embedded you should be able to just drag and drop from the Render Libraries panel onto an object.
There was an error at some point where embedded files were written incorrectly to location of the file they were extracted from I think, but that should be fixed. I believe that was fixed in 8.7, which is currently available as service release candidate. Make sure you update to that as soon as you can - it will go out as actual service release coming Tuesday (barring any unforseen stop-ship issues), at which point you’ll then be able to install Rhino 8.8 service release candidate (which has a good amount of material and environment fixes for both Raytraced and Rhino Render)
You shouldn’t have to replace filenames when those are embedded - this at least works correctly in Rhino 8 even with HDR and EXR files used as image textures.
Right. So i have updated to the service release candidate. deleted the previous library i made and created a new one. I made sure i to tick the embed support files. I did this on Rhino 8.6 last time and when i did this, it created a separate folder within my library with all the support files separately.
This time it hasn’t created a separate folder, only the folder i made that now has all the RMTL files in. This seems to have been partially successful as i was able to use 2 of the materials from the library in a separate model. But not the rest.
Still getting the same “Failed to load render content from file” error message as well as the material previews only showing the general colour of the material but no textures ect
Here is what the library looks like when i open it in rhino
Here is a 3dm file with a couple of the materials embedded in so you can see what i mean if that helps? That’s assuming its not my machine / me that’s the problem here, but the fact i was able to use a couple of the materials from the library makes me feel like its something else.
I get the failed message also on my Mac with the latest materials. Thanks for sharing, now I can further investigate as to why it fails.
edit: I’ve found the reason this fails. I have logged an issue and am working on a fix: RH-81953 Unable to load large .rtml / .renv files due to artificial character limit of 100M
After this you should be able to load .rtml files that are ~4GB in character size.