Skip to content

Commit 016e64d

Browse files
committed
Merge remote-tracking branch 'origin/v5.0/master'
# Conflicts: # CHANGELOG.md
2 parents 5e3d7d8 + 45349b6 commit 016e64d

320 files changed

Lines changed: 1963 additions & 1432 deletions

File tree

Some content is hidden

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

CHANGELOG.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7-
87
## [Unreleased]
98

109
### Bug Fixes
@@ -18,36 +17,38 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1817

1918
- Add `GameObject/ProBuilder` menu to create primitives with default dimensions.
2019

21-
## [5.0.0-pre.12] - 2021-03-05
20+
## [5.0.2] - 2021-03-11
2221

2322
### Bug Fixes
2423

25-
- [case: 1317773] Fixing undo after shape creation.
26-
- Fixed shape creation requiring two undos to remove new shape.
27-
- Fixed shape preview flickering when executing shortcut to redo.
28-
- Fixed new shapes instantiating with generic "Shape" name instead of the primitive name.
24+
- Fixed `Draw Shape` tool showing incorrect UVs when setting shape bounding box.
25+
- Fixed `Draw Shape` tool not clearing selection when changing the active shape type.
26+
- Fixed `Cut Tool` error when pressing `Backspace` with no vertices placed.
27+
- Fixed `Cut Tool` error when finishing a cut segment with less than 3 vertices.
28+
- Fixed `Draw Shape` tool truncating shape property fields in the Scene View Overlay.
29+
30+
### Changes
31+
32+
- Moved contents of warning box in `Draw Shape` tool to tooltips.
2933

30-
## [5.0.0-pre.11] - 2021-02-25
34+
## [5.0.1] - 2021-03-09
3135

3236
### Bug Fixes
3337

34-
- [case: 1317148] Fixing edge picking problem with some Unity versions.
35-
- [case: 1312537] Fixing script stripping on disabled objects when building.
36-
- [case: 1311258] Fixing material reverting when subdividing edge.
37-
- [case: 1315335] Fixing the wording of the detach faces to be less confusing.
38-
- Added Particle System and IMGUI modules as a dependency.
38+
- Disable unstable test on Linux.
3939

40-
## [5.0.0-pre.10] - 2021-01-22
40+
## [5.0.0] - 2021-03-08
4141

4242
### Features
4343

44-
- Redesigned shape creation workflow: Shapes are now interactively drawn in the Scene View, and remain configurable after the point of creation via the `ShapeComponent` Inspector.
45-
- Added Point-to-point Cut tool.
46-
- Added a selection preview when using the Select Path tool.
44+
- Redesigned shape creation workflow. Shapes are now interactively drawn in the Scene View, and remain configurable after the point of creation via the `ShapeComponent` Inspector. Default shapes can still be created through the `GameObject/ProBuilder` menu.
45+
- Added `Point to Point Cut` tool.
46+
- Added a selection preview when using the `Select Path` tool.
4747
- Added `Selection X Ray` option to highlight occluded element selections with a muted color. Default shortcut is `Alt + Shift + X` (modifiable in Shortcut Manager).
4848
- Added Analytics for Actions and Menu Shortcuts
4949

5050
### Bug Fixes
51+
5152
- [case: 1304442] Update package description for SRPs : warning to users to add samples projects.
5253
- [case: 1300329] Fixing Undo completely reverting all actions.
5354
- [case: 1299638] Fixed missing dependency on com.unity.modules.physics.
@@ -86,6 +87,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
8687
- [case: 1286045] Fixed selection cleaning problem after scene restart.
8788
- [case: 1266769] Fixed tooltip window not rendering correctly on Linux.
8889
- [case: 1281658] Fixed warning when modifying a PBMesh with particule effect using PBMesh as shape emitter.
90+
- [case: 1317148] Fixed edge selection returning incorrect results with some Unity versions.
91+
- [case: 1312537] Fixed script stripping on disabled objects when building.
92+
- [case: 1311258] Fixed material reverting when subdividing edge.
93+
- [case: 1317773] Fixed undo after shape creation.
8994

