Friday, December 5, 2008

Tagtool + Video

The Tagtool is an open source instrument for drawing and animation in a live performance situation. Its development is coordinated by OMA International.

The Tagtool is operated collaboratively by an artist drawing the pictures and an animator adding movement to the artwork with a gamepad.

You can get all the info on tagtool here: http://www.tagtool.org/

I set out to add video to the Tagtool, being interested in masking and animating parts of video, in the idea of not being limited to the rectangular shape of the video box.

I first built the tagtool itself. Here are some pics.






Work completed on the software side:

In order to "add video" I needed to create a node within nodekit that handled it. I started out by researching on handling video in C# and decided that I needed to use Visual C#. I found the code I needed and started modifying it to fit as a node. I quickly realized that I needed to build the whole program because I needed to refrence other libraries in nodekit. So, I built the whole program of Nodekit, which consists of 21 solutions, in Visual C#. It was difficult because I had missing components like csgl (this was my first time using Visual C#). When I finally got to building it and compiling without errors, the program would not launch. The OSC connection would work and then it would just crash.

Since I'm not so sure I can post files, let alone a whole folder, I will attach the folder with the source code for nodekit including the changes I made in Visual C#, and the folder with the code for the video that I gave up on using in webCT.

With the deadline approaching quickly and my ignorance in Visual C#, I decided to get my idea working through the use of hardware.

Work completed on the hardware side:

These diagrams pretty much sum up the differences in setup between the original plan and what I ended up using.

original setup



setup used




After I decided that I was just going to use the chroma key, I decided that I needed at least to be able to change the color of the black background that was the only option in nodekit. I put up a post on the google group for the tagtool asking if anyone knew how to do that, and the programer of nodekit said that was an update in their new development of the nodekit, and so he attached it to the response. But I couldn't get it to work even to compile as stand alone because of all the missing new features...

Here is the code for the backgroundColor node:
>>>>>>>> BackGroundColorNode

using System;
using TagTool.Core;
using TagTool.GraphicTypes;
using TagTool.Graphics;
namespace TagTool.Nodes.Graphics
{
[Information("Background Color", ToolTipText = "Sets the background color
of the specified stage.")]
public class BackgroundColorNode : BaseNode
{
private InputSlot color;
public BackgroundColorNode()
{
Name = "Background Color";
color = new InputSlot(this, "Color", Color.Black);
color.Active = true;
triggerIn.ArgumentType = typeof(double);
triggerIn.Active = true;
triggerIn.ParseCallback = ParseHelper.ParseDouble;
triggerOut.FormatCallback = FormatHelper.FormatDouble;
triggerIn.DefaultValue = 0.0;
triggerOut.Deprecated = true;
}
public override void Update(Object sender)
{
try
{
IStage stage =
ProjectManager.Instance.GetStage((int)(double)triggerIn.Value);
if(stage != null)
{
stage.ClearColor = (Color)color.Value;
}
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
}
public override void Initialize()
{
Update(triggerIn);
}
[NodeAttribute(SlotType.Input, Show = true)]
public InputSlot BkColor
{
get { return color; }
}
}
}

Here is the video of the presentation.