Skip to content

Free Motion Capture for Everyone πŸ’€βœ¨

TypeScript

Trent/choose your blender (#341)

trentwirth4fd59f635848
diff --git a/freemocap/core_processes/capture_volume_calibration/anipose_camera_calibration/anipose_camera_calibrator.py b/freemocap/core_processes/capture_volume_calibration/anipose_camera_calibration/anipose_camera_calibrator.py
index 9a0549a7..be133fdd 100644
--- a/freemocap/core_processes/capture_volume_calibration/anipose_camera_calibration/anipose_camera_calibrator.py
+++ b/freemocap/core_processes/capture_volume_calibration/anipose_camera_calibration/anipose_camera_calibrator.py
@@ -5,16 +5,16 @@ from typing import Callable, Union
import numpy as np
from aniposelib.boards import CharucoBoard as AniposeCharucoBoard
-from freemocap.system.paths_and_files_names import (
- get_calibrations_folder_path,
- get_last_successful_calibration_toml_path, create_camera_calibration_file_name,
-)
from freemocap.core_processes.capture_volume_calibration.anipose_camera_calibration import (
freemocap_anipose,
)
from freemocap.core_processes.capture_volume_calibration.charuco_stuff.charuco_board_definition import (
CharucoBoardDefinition,
)
+from freemocap.system.paths_and_files_names import (
+ get_calibrations_folder_path,
+ get_last_successful_calibration_toml_path, create_camera_calibration_file_name,
+)
logger = logging.getLogger(__name__)
diff --git a/freemocap/core_processes/capture_volume_calibration/anipose_camera_calibration/get_anipose_calibration_object.py b/freemocap/core_processes/capture_volume_calibration/anipose_camera_calibration/get_anipose_calibration_object.py
index aae821a7..16de22ff 100644
--- a/freemocap/core_processes/capture_volume_calibration/anipose_camera_calibration/get_anipose_calibration_object.py
+++ b/freemocap/core_processes/capture_volume_calibration/anipose_camera_calibration/get_anipose_calibration_object.py
@@ -4,12 +4,12 @@ import shutil
from pathlib import Path
from typing import Union
-from freemocap.system.paths_and_files_names import (
- get_last_successful_calibration_toml_path,
-)
from freemocap.core_processes.capture_volume_calibration.anipose_camera_calibration import (
freemocap_anipose,
)
+from freemocap.system.paths_and_files_names import (
+ get_last_successful_calibration_toml_path,
+)
logger = logging.getLogger(__name__)
diff --git a/freemocap/core_processes/detecting_things_in_2d_images/mediapipe_stuff/mediapipe_skeleton_detector.py b/freemocap/core_processes/detecting_things_in_2d_images/mediapipe_stuff/mediapipe_skeleton_detector.py
index e14097fe..92818239 100644
--- a/freemocap/core_processes/detecting_things_in_2d_images/mediapipe_stuff/mediapipe_skeleton_detector.py
+++ b/freemocap/core_processes/detecting_things_in_2d_images/mediapipe_stuff/mediapipe_skeleton_detector.py
@@ -1,6 +1,6 @@
import logging
-from dataclasses import dataclass
import multiprocessing
+from dataclasses import dataclass
from pathlib import Path
from typing import Any, List, Union
@@ -11,11 +11,11 @@ from skellycam.detection.models.frame_payload import FramePayload
from skellycam.opencv.video_recorder.video_recorder import VideoRecorder
from tqdm import tqdm
-from freemocap.system.paths_and_files_names import MEDIAPIPE_2D_NPY_FILE_NAME, ANNOTATED_VIDEOS_FOLDER_NAME
from freemocap.core_processes.detecting_things_in_2d_images.mediapipe_stuff.mediapipe_skeleton_names_and_connections import (
mediapipe_tracked_point_names_dict,
)
from freemocap.parameter_info_models.recording_processing_parameter_models import MediapipeParametersModel
+from freemocap.system.paths_and_files_names import MEDIAPIPE_2D_NPY_FILE_NAME, ANNOTATED_VIDEOS_FOLDER_NAME
logger = logging.getLogger(__name__)
diff --git a/freemocap/core_processes/export_data/blender_stuff/blender_bpy_export_scripts/freemocap_blender_megascript_take2.py b/freemocap/core_processes/export_data/blender_stuff/blender_bpy_export_scripts/freemocap_blender_megascript_take2.py
index df36d539..c5155043 100644
--- a/freemocap/core_processes/export_data/blender_stuff/blender_bpy_export_scripts/freemocap_blender_megascript_take2.py
+++ b/freemocap/core_processes/export_data/blender_stuff/blender_bpy_export_scripts/freemocap_blender_megascript_take2.py
@@ -1,13 +1,10 @@
import json
import logging
-import pprint
import sys
from copy import copy
from pathlib import Path
from typing import List, Union, Dict
-
-
import addon_utils
import bpy
import numpy as np
@@ -246,8 +243,8 @@ def main(recording_path: Union[str, Path],
###########################
### Make stick figure
- creating_stick_figure_mesh_from_bone_dictionary(trajectory_frame_marker_xyz=mediapipe_body_fr_mar_xyz,
- body_connections=body_connections,)
+ # creating_stick_figure_mesh_from_bone_dictionary(trajectory_frame_marker_xyz=mediapipe_body_fr_mar_xyz,
+ # body_connections=body_connections,)
############################
### Load videos into scene
if Path(recording_path / "annotated_videos").is_dir():
@@ -894,29 +891,36 @@ print(f"__name__: {__name__}")
if __name__ == "__main__" or __name__ == "<run_path>":
# this is the part that actually runs the script
+ argv = sys.argv
+ create_rig_input = False
print(f"Running script to create Blender file from freemocap session data from script {__file__}")
try:
- ##% Session path
+ # Session path
# get session path as command line argument
- argv = sys.argv
print(f"Received command line arguments: {argv}")
argv = argv[argv.index("--") + 1:]
recording_path_input = Path(argv[0])
blender_file_save_path_input = Path(argv[1])
create_rig_input = bool(argv[2])
- except:
- print("No command line arguments received, using hard-coded path instead :D")
+ except Exception as e:
+ print(f"There was a problem loading command line arguments: {e}. Using hardcoded values instead.")
- ####
- ### Change the path below (`recording_path_input`) to the path to your recording session folder
- ####
- recording_path_input = Path(
- r"C:\Users\jonma\freemocap_data\recording_sessions\session_2023-02-15_08_46_43_wud\recording_08_47_25_gmt-5_wud"
- )
- blender_file_save_path_input = Path(recording_path_input) / f"{Path(recording_path_input).name}_.blend"
- create_rig = True
+ if len(argv) == 0:
+
+ ####
+ # Change the path below (`recording_path_input`) to the path to your recording session folder
+ ####
+ recording_path_input = Path(
+ r"C:\Users\jonma\freemocap_data\recording_sessions\session_2023-02-15_08_46_43_wud\recording_08_47_25_gmt-5_wud"
+ )
+ blender_file_save_path_input = Path(recording_path_input) / f"{Path(recording_path_input).name}_.blend"
+ create_rig = True
+
+ print(f"recording_path_input: {recording_path_input}, \n"
+ f"blender_file_save_path_input: {blender_file_save_path_input}, \n"
+ f"create_rig_input: {create_rig_input}")
main(recording_path=recording_path_input,
blender_file_save_path=blender_file_save_path_input,
diff --git a/freemocap/core_processes/export_data/blender_stuff/export_to_blender.py b/freemocap/core_processes/export_data/blender_stuff/export_to_blender.py
index 63bda9fe..d3f9c0b0 100644
--- a/freemocap/core_processes/export_data/blender_stuff/export_to_blender.py
+++ b/freemocap/core_processes/export_data/blender_stuff/export_to_blender.py
@@ -17,7 +17,7 @@ logger = logging.getLogger(__name__)
def export_to_blender(
recording_folder_path: Union[str, Path],
blender_file_path: Union[str, Path],
- blender_exe_path: Union[str, Path] = get_best_guess_of_blender_path(),
+ blender_exe_path: Union[str, Path],
method: str = "megascript_take2",
):
@@ -50,4 +50,6 @@ def export_to_blender(
if __name__ == "__main__":
recording_path = r"D:\Dropbox\FreeMoCapProject\FreeMocap_Data\old\sesh_2022-09-19_16_16_50_in_class_jsm"
- export_to_blender(recording_path, recording_path)
+ export_to_blender(recording_path,
+ recording_path,
+ get_best_guess_of_blender_path())
diff --git a/freemocap/core_processes/export_data/blender_stuff/get_best_guess_of_blender_path.py b/freemocap/core_processes/export_data/blender_stuff/get_best_guess_of_blender_path.py
index ff51dd16..df35d700 100644
--- a/freemocap/core_processes/export_data/blender_stuff/get_best_guess_of_blender_path.py
+++ b/freemocap/core_processes/export_data/blender_stuff/get_best_guess_of_blender_path.py
@@ -10,11 +10,9 @@ logger = logging.getLogger(__name__)
def guess_blender_exe_path_from_path(base_path: Union[str, Path]) -> Path:
blender_folder_path = [path for path in base_path.glob("Blender*")]
if len(blender_folder_path) > 0:
- blender_exe_path = blender_folder_path[0] / "blender.exe"
+ blender_exe_path = blender_folder_path[-1] / "blender.exe"
return blender_exe_path
- return
-
def get_best_guess_of_blender_path():
if platform.system() == "Windows":
diff --git a/freemocap/core_processes/process_motion_capture_videos/process_recording_folder.py b/freemocap/core_processes/process_motion_capture_videos/process_recording_folder.py
index 483a6972..dae8634a 100644
--- a/freemocap/core_processes/process_motion_capture_videos/process_recording_folder.py
+++ b/freemocap/core_processes/process_motion_capture_videos/process_recording_folder.py
@@ -4,13 +4,6 @@ from pathlib import Path
import pandas as pd
-from freemocap.core_processes.detecting_things_in_2d_images.mediapipe_stuff.mediapipe_skeleton_names_and_connections import (
- mediapipe_names_and_connections_dict,
-)
-from freemocap.system.paths_and_files_names import (
- MEDIAPIPE_BODY_3D_DATAFRAME_CSV_FILE_NAME,
- RAW_DATA_FOLDER_NAME,
-)
from freemocap.core_processes.capture_volume_calibration.anipose_camera_calibration.get_anipose_calibration_object import (
load_anipose_calibration_toml_from_path,
)
@@ -23,6 +16,9 @@ from freemocap.core_processes.detecting_things_in_2d_images.mediapipe_stuff.conv
from freemocap.core_processes.detecting_things_in_2d_images.mediapipe_stuff.mediapipe_skeleton_detector import (
MediaPipeSkeletonDetector,
)
+from freemocap.core_processes.detecting_things_in_2d_images.mediapipe_stuff.mediapipe_skeleton_names_and_connections import (
+ mediapipe_names_and_connections_dict,
+)
from freemocap.core_processes.post_process_skeleton_data.estimate_skeleton_segment_lengths import (
estimate_skeleton_segment_lengths,
mediapipe_skeleton_segment_definitions,
@@ -31,7 +27,10 @@ from freemocap.core_processes.post_process_skeleton_data.gap_fill_filter_and_ori
gap_fill_filter_origin_align_3d_data_and_then_calculate_center_of_mass,
)
from freemocap.parameter_info_models.recording_processing_parameter_models import RecordingProcessingParameterModel
-
+from freemocap.system.paths_and_files_names import (
+ MEDIAPIPE_BODY_3D_DATAFRAME_CSV_FILE_NAME,
+ RAW_DATA_FOLDER_NAME,
+)
from freemocap.tests.test_mediapipe_2d_data_shape import (
test_mediapipe_2d_data_shape,
)
diff --git a/freemocap/gui/qt/freemocap_main.py b/freemocap/gui/qt/freemocap_main.py
index aba8b273..6cdd45fc 100644
--- a/freemocap/gui/qt/freemocap_main.py
+++ b/freemocap/gui/qt/freemocap_main.py
@@ -6,11 +6,11 @@ from pathlib import Path
from PyQt6.QtCore import QTimer
from PyQt6.QtWidgets import QApplication
+from freemocap.gui.qt.main_window.freemocap_main_window import FreemocapMainWindow, EXIT_CODE_REBOOT
+from freemocap.gui.qt.utilities.get_qt_app import get_qt_app
from freemocap.system.paths_and_files_names import (
get_freemocap_data_folder_path,
)
-from freemocap.gui.qt.main_window.freemocap_main_window import FreemocapMainWindow, EXIT_CODE_REBOOT
-from freemocap.gui.qt.utilities.get_qt_app import get_qt_app
from freemocap.system.user_data.pipedream_pings import PipedreamPings
repo = Path(__file__).parent.parent.parent.parent
diff --git a/freemocap/gui/qt/main_window/freemocap_main_window.py b/freemocap/gui/qt/main_window/freemocap_main_window.py
index d41ccd29..8d5e0f6b 100644
--- a/freemocap/gui/qt/main_window/freemocap_main_window.py
+++ b/freemocap/gui/qt/main_window/freemocap_main_window.py
@@ -1,10 +1,7 @@
import logging
import multiprocessing
import shutil
-import threading
-from copy import copy
from pathlib import Path
-from time import sleep
from typing import Union, List
from PyQt6.QtCore import Qt, pyqtSlot
@@ -13,8 +10,7 @@ from PyQt6.QtWidgets import (
QDockWidget,
QMainWindow,
QFileDialog,
- QTabWidget, QLineEdit,
-)
+ QTabWidget, )
from skelly_viewer import SkellyViewer
from skellycam import (
SkellyCamParameterTreeWidget,
@@ -26,6 +22,8 @@ from tqdm import tqdm
from freemocap.core_processes.export_data.blender_stuff.export_to_blender import (
export_to_blender,
)
+from freemocap.core_processes.export_data.blender_stuff.get_best_guess_of_blender_path import \
+ get_best_guess_of_blender_path
from freemocap.gui.qt.actions_and_menus.actions import Actions
from freemocap.gui.qt.actions_and_menus.menu_bar import MenuBar
from freemocap.gui.qt.style_sheet.css_file_watcher import CSSFileWatcher
@@ -58,7 +56,6 @@ from freemocap.parameter_info_models.recording_processing_parameter_models impor
)
from freemocap.system.paths_and_files_names import (
get_css_stylesheet_path,
- get_freemocap_data_folder_path,
get_most_recent_recording_path,
PATH_TO_FREEMOCAP_LOGO_SVG,
get_blender_file_path,
@@ -67,7 +64,6 @@ from freemocap.system.paths_and_files_names import (
GEAR_EMOJI_STRING,
COOL_EMOJI_STRING,
)
-
# reboot GUI method based on this - https://stackoverflow.com/a/56563926/14662833
from freemocap.system.start_file import open_file
from freemocap.system.user_data.pipedream_pings import PipedreamPings
@@ -282,7 +278,8 @@ class FreemocapMainWindow(QMainWindow):
self._handle_processing_finished_signal
)
- self._visualization_control_panel = VisualizationControlPanel(parent=self)
+ self._visualization_control_panel = VisualizationControlPanel(parent=self,
+ blender_executable_path=get_best_guess_of_blender_path())
self._visualization_control_panel.export_to_blender_button.clicked.connect(
self._export_active_recording_to_blender
)
@@ -296,12 +293,18 @@ class FreemocapMainWindow(QMainWindow):
)
def _export_active_recording_to_blender(self):
+ logger.info("Exporting active recording to Blender...")
recording_path = self._active_recording_info_widget.get_active_recording_info(return_path=True)
+ if self._visualization_control_panel.blender_executable_path is None:
+ logger.error("Blender executable path is None!")
+ return
+
self._visualization_control_panel.get_user_selected_method_string()
export_to_blender(
recording_folder_path=recording_path,
blender_file_path=get_blender_file_path(recording_path),
+ blender_exe_path=self._visualization_control_panel.blender_executable_path,
method=self._visualization_control_panel.get_user_selected_method_string(),
)
diff --git a/freemocap/gui/qt/utilities/update_most_recent_recording_toml.py b/freemocap/gui/qt/utilities/update_most_recent_recording_toml.py
index 902d445a..69c473e8 100644
--- a/freemocap/gui/qt/utilities/update_most_recent_recording_toml.py
+++ b/freemocap/gui/qt/utilities/update_most_recent_recording_toml.py
@@ -1,13 +1,10 @@
import logging
-from pathlib import Path
-from typing import Union
import toml
from freemocap.parameter_info_models.recording_info_model import RecordingInfoModel
from freemocap.system.paths_and_files_names import (
get_most_recent_recording_toml_path,
- SYNCHRONIZED_VIDEOS_FOLDER_NAME,
)
logger = logging.getLogger(__name__)
diff --git a/freemocap/gui/qt/widgets/camera_controller_group_box.py b/freemocap/gui/qt/widgets/camera_controller_group_box.py
index 3a6a9d41..1e2fd0c7 100644
--- a/freemocap/gui/qt/widgets/camera_controller_group_box.py
+++ b/freemocap/gui/qt/widgets/camera_controller_group_box.py
@@ -8,7 +8,6 @@ from PyQt6.QtWidgets import (
QLabel,
QRadioButton,
QCheckBox,
- QWidget,
)
from skellycam import SkellyCamControllerWidget
diff --git a/freemocap/gui/qt/widgets/central_tab_widget.py b/freemocap/gui/qt/widgets/central_tab_widget.py
index 72ae86b0..2fa5e594 100644
--- a/freemocap/gui/qt/widgets/central_tab_widget.py
+++ b/freemocap/gui/qt/widgets/central_tab_widget.py
@@ -2,14 +2,13 @@ import logging
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QTabWidget, QVBoxLayout, QWidget
-
# from skelly_viewer import SkellyViewer
from skellycam import SkellyCamWidget
from freemocap.gui.qt.widgets.welcome_panel_widget import (
WelcomeToFreemocapPanel,
)
-from freemocap.system.paths_and_files_names import SKULL_EMOJI_STRING, CAMERA_WITH_FLASH_EMOJI_STRING, EYES_EMOJI_STRING
+from freemocap.system.paths_and_files_names import CAMERA_WITH_FLASH_EMOJI_STRING, EYES_EMOJI_STRING
logger = logging.getLogger(__name__)
diff --git a/freemocap/gui/qt/widgets/control_panel/calibration_control_panel.py b/freemocap/gui/qt/widgets/control_panel/calibration_control_panel.py
index b83a362f..56951f29 100644
--- a/freemocap/gui/qt/widgets/control_panel/calibration_control_panel.py
+++ b/freemocap/gui/qt/widgets/control_panel/calibration_control_panel.py
@@ -1,8 +1,7 @@
import logging
import os
import threading
-from pathlib import Path
-from typing import Callable, Union
+from typing import Callable
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QDoubleValidator
@@ -16,19 +15,17 @@ from PyQt6.QtWidgets import (
QVBoxLayout,
QWidget,
QHBoxLayout,
- QLayout, QInputDialog, QDialogButtonBox, QDialog, QCheckBox,
-)
+ QLayout, )
-from freemocap.system.paths_and_files_names import (
- get_last_successful_calibration_toml_path,
- get_calibrations_folder_path,
-)
from freemocap.core_processes.capture_volume_calibration.charuco_stuff.default_charuco_square_size import (
default_charuco_square_size_mm,
)
from freemocap.gui.qt.workers.anipose_calibration_thread_worker import (
AniposeCalibrationThreadWorker,
)
+from freemocap.system.paths_and_files_names import (
+ get_last_successful_calibration_toml_path,
+)
logger = logging.getLogger(__name__)
diff --git a/freemocap/gui/qt/widgets/control_panel/process_mocap_data_panel/parameter_groups/create_3d_triangulation_parameter_group.py b/freemocap/gui/qt/widgets/control_panel/process_mocap_data_panel/parameter_groups/create_3d_triangulation_parameter_group.py
index 1408c328..139597f9 100644
--- a/freemocap/gui/qt/widgets/control_panel/process_mocap_data_panel/parameter_groups/create_3d_triangulation_parameter_group.py
+++ b/freemocap/gui/qt/widgets/control_panel/process_mocap_data_panel/parameter_groups/create_3d_triangulation_parameter_group.py
@@ -1,4 +1,2 @@
-from pyqtgraph.parametertree import Parameter
-from freemocap.parameter_info_models.recording_processing_parameter_models import AniposeTriangulate3DParametersModel
diff --git a/freemocap/gui/qt/widgets/control_panel/process_mocap_data_panel/process_motion_capture_data_panel.py b/freemocap/gui/qt/widgets/control_panel/process_mocap_data_panel/process_motion_capture_data_panel.py
index 6fca084e..6b2756dd 100644
--- a/freemocap/gui/qt/widgets/control_panel/process_mocap_data_panel/process_motion_capture_data_panel.py
+++ b/freemocap/gui/qt/widgets/control_panel/process_mocap_data_panel/process_motion_capture_data_panel.py
@@ -8,12 +8,9 @@ from PyQt6.QtWidgets import QPushButton, QVBoxLayout, QWidget, QGroupBox
from pyqtgraph.parametertree import Parameter, ParameterTree
from freemocap.gui.qt.widgets.control_panel.calibration_control_panel import CalibrationControlPanel
-
from freemocap.gui.qt.widgets.control_panel.process_mocap_data_panel.parameter_groups.create_parameter_groups import (
- create_mediapipe_parameter_group, extract_mediapipe_parameter_model_from_parameter_tree,
- create_3d_triangulation_prarameter_group, create_post_processing_parameter_group,
+ create_mediapipe_parameter_group, create_3d_triangulation_prarameter_group, create_post_processing_parameter_group,
)
-
from freemocap.gui.qt.workers.process_motion_capture_data_thread_worker import (
ProcessMotionCaptureDataThreadWorker,
)
diff --git a/freemocap/gui/qt/widgets/control_panel/visualization_control_panel.py b/freemocap/gui/qt/widgets/control_panel/visualization_control_panel.py
index 4ee7a681..a5499848 100644
--- a/freemocap/gui/qt/widgets/control_panel/visualization_control_panel.py
+++ b/freemocap/gui/qt/widgets/control_panel/visualization_control_panel.py
@@ -1,10 +1,19 @@
+import logging
+from pathlib import Path
+from typing import Union
+
from PyQt6.QtCore import Qt
-from PyQt6.QtWidgets import QGroupBox, QVBoxLayout, QPushButton, QRadioButton, QWidget, QCheckBox
+from PyQt6.QtWidgets import QGroupBox, QVBoxLayout, QPushButton, QRadioButton, QWidget, QCheckBox, QLabel, QFileDialog, \
+ QLineEdit
+logger = logging.getLogger(__name__)
+BLENDER_EXECUTABLE_PATH_MISSING_STRING = "BLENDER EXECUTABLE NOT FOUND"
class VisualizationControlPanel(QWidget):
- def __init__(self, parent=None):
+ def __init__(self, blender_executable_path: Union[str, Path] = BLENDER_EXECUTABLE_PATH_MISSING_STRING, parent=None):
super().__init__(parent=parent)
+
+ self._blender_executable_path = str(blender_executable_path)
self._layout = QVBoxLayout()
self.setLayout(self._layout)
@@ -32,6 +41,16 @@ class VisualizationControlPanel(QWidget):
self._use_cgtinker_method_radio_button = QRadioButton("Use @cgtinker method (Work in progress)")
groupbox.layout().addWidget(self._use_cgtinker_method_radio_button)
+ self._layout.addWidget(QLabel("Blender Executable Path:"))
+
+ self._blender_executable_label = QLineEdit(self._blender_executable_path)
+ self._layout.addWidget(self._blender_executable_label)
+
+ self._set_blender_executable_path_button = QPushButton("Choose your Blender Executable")
+ self._set_blender_executable_path_button.clicked.connect(self._handle_blender_executable_button_clicked)
+ self._layout.addWidget(self._set_blender_executable_path_button)
+ self._layout.addStretch()
+
@property
def export_to_blender_button(self):
return self._export_to_blender_button
@@ -40,7 +59,23 @@ class VisualizationControlPanel(QWidget):
def open_in_blender_automatically_box_is_checked(self):
return self._open_in_blender_automatically_checkbox.isChecked()
+ @property
+ def blender_executable_path(self) -> str:
+ """
+ Returns the path to the Blender executable
+
+ Returns:
+ str: Path to the Blender executable
+ """
+ return self._blender_executable_path
+
def get_user_selected_method_string(self):
+ """
+ Returns the string that represents the method the user selected to generate the Blender scene.
+
+ Returns:
+ str: String representing the method the user selected to generate the Blender scene.
+ """
if self._use_default_method_radio_button.isChecked():
return "megascript_take2"
@@ -49,3 +84,20 @@ class VisualizationControlPanel(QWidget):
if self._use_cgtinker_method_radio_button.isChecked():
return "cgtinker"
+
+ def _handle_blender_executable_button_clicked(self):
+ # from this tutorial - https://www.youtube.com/watch?v=gg5TepTc2Jg&t=649s
+ path_selection = QFileDialog.getOpenFileName(
+ self,
+ "Locate your Blender Executable",
+ str(Path().home()),
+ "*.*",
+ )
+
+ if "blender." in path_selection[0]:
+ self._blender_executable_path = path_selection[0]
+ else:
+ self._blender_executable_path = BLENDER_EXECUTABLE_PATH_MISSING_STRING
+
+ logger.info(f"User selected Blender Executable path:{self._blender_executable_path}")
+ self._blender_executable_label.setText(self._blender_executable_path)
diff --git a/freemocap/gui/qt/widgets/import_videos_window.py b/freemocap/gui/qt/widgets/import_videos_window.py
index 2d15140b..0033cbfa 100644
--- a/freemocap/gui/qt/widgets/import_videos_window.py
+++ b/freemocap/gui/qt/widgets/import_videos_window.py
@@ -4,8 +4,8 @@ from typing import Union
from PyQt6.QtCore import pyqtSignal
from PyQt6.QtGui import QFileSystemModel
-from PyQt6.QtWidgets import QFileDialog, QWidget, QVBoxLayout, QListView, QListWidget, QLabel, QFormLayout, QLineEdit, \
- QTreeView, QPushButton, QDialog, QDialogButtonBox, QInputDialog
+from PyQt6.QtWidgets import QVBoxLayout, QListWidget, QLabel, QFormLayout, QLineEdit, \
+ QTreeView, QPushButton, QDialog
from freemocap.system.paths_and_files_names import get_recording_session_folder_path, SYNCHRONIZED_VIDEOS_FOLDER_NAME
from freemocap.system.start_file import open_file
diff --git a/freemocap/gui/qt/widgets/welcome_panel_widget.py b/freemocap/gui/qt/widgets/welcome_panel_widget.py
index 8e5cd63c..5d1882b3 100644
--- a/freemocap/gui/qt/widgets/welcome_panel_widget.py
+++ b/freemocap/gui/qt/widgets/welcome_panel_widget.py
@@ -10,17 +10,14 @@ from PyQt6.QtWidgets import (
QWidget,
)
-from freemocap.system.paths_and_files_names import PATH_TO_FREEMOCAP_LOGO_SVG, SPARKLES_EMOJI_STRING
from freemocap.gui.qt.actions_and_menus.actions import (
CREATE_NEW_RECORDING_ACTION_NAME,
LOAD_MOST_RECENT_RECORDING_ACTION_NAME,
LOAD_EXISTING_RECORDING_ACTION_NAME,
IMPORT_VIDEOS_ACTION_NAME,
- REBOOT_GUI_ACTION_NAME,
- EXIT_ACTION_NAME,
Actions,
- KILL_THREADS_AND_PROCESSES_ACTION_NAME,
)
+from freemocap.system.paths_and_files_names import PATH_TO_FREEMOCAP_LOGO_SVG, SPARKLES_EMOJI_STRING
logger = logging.getLogger(__name__)
diff --git a/freemocap/gui/qt/workers/anipose_calibration_thread_worker.py b/freemocap/gui/qt/workers/anipose_calibration_thread_worker.py
index 89c7117a..cee28197 100644
--- a/freemocap/gui/qt/workers/anipose_calibration_thread_worker.py
+++ b/freemocap/gui/qt/workers/anipose_calibration_thread_worker.py
@@ -1,4 +1,3 @@
-import asyncio
import logging
import threading
from pathlib import Path
diff --git a/freemocap/parameter_info_models/recording_info_model.py b/freemocap/parameter_info_models/recording_info_model.py
index 304a2d9c..eababdb2 100644
--- a/freemocap/parameter_info_models/recording_info_model.py
+++ b/freemocap/parameter_info_models/recording_info_model.py
@@ -12,7 +12,6 @@ from freemocap.system.paths_and_files_names import (
MEDIAPIPE_REPROJECTION_ERROR_NPY_FILE_NAME,
SYNCHRONIZED_VIDEOS_FOLDER_NAME,
get_blender_file_path,
- get_last_successful_calibration_toml_path,
ANNOTATED_VIDEOS_FOLDER_NAME,
MEDIAPIPE_3D_NPY_FILE_NAME, create_camera_calibration_file_name,
)
diff --git a/freemocap/system/paths_and_files_names.py b/freemocap/system/paths_and_files_names.py
index c600197f..7debe97c 100644
--- a/freemocap/system/paths_and_files_names.py
+++ b/freemocap/system/paths_and_files_names.py
@@ -1,3 +1,4 @@
+import logging
import time
from datetime import datetime
from pathlib import Path
@@ -6,7 +7,6 @@ from typing import Union
import toml
import freemocap
-import logging
logger = logging.getLogger(__name__)
diff --git a/freemocap/system/start_file.py b/freemocap/system/start_file.py
index 501dcebb..75d6fcad 100644
--- a/freemocap/system/start_file.py
+++ b/freemocap/system/start_file.py
@@ -1,4 +1,6 @@
-import os, sys, subprocess
+import os
+import subprocess
+import sys
def open_file(filename):
diff --git a/freemocap/system/user_data/pipedream_pings.py b/freemocap/system/user_data/pipedream_pings.py
index 4e65fc58..1c404e0c 100644
--- a/freemocap/system/user_data/pipedream_pings.py
+++ b/freemocap/system/user_data/pipedream_pings.py
@@ -1,5 +1,6 @@
import logging
import uuid
+
import requests
logger = logging.getLogger(__name__)