iByte
Topic Author
Posts: 5
Joined: 14 Aug 2013, 04:13

Trouble shooting steps in Unity

06 Oct 2013, 16:54

Hi, I have reposted the following from the Unity forum

"Hi I exported the xaml from inkscape and then opened it in Blend for VS 2013 Preview. I copied the grid tags from the tux sample posted earlier but i get the error mentioned above in the editor when i press play. When the xaml file is first added to unity I did see a different error. I understand the xaml has to be parsed ... not sure how to re-invoke that step from within unity. "

Okay I see now by just by re-saving the file the real errors show up - for example

[DX9] Assets/XAML/Kids_ZooFun_ColoringBook_inGame.xaml
Parsing MatrixTransformh.Matrix (@22,0)
, expected (1, 3)

XAML code - http://pastebin.com/cAyErUab

I am not sure where to start looking to determine what this error means?

iByte

.ps also Would you point me to a feature in VS XAML editor to reformat the XAML file so it is not all mostly on one line as written by Inkscape. UPDATE: Found it Ctrl+K+D
 
User avatar
jsantos
Site Admin
Posts: 3925
Joined: 20 Jan 2012, 17:18
Contact:

Re: Trouble shooting steps in Unity

06 Oct 2013, 19:22

I found one of the problems, it seems that our parser doesn't understand this syntax:
<MatrixTransform Matrix="1.25 0 0 -1.25 -862.8501 803.55579"/>
It needs the commas,
<MatrixTransform Matrix="1.25, 0, 0, -1.25, -862.8501, 803.55579"/>
We have to fix this but after manually adding the commans, it seems that the .xaml still doesn't display. Will continue investigating.
 
User avatar
sfernandez
Site Admin
Posts: 2997
Joined: 22 Dec 2011, 19:20

Re: Trouble shooting steps in Unity

07 Oct 2013, 15:05

We don't have PathGeometry implemented, but you can use Path Markup Syntax directly as the contents of Path.Data property, it would be automatically converted to an efficient StreamGeometry object. StreamGeometry objects can also be defined as resources.

Instead of:
<Grid
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid.Resources>
        <PathGeometry x:Key="clipPath" Figures="m 883.5369 339.1515 404.9269 0 0 53.7828 -404.9269 0 0 -53.7828 z"/>
    </Grid.Resources>
    <Path Fill="#FF663300">
        <Path.Data>
            <PathGeometry Figures="m 920.9727 420.8907 c 118.991 9.3484 238.7545 7.9603 357.7819 0.004 20.1716 -1.3484 34.4531 -16.7306 36.6409 -36.4725 3.5538 -32.0661 5.1851 -65.7938 -0.03 -97.7565 -3.1495 -19.3064 -16.3267 -34.9443 -36.6202 -36.2568 -118.995 -7.694 -238.8399 -9.6199 -357.7827 0.005 -20.0498 1.6223 -34.5819 16.6553 -36.5859 36.5094 -3.2908 32.6021 -5.4318 65.2232 0.0374 97.7358 3.2471 19.3039 16.3519 34.6447 36.5584 36.2318"/>
        </Path.Data>
    </Path>
    <Path Data="{StaticResource clipPath}" Fill="Red"/>
</Grid>
You can have:
<Grid
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid.Resources>
        <StreamGeometry x:Key="clipPath">m 883.5369 339.1515 404.9269 0 0 53.7828 -404.9269 0 0 -53.7828 z</StreamGeometry>
    </Grid.Resources>
    <Path Fill="#FF663300" Data="m 920.9727 420.8907 c 118.991 9.3484 238.7545 7.9603 357.7819 0.004 20.1716 -1.3484 34.4531 -16.7306 36.6409 -36.4725 3.5538 -32.0661 5.1851 -65.7938 -0.03 -97.7565 -3.1495 -19.3064 -16.3267 -34.9443 -36.6202 -36.2568 -118.995 -7.694 -238.8399 -9.6199 -357.7827 0.005 -20.0498 1.6223 -34.5819 16.6553 -36.5859 36.5094 -3.2908 32.6021 -5.4318 65.2232 0.0374 97.7358 3.2471 19.3039 16.3519 34.6447 36.5584 36.2318"/>
    <Path Data="{StaticResource clipPath}" Fill="Red"/>
</Grid>
 
iByte
Topic Author
Posts: 5
Joined: 14 Aug 2013, 04:13

Re: Trouble shooting steps in Unity

07 Oct 2013, 15:15

Hi, Thanks for the reply. How would i force Inkscape to use that method when exporting the xaml? Also do you folks have any tips/hints on how to setup the artwork to make it easier to work with in blend and NoesisGUI?

Thanks
 
User avatar
jsantos
Site Admin
Posts: 3925
Joined: 20 Jan 2012, 17:18
Contact:

Re: Trouble shooting steps in Unity

07 Oct 2013, 17:18

It seems that in newer versions InkScape changed the kind of XAML generated. The new format does not work properly with NoesisGUI. I have created a report to solve this problem.

Meanwhile, it seems that the old mode is still there. You have the open the file inkscape\share\extensions\svg2xaml.xsl and change the following line:
<xsl:param name="silverlight_compatible" select="2" />
to this one
<xsl:param name="silverlight_compatible" select="1" />
Could you test your sample and tell me if it is working? (I can't test it myself because Inkscape is unable to import from the xaml you gave me, I would need the original svg).
 
iByte
Topic Author
Posts: 5
Joined: 14 Aug 2013, 04:13

Re: Trouble shooting steps in Unity

07 Oct 2013, 18:08

Changing that parm lets the outputed xaml display properly in Unity. Would it be possible to get a bug fix for the Matrix parsing error. It is a little tedious to replace those spaces for comma's.

Thanks
 
User avatar
jsantos
Site Admin
Posts: 3925
Joined: 20 Jan 2012, 17:18
Contact:

Re: Trouble shooting steps in Unity

07 Oct 2013, 18:14

Sure. It will be fixed in the next release. Probably in a few days.

Thanks for reporting!
 
iByte
Topic Author
Posts: 5
Joined: 14 Aug 2013, 04:13

Re: Trouble shooting steps in Unity

07 Oct 2013, 18:29

(I can't test it myself because Inkscape is unable to import from the xaml you gave me, I would need the original svg).
Hmm I was able to load the last set of xaml exported from inkscape back into inkscape. Perhaps inkscape does not like the grid tag I added previously?

Edit - Paste-bin removed as the lines were wrapping as they were so long

iByte

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 38 guests