@SuppressWarnings("unchecked")
	void addStateScript(String script) {
		int iFrame = viewer.getDisplayModelIndex();
		if (thisFrame != iFrame) {
			thisFrame = iFrame;
			script = "frame " + this.getModelNumber(iFrame) + ";\n" + script;
		}
		stateScripts.add(script);
	}