public void save(PrintWriter writer, String modifier)
	{
		try
		{
			if(parentAnimation == null)
			{
				writer.println(modifier + "Animation " + name);
				writer.println(modifier + "Duration: " + duration + " frames");
			}
			else
			{
				writer.println(modifier + "Add Animation " + name + " at frame " + (frame == -1 ? 0 : frame));
				writer.println(modifier + "Duration: " + duration + " frames");
			}
			
			if(hasSubAnimations())
			{
				writer.println(modifier + "SubAnimations");
				writer.println(modifier + "{");
				for(int i=0; i<subAnimations.size(); i++)
					subAnimations.get(i).save(writer, modifier + "\t");
				writer.println("}");
			}
			writer.println(modifier + "Poses");
			writer.println(modifier + "{");
			for(int i=0; i<poses.size(); i++)
				poses.get(i).save(writer, modifier + "\t");
			if(parentAnimation == null)
				writer.println(modifier + "}");
			else
				writer.println(modifier + "};");
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		
	}