From b05cd208b9ed94d12aa0037f90b9c1d619c37411 Mon Sep 17 00:00:00 2001 From: 2shady4u Date: Thu, 15 Aug 2024 18:48:32 +0200 Subject: [PATCH] Add editor documentation for KraImporter --- README.md | 4 +-- SConstruct | 6 ++-- demo/project.godot | 2 +- doc_classes/KraImporter.xml | 58 +++++++++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 doc_classes/KraImporter.xml diff --git a/README.md b/README.md index a911c75..7f33b63 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Plugin for Godot Engine to automatically import Krita KRA & KRZ-files - [How to install?](#how-to-install) - [How to use?](#how-to-use) - [Variables](#variables) - - [Functions](#functions) + - [Methods](#methods) - [FAQ](#faq) - [How to contribute?](#how-to-contribute) @@ -69,7 +69,7 @@ In cases where more advanced importing functionality is wanted or required, the ***NOTE:** VERBOSE and higher levels might considerably slow down the importing process due to excessive logging.* -## Functions +## Methods - void **load(** String path **)** diff --git a/SConstruct b/SConstruct index ec71ce0..705621e 100644 --- a/SConstruct +++ b/SConstruct @@ -1,6 +1,4 @@ #!/usr/bin/env python -import os -import sys target_path = ARGUMENTS.pop("target_path", "demo/addons/godot-krita-importer/bin/") target_name = ARGUMENTS.pop("target_name", "libkra_importer") @@ -52,6 +50,10 @@ else: env["SHLIBSUFFIX"] ) +if env["target"] in ["editor", "template_debug"]: + doc_data = env.GodotCPPDocData("src/gen/doc_data.gen.cpp", source=Glob("doc_classes/*.xml")) + sources.append(doc_data) + if env["platform"] == "macos": # For compiling zlib on macOS, an additional compiler flag needs to be added! # See: https://github.com/HaxeFoundation/hxcpp/issues/723 diff --git a/demo/project.godot b/demo/project.godot index b2fd412..e0f167a 100644 --- a/demo/project.godot +++ b/demo/project.godot @@ -12,7 +12,7 @@ config_version=5 config/name="Krita Importer Demo" run/main_scene="res://Main.tscn" -config/features=PackedStringArray("4.2") +config/features=PackedStringArray("4.3") config/icon="res://icon.png" [debug] diff --git a/doc_classes/KraImporter.xml b/doc_classes/KraImporter.xml new file mode 100644 index 0000000..de6b077 --- /dev/null +++ b/doc_classes/KraImporter.xml @@ -0,0 +1,58 @@ + + + + Class that allows natively importing Krita [code]*.kra[/code] & [code]*.krz[/code]-archives straight into the Godot editor. + + + + + https://github.com/2shady4u/godot-krita-importer/blob/main/README.md + + + + + + Load a KRA or KRZ-archive file and populate the internal layer structure. + + + + + + Return the layer_data of the layer at the given top-level index. + + + + + + Return the layer_data of the layer with the given UUID. + + + + + + Number of loaded layers at the top level of the document's layer structure. + + + The verbosity_level determines the amount and depth of logging to the Godot console. + [i][b]NOTE:[/b] [constant VERBOSE] and higher levels might considerably slow down your queries due to excessive logging.[/i] + + + + + + + Don't print anything to the console. + + + Print essential information to the console. + + + Print additional information to the console. + + + Same as [constant VERBOSE]. + + + \ No newline at end of file