Wierdness with Canvas references.

Do you have a weird issue and aren't yet ready to post a bug to the bug tracker? See what other people think here.
computa_mike
Posts: 7
Joined: Mon Jul 22, 2013 8:24 pm

Wierdness with Canvas references.

Postby computa_mike » Mon Jul 22, 2013 8:46 pm

Hi -

So I've been working with forum user Dave Hingley trying to solve a synfig issue, and I think I have a partial solution - I just wanted to run something past you guys. [I'm not an animation guy - that's Dave's thang - I just try to help him out with the more technical stuff - do if I get the terminology wrong, appologies]

Dave has been interested in producing what I would describe as animation rigs for characters in an animation. Each character is a self contained sif file. He's set up canvas elements with replacement heads - this allows him to use a 'head' swapping approach to animation - but it could equally be used to swap mouth shapes for lip syncing.

The main issue Dave was having was that he had a bunch of layers - and when he clicked the head layer he was able to pick one of the canvas elements to be the head. So far so good. Then then encapsulated the layers with a character layer, and the head stopped working.

so - initially it looked like this :

*Head
head drawing stuff
*Right Arm
Right Arm Drawing Stuff
*Torso
Torso Drawing stuff
*Head (reference to an existing canvas)

and now it looks like this:

*Char_Name
*Head
head drawing stuff
*Right Arm
Right Arm Drawing Stuff
*Torso
Torso Drawing stuff
*Head Pasted Canvas
(this is a link to an existing canvas)

This works fine. I save it away - no worries.

Load it back up - ok... Change the head to something else... Save it away.
Load it back up again... Boom!... I get a parser error from Synfig

<canvas>:65535: error Canvas 'in line' has undefined ValueNode : <Name of head canvas>
<canvas>:2 error Canvas 'Untitled' has undefined ValueNode : <Name of head canvas>

so I'm not sure what's wrong with the file here. Anyone got any ideas? Would this be a bug relating to canvas references? I'll see if I can knock up a test file to show the issue.

Advertisement

User avatar
Genete
Site Admin
Posts: 5155
Joined: Sat Dec 01, 2007 6:26 am
Location: Spain

Re: Wierdness with Canvas references.

Postby Genete » Tue Jul 23, 2013 1:54 am

Possibly there are circular references there. Can you provide the original file and a recipe to reproduce the error? If there are more than one file involved, please folder them and paste the zip of it.
-G
Synfig needs your help!
Developers, packagers, bug testers, translators, artists, web developers, wiki writers... you can contribute! :D

computa_mike
Posts: 7
Joined: Mon Jul 22, 2013 8:24 pm

Re: Wierdness with Canvas references.

Postby computa_mike » Tue Jul 23, 2013 8:34 am

Hi Genete -

I'll see if I can knock up an example - the 'real' model is quite large at approx 6mb, but I'll ask Dave to knock up something smaller.

Thanks

computa_mike
Posts: 7
Joined: Mon Jul 22, 2013 8:24 pm

Re: Wierdness with Canvas references.

Postby computa_mike » Wed Jul 24, 2013 7:38 pm

Right - Dave managed to knock up a manageable example. It's attached here.

To reproduce this issue, all I need to do is load the robot file up, then save it as something - even over itself, and I get the following error message when I try to re-load the file synfig has just created.

Here's my system information :

32 bit Ubuntu 13.04
Synfig Studio 0.63.05 - installed from repos.

error message ( from Terminal)
/home/mike/projects/synfig/synfig_scene_construction/chars/robot.sifz:<canvas>:2: error: Canvas 'Untitled' has undefined ValueNode: 'robothead_sad'
/home/mike/projects/synfig/synfig_scene_construction/chars/robot.sifz:<canvas>:21761: error: Canvas 'in line' has undefined ValueNode: 'robothead_sad'
/home/mike/projects/synfig/synfig_scene_construction/chars/robot.sifz:<canvas>:2: error: Canvas 'Untitled' has undefined ValueNode: 'robothead_sad'
Attachments
Synfig- error loading robot.png
Error produced by synfig when loading up the robot sifz file.
robot.sifz
Robot Cut out animation - if you try and save this as any other file (or indeed over itself - kaboom!)
(32.22 KiB) Downloaded 77 times

computa_mike
Posts: 7
Joined: Mon Jul 22, 2013 8:24 pm

Re: Wierdness with Canvas references.

Postby computa_mike » Wed Jul 24, 2013 7:40 pm

Will try using latest version - just spotted that the ubuntu version (in repos) isn't latest version.

computa_mike
Posts: 7
Joined: Mon Jul 22, 2013 8:24 pm

Re: Wierdness with Canvas references.

Postby computa_mike » Wed Jul 24, 2013 7:51 pm

same error occurs in latest version 0.64.0.

not sure if this is an issue with the way files are saved, or when the file is loaded - will try an generate a diff for it.

computa_mike
Posts: 7
Joined: Mon Jul 22, 2013 8:24 pm

Re: Wierdness with Canvas references.

Postby computa_mike » Wed Jul 24, 2013 8:13 pm

