Skip to content

Commit

Permalink
Add editor documentation for KraImporter
Browse files Browse the repository at this point in the history
  • Loading branch information
2shady4u committed Aug 15, 2024
1 parent b28a13f commit b05cd20
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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.*

## <a name="functions">Functions</a>
## <a name="methods">Methods</a>

- void **load(** String path **)**

Expand Down
6 changes: 4 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion demo/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
58 changes: 58 additions & 0 deletions doc_classes/KraImporter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<class name="KraImporter" inherits="RefCounted"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
Class that allows natively importing Krita [code]*.kra[/code] &amp; [code]*.krz[/code]-archives straight into the Godot editor.
</brief_description>
<description>
</description>
<tutorials>
<link title="Repository's README.md">https://github.com/2shady4u/godot-krita-importer/blob/main/README.md</link>
</tutorials>
<methods>
<method name="load">
<return type="void" />
<description>
Load a KRA or KRZ-archive file and populate the internal layer structure.
</description>
</method>
<method name="get_layer_data_at">
<return type="Dictionary" />
<description>
Return the layer_data of the layer at the given top-level index.
</description>
</method>
<method name="get_layer_data_with_uuid">
<return type="Dictionary" />
<description>
Return the layer_data of the layer with the given UUID.
</description>
</method>
</methods>
<members>
<member name="layer_count" type="int" default="0">
Number of loaded layers at the top level of the document's layer structure.
</member>
<member name="verbosity_level" type="int" default="1">
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]
</member>
</members>
<signals>
</signals>
<constants>
<constant name="QUIET" value="0">
Don't print anything to the console.
</constant>
<constant name="NORMAL" value="1">
Print essential information to the console.
</constant>
<constant name="VERBOSE" value="2">
Print additional information to the console.
</constant>
<constant name="VERY_VERBOSE" value="3">
Same as [constant VERBOSE].
</constant>
</constants>
</class>

0 comments on commit b05cd20

Please sign in to comment.