Create and export materials based on PBR maps

Create and export materials based on PBR maps

l_neumann57FQ9
Explorer Explorer
581 Views
8 Replies
Message 1 of 9

Create and export materials based on PBR maps

l_neumann57FQ9
Explorer
Explorer

Hello,


I am currently looking into whether there is a solution to programmatically create and "export" materials in Revit. I would like to make it as easy as possible for Revit users to use our PBR materials and import them into Revit.

 

As we create a lot of materials, we want this process to be as automated as possible.

So far I have found out that it is possible to create new materials via the Revit API and configure the necessary appearance assets such as colour, bump, transparency images.


However, I am stuck when I want to create a material library and add the new material. I couldn't find anything about this in the SDK API documentation or in any of the existing topics.

 

@GaryOrrMBI done a great job! However, he also describes the lack of API access to the material library here: https://forums.autodesk.com/t5/revit-api-forum/materials-material-assets-appearance-structural-therm...


Do I understand correctly that full automation through the Revit API is not possible and the only option is to create the libraries manually?

Kind regards
Lukas

0 Likes
582 Views
8 Replies
Replies (8)
Message 2 of 9

jeremy_tammik
Alumni
Alumni

I search for PBR and found professional bull riders and this extensive list on Wikipedia, but no hint at what you may be referring to:

  

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 9

l_neumann57FQ9
Explorer
Explorer

Sorry, I was referring to physically based rendering (https://en.wikipedia.org/wiki/Physically_based_rendering). In Revit context this would be the "new" material appearance assets using the color, bump/normal, roughness and transparency images?!

0 Likes
Message 4 of 9

spacefrog_
Advisor
Advisor

As Autodesk has switched 3ds Max default materials to OpenPBR and is a strong supporter for OpenPBR, it would definitely make sense to look at the OpenPBR codebase while implementing some PBR support for Revit
https://github.com/AcademySoftwareFoundation/OpenPBR


Josef Wienerroither
Software Developer & 3d Artist Hybrid
0 Likes
Message 5 of 9

GaryOrrMBI
Collaborator
Collaborator

@spacefrog_ , That really has no bearing on creating an *.adsklib (Autodesk Material Library) that can be distributed to Revit users for loading Revit Render Materials into a Revit Project file.

 

@l_neumann57FQ9 , I got curious as to whether an *.adsklib was actually usable between different Autodesk products and... Nope. The initial libraries may live in the same location on your computer, but most of what actually gets shared between the different libraries are the image files, the actual libraries aren't cross platform compatible.

 

I came to this conclusion by opening AutoCAD and opening Revit and finding the default library for each (honestly hoping that they would be the same library and that perhaps access could be obtained via the AutoCAD object ARX SDK for the purpose of building the materials and libraries for Revit). They were different library files (even though they lived in the same ...Autodesk Shared... location).

I then loaded the Revit library into AutoCAD and the AutoCAD library into Revit. AutoCAD can open the Revit library and display the contents (although the folder/category structure is displayed differently) and even import a few random samples that I tried. Revit will open the AutoCAD library without errors, but it shows as being empty.

My guess as to the reason for the difference in capabilities is that Revit has three possible aspects for it's materials: Appearance, Physical, and Thermal whereas AutoCAD only has the Appearance aspect. So AutoCAD perhaps simply ignores the additional information and loads the Appearance aspects, but Revit is looking for information that doesn't exist in the AutoCAD material library (Physical and Thermal) and sees them as being invalid or incomplete???

 

Either way, the result is that that route (build the materials libraries in AutoCAD to import into Revit) simply isn't an option either.

 

-G

Gary J. Orr
GaryOrrMBI (MBI Companies 2014-Current)
aka (past user names):
Gary_J_Orr (GOMO Stuff 2008-2014);
OrrG (Forum Studio 2005-2008);
Gary J. Orr (LHB Inc 2002-2005);
Orr, Gary J. (Gossen Livingston 1997-2002)
0 Likes
Message 6 of 9

l_neumann57FQ9
Explorer
Explorer

@spacefrog_We do have an OpenPBR export on our roadmap as well. The more pressing task is to make it simple for current Revit users.


@GaryOrrMBI  Thank you for this test! It would have been my next research target to look at the other Autodesk products for something usable.

Initially I though I could create the libraries manually. However, the important information within the adsklb package is in the binary files. The XMLs only contain the information about the preview bitmaps.

 

 

0 Likes
Message 7 of 9

jeremy_tammik
Alumni
Alumni

By the way, The Building Coder did take a look at Material Management and Libraries, including adsklib, though it's been a while since anything new was added:

      

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 8 of 9

l_neumann57FQ9
Explorer
Explorer

@jeremy_tammik  Thank you for finding this. Please correct me if I am wrong:

I went through these and, if nothing has changed since then, it is still not possible to interact with the material manager through the API (i.e., create, add and "export" a material library stored in an adsklb package).

https://thebuildingcoder.typepad.com/blog/2013/05/copy-and-paste-api-applications-and-modeless-asser... -> Not possible
https://forums.autodesk.com/t5/revit-api-forum/library-adsklib/td-p/7161670 -> No more answers -> Not possible ?!

Do I understand correctly, that the suggestion of using the copy and paste API refers to copy and paste between documents, not into material libraries (as used in the material manager)?

One alternative to providing our materials through an adsklb libary could be to create an empty document and create the materials there. Then distribute the .rvt document.

0 Likes
Message 9 of 9

jeremy_tammik
Alumni
Alumni

Yes, I confirm that is my understanding also. Unfortunately, that does not mean to guarantee that it is true 🙂

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open