9095
### Changes
9196

@@ -97,6 +102,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
97102
- Removed unused HDRP shader variants.
98103
- `MergeElements.Merge` moved to public API.
99104
- Upgraded `PolyShape` tool to EditorTool and correct some features in it.
105+
- Updated documentation for ProBuilder 5.0.0.
106+
- Add `GameObject/ProBuilder` menu to create primitives with default dimensions.
107+
- Added `com.unity.modules.physics` and `com.unity.modules.imgui` modules as dependencies.
100108

101109
### Internal
102110

Debug/Editor/Guides.cs

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
using UnityEditor;
2+
using UnityEditor.SettingsManagement;
3+
using UnityEngine;
4+
using UnityEngine.Rendering;
5+
6+
namespace ProBuilder.Debug.Editor
7+
{
8+
static class GuidesSettingsProvider
9+
{
10+
const string k_PreferencesPath = "Preferences/Scene Guides";
11+
static Settings s_Settings;
12+
public static Settings settings => s_Settings ?? (s_Settings = new Settings("com.unity.scene-guides"));
13+
14+
[SettingsProvider]
15+
static SettingsProvider CreateSettingsProvider()
16+
{
17+
var provider = new UserSettingsProvider(k_PreferencesPath,
18+
settings,
19+
new[] { typeof(GuidesSettingsProvider).Assembly });
20+
21+
settings.afterSettingsSaved += HandleUtility.Repaint;
22+
23+
return provider;
24+
}
25+
}
26+
27+
class Pref<T> : UserSetting<T>
28+
{
29+
public Pref(string key, T value, SettingsScope scope = SettingsScope.Project)
30+
: base(GuidesSettingsProvider.settings, key, value, scope) { }
31+
}
32+
33+
static class Guides
34+
{
35+
[UserSetting("World Space", "Origin Axes", "Shows 3 axis guides from the scene view origin.")]
36+
static Pref<bool> s_SceneOrigin = new Pref<bool>("Guides.s_SceneOrigin", false);
37+
38+
[UserSetting("Selection", "Transform Pivot", "Draw a gizmo at the origin of each selected transform.")]
39+
static Pref<bool> s_SelectionPivot = new Pref<bool>("Guides.s_SelectionPivot", false);
40+
41+
static Vector3 zero = Vector3.zero,
42+
up = new Vector3(0f, 1f, 0f),
43+
right = new Vector3(1f, 0f, 0f),
44+
forward = new Vector3(0f, 0f, 1f);
45+
46+
[InitializeOnLoadMethod]
47+
static void Init()
48+
{
49+
SceneView.duringSceneGui += view =>
50+
{
51+
var evt = Event.current;
52+
53+
if (evt.type != EventType.Repaint)
54+
return;
55+
56+
if (s_SceneOrigin)
57+
{
58+
var dist = view.camera.farClipPlane / 10f;
59+
60+
DrawLine(zero, right * dist, Handles.xAxisColor);
61+
DrawLine(zero, right * -dist, Handles.xAxisColor * .7f);
62+
63+
DrawLine(zero, up * dist, Handles.yAxisColor);
64+
DrawLine(zero, up * -dist, Handles.yAxisColor * .7f);
65+
66+
DrawLine(zero, forward * dist, Handles.zAxisColor);
67+
DrawLine(zero, forward * -dist, Handles.zAxisColor * .7f);
68+
}
69+
70+
if (s_SelectionPivot)
71+
{
72+
foreach (var transform in Selection.transforms)
73+
DrawPivot(transform);
74+
}
75+
};
76+
}
77+
78+
static void DrawPivot(Transform transform)
79+
{
80+
using (new Handles.DrawingScope(transform.localToWorldMatrix))
81+
{
82+
DrawLine(zero, right * .2f, Handles.xAxisColor, 1f, 3f);
83+
DrawLine(zero, up * .2f, Handles.yAxisColor, 1f, 3f);
84+
DrawLine(zero, forward * .2f, Handles.zAxisColor, 1f, 3f);
85+
}
86+
}
87+
88+
static void DrawLine(Vector3 from, Vector3 to, Color color, float occludedTint = .7f, float thickness = 0f)
89+
{
90+
Handles.color = color;
91+
Handles.zTest = CompareFunction.LessEqual;
92+
#if UNITY_2021_1_OR_NEWER
93+
Handles.DrawLine(from, to, thickness);
94+
#else
95+
Handles.DrawLine(from, to);
96+
#endif
97+
98+
Handles.color = color * occludedTint;
99+
Handles.zTest = CompareFunction.Greater;
100+
#if UNITY_2021_1_OR_NEWER
101+
Handles.DrawLine(from, to, thickness);
102+
#else
103+
Handles.DrawLine(from, to);
104+
#endif
105+
}
106+
}
107+
}

