19 Mar 2010

FAFF cleanup: Sketch

As some of you might have read, at Unity we have a thing called FAFF – very much the same as Google and other IT businesses are doing. It generally lets you step out of the bit stream for a day and just, during work hours, go with whatever crazy idea(s) you’ve been throwing around.

Some of these ideas are pushed into the product later and others are just filed under “something to play with when bored” and “now I can stop wondering about that”. Sketch was a micro FAFF project I just remembered I had filed under “this was fun” and then forgot all about. Since then I’ve continued work on other projects and started new ones – in all likelihood I’ll not return to this project.

So I figured I’d push it to github and let you guys take it for a spin. If nothing else, it’s a nice demo of what you can do with Unity editor scripting.

The idea of Sketch is to have simple tools inside the Unity editor to modify meshes in your assets. My goal with the project was never to turn Unity into a mesh authoring environment, but rather to give people an extra tool for rapid prototyping.

So what’s in there now? The simplest I could think of: Triangle selection and movement.

Workflow:

  1. Go to the GameObject → Create Other menu and click Sketch Cube.
  2. With the cube selected, click a triangle and with the handle that appears, drag it around to modify the mesh.
  3. GOTO 1.

Alternatively, you could drag in your own mesh from the Assets folder (make sure that it generates a mesh collider in its import settings) and attach the Sketch script to it.

NOTICE: Sketch modifies the imported asset. This means that:

  • If you modify a some of the basic geometry meshes (such as GameObject → Create Other → Cube), the changes will apply to all cubes until editor relaunch.
  • If the geometry you’re modifying is based on an imported 3D asset, reimporting it will mean you loose your changes.

Structure-wise, Sketch consists of two components: A MonoBehaviour (Sketch/Sketch.cs) and a custom inspector (Sketch/Editor/SketchEditor.cs). The purpose of the MonoBehaviour is merely to do some bookkeeping and provide utility functions (it will even destroy itself at runtime) while the custom inspector holds the logic for doing the modifications.

Woah. That’s a lot of talk. Here’s the repository – go nuts: http://github.com/AngryAnt/Sketch.

CoreObject
Unity Protocol Buffers
Behave 2.7
Learn
Behave 2.6
Trusted Gear
Mad Mash Versioning
Behave 2.5
Behave 2.4
Co-very-routine
Construct
The Engine Wars: Numbers
GDC 14: The Quest For Fun
Moving in Unity
Behave 2.3
Unity and .net assemblies
Behave 2.2
ReView
Behave 2.1
Behave 2.0
Unity Hacks: Dual sticks
Unity Hacks: Cameras
Unity Hacks: Touch gestures
OnRenderTextureGUI
Unite 13 video "Unity Hacks" available
The implicit local network interface
Talks and progress
Five years of Unity expertise looking for contracts
Automagic Unity Android Java gadget OF DOOM!
Invading Planet from your couch
Mountain Lion and laggy bluetooth and duct-tape
Unite 12 video and new videos section available
Asia Bootcamp videos now available
Path is now MIT licensed
Behave 1.4 released
So I've been a bit busy lately
Behave 1.3 released
IGDA Unity SIG slides
Second Unity IGDA SIG this evening: Scene construction and AI
First IGDA Unity SIG this evening
Alternative licensing available
Pathfinding in two lines
Path 2 released
Assembling and assimilating
Path 2 intro screencast
Path 2 beta release for GGJ
AIgameDev master class video now online
Expanding beta
Behave AIgameDev master class public stream
Behave master class on open AIgameDev stream tomorrow
Interview with AIGameDev
New video: From tree to code
Issue tracking on github Behave release project
IT University Copenhagen Unity course completed
IT University Copenhagen Unity course files Thursday
CPH IT University Unity course files
Behave 1.2 released
Video: Behave - starting from scratch
Behave runtime documentation updated
Behave 1.1 released
FAFF cleanup: Sketch
Building a menu of delegates and enums
Pick me! Pick me!
Optimising coroutine yielding in C#
Downloading the hydra
New license of Path: GPL
CopyInspector
Magnetic
GUI drag-drop
Logging an entire GameObject
I bet you can't type an A!
Where did that component go?
UnitySteer
New and improved: Behave 1.0 released
Behave 0.3b and unity 2.5
Behave 0.3b hotfix
Path tutorial video available
Path 1.0 launched!
Continued community tutorials
Community tutorial
New tutorial
First tutorial available
Behave 0.3b
unite '08 open-mic session
Behave 0.2b
Behave 0.1b
Behave pre-release
Path beta 0.3b
Path beta 0.2b
Path beta 0.1b
Path pre-release