Using Rhino3dm in Blender

Hi @nathanletwory. I installed the latest version of the 3dm blender importer in Blender 2.8 and I made some importing test.

Unfortunately after import I can’t find the objects in the scene.

Also seems that the Rhino cameras are not imported?

It is possible to have an update of this plugin? Thank you.

I’ll be updating the add-on once the patch from @tom_svilans is merged in. It will ease the install process for import_3dm.

Hi @Macuso, what does the console output say?

Objects should show up in new Collections and Rhino cameras should be imported. Check the import options: there should be two checkboxes for importing standard and named views as cameras.

Nope. In the version 0.2 I have only “Import hidden geometry” as import option for 3DM files.

Updated to version 0.3 and now I have errors in console:

#===================
Traceback (most recent call last):
File “C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\import_3dm_init_.py”, line 93, in execute
return read_3dm(context, self.filepath, self.import_hidden, self.import_views, self.import_named_views)
File “C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\import_3dm\read3dm.py”, line 38, in read_3dm
scale = r3d.UnitSystem.UnitScale(model.Settings.ModelUnitSystem, r3d.UnitSystem.Meters) / context.scene.unit_settings.scale_length
AttributeError: module ‘rhino3dm’ has no attribute ‘UnitSystem’

location: :-1

#===================

Version 0.3 it is not importing anything.

Version 0.2 is importing only some geometries. Curves and text not.

Also the imported meshes (v0.2) have some weird artefacts, a lot of faces have flipped normals, in viewport it is not possible to pan the view anymore, etc.

I can share some files, but needs to be confidential :slight_smile:

I reverted back to 0.2 as seems to be able to import something :slight_smile:

Ok, this probably means that you need to update the rhino3dm module. I think UnitSystem is something that wasn’t there in the beginning.

Two options:

  1. Using the system console, go to <blender_dir>/2.80/python/Scripts and type in pip install --upgrade rhino3dm. If the Scripts folder doesn’t exist or you don’t have pip, go to <blender_dir>/2.80/python/bin and type in python ensurepip and then do the first thing. This should install or upgrade rhino3dm in your Blender Python site-packages folder.
  2. Go to <blender_dir>/2.80/python/lib/site-packages and delete the rhino3dm folder. Then in the system console, go to <blender_dir>/2.80/python/Scripts as before, and type in pip install --upgrade "%APPDATA%/Blender Foundation/Blender/2.80/scripts/addons/modules" rhino3dm. Make sure that the modules folder is created beforehand. This will install rhino3dm in your Blender modules folder.

v0.2 doesn’t have support for scale. Curves and text are not yet supported in either version.

I don’t have this folder:

<blender_dir>/2.80/python/Scripts

Only this: <blender_dir>\2.80\scripts

Into the <blender_dir>/2.80/python/Scripts I have only bin and lib folders.

I’m using Rhino and Blender into a Windows10 machine.

Right, so see the 1st option:

If the Scripts folder doesn’t exist or you don’t have pip , go to <blender_dir>/2.80/python/bin and type in python ensurepip and then do the first thing.

Blender_2.80\2.80\python\bin>python ensurepip

(null): can’t open file ‘ensurepip’: [Errno 2] No such file or directory.

I do have a Scripts folder but it is located here:

Blender_2.80\2.80\scripts\

You should explicitly use the entire path to both Python and ensurepip. Something along the lines of.

C:\Blender_2.80\2.80\python\bin\python c:\Blender_2.80\2.80\python\lib\ensurepip

Note the actual paths to python .exe and the ensurepip (folder) and use those on the command-line.

I do have a Scripts folder but it is located here:

Blender_2.80\2.80\scripts\

That’s a different scripts directory.

Another way of installing pip is here:

Ok. Managed to get-it working but only after copying the rhino3dm package from C:\Users\User\AppData\Local\Programs\Python\Python37\Lib\site-packages\ to C:\Blender_2.80\2.80\scripts\addons\

The pip installed the latest 0.4 version of the rhino3dm package. Previously I had 0.1.1.

Now the add-on is importing also the Rhino cameras.

Still problems with flipped normals for geometries, and seems that the textures that I associated to some objects in Rhino are missing.

P.S. For some reason pip is installing the rhino3dm package in that place. Found the install location after searching in explorer.

Can be a solution. Not tried this one as I fixed the way described above.

Your way is ok as well. Hopefully we can get the rhino3dm installation fixed by doing it automatically for the user. Still a way to go on the linux platform (maybe we should disable that for now there) at least. Would be nice to have this running well on Windows at least.

But good that you solved this for now.

Would be useful if you could save a 3dm with (part) of the object that causes this problem.

Textures aren’t properly supported yet. That is still missing.

Rhino_staircase.3dm (3.3 MB)

Blender_imported.zip (1.3 MB)

As the objects needs to be quite far away from the 0 origin coordinate system, after importing in Blender it is quite difficult to pan and rotate.

I forgot to mention that I have problems with flipped normals on all files that I imported in Blender. I have geometries build using different techniques and tools.

I have a raytraced version where backfaces are shown with purple color:

If you select those objects and use _Flip on them you should be able to import with expected results.

I know Rhino is a surface modeller, where often back and front is ignored by the user. But for a mesh it matters. So always good to check your model and ensure your surfaces are properly oriented.

And is a quick way to do this in Rhino? Because right now, to do know what faces needs to be flipped needs to import in Blender and check there, after that select that faces in Rhino and _Flip. Needs to be a quicker way to do this.

Hi - in the display mode that you prefer, go to the main page > Shading settings > Backface settings and change that from Use front face settings to Single color for all backfaces and pick a color that stands out - like so:
image
-wim

1 Like

Thank you for the info. I can see the back-faces normals straight in Rhino. Select the pinkish things and _Flip. Problem solved.

I think that this tip needs to be written also into the 3dm importer documentation for other peoples who will face the same issues.

Another issue that I found working with the 3dm importer is the fact that the importer is importing also the geometry from hidden layers even if I deselect the option to "Import hidden geometry". I personally think that the "Import hidden geometry" option should be unchecked by default.

Also seems that even if I flipped all the geometry in one direction in Rhino, when imported in Blender still are some issues with the flipped normals.