FreeCAD Sverchok & Subd To Nurbs

Not sure if this is posted here already

3 Likes

Hello @Rastart
Finally, I have the opportunity to test your wonderful node Approximate Subd to Nurb!
It seems that your patch did not accept in upstream and I installed sverchok directly from your fork

There was a problem. Happens both in 2.93 and 3.0 with FreeCad-0.20
I just added node Approximate Subd to Nurb and connect it to viewer - blender crashed :frowning:

src/Base/BaseClass.cpp:93: static void Base::BaseClass::initSubclass(Base::Type&, const char*, const char*, Base::Type::instantiationMethod): Assertion `toInit == B
ase::Type::badType()' failed.

Can you check it?

Thank you for developing!

Hi! very strange… tested now on 2.93.1:
I downloaded sverchok from my fork, then reinstalled and the node still works.
Maybe the problem could be freecad side but I’m using freecad 0.2 too.
In the next days I’ll updated it to upstream, maybe this will fix.

here a test of usage:

very interesting links, I’m going to test it!

1 Like

Thank you for reply

I have this bug happend with FreeCad-0.19 too

blender-2.93: /var/tmp/portage/media-gfx/freecad-0.19.2-r3/work/FreeCAD-0.19.2/src/Base/BaseClass.cpp:93: static void Base::BaseClass::initSubclass(Base::Type&, const char*, const char*, Base::Type::instantiationMethod): Assertion `toIn
it == Base::Type::badType()' failed.

Very strange…

this error happen just with this node? for example readFCstd node is working?

@Rastart
Please check


Approximate Subd to Nurb - crash
Export Freecad - some issue, not exporting
Import Freecad - works!

1 Like

Ok, write fcstd node actually works on existing freecad file, so It should works.

For approximate node I have to investigate, i never had this issue, but since I have to update the nodes maybe for the next release It Will be fixed.

Are you on Linux?

1 Like

Thank you!
Yes, I’m on Gentoo
My FreeCAD build with
USE=“addonmgr fem idf image inspection material openscad part-design path points raytracing robot show surface techdraw tux -cloud -debug -headless -pcl -plot -ship -te
st” PYTHON_SINGLE_TARGET=“python3_9”
May be problem is in some deps like boost or so…

I thought too give this a go since Realthunder branch just got yeeted on Python 3.9
But I tried to install it on several Blender version (2.93/3.0.1/3.1)
On windows 10 X64 system.
All of them give me this error:

Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 3.1.0\3.1\scripts\modules\addon_utils.py", line 351, in enable
    mod = __import__(module_name)
  File "C:\Users\marij\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\sverchok-9073411a3aa45d6f6cf1a0797460c535e64357dd\__init__.py", line 73, in <module>
    imported_modules = init_architecture(__name__, utils_modules, ui_modules)
  File "C:\Users\marij\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\sverchok-9073411a3aa45d6f6cf1a0797460c535e64357dd\core\__init__.py", line 108, in init_architecture
    import_settings(imported_modules, sv_name)
  File "C:\Users\marij\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\sverchok-9073411a3aa45d6f6cf1a0797460c535e64357dd\core\__init__.py", line 89, in import_settings
    settings = importlib.import_module(".settings", sv_dir_name)
  File "C:\Program Files\Blender Foundation\Blender 3.1.0\3.1\python\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\marij\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\sverchok-9073411a3aa45d6f6cf1a0797460c535e64357dd\settings.py", line 15, in <module>
    PYPATH = bpy.app.binary_path_python
AttributeError: 'bpy.app' object has no attribute 'binary_path_python'


here my installing sequence…

BLENDER VERSION: 3.0.1 python 3.9.7

SVERCHOK VERSION: https://github.com/rastart/sverchok

  • install sverchok addon
  • activate it
  • save preferences and restart
  • from sverchok extra nodes preferences set freecad bin path
  • save preferences and restart

for me it works, let me know

2 Likes

I got it working!
Running on Blender 3.1 Alpha with latest daily Link3 branch.
Install method:
Install Master branch Sverchok.
Just copy all files from https://github.com/rastart/sverchok over the files in
AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\sverchok
Probably something got screwed up in the zip naming. Don’t understand why sverchock isn’t in the add-ons menu, and why your branch isn’t merge with that!
Proof:


Edit got to play with it some more:
https://twitter.com/MisterMakerNL_/status/1510605638434496512
Could we btw import materials type from freecad, so we can apply Blender shaders automatically?

1 Like

So I managed to add a filter to filter on names, but I want to filter on materials and then add a material to it.
edit:
I managed to make nodes for certain bodies, with a certain name. Then add a material too it. It converts to meshes but that doesn’t matter as rendering is the main goal here.
Only thing what is missing is to filter on materials from Freecad.


Edit 2 added Freecad topic on forum https://forum.freecadweb.org/viewtopic.php?f=8&t=67728

2 Likes

Hello Haas,

Which python version runs this “latest daily Link3 branch” of FreeCAD?
Can you specify from where we can download it?

Thanks

hello, this freecad branch is built on python 3.9 that match blender 3.0.1 python version.

Unfortunately the latest versions of blender run python 3.10+, so will need to wait some time before freecad could be built on py3.10 because It’s not ready for this at moment.

Yes I can confirm. Thanks for the clarification @Rastart.

1 Like

I’m very happy about your feedbak,
about materials I think it should be doable, I need to check freecad API (added to TODOLIST!)

if you need to read a specific element you can select from the dropdown list:

I need also to support multiple parts list in filter input.
There are a lot of feature already in these freecad exchanges nodes:

I’ll keep working on this project but in little steps so feedbak are very useful,
this is a brand new workflow so before establish a documentation I need to get a stable set of tools.
Thanx also for the freecad forum topic, I will use it to post some use cases!

5 Likes

Use the dev branch 0.2 it should run python 3.9 you can get it here.

Don’t use Blender 3.1 latest release, I was using alpha didn’t updated it for a while so it still seems to run on python 3.9.
I proposed here to support the LTS version which would be a great stable way to keep it working.
As things going this would be the case when Freecad 0.2 releases, since both are on 3.9, and it would support the LTS release by default.

@restart Multiple parts list filter would be awesome. Also with wildcards so you can filter all nuts and make them steel.

I btw added more pictures to the Freecad forum.
Like this lamp I made.


2 Likes

I say here that I was using Link3 branch but I was actually using dev 0.2. But both work.

I do had to start Blender (2.93/3.01/3.1) in Admin mode to set the freecad path in settings, not sure if this is a local issue or not, nevertheless I reported it here I had this issue with the main installation of Sverchok so not specific for Restart version.

no problem for the “wildcards”, as identifier we can use # so with “#bolt” you get a list of all parts with “bolt” in the label string.
I started to check on materials, never used materials in freecad before,
but do you mean also the “view property data”?
Screenshot (89)
this could be a problem because freecad view layer is not accesible I think, but I will check.

Ah damn this is a Link3 specific thing, didn’t notice.
But it only sets the colors of the model it doesn’t add a material name to it which is a shame, but I am sure this can be added… Also know there is a huge topic about this on the Freecad forum.


File added for example of 2 bodies with a material color added in Link3.
blendersverchocktest.FCStd (19.3 KB)