Document for Developer

This is guide for developer.

Introduction

First, Marutools has addon system. You can make addon in very easy steps.

Tutorial

Here comes addon making tutorial.

Get started

First, you have to decide that it is big addon or small addon. Big addon is consisted with folder(it’s same as python package). Small addon is consisted with only one python script. It can change later, but it may be hard.

Now, Marutools contain only Marueditor. So, you can make addon only for editor.

This is base code:

 1class Edit():
 2    name=""
 3    description=""
 4    file_types=[""]
 5    def __init__(self, api):
 6        self.api=api
 7    def save(self, file=None):
 8        pass
 9    def new(self):
10        pass
11    def close(self):
12        pass

addon_base.py

class Edit
name: str

Addon name.

description: str

Addon description string.

file_types: list[str]

You can write like this: ["txt","py", ....]

__init__(api)

Calls on file open. self will share.

Parameters

api (libmarusoftware.addon.AddonAPI) – AddonAPI. You will use this to control UI, settings, and etc… Please keep this for later

save(file=None)

Calls on file saving.

Parameters

file (str or None) – When “save as…” is selected, here comes new file path.

new()

Calls on new file created.

close()

Calls on file closing.

On __init__, api object will pass. api object has many api. Please see Addon API Reference.

You can write just as python. Happy coding!!