Skip to content

Commit a6b72ad

Browse files
committedFeb 18, 2023
Better duplication options, new mounding on planes, more samples
1 parent 6947f51 commit a6b72ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+6091
-3743
lines changed
 

‎README.md

+32-18
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
12
# Goshapes for Godot 4
23
![goshapes1](https://raw.githubusercontent.com/daleblackwood/goshapes/main/addons/goshapes/logo.png)
34

45
## Intuitive path-based level creation for Godot 4
56

6-
Goshapes makes it easy to rapidly generate levels in Godot 4.
7+
Goshapes makes it easier to rapidly generate level geometry in Godot 4.
78

8-
This tool augments Path3D nodes with abilities to:
9+
This tool augments Path3D nodes with the following abilities:
910
- create custom block meshes (earth, buildings, etc)
1011
- create path meshes (fences, paths, roads)
1112
- scatter instances (trees, rocks, grass, etc)
@@ -21,21 +22,28 @@ You can also use paths to procedurally place instances:
2122

2223
[Screenshots](https://imgur.com/a/R0b3cXD)
2324

25+
### What's New in 1.1.0
26+
Goshapes 1.1.0 has been released Feb 14th, 2023 and follows RC1 of Godot 4. It fixes several issues that arose due to changes throughout the alpha and beta.
27+
- Goshapes' folder structure now correctly adheres to the Godot plugin specification, making it an easy include from the Asset Store.
28+
- Compilation fixes to issues that arose from changes made to GDScript during the Godot 4 alpha period.
29+
- Line-pathed Goshapes now generate much cleaner and more even corners, making squared paths easy to generate.
30+
- Inspector hints have been added.
31+
2432
### Installation
25-
To install, clone this repository into the addons folder of your Godot 4 project, so that its path in your project is `res://addons/goshapes`.
33+
To install, use the Godot Asset Library or clone this repository into the addons folder of your Godot 4 project, so that its path in your project is `res://addons/goshapes`.
2634

2735
### Demo Scene
28-
A sample scene, and some sample shape styles and materials have been included under the `samples` subdirectory. Have a play around there, it should become obvious what the tools can do.
36+
A few sample scenes, and some sample shape styles and materials have been included under the `addons/goshapes/samples` folder. Have a play around there, it should help demonstrate what's possible.
2937

3038
### Editor Tools
3139
Goshapes works mainly in the inspector. You can add a new Goshape through the add menu or the Goshapes menu in the top toolbar.
3240

3341
#### Inspector
3442
![image](https://user-images.githubusercontent.com/386025/174332654-e77556d3-c884-4353-83f6-8269afde5c8a.png)
3543

36-
The inspector will always have shape native properties and path options. Path options can be copied between shapes, while shape native properties are individual.
44+
The inspector will always have shape native properties and path options. Path options can be copied between shapes, while shape native properties are individual. The data for shapes is contained within Resources. This means you can rapidly assemble shapes using preset styles and options or set to local to set custom for each shape.
3745

38-
For a Goshape, all posibilities and configurations can be achieved using **the inspector**.
46+
For a Goshape, all functions and configurations can be achieved using **the inspector**.
3947
- **Axis matched editing** is useful for inorganic shapes like buildings or structures. When enabled it will caused axis-aligned points to move with the point you're currently editing.
4048
- **Invert and recenter** alow you to change the direction and origin respectively.
4149

@@ -53,36 +61,42 @@ Alongside that, there's the Path Options which can be copied between shapes.
5361
#### Choosing Shapers
5462
![image](https://user-images.githubusercontent.com/386025/174336140-0f291c1e-d41a-4062-a36d-d88fd0dacc62.png)
5563

56-
Shapers can be picked from the top of the shaper inspector (Shaper must be expanded.)
64+
### The Shaper Resource: The thing that tells a Goshape what to generate
65+
The Shaper Resource contains the data that is used as instructions for what to generate within the Goshape. You can use these to have your Goshape generate geometry or objects using the type of Shaper used.
5766

58-
#### Blockshapers
67+
Shapers can be picked from the top of the GoShape inspector (Shaper must be expanded.)
68+
69+
#### BlockShapers: The main geometry generator
5970
![image](https://user-images.githubusercontent.com/386025/174334424-8b0242c7-8508-4429-8924-a81d4a2ad140.png)
6071

61-
Blockshapes are the main Shaper type for rendering geometry, they combine up to three shapers to make geometry: the **CapShaper**, the **WallShaper** and the **BottomShaper**. For the most part, this is automatic.
72+
Blockshapers are the main Shaper type for rendering geometry, they combine up to three Shapers to make geometry: the **CapShaper**, the **WallShaper** and the **BottomShaper**. For the most part, this is automatic.
6273

63-
##### Caps
74+
##### The CapShaper (generates a cap at the top, best used as part of a BlackShaper)
6475
There are three cap shaper types: **Flat**, **Plane** and **Line**. Flat and Plane are great for building most shapes (with Plane containing more detail) and Line is useful when using the line PathOption (see above). These three methods alter the triangulation technique used for the caps.
6576

6677
![image](https://user-images.githubusercontent.com/386025/174335390-e10761f4-2ae9-4006-a33f-e115f9df2794.png)
6778

6879
All Cap shapers take a material and render its UVs 1:1 in world space.
6980

70-
##### Walls
81+
##### The WallShapers (generates a wall around the path, best used as part of a BlackShaper)
7182
There are two wall shaper types: **Bevel** and **Mesh**. Bevel will generate a straight wall and allows tapering and bevelling. **MeshWall** is the most useful, allowing you to **create custom geometry and wrap it to a wall**. There are some tricks to creating that geometry, that I go into below (see Making Mesh Walls).
7283

7384
![image](https://user-images.githubusercontent.com/386025/174335860-a66f9344-9209-487b-b2b1-fdd604b1de5c.png)
7485

75-
#### ScatterShapers
86+
#### The ScatterShaper: Useful for randomly placing objects within an area
7687
![image](https://user-images.githubusercontent.com/386025/174336335-7daa2bd6-2e64-4426-88f6-4da5b4f35cee.png)
7788

78-
Scatter shapers allow for spawning of as many instances is needed within an area:
89+
A ScatterShaper allows for as many instances as is needed within an area:
7990
- **Density** controls how likely an instance is to spawn
8091
- **Spread** changes how far apart the instances are (actual distance from neighbour is between 0 and spread * 2
8192
- **Seed** changes the random seed
82-
- **Place on ground** causes the genrnated instances to be placed on the ground using Raytracing
83-
- **Noise** lets you override the inbuilt reandomness
84-
- **Evenness** changes how well aigned the instaces are. The higher the value, the less *organic* the scatter selection is.
93+
- **Place on ground** causes the genernated instances to be placed on the ground using Raycasting
94+
- **Noise** lets you override the inbuilt random function with a noise texture
95+
- **Evenness** changes how well aligned the instances are to each other. The higher the value, the less *organic* the scatter selection is.
96+
8597

98+
### What happened to GDBlocks for Godot 3?
99+
I initially developed this addon for Godot 3, as [GDBlocks](https://github.com/daleblackwood/gdblocks). Goshapes marks an increase in scope that was made possible thanks to new tools and performance improvements in Godot 4 and was developed predominantly during the Godot 4 alpha period. As the change is quite dramatic, I've decided to fork my own project and make the improvements here. Going forward, this will be the only active project in development - though I'm working on it as slowly as a hobby.
86100

87-
### What about GDBlocks for Godot 3?
88-
I initially developed this addon for Godot 3, as [GDBlocks](https://github.com/daleblackwood/gdblocks). This version marks an increase in scope that was made possible thanks to new tools and performance improvements in Godot 4. As the change is quite dramatic, I've decided to fork my own project and make the improvements here. Going forward, this will be the only active project in development.
101+
### Contribution Policy
102+
I will endeavour to review any pull requests on Github that fix, optimise or compliment existing functionality without changing the nature of previously generated output. Please note that, while I'm a hobbyist and may sometimes take a little while to respond, I do enjoy and welcome the code contributions of others.

‎addons/goshapes/Goshape.gd

+24-5
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,48 @@
22
extends Path3D
33
class_name Goshape
44

5+
## Goshape is the main node that generates shapes from paths using Shapers
6+
57
const AXIS_X = 1
68
const AXIS_Y = 2
79
const AXIS_Z = 4
810

9-
11+
## Invert the direction of the path
1012
@export var inverted = false:
1113
set(value):
1214
inverted = value
1315
mark_dirty()
1416

15-
17+
18+
## A toggle that moves the origin of the path to the center
1619
@export var recenter = false:
1720
set(value):
1821
if value:
1922
recenter_points()
2023

21-
24+
25+
## An editing option that causes aligned points to move together
2226
@export var axis_matched_editing = false
2327

24-
28+
29+
## The PathOptions Resource that contains the options for this shape
2530
@export var path_options: Resource:
2631
set = set_path_options
2732

2833

34+
## The Shaper Resource that configures how to build this Goshape
2935
@export var shaper: Resource:
3036
set = set_shaper
3137

3238

39+
## Cause path twists to build along the path (useful for loop-de-loops)
3340
@export var cascade_twists = false:
3441
set(value):
3542
cascade_twists = value
3643
mark_dirty()
3744

3845

46+
## An array of twists to apply to each point in the path
3947
@export var path_twists : Array[int]:
4048
set = set_path_twists
4149

@@ -50,6 +58,7 @@ var watcher_shaper := ResourceWatcher.new(mark_dirty)
5058
var watcher_pathmod := ResourceWatcher.new(mark_dirty)
5159
var axis_match_index = -1
5260
var axis_match_points := PackedInt32Array()
61+
var has_made_local = false
5362

5463

5564
func _ready() -> void:
@@ -91,6 +100,16 @@ func _edit_begin(edit_proxy) -> void:
91100
_init_curve()
92101
if not curve is GoCurve3D:
93102
curve.set_script(GoCurve3D.new().get_script())
103+
104+
if not has_made_local:
105+
has_made_local = true
106+
if ResourceUtils.is_local(curve):
107+
curve = curve.duplicate(true)
108+
if ResourceUtils.is_local(shaper):
109+
shaper = shaper.duplicate(true)
110+
if ResourceUtils.is_local(path_options):
111+
path_options = path_options.duplicate(true)
112+
94113
curve_changed.connect(on_curve_changed)
95114
watcher_shaper.watch(shaper)
96115
watcher_pathmod.watch(path_options)
@@ -136,7 +155,7 @@ func _edit_end() -> void:
136155

137156

138157
func set_shaper(value: Resource) -> void:
139-
if ResourceUtils.is_local(value):
158+
if value and ResourceUtils.is_local(value):
140159
value.resource_name = ShaperTypes.get_type_name(value)
141160
shaper = value
142161
watcher_shaper.watch(shaper)

0 commit comments

Comments
 (0)
Please sign in to comment.