Plugin Loader

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
TT-RS
Posts: 70
Joined: Fri Oct 24, 2014 9:19 pm

Re: Plugin Loader

Postby TT-RS » Sat May 09, 2015 7:44 pm

Good job, but I would divide macros and WBs into two groups.

As yorik said, macros are (many times) simple scripts and they differ from WBs wchich are larger, more complicated (and have more data, "header", etc.). Your script should give possibility to have both up to date and download them automatically or by user command from GITHUBs, BITBUCKEDs and other websites of this kind. I think only WBs should have header ("meta data") and of course possibilty to turn them on or off. Another thing is to divide WBs into functionality groups - in DS CATIA it is made very good. CATIA WBs are grouped into: Design, Manufacturing, Routing and Tubing, FEA,...etc.
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Plugin Loader

Postby microelly2 » Sun May 10, 2015 8:58 am

TT-RS wrote: I would divide macros and WBs into two groups.
Yes it will be possible, but there are other classes too: Part Library, Bolts Library
Your script should give possibility to have both up to date and download them automatically or by user command from GITHUBs, BITBUCKEDs and other websites of this kind. I think only WBs should have header ("meta data") and of course possibilty to turn them on or off.
Automated update requires a version information. from git I can read the last commit date but i still dont know how to handle data stored otherwise.
One idea ist to have a central database, where devoloper can register their commits.
Of course nearly all attributes are optional.
Another thing is to divide WBs into functionality groups - in DS CATIA it is made very good. CATIA WBs are grouped into: Design, Manufacturing, Routing and Tubing, FEA,...etc.
Already started :
viewtopic.php?f=10&t=10844&start=20#p87482
A usefule division into tabs will be done next days.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Plugin Loader

Postby NormandC » Sun May 10, 2015 11:02 pm

yorik wrote:Okay, I started a repo: https://github.com/FreeCAD/FreeCAD-macros
I'll copy/paste a couple of macros from the wiki so we can test...
I copied two macros and created a new topic.

viewtopic.php?f=21&t=10905

I wasn't sure if those few posts about the FreeCAD-macros repo should have been split into a separate topic...
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Plugin Loader

Postby microelly2 » Tue May 12, 2015 10:05 pm

I have changed the working name to Plugin Mangager - so I can merge all kinds of extension
but they need to be grouped

this is my first try:

# tabs of the manager window
tabs:
0 My Favorites:
PartDesign: *PartDesign
Part: *Part
Draft: *Draft
Drawing: *Dang
DrawingDim: *Ddim
FEM: *FEM
Cura Engine: *cura
#---------------------------------------------------------------
1 Pre: # activities before CAD
3 Image WB: *Imag
2 Reverse WB: *Rein
1 Import WB:
exec: import FreeCAD;FreeCAD.Console.PrintWarning("I'm the Importer!")

2 CAD:
# workbenches
1 PartDesign WB: *PartDesign
2 Part WB: *Part
3 Draft WB: *Draft
7 Assembly2 WB: *Ass2
4 OpenSCAD WB: *Scad
5 Mesh WB: *Mesh
# macros
0 Workfeature : *wofe
# add objects
A Bolts Lib: *bolt
B Screw maker Macro: *screw
C Part Lib : *pali

Create Box:
exec: FreeCAD.ActiveDocument.addObject("Part::Box","Box")
icon: AppHomePath/Mod/plugins/icons/part.png
Solid Sweep Macro: *Sweep
Circular Text Macro: *cirtex

3 Simulation: # after CAD - Test the model
# Analyse
1 FEM WB: *FEM
3 Animation WB : *Anim
2 Inspection WB: *Insp

4 Post: # after CAD - produce documentation
1 Drawing WB: *Dang
3 DrawingDim WB: *Ddim
2 Symbol Lib: *symli
4 Exploded Assembly Animation: *Exan
5 Raytraicing WB: *Rayt
6 Plot WB: *Plot
7 Points WB: *Poin

5 CAM: # production interface
1 Export WB:
exec: import FreeCAD;FreeCAD.Console.PrintWarning("I'm the Exporter!")
3 Cura Engine WB: *cura
2 Path WB:
exec: import FreeCAD;FreeCAD.Console.PrintWarning("I'm the Path workbench!")
4 Slicer Macro: *Slim


6 Config: # spiritual design
Spreedsheet WB: *Calc
Sipoc Macro: *sipoc

7 Special: # branches
Architecture WB: *Arch # Architecture
PCB WB: *pcb
Ship WB: *Ship
Robot WB: *Robo
#Sheet Metal ...
Sheet Metal Unfolder Macro: *Unfold
Box Unfold Macro: *Bum
School WB:
exec: import FreeCAD;FreeCAD.Console.PrintWarning("I'm the School workbench!")


8 Helper: # not realy needed in production workflow
Sketcher WB: *Sket
Start WB: *Start
Test WB: *Test
Web WB: *Web

9 Not Categorized: # dont know where to place
Reference WB: *Refe

#Other Workbenches:
# reuse entries by links
# create individual entries outside the database