Have been able to determine that if you save the file having just loaded it, it seems to do quite a bit of conversion - in particular it seems to convert the reference canvas layer from this simple line :

<reference type="canvas" link=":robothead_sad"/>

and appears to resolve the canvas :

<reference type="canvas">
<link>
<canvas id="robothead_sad" width="744" height="1052" view-box="-6.200788 8.769685 6.200788 -8.769685" bgcolor="0.500000 0.500000 0.500000 1.000000">
<layer type="outline" active="true" version="0.2" desc="path3822-2">
<param name="z_depth">
...
...
...
Attachments
v2_robot.sif
Updated robot file - when just clicking save button
(1.31 MiB) Downloaded 81 times
v1_robot.sif
Original Robot sif file -
(1.37 MiB) Downloaded 120 times

User avatar
Genete
Site Admin
Posts: 5155
Joined: Sat Dec 01, 2007 6:26 am
Location: Spain

Re: Wierdness with Canvas references.

Postby Genete » Thu Jul 25, 2013 1:59 am

The problem is currently defined in a bug not solved yet. It happens when you're defining a exported canvas that uses other exported canvas and viceversa. Currently it its not smart enough to save the composition without the circular reference and then it is unable to load it after.

This is a bug and it is not fixed yet.

http://www.synfig.org/issues/thebuggeni ... /issues/39

If I remember correctly, I fixed the crash but not the un definition for the referenced exported canvases.
I'll try to confirm this afternoon if the problem with your file is the same problem. It can be done by inspecting the file with a text editor and watching the definition of the problematic canvas ans its usage before its definition. Maybe it can be fixed if it is just a usage before the definition, by moving the definition before its use. If there a circular reference, there is not solution at the moment other than use other name for the references and not use circular references.

You'll need to rename the xxxxxx.sifz file to xxxxxx.sif.gz and then unzip it to xxxxxx.sif before inspect the file in a text editor, because you can't save it to sif using Synfig Studio in this situation.


Edited: the above quote was fully wrong :)
-G
Synfig needs your help!
Developers, packagers, bug testers, translators, artists, web developers, wiki writers... you can contribute! :D

User avatar
Genete
Site Admin
Posts: 5155
Joined: Sat Dec 01, 2007 6:26 am
Location: Spain

Re: Wierdness with Canvas references.

Postby Genete » Thu Jul 25, 2013 3:50 am

This is another kind of bug.
Looks like when you use a Reference convert type over a Canvas parameter, then the referenced canvas is replaced by its ID when saved but it doesn't know how to load it back.

I've fixed the V1 file to the V2 file by replacing the Canvas Reference convert type in the visible head of the robot by a direct Canvas usage. Now the file can be loaded and saved with other name:
v2_robot.sif
Edited V1 file that can be saved to any other name.
(1.15 MiB) Downloaded 85 times


Steps to convert the V1 to this V2 version:

1) Open the file
2) Go to the Group that has the visible head (the first visible group inside the 'robot' group). Select it.
3) At the Parameter panel, select the Canvas parameter and RMB click 'Disconnect'. It would create a in-line group with the content of the sad head.
4) Since I guess you want to use the exported one, LMB click on the Canvas parameter and select 'other'. In the canvas chooser dialog write: ':robothead_sad' (without the quotes). The colons are needed to reference the root canvas before the children canvas.
5) Save it normally.

So the bug is related to Reference convert type mixed with exported canvases. Sincerely I don't remember why the Reference convert type was introduced. Here is an explanation of its usage:
http://wiki.synfig.org/wiki/Convert#Reference
Possibly the Reference convert type is not appropriated for canvas parameters.

-G
Synfig needs your help!
Developers, packagers, bug testers, translators, artists, web developers, wiki writers... you can contribute! :D

computa_mike
Posts: 7
Joined: Mon Jul 22, 2013 8:24 pm

Re: Wierdness with Canvas references.

Postby computa_mike » Thu Jul 25, 2013 4:13 pm

Thanks Genete -

The workaround you've come up with is quite good, and simple to implement. I do like the way that the canvas references work - I suppose this works too - but the UI seemed to have better support for reference canvases.

Dave is planning on using this technique to do head swaps for a character over time to allow lipsyncing etc.

Do I need to raise a bug regarding this, or will it be covered under the existing bug for canvas references?

I've even contemplated grabbing the sources - I know it's C++ (i work in .net mostly) but It has tempted me to see if I can debug this.

Thanks

User avatar
Genete
Site Admin
Posts: 5155
Joined: Sat Dec 01, 2007 6:26 am
Location: Spain

Re: Wierdness with Canvas references.

Postby Genete » Thu Jul 25, 2013 6:17 pm

As i mentioned, the Reference convert type has limited usage in canvas parameter. Better use the canvas parameter itself.

Yes, please file a bug with they problem to fix it in the future in one way or other.
http://www.synfig.org/issues/thebuggenie/about
-G
Synfig needs your help!
Developers, packagers, bug testers, translators, artists, web developers, wiki writers... you can contribute! :D


Return to “Debugging”

Who is online

Users browsing this forum: No registered users and 5 guests