Wierdness with Canvas references.

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 drawing stuff
*Right Arm
Right Arm Drawing Stuff
Torso Drawing stuff
*Head (reference to an existing canvas)

and now it looks like this:

head drawing stuff
*Right Arm
Right Arm Drawing Stuff
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

:65535: error Canvas ‘in line’ has undefined ValueNode :
:2 error Canvas ‘Untitled’ has undefined ValueNode :

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.

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.

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.


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::2: error: Canvas ‘Untitled’ has undefined ValueNode: ‘robothead_sad’
/home/mike/projects/synfig/synfig_scene_construction/chars/robot.sifz::21761: error: Canvas ‘in line’ has undefined ValueNode: ‘robothead_sad’
/home/mike/projects/synfig/synfig_scene_construction/chars/robot.sifz::2: error: Canvas ‘Untitled’ has undefined ValueNode: ‘robothead_sad’
Synfig- error loading robot.png
robot.sifz (32.2 KB)

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

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.

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 :

and appears to resolve the canvas :

... ... ... v2_robot.sif (1.31 MB) v1_robot.sif (1.37 MB)

Edited: the above quote was fully wrong :slight_smile:

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 (1.15 MB)

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:
Possibly the Reference convert type is not appropriated for canvas parameters.


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.


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.