Author Topic: What's the difference between Modules and Plug-ins?  (Read 6645 times)

tomek

  • Full Member
  • ***
  • Posts: 29
    • View Profile
    • About Me
What's the difference between Modules and Plug-ins?
« on: August 06, 2015, 05:20:43 PM »
I don't seem to be able to find this well defined anywhere.


cheers,
-tomek

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: What's the difference between Modules and Plug-ins?
« Reply #1 on: August 07, 2015, 09:49:08 AM »
A module is a script that can be loaded in your layout to add features or functionality. Think of this as includes - for example, there is a file module you can load to help read files, or my animate module which allows you to add animations to objects.

Modules is similar to using fe.do_nut() to run a script, except it's a common location so that all layouts can make use of the script.

A Plugin adds functionality to the frontend in Configure -> Plugins menu, across all layouts.

tomek

  • Full Member
  • ***
  • Posts: 29
    • View Profile
    • About Me
Re: What's the difference between Modules and Plug-ins?
« Reply #2 on: August 07, 2015, 10:48:38 PM »
I guess that makes sense, sort of.


Since modules are basically equivalent to the concept of a "module" in any other language, they are generic and can store any sort of code, reusable or not. So plugins could be implemented as modules? If yes then I don't see the point of plugins. But then I haven't actually spent that much time familiarising myself with AM so I might be missing the point entirely.

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: What's the difference between Modules and Plug-ins?
« Reply #3 on: August 09, 2015, 12:53:26 PM »
There could be overlap, yes. Raygun could probably shed some light on this, i think it was discussed before.

Modules was added so scripts could be shared across layouts. For example, the conveyor.nut module allows different layouts to create grid/conveyor layouts for artwork.

Plugins do get their own config and are automatically added to the plugins menu to be enabled/disabled by the end user. They are automatically available (but disabled by default). Modules are loaded on demand by a layout if that layout wants to make use of the modules functionality.

If you are doing something that could help enhance others layouts as well as your own, create a module. If it's something that will enhance the FE experience regardless of layout, use a plugin. If it's only something specific to your layout, then you can use fe.do_nut(). It just depends on what you are looking to do, really.

tomek

  • Full Member
  • ***
  • Posts: 29
    • View Profile
    • About Me
Re: What's the difference between Modules and Plug-ins?
« Reply #4 on: August 10, 2015, 01:37:32 AM »
Thanks all fir the exhaustive answers. I'm just trying to get a good understanding of the system at this stage. It's mostly well thought out and quite intuitive but every now and then I'll come up against something that is not documented and so I have to ask.

-t