Debug/Editor/Guides.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "Unity.ProBuilder.Debug.Editor",
3+
"rootNamespace": "",
34
"references": [
45
"Unity.ProBuilder",
56
"Unity.ProBuilder.Editor",
6-
"Unity.ProBuilder.AssetIdRemapUtility"
7+
"Unity.ProBuilder.AssetIdRemapUtility",
8+
"Unity.Settings.Editor"
79
],
8-
"optionalUnityReferences": [],
910
"includePlatforms": [
1011
"Editor"
1112
],
@@ -14,5 +15,7 @@
1415
"overrideReferences": false,
1516
"precompiledReferences": [],
1617
"autoReferenced": false,
17-
"defineConstraints": []
18+
"defineConstraints": [],
19+
"versionDefines": [],
20+
"noEngineReferences": false
1821
}

Documentation~/Arch.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,23 @@ The basic arch shape is a curved symmetrical shape (see **A** in the image belo
33

44
![Arch shapes](images/shape-tool_arch.png)
55

6-
![A](images/LetterCircle_A.png) Basic arch shape (default values)
6+
**(A)** Roof: Arch with 2 sides and increased depth
77

8-
![B](images/LetterCircle_B.png) Tunnel: Arch with increased depth and thickness
8+
**(B)** Wheel: Arch with increased number of sides, thickness and degrees (and no end cap)
99

10-
![C](images/LetterCircle_C.png) Wheel: Arch with increased number of sides, thickness and degrees (and no end cap)
10+
**(C)** Basic arch shape (default values)
1111

12-
![D](images/LetterCircle_D.png) Roof: Arch with 2 sides and increased depth
12+
**(D)** Tunnel: Arch with increased depth and thickness
1313

14-
When you customize an arch shape, keep in mind that when you change the thickness and number of sides, it is relative to the **Radius** and **Arch Degrees** values. For example, two arches with the same thickness (15) but where one arch has twice the radius as the other (3 vs. 6), look very different. The one with the smaller radius appears much smoother than the other.
14+
When you customize an arch shape, keep in mind that when you change the thickness and number of sides, it is relative to the overall size and circumference. For example, two arches with the same thickness but where one arch is twice as long as the other look very different. The shorter one appears much smoother than the other.
1515

16-
You can customize the shape of an arch with these shape properties:
17-
18-
![Arch shape properties](images/shape-tool_arch-props.png)
16+
You can customize the shape of an arch with these shape-specific properties:
1917

2018

2119
| **Property:** | **Description:** |
2220
|:-- |:-- |
23-
| __Radius__ | Set the radius (size) of the arch in meters. A change in radius affects the overall height. The default value is 3. |
24-
| __Thickness__ | Set the thickness of the arch in meters. As this value approaches the __Radius__ value, the smaller the _doorway_ becomes. The default value is 0.5. |
25-
| __Depth__ | Set the depth for the arch in meters. The higher the value, the longer the _tunnel_ effect. The default value is 1. |
26-
| __Number of Sides__ | Set the number of sides for the arch. The more sides you use (relative to the size of the __Radius__), the smoother the arch becomes, so the closer you get to a semi-circle. Conversely, if you this value to 2, the arch turns into a peaked roof, regardless of the radius. The efault value is 6. |
27-
| __Arch Degrees__ | Set the circumference of the arch in degrees. For example, an arch of 360 degrees is circular. The default value is 180. |
28-
| __End Caps__ | Enable this option to create faces for the ends of the arch (default). <br />Disable this option if you know the ends are not visible to the camera (this is an [optimization strategy](workflow-edit-tips.md) that reduces the number of polygons that Unity has to render). |
21+
| __Thickness__ | Set the thickness of the arch in meters. The larger the thickness, the smaller the opening becomes. The default value is 0.1. The minimum value is 0.01. |
22+
| __Sides Count__ | Set the number of sides for the arch. The more sides you use (relative to the size of the __Radius__), the smoother the arch becomes, so the closer you get to a semi-circle. Conversely, if you this value to 2, the arch turns into a peaked roof, regardless of the radius. The default value is 5. Valid values range from 3 to 200. |
23+
| __Arch Circumference__ | Set the circumference of the arch in degrees. For example, an arch of 360 degrees is circular. The default value is 180. Valid values range from 1 to 360. |
24+
| __End Caps__ | Enable this option to create faces for the ends of the arch (default). <br /><br />Disable this option if you know the ends are not visible to the camera (this is an [optimization strategy](workflow-edit-tips.md) that reduces the number of polygons that Unity has to render). |
25+
| **Smooth** | Enable this option to smooth the edges of the polygons. This property is enabled by default. |

Documentation~/CenterPivot.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# ![Center Pivot icon](images/icons/CenterPivot.png) Center Pivot
22

3-
The __Center Pivot__ tool moves the pivot point for the Mesh to the center of the object’s bounds. For example, if you move a lot of vertices on one side of your Mesh, when you try to rotate the object, it rotates around a point outside of the Mesh.
3+
The __Center Pivot__ action moves the pivot point for the Mesh to the center of the object’s bounds. For example, if you move a lot of vertices on one side of your Mesh, when you try to rotate the object, it rotates around a point outside of the Mesh.
4+
5+
> **Tip:** You can also launch this action from the ProBuilder menu (**Tools** > **ProBuilder** > **Object** > **Center Pivot**).
46
57
![Center Pivot example](images/CenterPivot_Example.png)
68

Documentation~/Cone.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
# Cone
2-
A cone is a shape which tapers from a circular (or roughly circular) base to a point. You can adjust the settings to change the height, width, and smoothness.
2+
A cone is a shape which tapers from a circular (or roughly circular) base to a point. You can adjust the smoothness.
33

4-
![Cone shapes](images/shape-tool_cone.png)
4+
![Cone shapes](images/shape-tool_cone.png)
55

6-
![A](images/LetterCircle_A.png) Basic cone shape (default values)
6+
**(A)** Cone with wide radius
77

8-
![B](images/LetterCircle_B.png) Cone with increased height
8+
**(B)** Basic cone shape (default values)
99

10-
![C](images/LetterCircle_C.png) Cone with increased number of sides
10+
**(C)** Cone with increased height
1111

12-
![D](images/LetterCircle_D.png) Cone with wide radius
12+
**(D)** Cone with increased number of sides
1313

14-
You can customize the shape of a cone with these shape properties:
15-
16-
![Cone shape properties](images/shape-tool_cone-props.png)
14+
You can customize the shape of a cone with this shape-specific property:
1715

1816

1917
| **Property:** | **Description:** |
2018
|:-- |:-- |
21-
| __Radius__ | Set the radius of the base of the cone in meters. The default value is 1. The minimum value is 0.1. |
22-
| __Height__ | Set the height for the cone in meters. The default value is 2. The minimum value is 0.1. |
23-
| __Number of Sides__ | Set the number of sides for the cone. The more sides you use (relative to the size of the __Radius__ and the __Height__), the smoother the sides of the cone become. The default value is 6. Valid values range from 3 to 32. |
19+
| __Sides Count__ | Set the number of sides for the cone. The more sides you use, the smoother the sides of the cone become. The default value is 6. Valid values range from 3 to 64. |
20+
| **Smooth** | Enable this option to smooth the edges of the polygons. This property is enabled by default. |

Documentation~/Cube.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
# Cube
2-
A cube is the default shape in ProBuilder. It is a six-sided 3D square. To add a default cube to the Scene, you can use the **Ctrl/Cmd+K** keyboard shortcut.
2+
A cube is the default shape in ProBuilder. It is a six-sided 3D square.
33

44
![Cube shapes](images/shape-tool_cube.png)
55

6-
The blue cube in this image is the default cube in preview mode.
6+
The cube shape has no shape-specific properties.
77

8-
You can customize the shape of a cube with these shape properties:
98

10-
![Cube shape properties](images/shape-tool_cube-props.png)
11-
12-
13-
| **Property:** | **Description:** |
14-
|:-- |:-- |
15-
| __X__ | Set the dimensions in the x-axis of the cube (width) in meters. The default value is 1. The minimum value is 0.01. |
16-
| __Y__ | Set the dimensions in the y-axis of the cube (height) in meters. The default value is 1. The minimum value is 0.01. |
17-
| __Z__ | Set the dimensions in the z-axis of the cube (depth) in meters. The default value is 1. The minimum value is 0.01. |

Documentation~/Custom.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

Documentation~/Cylinder.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,20 @@ A cylinder is a shape with long straight sides and two circular (or roughly circ
33

44
![Cylinder shapes](images/shape-tool_cylinder.png)
55

6-
![A](images/LetterCircle_A.png) Default cylinder shape
6+
**(A)** Cylinder without a smoothing group
77

8-
![B](images/LetterCircle_B.png) Cylinder without the smoothing
8+
**(B)** Cylinder with a high sides count
99

10-
![C](images/LetterCircle_C.png) Cylinder with a height of 3 and 16 sides
10+
**(C)** Cylinder with a lot of height cuts
1111

12-
![D](images/LetterCircle_D.png) Cylinder with a radius of 4 and 10 subdivisions
12+
**(D)** Default cylinder shape
1313

14-
You can customize the shape of a cylinder with these shape properties:
15-
16-
![Cylinder shape properties](images/shape-tool_cylinder-props.png)
14+
You can customize the shape of a cylinder with these shape-specific properties:
1715

1816

1917
| **Property:** | **Description:** |
2018
|:-- |:-- |
21-
| __Radius__ | Set the radius (width) of the cylinder in meters. The default value is 0.5. The minimum value is 0.01. |
22-
| __Number of Sides__ | Set the number of sides for the cylinder. The more sides you use (relative to the size of the __Radius__), the smoother the sides of the cylinder become. The default value is 8. Valid values range from 4 to 48. |
23-
| __Height__ | Set the height of the cylinder in meters. The default value is 1. |
24-
| __Height Segments__ | Set the number of divisions to use for the height of the cylinder. For example, a value of 3 produces 4 faces on every side of the cylinder. The default value is 0. Valid values range from 0 to 48. |
25-
| __Smooth__ | Enable this option to smooth the edges of the polygons. This is enabled by default. |
19+
| __Sides Count__ | Set the number of sides for the cylinder. The more sides you use, the smoother the sides of the cylinder become. The default value is 6. Valid values range from 4 to 64. |
20+
| __Height Cuts__ | Set the number of divisions to use for the height of the cylinder. For example, a value of 3 produces 4 faces on every side of the cylinder. The default value is 0. |
21+
| __Smooth__ | Enable this option to smooth the edges of the polygons. This property is enabled by default. |
22+

0 commit comments

Comments
 (0)