FreeCAD .FCStd importer for Blender 2.80
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: FreeCAD .FCStd importer for Blender 2.80
I think both approaches are valid... It depends much more, actually, if you are more a "FreeCAD person" (your "master" file will be the freecad file, and you will prefer an fcstd importer in blender, to reimport/update the full file), or a "Blender person" (your master file will be the blender file, you will prefer to import pieces from freecad, hence Bayesian's idea makes full sense)
That's the great aspect of open-source projects, both can coexist.
That's the great aspect of open-source projects, both can coexist.
Re: FreeCAD .FCStd importer for Blender 2.80
From my perspective Blender and FreeCAD don't overlap much, so I expect a clear division of tasks between FC and Blender depending on the usecase.
I also suspect that the flow of data is mostly from FreeCAD to Blender, rather than the other way, because Blender is very good at rendering and animating and FC doesn't provide a whole lot of hooks for such information.
Linked Libraries are also a good idea, sometimes. But I guess the primary challenge for updating is to keep the references between Blender Meshes and FreeCAD objects intact.
I also suspect that the flow of data is mostly from FreeCAD to Blender, rather than the other way, because Blender is very good at rendering and animating and FC doesn't provide a whole lot of hooks for such information.
Linked Libraries are also a good idea, sometimes. But I guess the primary challenge for updating is to keep the references between Blender Meshes and FreeCAD objects intact.
- pl7i92LCNC
- Posts: 208
- Joined: Tue Mar 12, 2019 3:03 pm
- Location: RLP DE
Re: FreeCAD .FCStd importer for Blender 2.80
for me it depends on parts to handle
like curve design Blender handels things for printing easier
but on cunstruction real Mechanic parts or Arch most go over to FC
like curve design Blender handels things for printing easier
but on cunstruction real Mechanic parts or Arch most go over to FC
Re: FreeCAD .FCStd importer for Blender 2.80
Regarding your issues with bodies and not having the same number of objects in a same file, internally and externally: That's pretty worrying! Can you share a test file?
Re: FreeCAD .FCStd importer for Blender 2.80
sorry for the late reply - somehow the forum did not want to send me notifications
https://github.com/s-light/io_import_fc ... Test.FCStd
it contains this structure:
if i copy&paste the content from list_objects_copypaste.py into the FreeCAD python console i get this:
if i run the script list_objects.py in the same directory as the file i get this:
so in the external listing i get 2 objects less - and this are:
* Body_Hex Body PartDesign::Body
* Pad Pad PartDesign::Pad
---
if a second test file with a little bit more objects is needed:
https://github.com/s-light/io_import_fc ... orld.FCStd
and there is also a complex test file with linking:
https://github.com/s-light/io_import_fc ... port.FCStd
hope this helps in finding the source for this...
sunny greetings
stefan
i have created a very simple test file:
https://github.com/s-light/io_import_fc ... Test.FCStd
it contains this structure:
if i copy&paste the content from list_objects_copypaste.py into the FreeCAD python console i get this:
Code: Select all
>>> # ******************************************
>>> #
>>> # Main experimetns
>>> #
>>> # ******************************************
>>>
>>> doc = FreeCAD.ActiveDocument
>>> docname = doc.Name
>>>
>>> # ******************************************
>>> objects = doc.Objects
>>> print("doc.Objects", len(objects))
doc.Objects 19
>>> print_objects(objects)
Label Name TypeId
* BodyTest_Part Part App::Part
* Origin Origin App::Origin
* X_Axis X_Axis App::Line
* Y_Axis Y_Axis App::Line
* Z_Axis Z_Axis App::Line
* XY_Plane XY_Plane App::Plane
* XZ_Plane XZ_Plane App::Plane
* YZ_Plane YZ_Plane App::Plane
* Body_Hex Body PartDesign::Body
* Origin001 Origin001 App::Origin
* X_Axis001 X_Axis001 App::Line
* Y_Axis001 Y_Axis001 App::Line
* Z_Axis001 Z_Axis001 App::Line
* XY_Plane001 XY_Plane001 App::Plane
* XZ_Plane001 XZ_Plane001 App::Plane
* YZ_Plane001 YZ_Plane001 App::Plane
* Sketch Sketch Sketcher::SketchObject
* Pad Pad PartDesign::Pad
* Sphere_Sun Sphere Part::Sphere
>>>
>>> # ******************************************
>>>
>>> print_obj_with_label(doc, "BodyTest_Part")
BodyTest_Part Part App::Part
>>> print_obj_with_label(doc, "Body_Hex")
Body_Hex Body PartDesign::Body
>>> print_obj_with_label(doc, "Sphere_Sun")
Sphere_Sun Sphere Part::Sphere
>>>
>>> # ******************************************
>>> print("tests done :-)")
tests done :-)
>>>
Code: Select all
Latitude-E6510:~/mydata/github/blender/io_import_fcstd/dev/freecad_test_body_objects (master)$ ./list_objects.py
Configured FreeCAD path: /usr/lib/freecad-daily-python3/lib
Sheet Metal workbench loaded
FreeCAD version: ['0', '19', '', 'https://code.launchpad.net/~vcs-imports/freecad/trunk', '2019/10/25 00:22:09']
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
doc.Objects 17
Label Name TypeId
* BodyTest_Part Part App::Part
* Origin Origin App::Origin
* X_Axis X_Axis App::Line
* Y_Axis Y_Axis App::Line
* Z_Axis Z_Axis App::Line
* XY_Plane XY_Plane App::Plane
* XZ_Plane XZ_Plane App::Plane
* YZ_Plane YZ_Plane App::Plane
* Origin001 Origin001 App::Origin
* X_Axis001 X_Axis001 App::Line
* Y_Axis001 Y_Axis001 App::Line
* Z_Axis001 Z_Axis001 App::Line
* XY_Plane001 XY_Plane001 App::Plane
* XZ_Plane001 XZ_Plane001 App::Plane
* YZ_Plane001 YZ_Plane001 App::Plane
* Sketch Sketch Sketcher::SketchObject
* Sphere_Sun Sphere Part::Sphere
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BodyTest_Part Part App::Part
object with label 'Body_Hex' not found.
Sphere_Sun Sphere Part::Sphere
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tests done :-)
* Body_Hex Body PartDesign::Body
* Pad Pad PartDesign::Pad
---
if a second test file with a little bit more objects is needed:
https://github.com/s-light/io_import_fc ... orld.FCStd
and there is also a complex test file with linking:
https://github.com/s-light/io_import_fc ... port.FCStd
hope this helps in finding the source for this...
sunny greetings
stefan
Re: FreeCAD .FCStd importer for Blender 2.80
Hi,
I haven't posted this on GitHub -> Issues as its almost certainly an issue with me / my install... However whenever I install this plugin, or the original, I CANNOT get the import to complete.
I have installed via .zip file, enable the plugin and set the FreeCAD.so path (/Applications/FreeCAD.app/Contents/Resources/lib/FreeCAD.so), saved preferences, reloaded Blender, then File, Import, .FCStd. I then get the error ( Screenshot below).
If I run "import FreeCAD" in console I get no error.
OS: macOS Catalina, FreeCAD version 0.19 - 18524, Blender Version 2.80 (2.80 2019-07-29)
I haven't posted this on GitHub -> Issues as its almost certainly an issue with me / my install... However whenever I install this plugin, or the original, I CANNOT get the import to complete.
I have installed via .zip file, enable the plugin and set the FreeCAD.so path (/Applications/FreeCAD.app/Contents/Resources/lib/FreeCAD.so), saved preferences, reloaded Blender, then File, Import, .FCStd. I then get the error ( Screenshot below).
If I run "import FreeCAD" in console I get no error.
OS: macOS Catalina, FreeCAD version 0.19 - 18524, Blender Version 2.80 (2.80 2019-07-29)
Re: FreeCAD .FCStd importer for Blender 2.80
Hey alxscott,
thanks for trying
i think it was a classical bug i introduced...
i have uploaded - hopefully - a fix.
please have a try
sunny greetings
stefan
thanks for trying
i think it was a classical bug i introduced...
i have uploaded - hopefully - a fix.
please have a try
sunny greetings
stefan
Re: FreeCAD .FCStd importer for Blender 2.80
this one i can fix easily
Please - after Downloading rename the zip from "io_import_fcstd-master.zip" to "io_import_fcstd.zip"
otherwise blender things the addon is called "io_import_fcstd-master"...
and this breaks the assumptions from the script...
i will add this as a note to the readme -
and later will try to handle this in the script itself..
by the way - be warned - iam currently making realtiv big changes -
and currently i do this in the master branch..
once i get this to work mostly i will switch my development to a user-friendlier 'release' based thing..
if you are familiar with git i highly encourage to clone the repro..
this way it could be easier to update.
sunny greetings
stefan