diff --git a/README.md b/README.md index 0c6ce7e..543fb99 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # 4DOverviewWB 4DOverview: A K.I.S.S. FreeCAD Workbench for easy **VISUAL** file management within FreeCAD, including overview, Time Travel, Assets, Bill of Process, Bill of Materials, and more. -All features are not ready yet, this workbench is in developpement. +All features are not ready yet, this workbench is in development. The goal of this workbench is to gather, in a simple and practical way, various small macros I’ve developed over time to streamline the management of my FreeCAD projects. ## Functionalities @@ -33,34 +33,40 @@ The goal of this workbench is to gather, in a simple and practical way, various **General Presentation** -[4DOverview : Un Workbench FreeCAD qui organise TOUT , The Ultimate Visual Manager](https://youtu.be/kXRMw0q2pHw) +[4DOverview : Un Workbench FreeCAD qui organise TOUT, The Ultimate Visual Manager](https://youtu.be/kXRMw0q2pHw) + +**Important note: please just enable auto-dubbing for the English translation when watching video** + +--- - -please just enable auto-dubbing for the English translation. - --- ## Quick Start ### Manual installation -#### 1. Find where are located your FreeCAD's workbenches -The install path for FreeCAD modules depends on the operating system used. -To find where is the user's application data directory enter next command on FreeCAD's Python console. -App.getUserAppDataDir() -Examples on different OS +
Expand to view manual installation options -Linux: /home/user/.local/share/FreeCAD/Mod/ (/home/user/.local/share/FreeCAD/v1-1/Mod (for instance if you use a developper version)) +#### 1. Locate where FreeCAD stores workbenches on your system +The install path for FreeCAD modules depends on the operating system used. +To find where is the user's application data directory enter next command on FreeCAD's Python console. +`App.getUserAppDataDir()` -macOS: /Users/user/Library/Preferences/FreeCAD/Mod/ +##### Examples on different OS -Windows: C:\Users\user\AppData\Roaming\FreeCAD\Mod\ +* **Linux**: `/home/user/.local/share/FreeCAD/Mod/` (`/home/user/.local/share/FreeCAD/v1-1/Mod` (for instance if you use the development version)) +* **macOS**: `/Users/user/Library/Preferences/FreeCAD/Mod/` +* **Windows**: `C:\Users\user\AppData\Roaming\FreeCAD\Mod\` #### 2. Download 4DOverview -git clone https://github.com/GA3Dtech/4DOverview.git (in the .../Mod/ folder of your operating system) +``` +cd <(Mod/ folder of your operating system)> +git clone https://github.com/GA3Dtech/4DOverview.git +``` +or browse https://github.com/GA3Dtech/4DOverviewand +click on code button to download the ZIP archive of the depository, unzip it, rename the Folder "4DOverview-main" into "4DOverview", and paste the "4DOverview" folder into the .../Mod/ folder -or go on https://github.com/GA3Dtech/4DOverview, and click on code button to download the ZIP archive of the depository, unzip it, rename the Folder "4DOverview-main" into "4DOverview" ,and paste the "4DOverview" folder in the .../Mod/ folder of your operating system. +Restarting FreeCAD is necessary to then load the workbench, you should find it the Workbench list (menu - View - Workbench) -restarting FreeCAD is necessary to then load the workbench, you should find it the wb list (menu - View - Workbench) +
- --- ## How it works It is done for an organisation of files like this @@ -119,9 +125,9 @@ RootFolder/ . . - - --- + ## Maintainer GA3Dtech - Alain D. G. - --- + +## License \ No newline at end of file diff --git a/docs/HISTORICAL_README.md b/docs/HISTORICAL_README.md index 4b0e367..6b17c90 100644 --- a/docs/HISTORICAL_README.md +++ b/docs/HISTORICAL_README.md @@ -15,7 +15,7 @@ pip install freecad.workbench_starterkit pip uninstall freecad.workbench_starterkit ``` -**Note:** There are currently two FreeCAD workbench styles. The origin workbench type is called "legacy-workbench". In addition the "namespace-workbench" is now an optional (and preffered) way to extend the FreeCAD. (See [Glossary terms used in this discussion](#glossary-terms-used-in-this-discussion-that-may-lead-to-confusion)). For more discussion about the motivation behind the "namespace-workbench" see [Motivation for namespace-workbenches](#motivation-for-namespace-workbenches). +**Note:** There are currently two FreeCAD workbench styles. The origin workbench type is called "legacy-workbench". In addition the "namespace-workbench" is now an optional (and preferred) way to extend the FreeCAD. (See [Glossary terms used in this discussion](#glossary-terms-used-in-this-discussion-that-may-lead-to-confusion)). For more discussion about the motivation behind the "namespace-workbench" see [Motivation for namespace-workbenches](#motivation-for-namespace-workbenches). ### Changing variables and strings @@ -185,7 +185,7 @@ There are several reasons why you might consider using the namespace-workbenche 3. Integrating with [PyPI](https://pypi.org/) / [pip](https://pip.pypa.io/en/stable/). The ability to `pip install freecad.myworkbench` (See [related forum discussion](https://forum.freecadweb.org/viewtopic.php?f=10&t=38476&p=326444#p326574)). 4. InitGui.py and Init.py (legacy-workbenches) do not behave like expected because these files are called with exec and are not properly imported. This leads to problems like: - - `__file__` not useable to get the path to the python file + - `__file__` not usable to get the path to the python file - predefined variables ### Tip diff --git a/freecad/_4d_overview_wb/core/CentralWindowOverview.py b/freecad/_4d_overview_wb/core/CentralWindowOverview.py index 184c006..fc5486f 100644 --- a/freecad/_4d_overview_wb/core/CentralWindowOverview.py +++ b/freecad/_4d_overview_wb/core/CentralWindowOverview.py @@ -112,7 +112,7 @@ def on_thumbnail_clicked(self, path): QtWidgets.QMessageBox.information(self, "Action thumbnail clicked", f"File not found: {fcstd}") -# --- function to find all file .fcstd in the folder --- +# --- function to find all .FCStd files in the folder --- def fForAllFcstd(folder_path) : for filename in os.listdir(folder_path): @@ -126,7 +126,7 @@ def fForAllFcstd(folder_path) : # code for each file mycode(doc) - # Sauvegarder le document + # Save the document # doc.save() # close file @@ -146,7 +146,7 @@ def fForAllFcstdO(folder_path) : # code for each file mycodeO(doc) - # Sauvegarder le document + # Save the document # doc.save() # close file @@ -193,7 +193,7 @@ def mycodeO (doc): raise FileNotFoundError except Exception: - # fallback : capture de la vue actuelle + # fallback: capture of the current view FreeCAD.Console.PrintMessage("No Miniature found , capture scene instead.\n") view = FreeCADGui.ActiveDocument.ActiveView @@ -263,13 +263,13 @@ def mycode (doc): raise FileNotFoundError except Exception: - # fallback : capture de la vue actuelle + # fallback: capture of the current view FreeCAD.Console.PrintMessage("No Miniature found , capture scene instead.\n") view = FreeCADGui.ActiveDocument.ActiveView if False : - # Export GLTF (toute la scène visible) + # Export GLTF (the entire scene visible) try: import ImportGui visible_objs = [] @@ -278,16 +278,16 @@ def mycode (doc): if hasattr(obj, "ViewObject") and getattr(obj.ViewObject, "Visibility", True): visible_objs.append(obj) except Exception: - # sécurité : on inclut par défaut si pas d'attribut + # security: it's included by default if no attribute visible_objs.append(obj) if visible_objs: ImportGui.export(visible_objs, gltf_path) FreeCAD.Console.PrintMessage("Export GLTF réussi.\n") else: - FreeCAD.Console.PrintMessage("Aucun objet visible à exporter.\n") + FreeCAD.Console.PrintMessage("No visible objects to export.\n") except Exception as e: - FreeCAD.Console.PrintError(f"Erreur export GLTF: {e}\n") + FreeCAD.Console.PrintError(f"GLTF export error: {e}\n") FreeCAD.Console.PrintMessage(f"Version {new_version} saved in {project_dir}\n") diff --git a/freecad/_4d_overview_wb/core/CentralWindowProjectBrowser.py b/freecad/_4d_overview_wb/core/CentralWindowProjectBrowser.py index 2957bc6..e5bfcf0 100644 --- a/freecad/_4d_overview_wb/core/CentralWindowProjectBrowser.py +++ b/freecad/_4d_overview_wb/core/CentralWindowProjectBrowser.py @@ -147,7 +147,7 @@ def on_project_clicked(self, project_path: str): # ============================================================================ class ProjectThumbnail(QtWidgets.QFrame): - """Miniature cliquable représentant un projet entier""" + """Clickable thumbnail representing an entire project""" clicked = QtCore.Signal(str) def __init__(self, project_dir: Path, pixmap: QtGui.QPixmap, size=200): diff --git a/freecad/_4d_overview_wb/core/StartDockWidget.py b/freecad/_4d_overview_wb/core/StartDockWidget.py index 22c400d..f27eb14 100644 --- a/freecad/_4d_overview_wb/core/StartDockWidget.py +++ b/freecad/_4d_overview_wb/core/StartDockWidget.py @@ -42,16 +42,17 @@ def __init__(self, parent=None): self.setWindowTitle("4D Overview - Main") layout = QtWidgets.QVBoxLayout(self) - # --- Project Browser view button --- + # --- Project Browser view button --- self.ProjectBrowserButton = QtWidgets.QPushButton("Projects Browser") self.ProjectBrowserButton.setMinimumHeight(40) layout.addWidget(self.ProjectBrowserButton) self.ProjectBrowserButton.clicked.connect(self.functionProjectBrowser) - # --- Ligne horizontale --- + # --- Horizontal line --- + line = QtWidgets.QFrame() - line.setFrameShape(QtWidgets.QFrame.HLine) # Ligne horizontale + line.setFrameShape(QtWidgets.QFrame.HLine) # Horizontal line layout.addWidget(line) # --- Project folder selection --- @@ -68,7 +69,7 @@ def __init__(self, parent=None): - # --- Overview view button --- + # --- Overview view button --- self.OverviewViewButton = QtWidgets.QPushButton("Overview - View") self.OverviewViewButton.setMinimumHeight(40) @@ -89,9 +90,10 @@ def __init__(self, parent=None): layout.addWidget(self.OverviewGeneratorButtonOT) self.OverviewGeneratorButtonOT.clicked.connect(self.functionGenerateOT) - # --- Ligne horizontale --- + # --- Horizontal line --- + line = QtWidgets.QFrame() - line.setFrameShape(QtWidgets.QFrame.HLine) # Ligne horizontale + line.setFrameShape(QtWidgets.QFrame.HLine) # Horizontal line layout.addWidget(line) # --- Asset creator widget button --- @@ -163,7 +165,7 @@ def functionGenerateO(self) : # --- def functionGenerateOT(self) : - print("Generate 4DOverview of the project folder and Versionning") + print("Generate 4DOverview of the project folder and Versioning") if self.path == None : self.selectFolder() @@ -227,10 +229,10 @@ def functionTimeInc(self) : def start () : - # create the dock + # create the dock main_win = FreeCADGui.getMainWindow() - #check if already activated + # check if already activated dock_name = "FourOverviewMainPanel" existing_dock = main_win.findChild(QtWidgets.QDockWidget, dock_name) @@ -246,7 +248,7 @@ def start () : else : - print(f"The pannel '{dock_name}' is already open, bring it front") + print(f"The panel '{dock_name}' is already open, bring it front") existing_dock.show() existing_dock.raise_()