diff --git a/README.md b/README.md index 8a47ba8..2ab1109 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ -SmartShape2D ---- +# SmartShape2D + ![Sample Image]( ./addons/rmsmartshape/documentation/imgs/sample.png ) ![Sample Gif]( ./addons/rmsmartshape/documentation/imgs/sample.gif ) -[![🔎 Unit Tests](https://github.com/SirRamEsq/SmartShape2D/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/SirRamEsq/SmartShape2D/actions/workflows/unit_tests.yml) +## About + +![Godot 4.2](https://img.shields.io/badge/Godot-v4.2.x-%23478cbf?logo=godot-engine&logoColor=white) +[![⚙️ CI](https://github.com/SirRamEsq/SmartShape2D/actions/workflows/ci.yml/badge.svg)](https://github.com/SirRamEsq/SmartShape2D/actions/workflows/ci.yml) -# About **This is the GODOT 4 version of this plugin. If you're looking for the GODOT 3 version, please go [here](https://github.com/SirRamEsq/SmartShape2D/tree/Godot3-latest)** @@ -25,29 +27,36 @@ Read the section below on Contributing and post an issue if one doesn't already --- -# Support +## Support + - Newest version is developed for Godot 4 - Older version is supported and tested on Godot 3.2 - Should work with later versions of Godot 3.x -# Demo +## Demo + A Sample Godot Project can be found here: https://github.com/SirRamEsq/SmartShape2D-DemoProject -# Documentation -- [How To Install]( ./addons/rmsmartshape/documentation/Install.md ) -- [Quick Start]( ./addons/rmsmartshape/documentation/Quickstart.md ) -- [Using SmartShape2D with Godot 4.0](./addons/rmsmartshape/documentation/Godot4.md) -- [Migrating from 1.x]( ./addons/rmsmartshape/documentation/Migration.md ) -- [Shapes]( ./addons/rmsmartshape/documentation/Shapes.md ) -- [Toolbar]( ./addons/rmsmartshape/documentation/Toolbar.md ) -- [Resources]( ./addons/rmsmartshape/documentation/Resources.md ) -- [Normals]( ./addons/rmsmartshape/documentation/Normals.md ) -- [Controls and Hotkeys]( ./addons/rmsmartshape/documentation/Controls.md ) -- [FAQ]( ./addons/rmsmartshape/documentation/FAQ.md ) -- [Version History]( ./addons/rmsmartshape/documentation/VersionHistory.md ) - -# Video Tutorials +## Documentation +> 🛈 Some documentation is outdated. + +- [How To Install](./addons/rmsmartshape/documentation/Install.md) +- [Quick Start](./addons/rmsmartshape/documentation/Quickstart.md) +- [Using SmartShape2D with Godot 4](./addons/rmsmartshape/documentation/Godot4.md) +- [Shapes](./addons/rmsmartshape/documentation/Shapes.md) +- [Toolbar](./addons/rmsmartshape/documentation/Toolbar.md) +- [Resources](./addons/rmsmartshape/documentation/Resources.md) +- [Normals](./addons/rmsmartshape/documentation/Normals.md) +- [Controls and Hotkeys](./addons/rmsmartshape/documentation/Controls.md) +- [FAQ](./addons/rmsmartshape/documentation/FAQ.md) +- [Version History](./addons/rmsmartshape/documentation/VersionHistory.md) + +## Video Tutorials + +> 🛈 These tutorials are for Godot 3, and some things are different now. +> Please, check [using SmartShape2D with Godot 4](./addons/rmsmartshape/documentation/Godot4.md). + SmartShape2D + Aseprite tutorial can be found here (Thanks Picster!): [![VideoTutorial](https://img.youtube.com/vi/r-pd2yuNPvA/0.jpg)](http://www.youtube.com/watch?v=r-pd2yuNPvA) @@ -56,8 +65,10 @@ SmartShape2D tutorial can be found here (Thanks LucyLavend!): [![VideoTutorial](https://img.youtube.com/vi/45PldDNCQhw/0.jpg)](https://www.youtube.com/watch?v=45PldDNCQhw) -# Contibuting -## Issues +## Contibuting + +### Issues + If you have any suggestions or find any bugs, feel free to add an issue. Please include the following three bits of information in each issue posted: @@ -72,12 +83,14 @@ Some Guidelines for Issues: Issues can be added [here](https://github.com/SirRamEsq/SmartShape2D/issues) -## Development +### Development + We have a set of tests we run against the code (courtesy of [GUT](https://github.com/bitwes/Gut)). If making a merge request, please ensure that the tests pass. If the tests have been updated appropriately to pass, please note this in the merge request. -## Discord +### Discord + We have a Discord server for the plugin. https://discord.gg/mHWDPBD3vu Here, you can: diff --git a/addons/rmsmartshape/documentation/Controls.md b/addons/rmsmartshape/documentation/Controls.md index d8d6f13..424b2d8 100644 --- a/addons/rmsmartshape/documentation/Controls.md +++ b/addons/rmsmartshape/documentation/Controls.md @@ -1,14 +1,17 @@ -SmartShape2D - Controls and Hotkeys ---- +# SmartShape2D - Controls and Hotkeys + + + +## Controls - Point Create -# Controls - Point Create - Add Point - Left Click Anywhere in the viewport - Leave Point Create Mode - ESCAPE -# Controls - Point Edit +## Controls - Point Edit + - Add Point - Either: - Hold ALT and Left Click Anywhere in the viewport @@ -33,7 +36,8 @@ SmartShape2D - Controls and Hotkeys - Hold SHFT + ALT and click - The location of the click will be the the first point of a newly created Shape Node -## Overlap +### Overlap + When multiple points and edges overlap, it can be ambiguous what clicking will do. SmartShape adheres the following rules: - If a control point overlaps a vertex, the control point takes priority diff --git a/addons/rmsmartshape/documentation/FAQ.md b/addons/rmsmartshape/documentation/FAQ.md index 1db737b..ca83607 100644 --- a/addons/rmsmartshape/documentation/FAQ.md +++ b/addons/rmsmartshape/documentation/FAQ.md @@ -1,16 +1,19 @@ -SmartShape2D - FAQ ---- +# SmartShape2D - FAQ + + + +## Why aren't my textures repeating? -# Why aren't my textures repeating? If your textures aren't repeating and look something like this: -![Non-Repeating-Texture-IMG]( ./imgs/faq-texture-repeat.png ) +![Non-Repeating-Texture-IMG](./imgs/faq-texture-repeat.png) The issue is most likely that you need to set the texture's import options in Godot: -![Import-Texture-Settings]( ./imgs/faq-texture-repeat-import.png ) +![Import-Texture-Settings](./imgs/faq-texture-repeat-import.png) + +## Why isn't my shape updaing when I change the Light Mask? -# Why isn't my shape updaing when I change the Light Mask? Each shape is currently rendered by multiple-subnodes (Children Node2Ds). Their owner isn't set, making them invisible in the editor (unless you have debug mode on). @@ -30,7 +33,8 @@ If you need to manually tell the shape to update its rendering, call the set\_as If anyone has any insights on this issue, please feel free to open an issue on this subject and let us know how we might be able to fix it -# Why does changing the width look so ugly? +## Why does changing the width look so ugly? + Changing the width of the quads generally looks best with welding turned off. If welding is on, you can still change the width of the quads, but you may need to play with it a bit. diff --git a/addons/rmsmartshape/documentation/Godot4.md b/addons/rmsmartshape/documentation/Godot4.md index 9129f44..4601f2d 100644 --- a/addons/rmsmartshape/documentation/Godot4.md +++ b/addons/rmsmartshape/documentation/Godot4.md @@ -1,7 +1,6 @@ -Using SmartShape2D with Godot 4.0 ---- +# Using SmartShape2D with Godot 4 -Godot 4 no longer offers `repeat` import option for textures. On how to make textures repeat and +Godot 4 no longer offers `repeat` import option for textures. On how to make textures repeat and set normal maps see [section below.](#repeating-textures-and-normal-textures-with-canvastexture) By default, **shape resources are shared** when the shape is copy-pasted. Editing points will edit every copy of that shape. @@ -11,9 +10,9 @@ To make point geometry unique, press **"Make Unique"** property button in Geomet ## Repeating Textures and Normal Textures with CanvasTexture -Normal textures are no longer set in a material resource. +Normal textures are no longer set in a material resource. -To set normal textures, you can create a `CanvasTexture` resource in the inspector on any property, that allows setting a `Texture2D`. +To set normal textures, you can create a `CanvasTexture` resource in the inspector on any property, that allows setting a `Texture2D`. ![Creating CanvasTexture](imgs/godot4-create-texture-res.png) @@ -21,7 +20,7 @@ To set normal textures, you can create a `CanvasTexture` resource in the inspect ![Assigning Texture, Normal Map and Setting Repeat flag](img/../imgs/godot4-assign-normal-tex.png) -## Converting Projects to Godot 4.0 +## Converting Projects from Godot 3.x Scene files with shapes saved in Godot 3.x should load in Godot 4 project. However, you may encounter some issues. Here is a list of expected problems: 1. Textures are looking weird, not repeated. @@ -31,5 +30,5 @@ Please read the section on [how to set repeat and use normal textures in Godot 4 ## Removed Features -- The Godot 4.0 version of this addon does not support 1.x RMSmartShape2D nodes anymore. +- The Godot 4 version of this addon does not support 1.x RMSmartShape2D nodes anymore. - SS2D_Shape_Meta node was removed, since its functionality is available copy-pasted shapes by default. diff --git a/addons/rmsmartshape/documentation/Install.md b/addons/rmsmartshape/documentation/Install.md index ee79664..3a3d0ca 100644 --- a/addons/rmsmartshape/documentation/Install.md +++ b/addons/rmsmartshape/documentation/Install.md @@ -1,19 +1,20 @@ -SmartShape2D - Install ---- +# SmartShape2D - Install +## Asset Library -# Asset Library - After installing the plugin, you may encounter an error, this is normal. -- You need to restart Godot before using the plugin +- You need to restart Godot before using the plugin. -# Manual Install -- Clone the repository at https://github.com/SirRamEsq/SmartShape2D/tree/godot-release -- Move the "addons/rmsmartshape" folder to your project's "addons" folder -- Open your project in Godot to have the addon install +## Manual Install + +- Clone the repository at https://github.com/SirRamEsq/SmartShape2D. +- Move the "addons/rmsmartshape" folder to your project's "addons" folder. +- Open your project in Godot to have the addon install. - After installing the plugin, you may encounter an error, this is normal. -- Restart Godot +- Restart Godot. + +## Activate Plugin -# Activate Plugin -- After Installing the plugin, activate the plugin by navigating to Project -> Plugins +- After Installing the plugin, activate the plugin by navigating to `Project -> Project Settings... -> Plugins` -![Activate Plugin]( ./imgs/PluginActivate.png ) +![Activate Plugin](./imgs/PluginActivate.png) diff --git a/addons/rmsmartshape/documentation/Migration.md b/addons/rmsmartshape/documentation/Migration.md deleted file mode 100644 index 5f53fd1..0000000 --- a/addons/rmsmartshape/documentation/Migration.md +++ /dev/null @@ -1,16 +0,0 @@ -SmartShape2D - Migration ---- - -The Godot 4.0 version of this addon does not support 1.x RMSmartShape2D nodes anymore. - -On older Godot versions, you can continue to use the deprecated 1.x RMSmartShape2D nodes in your projects, but you cannot edit them with -the 2.x version of the plugin. - -If you want to migrate them to a 2.x SmartShape2D node then you can: -- Select a 1.x RMSmartShape2D node in the Scene tree -- This will add a a single icon in the toolbar -- Pressing this icon will recreate the node as a new 2.x SmartShape2D node. -- All the points, control points, and properties will be intact - -Note, Materials from 1.x cannot be automatically updated. You'll need to create new -2.x Shape Materials. After updating a RMSmartShape2D node, the new shape's material will be set to NULL. diff --git a/addons/rmsmartshape/documentation/Normals.md b/addons/rmsmartshape/documentation/Normals.md index b6d24bb..91c3e7b 100644 --- a/addons/rmsmartshape/documentation/Normals.md +++ b/addons/rmsmartshape/documentation/Normals.md @@ -1,16 +1,17 @@ -Normals ---- +# Normals + +## Default Normals -# Default Normals Even if you assign normal textures to your Edge Material, the normals will look wrong. For example, consider the following image: -![Normals Wrong]( ./imgs/NormalWrong.png ) +![Normals Wrong](./imgs/NormalWrong.png) The normals in the image clearly don't line up with where the light is actually coming from. -# Encoding Normal data in the canvas_item Vertex Shader Color Parameter +## Encoding Normal data in the canvas_item Vertex Shader Color Parameter + As SmartShape renders the edges, the textures and their normal textures are also rotated. This will result in incorrect normals. To solve this, we can use a shader to correctly calculate the normals. @@ -25,20 +26,21 @@ Vertex Shader's Color Parameter. If we set the COLOR ENCODING value to "Normals", we get this: -![Normals wrong with weird diffuse colors]( ./imgs/NormalColors.png ) +![Normals wrong with weird diffuse colors](./imgs/NormalColors.png) Ok, so now the normals still look wrong, but the colors look wrong too. Great. There is one final step before our normals will be correct. We need to decode the normal data in a shader. -# Writing a Shader +## Writing a Shader You'll want to assign a new shader to the Edge Material's material property. This shader will determine how each edge is rendered. Here's a sample shader to decode our normal data and set our actual color to that of our diffuse texture: -``` + +```glsl shader_type canvas_item; varying mat2 NORMAL_MATRIX; @@ -55,4 +57,4 @@ void fragment() { After assigning this shader the the Edge Material's material property, our normals finally look right: -![Normals Correct]( ./imgs/NormalCorrect.png ) +![Normals Correct](./imgs/NormalCorrect.png) diff --git a/addons/rmsmartshape/documentation/Quickstart.md b/addons/rmsmartshape/documentation/Quickstart.md index bd1523a..8eac75a 100644 --- a/addons/rmsmartshape/documentation/Quickstart.md +++ b/addons/rmsmartshape/documentation/Quickstart.md @@ -1,10 +1,13 @@ -SmartShape2D - QuickStart +# SmartShape2D - QuickStart --- -![Finished Image]( ./imgs/Inpsector-EdgeMaterialsNormalRange.png ) +![Finished Image](./imgs/Inpsector-EdgeMaterialsNormalRange.png) If you feel like your workflow with SmartShape2D is a little bit slow, try reading [Controls and Hotkeys](./Controls.md). The hotkeys may help you work with the tool more effectively. -# Creating a Shape +## Creating a Shape + + + - First, instance a node of either: - SS2D_Shape_Open - **SS2D_Shape_Closed** @@ -15,9 +18,10 @@ If you feel like your workflow with SmartShape2D is a little bit slow, try readi - RMSmartShape2D - RMSmartShape2DAnchor -![Nodes]( ./imgs/NewNode-SS2D_Nodes.png ) +![Nodes](./imgs/NewNode-SS2D_Nodes.png) + +## Editing the Shape -# Editing the Shape - After creating the shape node, make sure it's selected and the toolbar appears and is in Point Edit mode - ![Toolbar Default State](./imgs/Toolbar-PointEdit.png) - Hold ALT and Left Click on the viewport to add points @@ -26,19 +30,21 @@ If you feel like your workflow with SmartShape2D is a little bit slow, try readi ![Toolbar Default State](./imgs/ShapeClosed-Untextured.png) -# Setting the Fill Texture of the Shape (Closed Shape only) +## Setting the Fill Texture of the Shape (Closed Shape only) + - To give it some life, we'll want to edit the "Shape Material" in the Inspector - Under "Shape Material" Expand "Fill Textures" and you'll see an empty array - Set the Array's size to '1' - Assign a texture to the newly created slot in the array - After assigning the shape should now have a valid texture - If nothing happens after setting the texture, try to force the shape to update by adjusting one of the points -- **Note that "Fill Textures" does not affect SS2D_Shape_Open Nodes at all** +- **Note that "Fill Textures" does not affect open shapes at all** - If you want to add a normal_texture, you would add it using the "Fill Texture Normals" property ![Fill Texture Set](./imgs/ShapeClosed-FillTextured.png) -# Texturing the Edges +## Texturing the Edges + - This where the rubber hits the road, the real meat of the tool - Under "Shape Material" add an element to the "Edge Meta Materials" property - Shape Material -> Edge Meta Materials @@ -58,7 +64,8 @@ If you feel like your workflow with SmartShape2D is a little bit slow, try readi ![Inspector](./imgs/Inpsector-EdgeMaterial.png) -## Corners +### Corners + - If your shape has sharp 90-degree corners, the texture can look a bit warped in those places - You can specify a unique texture to use for inner and outer corners for each Edge Material - The following Edge Material properties are used for corners @@ -70,14 +77,16 @@ If you feel like your workflow with SmartShape2D is a little bit slow, try readi ![Inspector](./imgs/Inpsector-EdgeMaterialCornerOuter.png) -## Multiple Edge Materials in One Edge +### Multiple Edge Materials in One Edge + - You can add as many Edge Meta Materials as you want to a Shape Material, each with their own Edge Material - For instance, you can add an additional egde with a rock texture (and its own set of corner textures) and have it render behind the grass - To have it render behind the grass, Set the Z index of the meta material ![Inspector](./imgs/Inpsector-EdgeMaterials2.png) -## Normal Range +### Normal Range + - Each Meta material has a Normal Range - The Normal Range indicates when a texture should be rendered - If the normal range is 0 - 360 or 0 - 0, then any angle is considered in range and the edge will always render @@ -95,23 +104,26 @@ If you feel like your workflow with SmartShape2D is a little bit slow, try readi ![Inspector](./imgs/Inpsector-EdgeMaterialsNormalRange.png) -## Material Overrides +### Material Overrides + - Using Material Overrides will allow you to change how specific edges are rendered - For Example, to prevent the left edge from rendering, we'll do the following: - - Select the edge edit button from the toolbar ![]( ./imgs/icon_edge.png ) + - Select the edge edit button from the toolbar ![](./imgs/icon_edge.png) - Right Click the left edge of the shape - Press the "Material Override" Button - Uncheck the "Render" Checkbox -![Edge NoRender]( ./imgs/EdgeEdit-NoRender.png ) +![Edge NoRender](./imgs/EdgeEdit-NoRender.png) - You can use material overrrides to also specify a specific material for a single edge - For example, Checking Render and choosing the "Rock" Edge Material will cause the edge to render as rocks, even though the NormalRange configuration would otherwise have it render as grass -## Multiple Textures +### Multiple Textures + - If more than one texture is specified for an Edge Material, you can specify which texture should be used - Enter Point Edit mode, mouseover a point, and scroll up or down to change the texture index -# Anchoring Nodes to the Shape +## Anchoring Nodes to the Shape + - To anchor nodes directly to the SmartShape2D node, use SmartSahpeAnchor2D - You can then make nodes children to the anchor diff --git a/addons/rmsmartshape/documentation/Resources.md b/addons/rmsmartshape/documentation/Resources.md index 8bfc4d4..9b65ee1 100644 --- a/addons/rmsmartshape/documentation/Resources.md +++ b/addons/rmsmartshape/documentation/Resources.md @@ -1,7 +1,9 @@ -SmartShape2D - Resources ---- +# SmartShape2D - Resources + + + +## Shape Materials -# Shape Materials Shape materials provide all the texture and collision information needed by the SmartShape nodes. Once a shape material is defined, it can be easily reused by any number of SmartShape2D nodes. @@ -24,7 +26,8 @@ Once a shape material is defined, it can be easily reused by any number of Smart - Weld - Whether or not to weld the last quad of an edge with the first quad of the next edge -# Edge Meta Material +## Edge Meta Material + An Edge Meta Material doesn't contain the actual textures used to render an edge like **Edge Material** does. Instead, this resource contains a single **Edge Material** and describes how and when to render the edge. @@ -40,12 +43,13 @@ Instead, this resource contains a single **Edge Material** and describes how and - Offset of the edge - Can use a positive or negative value to draw the edges closer or further from the shape -# Normal Range +## Normal Range + The Normal Range indicates when a texture should be rendered. Each shape will compare the Surface Normal of an edge to the Normal Range in each Edge Meta Material. If the edge's Normal is inside a Meta Material's Normal Range, the Meta Material's Edge Material is rendered. -![NormalRangeVisual]( ./imgs/AngleExplaination.png ) +![NormalRangeVisual](./imgs/AngleExplaination.png) - A Normal Range is specified in Degrees - If the normal range is 0 - 360 or 0 - 0, any angle is considered in range and the edge will always render @@ -54,34 +58,46 @@ If the edge's Normal is inside a Meta Material's Normal Range, the Meta Material - Angle "180" is Facing directly Left - Angle "270" is Facing directly Down -# Edge Material +## Edge Material + The actual textures used to define an edge -## Textures +### Textures + - The primary textures used for the edge - At least one texture must be defined -- Example: ![Grass]( ./imgs/grass.png ) -## Taper Textures +- Example: ![Grass](./imgs/grass.png) + +### Taper Textures + These textures will be used as the first or last quad in an edge. They're named "Taper Textures" because the purpose is to show the edge "tapering off" - Textures_Taper_Left is the first quad in an edge - - Example: ![Grass Taper Left]( ./imgs/grass-taper-left.png ) + - Example: ![Grass Taper Left](./imgs/grass-taper-left.png) - Textures_Taper_Right is the final quad in an edge - - Example: ![Grass Taper Right]( ./imgs/grass-taper-right.png ) -## Corner Textures + - Example: ![Grass Taper Right](./imgs/grass-taper-right.png) + +### Corner Textures + These textures will be used when the edge forms a sharp corner (80 degrees - 100 degrees) These are used because corners can look warped when using only regular textures - Texture_Corner_Inner is used when the corner forms an inner corner - - Example: ![Grass Corner Inner]( ./imgs/grass-corner-inner.png ) + - Example: ![Grass Corner Inner](./imgs/grass-corner-inner.png) - Texture_Corner_Outer is used when the corner forms an outer angle - - Example: ![Grass Corner Outer]( ./imgs/grass-corner-outer.png ) -## Normal Texture and Repeat -To use normal textures, you can create a `CanvasTexture` resource in the inspector on any property, -that allows to set a texture. There you can assign your texture and your normal texture, as well as set + - Example: ![Grass Corner Outer](./imgs/grass-corner-outer.png) + +### Normal Texture and Repeat + +To use normal textures, you can create a `CanvasTexture` resource in the inspector on any property, +that allows to set a texture. There you can assign your texture and your normal texture, as well as set those to `repeat`. -## Repeat Textures + +### Repeat Textures + See previous section. -## Fit Mode + +### Fit Mode + Most likely, the textures you use will not *perfectly* fit the polygon. This setting allows you to determine how SmartShape will rectify this. diff --git a/addons/rmsmartshape/documentation/Shapes.md b/addons/rmsmartshape/documentation/Shapes.md index 42b61a2..b8fc9d0 100644 --- a/addons/rmsmartshape/documentation/Shapes.md +++ b/addons/rmsmartshape/documentation/Shapes.md @@ -1,61 +1,78 @@ -SmartShape2D - Shapes ---- +# SmartShape2D - Shapes Each shape consists of a set of points. You can directly edit either the points or the edges between the points in the viewport. -Shapes are configured to use a [Shape Material]( ./Resources.md#ShapeMaterial ) which determines how the shape is rendered. - -There are three kinds of shapes: -- ![OpenShapeImg]( ./../assets/open_shape.png ) **Open Shape** - - This shape's final point **doesn't** connect to its first point. - - This shape **doesn't** make use of the "Fill Textures" parameter in the ShapeMaterial. -- ![ClosedShapeImg]( ./../assets/closed_shape.png ) **Closed Shape** - - This shape's final point **does** connect to its first point. - - This shape **does** make use of the "Fill Textures" parameter in the ShapeMaterial. -- ![MetaShapeImg]( ./../assets/meta_shape.png ) **Meta Shape** - - This shape sets the points of all children shapes. - - Changing the points of any children shapes will also change the meta shape along with all the meta shapes children. - - Can be edited directly if contains only Open shapes. - - If children include Closed shapes, should only edit the closed shapes. - -# Properties -## Editor Debug +Shapes are configured to use a [Shape Material](./Resources.md#ShapeMaterial) which determines how the shape is rendered. + +A shape can be open or closed. Each new shape starts open. To close a shape, simply add a point on top of the first one. + + +## Properties + +> 🛈 Most properties now have documentation comments. + + + +### Editor Debug + - Will show the bounding box for each quad in the mesh of edges. - Can be helpful to illustrate why a shape doesn't look the way you expect. -## Flip Edges + +### Flip Edges + - Will flip the edges of the shape (invert y). -## Render Edges + +### Render Edges + - Whether or not the edges of the shape should be rendered. -## Collision Size + +### Collision Size + - Size of the collision shape. -## Collision Offset + +### Collision Offset + - Offset of where the collision shape starts and ends. - A **positive** value offsets the collision shape **outwards**. - A **negative** value offsets the collision shape **inwards**. -## Tessellation Stages + +### Tessellation Stages + - Number of stages in the curve tessellation process (Uses Curve2D Internally). - First Param in Curve2D.tessellate. - See [Curve2D Documentation](https://docs.godotengine.org/en/3.2/classes/class_curve2d.html#class-curve2d-method-tessellate). -## Tessellation Tolerence + +### Tessellation Tolerence + - Tolerence Degrees in the curve tessellation process (Uses Curve2D Internally). - Second Param in Curve2D.tessellate. - See [Curve2D Documentation](https://docs.godotengine.org/en/3.2/classes/class_curve2d.html#class-curve2d-method-tessellate). -## Curve Bake Interval + +### Curve Bake Interval + - Bake interval value for Curve2D. - See [Curve2D Documentation](https://docs.godotengine.org/en/3.2/classes/class_curve2d.html#class-curve2d-property-bake-interval). -## Collision Polygon Node Path + +### Collision Polygon Node Path + - The path to the CollisionShape that the SmartShape will use for collision. - Is Autoset when pressing the generate collision button. -## Shape Material + +### Shape Material + - The material that this shape will use to render itself. - For backwards compatibility `fill_texture_z_index` defaults to `-10`. Set this to `0` and enable `fill_texture_show_behind_parent` in order to preserve Godot's normal z-sorting when layering with other nodes. -## Points + +### Points + - **There is no need to edit this property by hand, but you can if you'd like.** - Contains all of the points and meta-data for the points contained in this shape. - This data structure is updated as you manipulate the shape. -## Material Overrides + +### Material Overrides + - **There is no need to edit this property by hand, but you can if you'd like.** - When an edge is given a "Material Override" the data for that edge is stored here. - This data structure is updated as you manipulate the shape. -![EdgeData Popup]( ./imgs/EdgeEdit-MaterialOverride.png ) +![EdgeData Popup](./imgs/EdgeEdit-MaterialOverride.png) diff --git a/addons/rmsmartshape/documentation/Toolbar.md b/addons/rmsmartshape/documentation/Toolbar.md index 2a494a5..ffd31b8 100644 --- a/addons/rmsmartshape/documentation/Toolbar.md +++ b/addons/rmsmartshape/documentation/Toolbar.md @@ -1,12 +1,18 @@ -SmartShape2D - Toolbar ---- +# SmartShape2D - Toolbar + ![Toolbar Default State](./imgs/Toolbar-PointEdit.png) -# Create Mode + + + +## Create Mode + - In this mode you can start creating a new shape. - Left-Click anywhere to add a new point. - Press ESCAPE to exit create mode. -- Hold down ALT and Left-Click to create a point between the two points closest to your mouse. -# Point Mode +- Hold down ALT and Left-Click to create a point between the two points closest to your mouse. + +## Point Mode + - In this mode you can add, delete, and move all of the points that make up a shape - To **Add** a new point to the shape: - Hold down ALT and Left-Click anywhere on the viewport to add a point between the two points closest to your mouse. @@ -17,23 +23,31 @@ SmartShape2D - Toolbar - After the Control Points have been set, you can edit them individually by Left-Clicking and dragging - You can delete control points by right clicking them - To make an empty clone SmartShape2D, hold down ALT + SHIFT and Left-Click anywhere in the viewport. -# Edge Mode + +## Edge Mode + - In this mode you can Move Eges and choose how specific edges are rendered - To **Move** an Edge, Left Click and Drag the Edge - To **Change an Edges Rendering**, right click the edge and press "**Material Override**" -![EdgeData Popup]( ./imgs/EdgeEdit-MaterialOverride.png ) +![EdgeData Popup](./imgs/EdgeEdit-MaterialOverride.png) - This popup allows you to **change how edges are rendered** - **Render** will toggle whether or not this edge will be drawn with Edge Materials - **Set Material** allows you to choose a specific Edge Material to use to render this edge -# Origin Set + +## Origin Set + - This tool allows you to set the origin of any SmartShape - To **Set the Origin** Left Click anywhere on the viewport -# Generate Collision + +## Generate Collision + - If you want your shape to have collision, press this button to autogenerate the collision nodes - The shape will be made a child of a newly created **StaticBody2D** - A sibling node, **CollisionPolygon2D** will also be created and added to the SceneTree - The "Collision Polygon" parameter of the Shape will be set to this sibling **CollisionPolygon2D** -# Snapping + +## Snapping + When Moving / Adding points, snapping will cause the positions of the points to snap to the grid. This works the same as Godot's built-in snapping. You can have snapping either use Global Space, or space relative to the shape's origin. diff --git a/addons/rmsmartshape/documentation/VersionHistory.md b/addons/rmsmartshape/documentation/VersionHistory.md index a217bee..e924a95 100644 --- a/addons/rmsmartshape/documentation/VersionHistory.md +++ b/addons/rmsmartshape/documentation/VersionHistory.md @@ -1,22 +1,21 @@ -Version History ---- +# Version History -# 2.x -## 2.2 +## 2.x +### 2.2 January 4th 2021 -## Fix +### Fix - Fix for crash that would occur when points were aligned *just* right - See issue 66 + https://github.com/SirRamEsq/SmartShape2D/issues/66 -## Features +### Features - Each Edge Material can now have a Material (Shader) - Each Edge Material Meta can have a z-index and z-as-relative set - See issue 64 + https://github.com/SirRamEsq/SmartShape2D/issues/64 -## 2.1 +### 2.1 December 14th 2020 -### Significant Changes from 2.0 +#### Significant Changes from 2.0 - Improved Width handling - Improved Welding - Rendering is now achieved by having multiple child-nodes each render a piece of the shape @@ -32,29 +31,28 @@ December 14th 2020 + Width Grabber for closest point + Preview for adding points - Several Bug fixes and issues closed -### New Features +#### New Features - Meta Shapes Introduced - "Fit mode" added to edge material + Can either squash and stretch the texture or crop it -### Minor Changes +#### Minor Changes - Changes to GUI Theme + More in line with standard Godot - Add windows scripts for running unit tests - Changed default snap settings to 8x8 pixels - -## 2.0 +### 2.0 September 7th 2020 -### Significant Changes from 1.0 +#### Significant Changes from 1.0 - Edge Textures are no longer determined by a cardinal direction (UP, DOWN, LEFT, RIGHT) - Instead, a starting and ending normal angle is specified for each edge - Textures are now defined per-edge instead of per-shape -### New Features +#### New Features - Taper textures - Instead of simply ending, the user can have an edge "taper-off" - Editing by Edges - Material Overrides -### Internal Changes +#### Internal Changes - Completely overhauled everything - A rudimentary constraint system is in place - Closed shapes will add a point when closing, then constrain the added point's position to the first point @@ -66,12 +64,12 @@ September 7th 2020 - Refactored original working code to better support testing - Kept original scripts and classes from version 1.0 to ease importing -# 1.x -## Changes in 1.3 +## 1.x +### Changes in 1.3 This update primarily fixes bugs and improves existing features to be more usable. -### Changes +#### Changes - Merged top/left/right/bottom offset into one variable. render offset -### Fixes +#### Fixes - Input bugs - Edge Flipping - Polygon orientation bugs @@ -79,13 +77,13 @@ This update primarily fixes bugs and improves existing features to be more usabl - Corer quad generation and welding - Collision variables in the RMSmartShapeMaterial working as intended -## Changes in 1.2 -### Tweaks +### Changes in 1.2 +#### Tweaks - Refactoring - Toolbar takes less space - Minor bug fixes -### New Features +#### New Features - Bezier Curves! - Hold shift on a control point to create a curve - Corner Quads! @@ -94,7 +92,7 @@ This update primarily fixes bugs and improves existing features to be more usabl - Edge Moving! - Can move an edge (two points) by pressing SHIFT in move mode and dragging the edge -## Changes in 1.1 +### Changes in 1.1 - Refactoring - Fixed Errors Occuring when Texture Arrays are size '0' but not null - Fixed sync between texture, flip, and width indicies @@ -104,12 +102,12 @@ This update primarily fixes bugs and improves existing features to be more usabl - Snapping - More informative toolbar -## Changes in 1.0 +### Changes in 1.0 - Fixed many debug errors reported related to indexing beyond array sizes - Fixed control point wrapping of RMSmartShapeAnchor2D nodes anchored to RMSmartShape2D nodes. - Tested on newly released 3.2 Godot. -## Changes in 0.91 +### Changes in 0.91 - Edges are calculated in relationship to object space instead of screen space - Added option to allow user to let the object recalculate edges based on screen space. - Fixed uv calculations for flipped textures.