-
Notifications
You must be signed in to change notification settings - Fork 515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Allow negative frame id in scene.setCell (scripting). #345
Conversation
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.
Jenkins, confirm this |
@Banbury I want know more detailed situation where negative indices are rquired. I tried following script, and of course, it works. I will be glad if you can show small sample script using negative indices.
I am excited to hear about your plan to use Papagayo. So I will merge this as soon as I can understand your request. |
Now I understood the problem. In ver.1.0.2,
|
OK, I confirmed this PR can solve the problem partially (I found another bug).
Thanks @Banbury . And we are looking forward to seeing your converter !! |
Thanks for merging this. The converter itself is finished. But I've postponed packaging and releasing it, until Opentoonz supports it. Below you'll find a part of the script for this animation. scene = new Scene()
scene.insertColumn(0)
AI = scene.loadLevel("AI", "d:/OpenToonz 1.0_stuff/projects/OotS/drawings/mouth1/AI.tif")
E = scene.loadLevel("E", "d:/OpenToonz 1.0_stuff/projects/OotS/drawings/mouth1/E.tif")
etc = scene.loadLevel("etc", "d:/OpenToonz 1.0_stuff/projects/OotS/drawings/mouth1/etc.tif")
FV = scene.loadLevel("FV", "d:/OpenToonz 1.0_stuff/projects/OotS/drawings/mouth1/FV.tif")
L = scene.loadLevel("L", "d:/OpenToonz 1.0_stuff/projects/OotS/drawings/mouth1/L.tif")
MBP = scene.loadLevel("MBP", "d:/OpenToonz 1.0_stuff/projects/OotS/drawings/mouth1/MBP.tif")
O = scene.loadLevel("O", "d:/OpenToonz 1.0_stuff/projects/OotS/drawings/mouth1/O.tif")
rest = scene.loadLevel("rest", "d:/OpenToonz 1.0_stuff/projects/OotS/drawings/mouth1/rest.tif")
U = scene.loadLevel("U", "d:/OpenToonz 1.0_stuff/projects/OotS/drawings/mouth1/U.tif")
WQ = scene.loadLevel("WQ", "d:/OpenToonz 1.0_stuff/projects/OotS/drawings/mouth1/WQ.tif")
scene.setCell(0, 0, { level:"etc", fid:'-2' })
scene.setCell(1, 0, { level:"etc", fid:'-2' })
scene.setCell(2, 0, { level:"AI", fid:'-2' })
scene.setCell(3, 0, { level:"AI", fid:'-2' })
scene.setCell(4, 0, { level:"etc", fid:'-2' })
scene.setCell(5, 0, { level:"etc", fid:'-2' })
scene.setCell(6, 0, { level:"etc", fid:'-2' })
scene.setCell(7, 0, { level:"E", fid:'-2' })
scene.setCell(8, 0, { level:"E", fid:'-2' })
scene.setCell(9, 0, { level:"etc", fid:'-2' })
scene.setCell(10, 0, { level:"etc", fid:'-2' })
scene.setCell(11, 0, { level:"U", fid:'-2' })
scene.setCell(12, 0, { level:"etc", fid:'-2' })
scene.setCell(13, 0, { level:"etc", fid:'-2' })
scene.setCell(14, 0, { level:"E", fid:'-2' })
scene.setCell(15, 0, { level:"etc", fid:'-2' })
scene.setCell(16, 0, { level:"etc", fid:'-2' })
scene.setCell(17, 0, { level:"etc", fid:'-2' })
scene.setCell(18, 0, { level:"etc", fid:'-2' })
scene.setCell(19, 0, { level:"U", fid:'-2' })
scene.setCell(20, 0, { level:"AI", fid:'-2' }) |
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 only allows positive numbers.
I'm planning to release a converter from Papagayo to Opentoonz script. The script will create a new level with all the mouth shapes. But without this patch the script won't work.