Nokse22 / Exhibit

3D model viewer for the GNOME desktop powered by f3d
https://flathub.org/apps/io.github.nokse22.Exhibit
GNU General Public License v3.0
73 stars 7 forks source link

`'f3d.pyf3d.Camera' object has no attribute 'pan'` on middle-click drag #11

Closed rien333 closed 3 months ago

rien333 commented 3 months ago

Issue description

Maybe it's the way I've build f3d, but whenever I drag with my middle-mouse button my terminals logs an error:

Traceback (most recent call last):
  File "/usr/share/exhibit/exhibit/window.py", line 258, in on_drag_update
    self.camera.pan(
    ^^^^^^^^^^^^^^^
AttributeError: 'f3d.pyf3d.Camera' object has no attribute 'pan'

Other than that, nothing happens though. No crash, no camera movement.

Interestingly, other mouse actions, such as scroll-to-zoom, work fine.

Installation details

I tried building f3d using the instructions in io.github.nokse22.Exhibit.json. Specifically:

  export CXXFLAGS+=" -ffat-lto-objects"
  cmake -GNinja \
    -Bbuild \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DF3D_BUILD_APPLICATION:BOOL=OFF \
    -DF3D_MODULE_EXTERNAL_RENDERING:BOOL=ON \
    -DF3D_MODULE_EXR:BOOL=ON \
    -DF3D_BINDINGS_PYTHON:BOOL=ON \
    -DBUILD_TESTING:BOOL=OFF \
    -DF3D_PLUGINS_STATIC_BUILD=ON \
    -DF3D_PLUGIN_BUILD_ALEMBIC=ON \
    -DF3D_PLUGIN_BUILD_ASSIMP:BOOL=ON \
    -DF3D_PLUGIN_BUILD_DRACO:BOOL=ON \
    -DF3D_PLUGIN_BUILD_EXODUS:BOOL=ON \
    -DF3D_PLUGIN_BUILD_OCCT:BOOL=ON
  ninja -C build

In the end, my python bindings consist of these two files:

/usr/lib/python3.12/site-packages/f3d/__init__.py                          
/usr/lib/python3.12/site-packages/f3d/pyf3d.cpython-312-x86_64-linux-gnu.so

Due to pyf3d being an .so file I can't really inspect if the pan method is indeed entirely absent.

Feel free to close if this issue is not with Exhibit (I'm actually guessing there's nothing Exhibit can do here, but opening just to be sure)

Nokse22 commented 3 months ago

It is because I build the library from a recent commit. It is the first use of this library so there were some missing feature that I suggested and the kindly added.

If you want to build from the lasted release you'd have to patch the app from this commit: https://github.com/Nokse22/Exhibit/commit/dc8b0f6e47baa331181fb4194dc8c1b756b8b25d It should be the only thing that relies on features not on the latest release, but I will probably add more.

rien333 commented 3 months ago

Got it, thanks!