Using Rhino3dm in Blender

#101

if u_converter:
bpy.ops.object.transform_apply({‘selected_editable_objects’: toplayer.all_objects},location=False, rotation=False, scale=True)

Thanks! That did it

(Nathan 'jesterKing' Letwory) #102

Cool. I made some small comments on your new branch. Most important is to remember to sync your fork with upstream.

#103

ok that was “fun” :crazy_face:

I have issued a pull request to handle incoming units as well as conversions between Blender/Rhino should the user require that.

Joel

(Nathan 'jesterKing' Letwory) #104

I’ll be testing your changes properly tomorrow. Just reading it mostly looks good.

Some things that stand out are for instance the meters to micrometers, millimeters, centimeters and kilometers looking funny, I’m guessing result of copy&paste: here

#105

okay I have FINALLY switched to the new Open Nurbs unit conversion function.

(Nathan 'jesterKing' Letwory) #106

Hi,

I saw your PR update come by in my mail box. I’ll do some proper testing tomorrow.

(Anika Boeller) #107

Hi Nathan. I m curious whether there is any progress on importing nested blocks within a 3dm.
Thanks again for this!

1 Like
(Nathan 'jesterKing' Letwory) #108

@anika.boeller, not much progress, my time is being sucked up by Rhino WIP for Mac getting it ready for release. I hope to get more back to this closer to summer.

1 Like
(Anika Boeller) #109

:sob:
love,
anika

(Anika Boeller) #110

maybe the other way around would be even cooler: import / link blender files as blocks into rhino!

(Nathan 'jesterKing' Letwory) #111

That would be funky yes. But we need a proper .blend -format implementation for that. Although the format is pretty well documented it is still not commonly available outside Blender - probably because it is quite the pointer arithmetic thing:

https://developer.blender.org/diffusion/B/browse/master/doc/blender_file_format/

1 Like
(jmv) #112

Hello

I met this thing one day, she looks promising but I have not tested her

https://formats.kaitai.io/blender_blend/cpp_stl.html

@nathanletwory do you know if the Blender 2.7 and 2.8 file formats have changed ?

-jmv

(Nathan 'jesterKing' Letwory) #113

They have. In most cases the file format is forward compatible, and often backwards compatible, but IIRC with 2.8 there is quite a lot of new stuff that isn’t backwards compatible.

With the development pace of Blender you’ll find a lot of new stuff gets added over the years even between minor versions.

I hadn’t heard of Kaitai Struct yet, sounds like something to investigate. https://formats.kaitai.io/blender_blend/csharp.html and https://formats.kaitai.io/blender_blend/python.html look like most interesting ones.

(Anika Boeller) #114

would also enable you to import blender cycles shaders. or is there another way already?

(Nathan 'jesterKing' Letwory) #115

Indirectly. You can use GhShaderNodes GH plug-in to create custom Cycles shaders.

(Anika Boeller) #116

Hi. yep. actually found that one first… but is there the option to get preset shaders out of blender/substance or convert them to a pbr rhino material file?
is there an import node in grasshopper i havent seen?

ps.:… and what export config in substance would be the best for cycles pbr/rhino?

(Nathan 'jesterKing' Letwory) #117

Thing is that not all shader nodes have been wrapped, so one can’t yet import (or recreate) every Blender Cycles material out there in the wild.

Use the RhinoPbrMaterial plug-in (also with TestPackageManager) and export Substance materials with the Substance player to image textures - TGAs are good for quality, PNGs are fine too.

(Anika Boeller) #118

thanks a lot… yeah what i meant: substance gives you a lot of export options, for different renderers… sometimes with flipped normals etc.
ill try out which one works the best.

also you can print out a json with shader parameters…
is there anyway they translate it to a rhino material xml?

(Nathan 'jesterKing' Letwory) #119

I haven’t looked into that kind of files, but I imagine it should be possible to do a good approximation.

(Nathan 'jesterKing' Letwory) #120

FWIW I’ve handled the open PRs from @tom_svilans and @joel_putnam (many thanks for your contributions!).

Based on the current code I’ve created a new release v0.0.3.

If you’re on a Mac be sure to read to the updated install/upgrade instructions.

The release notes from the download page:

  • Unit conversion. Rhino data gets converted to Blender unit system. @tsvilans and @joel-putnam worked on this (#21 and #24)
  • Views and Named Views by @tsvilans (#24)
  • Fix for invalid faces by @tsvilans (#26)
  • Improved install and update instructions for Mac and Windows
1 Like