From 09a48e32a3b901d9c8a063df6af5b5eaa71ae71f Mon Sep 17 00:00:00 2001 From: Banbury Date: Jun 07 2016 08:19:18 +0000 Subject: Fix: Allow negative frame id in scene.setCell (scripting). (#345) This fix is necessary for creating animations in Javascript from raster images with only one frame. For this Opentoonz expects a frame id of -2. A frame id of -1 is an empty frame. The original implementation onyl allows positive numbers. --- diff --git a/toonz/sources/toonzlib/scriptbinding_level.cpp b/toonz/sources/toonzlib/scriptbinding_level.cpp index 6421a75..f140fa8 100644 --- a/toonz/sources/toonzlib/scriptbinding_level.cpp +++ b/toonz/sources/toonzlib/scriptbinding_level.cpp @@ -228,7 +228,7 @@ TFrameId Level::getFid(const QScriptValue &arg, QString &err) { if (arg.isNumber() || arg.isString()) { QString s = arg.toString(); - QRegExp re("(\\d+)(\\w?)"); + QRegExp re("(-?\\d+)(\\w?)"); if (re.exactMatch(s)) { int d = re.cap(1).toInt(); QString c = re.cap(2);