Importing U3MA files to the material palette

Hello! I’m writing in about adding material files from outside sources to Rhino.
I have a pre existing library of materials that are U3MA files and I’m having trouble adding them to my palette. Is there a process by which I can add these files?
Thank You

You’ll need a way to interpret the binary U3M files (.u3ma). If you have the possibility to resave them as textual files (.u3m) you should do that. According the spec for .u3ma this is a subset of ZIP, so maybe just unpacking these using a ZIP utility is all you need to do to get the .u3m.

Once you’ve done that you can read the .u3m files, parse the JSON that it is, look for the material entry and parse its contents. You should be able to match the PBR properties from the U3M file to the corresponding properties in Rhino 7 PBR materials.

If you could share a .u3ma file it’d be easier to investigate.

Hello Nathan,

Thanks for the quick response. I don’t have an application that I can open the file up to resave it to get the U3m.

I’m attaching a U3ma file for investigation. I’m running on Rhino 6, I’m not sure if that will be an issue, just an FYI.

Thanks,

Steven

(Attachment fenili_32_4h_light_gold.u3ma is missing)

I don’t know if attaching files to a discourse post directly from an e-mail message works. Either you’ll have to log in here to share the file, or you can use https://rhino3d.com/upload?to=nathan@mcneel.com to share it directly with me.

Hey Nathan,

The file got rejected by my IT department during transfer. I’m going to send it through wetransfer.com

Thanks,

Steven

Have you managed yet to upload to wetransfer.com to share with me?

Hey Nathan,

I sent it out earlier, is the address below correct?

Thanks,

Steven

<img width=“739” height=“723” style=“width:7.6979in;height:7.5312in” id=“Picture_x0020_2” src="//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/mcneel/uploads/default/original/4X/3/2/d/32da3c728014afcaeb90155d241163718b970f22.jpeg" alt="Graphical user interface, application

Description automatically generated">

That was not a useful e-mail address (mine is nathan@mcneel.com), but from the screenshot I was able to type the correct URL. I have managed to download the file.

The .u3ma file is apparently just a ZIP archive. I was able to extract the contents from it.

It should be possible to write a script or plug-in with which you could import .u3ma files. It comes down to go through https://github.com/vizoogmbh/u3m/tree/master/u3m1.1/spec and write the code that parses the data contained within these files and set up materials based on that.

I’d suggest using Rhino 7 if possible, since the material definition in this specification appears to be according the PBR materials. In Rhino 7 we have that material type too. In Rhino 6 not, so there we can only approximate.

I’ll try set up some code in the coming time to do some basic importing of materials. If someone else wants to have a go at it, feel free, of course (:

Hey Nathan,

Thanks for offering to write code for this, it seems like there should be an easier way to unzip a file to get the materails?

Steven

A .u3ma is all files zipped, so unzipping is a necessary step. This can be done as part of code all in-memory. This gets you the .u3m and .json files and all texture images referenced.

I’m currently otherwise quite busy, so it is going to be typing code here and there, hence my hint towards the user community (: