Skip to content
This repository was archived by the owner on Feb 11, 2024. It is now read-only.

Brushes now get auto-generated names. Fixes #75. #78

Merged
merged 2 commits into from
Mar 30, 2018

Conversation

Henry00IS
Copy link
Collaborator

@Henry00IS Henry00IS commented Mar 30, 2018

Auto Generated Brush Names

It creates clean brush names like:

  • Cube Brush
  • Sphere Brush
  • Cylinder Brush
  • Prism Brush
  • Icosphere Brush
  • Cone Brush
  • Custom Brush
  • Trim Brush
  • Linear Stairs Brush
  • Curved Stairs Brush
  • 2D Shape Editor Brush

It then adds the bounds of the brush behind the name, for example:

  • (2 x 2 x 2)
  • (1.75 x 1 x 1)

There's more!

  • Duplicated brushes no longer have "(1)", "(2)", "(3) (1)" behind their names.
  • If you give a brush a custom name, it will stop auto-generating one.
  • Just rename it to an empty string and it will auto-generate again.

Resulting in:

Shows scene and hierarchy generating beautiful names

Fixes #75.

@@ -10,6 +10,7 @@
namespace Sabresaurus.SabreCSG
{
public enum CSGMode { Add, Subtract };
[ExecuteInEditMode]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested this against the test scene with a thousand brushes in, might be worth checking against levels with high brush counts if this dramatically increases scene load times or slows down interactivity

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested it against Temple several times with and without that statement and it makes no difference to the tool performance and loading time of the scene in the editor (~ 9 seconds).

PrimitiveBrush, GroupBrush, StairBrush, TrimBrush, CurvedStairBrush and ShapeEditorBrush all have [ExecuteInEditMode]. Essentially all of them except the abstract CompoundBrush. I went ahead and cleared my logic from BaseBrush.Update() as it's no longer necessary as well.

All it does now is a quick name comparison when the scene loads or when a brush is created.

@Henry00IS Henry00IS merged commit 520791a into sabresaurus:master Mar 30, 2018
@Henry00IS Henry00IS deleted the AutoGeneratedBrushNames branch March 30, 2018 21:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants