FreeCAD 1.1.4 Integration Issue

Hello, I just set up my Rotatrix Wired kit, and I was trying to get it work in FreeCAD 1.1.4. I previously had FreeCAD 1.0.2 installed, but I uninstalled it and updated to 1.1.4 and then set up in the integration for FreeCAD, placing it in the appdata/FreeCAD/… folder. I installed FreeCAD on my non-primary drive (D:), and so I also placed it in my Mod folder in there as well. It appears in FreeCAD, but I can’t get any diagnostic data to appear in Report View. Also holding Rotatrix control down buttons simply freezes the mouse in place but does not apply the relevant movements to the object, selected or unselected. My only hint as to what could be wrong is that when looking it the logs on Rotatrix, I get ‘missing’ under many of the parameters there:

13:12:06.949 INFO gesture_finished: gesture_id=12, reason=motion_end
13:12:09.343 INFO gesture_started: gesture_id=13
13:12:09.353 INFO   document.id — missing · 0.000 ms
13:12:09.360 INFO   world.orientation — missing · 0.000 ms
13:12:09.368 INFO   camera.pose — missing · 0.000 ms
13:12:09.376 INFO   viewport.aspect — missing · 0.000 ms
13:12:09.383 INFO   navigation.translation_scale — missing · 16.000 ms
13:12:09.389 INFO   navigation.preferences — missing · 0.000 ms
13:12:09.396 INFO   model.bounds — missing · 15.000 ms
13:12:09.403 INFO   selection.bounds — missing · 0.000 ms
13:12:09.410 INFO   pick.cursor.selection — miss · 16.000 ms
13:12:09.417 INFO   pick.viewport_center.selection — miss · 0.000 ms
13:12:09.423 INFO   pick.cursor — miss · 16.000 ms
13:12:09.430 INFO   pick.viewport_center — miss · 0.000 ms
13:12:09.431 INFO query complete · 78.000 ms · request 13
13:12:11.545 INFO navigation.performance gesture=13 reason=motion_end duration=2203.0 ms
    camera: no activity
    object: no activity
13:12:11.547 INFO gesture_finished: gesture_id=13, reason=motion_end
13:14:51.642 INFO gesture_started: gesture_id=14
13:14:51.651 INFO   document.id — missing · 0.000 ms
13:14:51.658 INFO   world.orientation — missing · 16.000 ms
13:14:51.665 INFO   camera.pose — missing · 0.000 ms
13:14:51.672 INFO   viewport.aspect — missing · 0.000 ms
13:14:51.679 INFO   navigation.translation_scale — missing · 16.000 ms
13:14:51.685 INFO   navigation.preferences — missing · 0.000 ms
13:14:51.692 INFO   model.bounds — missing · 15.000 ms
13:14:51.698 INFO   selection.bounds — missing · 0.000 ms
13:14:51.705 INFO   pick.cursor.selection — miss · 16.000 ms
13:14:51.712 INFO   pick.viewport_center.selection — miss · 0.000 ms
13:14:51.719 INFO   pick.cursor — miss · 0.000 ms
13:14:51.726 INFO   pick.viewport_center — miss · 0.000 ms
13:14:51.727 INFO query complete · 79.000 ms · request 14
13:14:56.123 INFO navigation.performance gesture=14 reason=motion_end duration=4484.0 ms
    camera: no activity
    object: no activity
13:14:56.125 INFO gesture_finished: gesture_id=14, reason=motion_end
13:17:16.315 INFO connection stopped

Further helpful data is that the GUI populates in the corner of FreeCAD, the keyboard, mouse, and app all detect correctly, and the Demos also function correctly.

Any help is appreciated in trying to get this set up.

Hi Matt, what version of the Rotatrix app do you have, and version of Windows?

For a normal installation, it should find the Mod in your AppData even if it’s installed on another drive as well. Are you using the Portable installation instead?

What document are you opening in FreeCAD? Try the simple AssemblyExample or engine block sample included FreeCAD.

Actually, I had another user report this issue a couple days ago, in 1.6.0b2. I will try to get a fix out today. If you’d like to try to patch it locally, here is what they reported to work:

## 3. The Bugfix

The fix is straightforward and minimal: **ensure `pivy.coin` is imported early so SWIG registers Coin3D types before any calls to `view.getCameraNode()` occur.**

### Change 1: `rotatrix_freecad/context.py`
Add the eager `pivy.coin` import at the top of the file so `viewport_token()` can safely query `view.getCameraNode()`.

```diff
--- a/rotatrix_freecad/context.py
+++ b/rotatrix_freecad/context.py
@@ -3,6 +3,11 @@
 
 from __future__ import annotations
 
+try:
+    from pivy import coin  # noqa: F401 - Register Coin3D SWIG types before getCameraNode()
+except ImportError:
+    pass
+
 
 def document_key() -> tuple[str, int] | None:
     """Return a session-local key for the active document."""
```

### Change 2: `rotatrix_freecad/__init__.py`
Ensure the package entry point registers Coin3D SWIG bindings as soon as the FreeCAD addon is imported:

```diff
--- a/rotatrix_freecad/__init__.py
+++ b/rotatrix_freecad/__init__.py
@@ -17,3 +17,8 @@
 if _lib_dir not in sys.path:
     sys.path.insert(0, _lib_dir)
 
+try:
+    from pivy import coin  # noqa: F401 - Register Coin3D SWIG types early
+except ImportError:
+    pass

Edit to add:
I’m also able to reproduce this now by opening a New Document as my first action. But once I open one of FreeCAD’s sample files, further motions start working. I found a workaround without any code changes:

In View > Panels > Python Console, paste the following:

from pivy import coin

and press enter. That seems to fix it for the rest of the FreeCAD session.

That fix you works for me :smiley:

Fixed in the new release 1.6.0b3!