From 325f6c6581ab4a22665ca59cd9859b6605a58841 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 23 Apr 2019 16:39:09 -0300 Subject: Added inspector plugin documentation. Fixed plugin bindings. --- doc/classes/Camera.xml | 18 ++++++++++++++++ doc/classes/CanvasItem.xml | 4 ++++ doc/classes/EditorInspectorPlugin.xml | 16 ++++++++++++++ doc/classes/EditorProperty.xml | 39 +++++++++++++++++++++++++++++++++++ doc/classes/MeshTexture.xml | 26 +++++++++++++++++++++++ doc/classes/MultiMesh.xml | 2 ++ doc/classes/Performance.xml | 3 +-- doc/classes/PoolByteArray.xml | 2 ++ doc/classes/Skeleton.xml | 6 ++++++ doc/classes/TextEdit.xml | 8 +++++++ doc/classes/VisualInstance.xml | 12 +++++++++++ doc/classes/VisualServer.xml | 25 +++++++++++++++++++--- editor/editor_inspector.cpp | 3 +++ modules/csg/doc_classes/CSGMesh.xml | 2 ++ modules/csg/doc_classes/CSGShape.xml | 2 +- 15 files changed, 162 insertions(+), 6 deletions(-) create mode 100644 doc/classes/MeshTexture.xml diff --git a/doc/classes/Camera.xml b/doc/classes/Camera.xml index d75203b988..014df2b72a 100644 --- a/doc/classes/Camera.xml +++ b/doc/classes/Camera.xml @@ -101,6 +101,20 @@ + + + + + + + + + + + + + + @@ -156,6 +170,8 @@ The camera's field of view angle (in degrees). Only applicable in perspective mode. Since [member keep_aspect] locks one axis, [code]fov[/code] sets the other axis' field of view angle. + + The horizontal (X) offset of the Camera viewport. @@ -182,6 +198,8 @@ Orthogonal Projection (objects remain the same size on the screen no matter how far away they are). + + Preserves the horizontal aspect ratio. diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index f3e598c17d..82a5679172 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -97,6 +97,10 @@ + + + + diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml index 49efee49f4..dd60c479c6 100644 --- a/doc/classes/EditorInspectorPlugin.xml +++ b/doc/classes/EditorInspectorPlugin.xml @@ -1,8 +1,16 @@ + Plugin for adding custom property editors on inspector. + This plugins allows adding custom property editors to [EditorInspector]. + Plugins are registered via [method EditorPlugin.add_inspector_plugin]. + When an object is edited, the [method can_handle] function is called and must return true if the object type is supported. + If supported, the function [method parse_begin] will be called, allowing to place custom controls at the beginning of the class. + Subsequently, the [method parse_category] and [method parse_property] are called for every category and property. They offer the ability to add custom controls to the inspector too. + Finally [method parse_end] will be called. + On each of these calls, the "add" functions can be called. @@ -13,6 +21,7 @@ + Add a custom control, not necesarily a property editor. @@ -23,6 +32,7 @@ + Add a property editor, this must inherit [EditorProperty]. @@ -35,6 +45,7 @@ + Add am editor that allows modifying multiple properties, this must inherit [EditorProperty]. @@ -43,6 +54,7 @@ + Return true if this object can be handled by this plugin. @@ -51,6 +63,7 @@ + Called to allow adding controls at the beginning of the list. @@ -61,12 +74,14 @@ + Called to allow adding controls at the beginning of the category. + Called to allow adding controls at the end of the list. @@ -85,6 +100,7 @@ + Called to allow adding property specific editors to the inspector. Usually these inherit [EditorProperty] diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml index 2fd7f18461..e187b8156b 100644 --- a/doc/classes/EditorProperty.xml +++ b/doc/classes/EditorProperty.xml @@ -1,12 +1,23 @@ + Custom control to edit properties for adding into the inspector + This control allows property editing for one or multiple properties into [EditorInspector]. It is added via [EditorInspectorPlugin]. + + + + + + + If any of the controls added can gain keyboard focus, add it here. This ensures that focus will be restored if the inspector is refreshed. + + @@ -19,45 +30,65 @@ + If one (or many properties) changed, this must be called. "Field" is used in case your editor can modify fields separately (as an example, Vector3.x). The "changing" argument avoids the editor requesting this property to be refreshed (leave as false if unsure). + Get the edited object. + Get the edited property. If your editor is for a single property (added via [method EditorInspectorPlugin.parse_property]), then this will return it.. + Override if you want to allow a custom tooltip over your property. + + + + + + + + + Add controls with this function if you want them on the bottom (below the label). + When this virtual function is called, you must update your editor. + Used by the inspector, set when property is checkable. + Used by the inspector, when the property is checked. + Used by the inspector, when the property must draw with error color. + Used by the inspector, when the property can add keys for animation/ + Set this property to change the label (if you want to show one) + Used by the inspector, when the property is read-only. @@ -67,6 +98,7 @@ + Emit yourself if you want multiple properties modified at the same time. Do not use if added via [method EditorInspectorPlugin.parse_property] @@ -75,6 +107,7 @@ + Used by sub-inspectors. Emit if what was selected was an Object ID. @@ -83,6 +116,7 @@ + Do not emit this manually, use the [method emit_changed] method instead. @@ -91,12 +125,14 @@ + Used internally, when a property was checked. + Emit if you want to add this value as an animation key (check keying being enabled first). @@ -105,6 +141,7 @@ + Emit if you want to key a property with a single value. @@ -113,6 +150,7 @@ + If you want a sub-resource to be edited, emit this signal with the resource. @@ -121,6 +159,7 @@ + Internal, used when selected. diff --git a/doc/classes/MeshTexture.xml b/doc/classes/MeshTexture.xml new file mode 100644 index 0000000000..915e5f07cc --- /dev/null +++ b/doc/classes/MeshTexture.xml @@ -0,0 +1,26 @@ + + + + Simple texture that uses a mesh to draw itself. + + + Simple texture that uses a mesh to draw itself. It's limited because flags can't be changed and region drawing is not supported. + + + + + + + + Set the base texture that the Mesh will use to draw. + + + Set the size of the image, needed for reference. + + + Set the mesh used to draw. It must be a mesh using 2D vertices. + + + + + diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index 723ba7ea2b..7148871e8c 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -116,6 +116,8 @@ Format of transform used to transform mesh, either 2D or 3D. + + diff --git a/doc/classes/Performance.xml b/doc/classes/Performance.xml index 8067095cce..3860511615 100644 --- a/doc/classes/Performance.xml +++ b/doc/classes/Performance.xml @@ -57,8 +57,7 @@ Number of nodes currently instanced in the scene tree. This also includes the root node. - - Number of instanced nodes that aren't included in the scene tree. + 3D objects drawn per frame. diff --git a/doc/classes/PoolByteArray.xml b/doc/classes/PoolByteArray.xml index 012a38a3ea..f46cb243d7 100644 --- a/doc/classes/PoolByteArray.xml +++ b/doc/classes/PoolByteArray.xml @@ -113,6 +113,8 @@ + + Return SHA256 string of the PoolByteArray. diff --git a/doc/classes/Skeleton.xml b/doc/classes/Skeleton.xml index 4377cf52c3..8fab778a48 100644 --- a/doc/classes/Skeleton.xml +++ b/doc/classes/Skeleton.xml @@ -134,6 +134,12 @@ + + + + + + diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 18dc82d377..1817055bab 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -418,6 +418,14 @@ Emitted when the cursor changes. + + + + + + + + diff --git a/doc/classes/VisualInstance.xml b/doc/classes/VisualInstance.xml index 381679f8bb..59f0a531dd 100644 --- a/doc/classes/VisualInstance.xml +++ b/doc/classes/VisualInstance.xml @@ -14,6 +14,18 @@ Returns the [AABB] (also known as the bounding box) for this VisualInstance. + + + + + + + + + + + + diff --git a/doc/classes/VisualServer.xml b/doc/classes/VisualServer.xml index 0030795a6b..87bf0b79b6 100644 --- a/doc/classes/VisualServer.xml +++ b/doc/classes/VisualServer.xml @@ -66,6 +66,22 @@ + + + + + + + + + + + + + + + + @@ -173,12 +189,15 @@ - + - + + + + + - Adds a [Mesh] to the [CanvasItem]'s draw commands. Only affects its aabb at the moment. diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index f7527763eb..b0a1331b2e 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -805,6 +805,9 @@ void EditorProperty::_bind_methods() { ClassDB::bind_method(D_METHOD("get_tooltip_text"), &EditorProperty::get_tooltip_text); + ClassDB::bind_method(D_METHOD("add_focusable", "control"), &EditorProperty::add_focusable); + ClassDB::bind_method(D_METHOD("set_bottom_editor", "editor"), &EditorProperty::set_bottom_editor); + ClassDB::bind_method(D_METHOD("emit_changed", "property", "value", "field", "changing"), &EditorProperty::emit_changed, DEFVAL(StringName()), DEFVAL(false)); ADD_PROPERTY(PropertyInfo(Variant::STRING, "label"), "set_label", "get_label"); diff --git a/modules/csg/doc_classes/CSGMesh.xml b/modules/csg/doc_classes/CSGMesh.xml index c1f04d724a..afe0bc262d 100644 --- a/modules/csg/doc_classes/CSGMesh.xml +++ b/modules/csg/doc_classes/CSGMesh.xml @@ -11,6 +11,8 @@ + + The mesh resource to use as a CSG shape. diff --git a/modules/csg/doc_classes/CSGShape.xml b/modules/csg/doc_classes/CSGShape.xml index 2311830ae0..7fa7c78534 100644 --- a/modules/csg/doc_classes/CSGShape.xml +++ b/modules/csg/doc_classes/CSGShape.xml @@ -1,5 +1,5 @@ - + The CSG base class. -- cgit v1.2.3