Is there any way I can import Radiance material from the library in Honeybee[+]? currently, I have to build the material from scratch using the material components or custom made components, but I was hoping I can use the traditional way of importing Radiance material from the library (inputting the name of the material into the HB surface component). If this is not possible can someone help me write a custom BRTDfunc? I understand that I have to import the material definition from the Radiance material class using:
from honeybee.radiance.material.brtdfunc import BRTDfunc
I checked the brtdfunc.py and obviously, the definition has nothing but “pass” does this mean that I only need to write a string?
@mostapha, My bad, the material definitions are correct in the opaque material file.
I found the problem with the BRTDfunc material
I copied and pasted your code, but it turned out that there was a value missing in the first line, also the second line has to have an empty list . the following code fixed the problem
Hi @OlivierDambron, I didn’t realize you tagged me until @mostapha answered the question, My apology.
Mostapha developed many Radiance primitives, all that you have to do is write your own Python component based on the Python Radiance materials files in the following directory:
C:\Users\userName\AppData\Roaming\McNeel\Rhinoceros\5.0\scripts\honeybee\radiance\material
For example, a trans material that has R,G,and B reflectance of 60% can be defined like this:
from honeybee.radiance.material.trans import Trans
Some_Material = Trans.by_single_reflect_value("Trans_Material", .60)
I have been really struggling to get custom materials to work in Honeybee +
We are trying to do a perforate.cal material (which we have executed successfully in legacy). But before we do that we are at least trying to get any custom specified material to be recognized.
I used @RaniaLabib last example for a basic trans material, created one for trans, one for plastic but for both I get an assertion error, even though the python component and data being outputted seem to be correct.
A colleague of mine may have identified the problem. Sending the output to print as opposed to A might be the issue. Will confirm when I am able to verify this has resolved the issue.
That is correct! In Honeybee[+] library the objects are python objects and not strings. When you print them out they will be cast to string which means you are passing a string and not a radiance material to the next component.
Thanks @mostapha ! We have successfully got a basic material to run. We now have a new question, which goes back to the original bigger question.
How do we use mixfunc without a library to reference other materials we create for the mixfunc?
As we need to reference other materials we create in the mixfunc, it is not clear how to do that in the python code.
Any insight on how to get the mixfunc to reference other custom materials will be most helpful. do they need to be in the same python script? Do we want to recreate the custom.py file? (Even if we do it’s not clear how to reference another material)