My Tests:
1 Dummy Macro:
exec: import FreeCAD;FreeCAD.Console.PrintWarning("Nothing to do!")
icon: AppHomePath/Mod/plugins/icons/master.png
2 Greeting Macro :
exec: FreeCAD.Console.PrintWarning("Hello World!")
icon: AppHomePath/Mod/plugins/icons/sun.png
3 My Test Macro: *Mymacro

# two toolbars - examples faster than menues
toolbars:
toolbar1:
FEM: *FEM
PCB: *pcb
Cura Engine: *cura
toolbar2:
Solid Sweep: *Sweep
Sheet Metal Unfolder: *Unfold
Circular Text: *cirtex


Please give me feedback how to categorize/organize it all

My idea was a workflow pre-cad -> cad -> test the design -> post cad -> cam

and some extra categories
workbenches/macros can occur in different tabs

I have added some screen shots for the first steps (icons come soon)


bn_659.png
bn_659.png (17.98 KiB) Viewed 2155 times
bn_656.png
bn_656.png (36.33 KiB) Viewed 2155 times
bn_657.png
bn_657.png (15.39 KiB) Viewed 2155 times
bn_658.png
bn_658.png (23.53 KiB) Viewed 2155 times
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Plugin Manager

Postby microelly2 » Sun May 17, 2015 10:37 am

bn_662.png
bn_662.png (64.1 KiB) Viewed 2102 times
https://youtu.be/ASLeOVUf8ac

I think this will be the final laylout. Now I start to migrate the macros and workbenches ...
(and translate the doc http://freecadbuch.de/doku.php?id=pluginmanager)
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Plugin Manager

Postby microelly2 » Tue May 19, 2015 8:57 pm

I have added toolbar management

define extra toolbar(s) for your workbenches
reuse toolbar-collections or single toolbar
reuse button/icon definitions
bn_669.png
bn_669.png (137.64 KiB) Viewed 2054 times
demo https://youtu.be/GPvd7a6PKnk
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Plugin Loader

Postby microelly2 » Thu Jun 11, 2015 1:57 pm

I have added two new Plugins found these days:

sheetmetal workbench viewtopic.php?f=8&t=11302
kerkythea render exporter viewtopic.php?f=21&t=11200&p=90105

May be usefule to have the kerkythea installed too this way !?
bn_680.png
bn_680.png (183.94 KiB) Viewed 1960 times

Code: Select all


  sheetmetal: &sheetmetal
    name: sheetmetal
    status: noignore
    web: http://forum.freecadweb.org/viewtopic.php?f=8&t=11302
    description: Sheet metal 
    author: shaise
    source: https://github.com/shaise/FreeCAD_SheetMetal/archive/master.zip
    method: zip
    sourcedir: FreeCAD_SheetMetal-master
    destdir: UserAppData/Mod/FreeCAD_SheetMetal
    exec: FreeCADGui.activateWorkbench("MyWorkbench")
    icon: UserAppData/Mod/FreeCAD_SheetMetal/Resources/icons/AddWall.svg

#http://forum.freecadweb.org/viewtopic.php?f=8&t=11302	 
#http://theseger.com/projects/2015/06/sheet-metal-addon-for-freecad/

  kerkythea: &kerkythea
     name: kerkythea exporter
     status: noignore
     web: http://www.freecadweb.org/wiki/index.php?title=Macro_FreeCAD_to_Kerkythea
     source: https://github.com/marmni/FreeCAD-Kerkythea/archive/master.zip
     author: marmni
     sourcedir: FreeCAD-Kerkythea-master
     destdir:  AppHomePath/Mod/plugins/FreeCAD-Kerkythea
     menu: FreeCAD-Kerkythea
     exec: fn="AppHomePath/Mod/plugins/FreeCAD-Kerkythea/exportToKerkythea.FCMacro";d={};exec(open(fn).read(),d,d)
     icon: AppHomePath/Mod/plugins/icons/camera-photo.png

abdullah
Posts: 3565
Joined: Sun May 04, 2014 3:16 pm

Re: Plugin Loader

Postby abdullah » Thu Jun 11, 2015 6:49 pm

I think you are doing a great job with this plugin loader.

I think that somebody else already suggested it in the past (I do not know how it evolved). Is not it possible to install this under /home/username/ ?

I mean the biggest issue I see is that I have to create "/usr/lib/freecad/Mod/plugins" and give my user writting permissions...
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Plugin Loader

Postby microelly2 » Thu Jun 11, 2015 7:36 pm

It will become configurable.

My targets are students which work in a pc pool.
so first I need one manager/administrator on each pc to install alluser apps and the opportunity to give every user the right to install some apps in his private storage.
The manager decides where the apps will be stored: Prefix UserAppData means local installation, AppHomePath means global install.
marmni
Posts: 44
Joined: Sat Nov 30, 2013 3:53 pm

Re: Plugin Loader

Postby marmni » Thu Jun 11, 2015 8:08 pm

I spotted that some icons are taken from
/usr/lib/freecad/Mod/plugins/icons/
and some from
/usr/lib/freecad/Mod/mylib/icons/

Maybe You can add bigger stretch value for marked row.
Zaznaczenie_002.png
Zaznaczenie_002.png (35.03 KiB) Viewed 1927 times
It will become configurable.
Is not it possible to install this under /home/username/ ?
I look forward for that change, because keeping that under /usr/lib/ is problematic.

Now everything is in one place, great job!