🐛 Fix infinite recursion with `parent.xyz`

feat/template
Shad Amethyst 2 years ago
parent 05aa534cef
commit c43827d203
Signed by: amethyst
GPG Key ID: D970C8DD1D6DEE36

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 33.866668 33.866668" height="128" width="128" export-ydpi="450" id="svg5" space="preserve" version="1.2.1 (9c6d41e410, 2022-07-14)" docname="blobamber.svg" export-filename="../output/blobamber.png" export-xdpi="450">
<title id="title30762">blobcat</title>
<sodipodi:namedview window-y="0" zoom="12.482971" current-layer="layer1" cy="109.02853" units="px" pagecolor="#505050" pagecheckerboard="1" window-x="0" showgrid="false" borderopacity="1" bordercolor="#ffffff" pageopacity="0" document-units="mm" cx="61.043158" id="namedview7" window-width="1536" window-height="779" showpageshadow="2" deskcolor="#505050" window-maximized="1" pageshadow="0">
<inkscape:grid type="xygrid" id="grid10"/>
</sodipodi:namedview>
<defs id="blobamber-defs">
<linearGradient collect="always" id="linearGradient1095">
<stop offset="0" style="stop-color:#b86a00;stop-opacity:1;" id="stop1091"/>
<stop style="stop-color:#dab91d;stop-opacity:1;" offset="1" id="stop1093"/>
</linearGradient>
<linearGradient x2="25.19339" gradientUnits="userSpaceOnUse" x1="25.110657" href="#linearGradient1095" id="linearGradient1097" y1="7.0228844" collect="always" y2="12.153695"/>
<linearGradient href="#linearGradient1095" gradientTransform="matrix(0.94114449,0,0,0.94114449,-10.797579,2.1054482)" x2="25.19339" gradientUnits="userSpaceOnUse" y2="12.153695" collect="always" x1="25.110657" y1="7.0228844" id="linearGradient1239"/>
</defs>
<g groupmode="layer" label="ref" id="ref" style="display:none">
<image height="56.029915" id="blobfoxmsnuggleleftcat" label="blobfoxmsnuggleleftcat" preserveAspectRatio="none" x="0.45707837" width="56.029915" href="../original/blobfoxmsnuggleleftcat.png" y="-16.623016" style="display:none;image-rendering:optimizeSpeed"/>
<image width="44.290115" href="../original/blobfoxnomcat.png" preserveAspectRatio="none" id="blobfoxnomcat" height="44.290115" y="-10.339302" style="display:none;image-rendering:optimizeSpeed" x="-3.1429539" label="blobfoxnomcat"/>
<image width="55.942009" style="display:none;image-rendering:optimizeSpeed" label="blobfoxmsnugglecentercat" id="blobfoxmsnugglecentercat" height="55.942009" preserveAspectRatio="none" x="-11.634965" y="-17.482618" href="../original/blobfoxmsnugglecentercat.png"/>
<image height="33.866665" href="../original/blobfox.png" x="0" width="33.866665" id="blobfox" preserveAspectRatio="none" style="display:none;image-rendering:optimizeSpeed" y="0" label="blobfox"/>
</g>
<g label="Base" id="Base" groupmode="layer" style="display:inline">
<path style="fill:#313131;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="left-ear" nodetypes="csscc" label="left-ear" d="M 4.2225247,12.78287 C 2.021009,7.5103594 2.5604085,3.6951828 2.6743801,2.856386 2.7720357,2.1376698 3.4357646,1.7692645 4.1639818,1.8924422 7.3443941,2.430408 10.157621,4.0991994 12.720122,6.1421708 9.2129023,8.1547016 6.1301266,10.633713 4.2225247,12.78287 Z"/>
<path id="body" nodetypes="sccsssssss" label="body" transform="scale(0.26458333)" d="M 49.112445,21.099228 C 22.954714,27.711036 1.527486,58.455986 0,95 c 0,0 0.14555099,8.03117 2.203125,14.33203 5.6666732,6.49391 20.789398,15.3256 40.376953,17.79492 18.881266,2.38028 43.113333,-0.44591 58.314452,-3.86328 15.20113,-3.41737 22.82639,-13.27959 23.81641,-15.80664 0.99,-2.52705 0.10795,-7.720166 -0.5586,-9.939452 -0.81185,-2.70308 -2.0586,-6.277707 -0.39843,-11.148437 1.66016,-4.87073 6.29813,-26.667335 -1.93795,-40.330311 C 104.00212,16.487149 60.621666,18.190078 49.112445,21.099228 Z" style="fill:#6a6862;fill-opacity:1;stroke:none;stroke-width:0.999999px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.4501"/>
<path nodetypes="cssssccscc" d="m 22.327555,5.7244503 c 1.295051,-1.2796236 4.29637,-3.1081967 8.159348,-3.8489133 0.726869,-0.1393755 1.275878,-0.3385914 1.507105,0.671644 0.5493,2.3998947 0.260115,6.1627772 -0.183624,9.290803 -0.09005,0.634797 -0.13748,0.926935 -0.401908,1.157661 -0.166663,0.145421 -0.348874,0.03458 -0.480691,-0.205428 C 30.498042,10.236452 29.514494,9.1033428 28.085198,11.198105 26.729927,10.941604 23.64993,8.8809175 22.973987,7.9348896 22.480603,7.2443656 21.964165,6.144611 22.327555,5.7244523 Z" style="fill:#313131;fill-opacity:1;stroke-width:1.065;stroke-linecap:round" id="right-ear" label="right-ear"/>
<path label="right-ear-fluff" id="right-ear-fluff" style="fill:#474747;fill-opacity:1;stroke:none;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1" d="m 27.879768,10.88962 c 0.917454,-3.4533158 1.871544,-6.9096158 2.936108,-7.9180511 0.333617,-0.3160271 0.701301,-0.3066452 0.810217,0.2082143 0.180668,0.8540374 0.07574,5.863623 -0.69645,9.6117088 -0.490708,-0.870889 -0.688315,-1.352738 -1.168669,-1.673583 -0.03662,0.434725 -0.09026,0.799186 -0.158405,0.986263 -0.340904,-0.13671 -0.718058,-0.734496 -0.70563,-1.270164 -0.31728,0.467008 -1.20166,0.497588 -1.017178,0.05561 z" nodetypes="csscccccc"/>
<path d="m 8.8955811,28.354858 c -2.8336361,0.490336 -5.3574795,3.064648 -3.8664307,3.547587 1.7493878,0.782481 3.8677063,1.431757 6.2368286,1.733228 3.276507,0.416935 7.142104,0.225674 10.698305,-0.211028 1.463279,-0.136551 0.33034,-2.560542 -2.392107,-3.790675 C 16.517515,28.253727 12.37533,27.752718 8.8955811,28.354858 Z" nodetypes="scscss" id="belly" style="fill:#c8c8c8;fill-opacity:1;stroke-width:0.865;stroke-linecap:round;stroke-linejoin:round"/>
</g>
<g id="Features" groupmode="layer" label="Features">
<path style="fill:none;stroke:#313131;stroke-width:1.165;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" id="mouth" d="m 9.9318896,19.995623 c 0.5486154,1.686713 1.0637784,2.752111 1.5767164,3.423841 0.992384,-0.828422 2.25927,-1.977918 2.761386,-2.480155 0.783749,1.274883 1.856673,2.745088 2.294365,3.345841 1.285631,-1.024786 2.518532,-2.115492 3.025709,-2.688925" nodetypes="ccccc" label="mouth"/>
<path style="fill:none;fill-opacity:1;stroke:#313131;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1" id="left-whisker-2" d="M 6.1830023,19.578813 C 4.1871054,17.828608 2.4340957,16.609582 1.3611551,16.012965" label="left-whisker-2" nodetypes="cc"/>
<path d="M 5.9107876,21.690708 C 3.9277707,21.232921 1.7485086,21.187496 0.54513174,21.179815" label="left-whisker" id="left-whisker" style="fill:none;fill-opacity:1;stroke:#313131;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1" nodetypes="cc"/>
<path d="m 23.430617,22.366051 c 2.540328,-0.912678 4.284056,-1.105124 4.982397,-1.142629" id="right-whisker-2" label="right-whisker-2" style="fill:none;fill-opacity:1;stroke:#313131;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1"/>
<path label="right-whisker" style="fill:none;fill-opacity:1;stroke:#313131;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1" d="m 22.565965,24.701884 c 1.919035,0.580733 3.985374,1.582507 4.971704,2.283901" id="right-whisker"/>
<g id="left-eye" label="left-eye">
<ellipse label="left-iris" transform="rotate(15.432511)" cx="12.84594" rx="1.9893776" style="fill:url(#linearGradient1239);fill-opacity:1;stroke-width:0.793338;stroke-linecap:round;stroke-linejoin:round" cy="11.158217" ry="2.4450841" id="left-iris"/>
<ellipse style="fill:#313131;fill-opacity:1;stroke-width:0.820753;stroke-linecap:round;stroke-linejoin:round" transform="rotate(13.154497)" cx="12.410919" rx="1.1371835" ry="1.6859709" cy="11.69791" label="left-pupil" id="left-pupil"/>
</g>
<g id="right-eye" label="right-eye">
<ellipse cx="25.122091" style="fill:url(#linearGradient1097);stroke-width:0.84295;stroke-linecap:round;stroke-linejoin:round;fill-opacity:1" rx="2.1137855" transform="rotate(15.432511)" id="right-iris" cy="9.6188946" label="right-iris" ry="2.59799"/>
<ellipse transform="rotate(14.274327)" style="fill:#313131;fill-opacity:1;stroke-width:0.865;stroke-linecap:round;stroke-linejoin:round" rx="1.1984892" cx="24.939991" cy="10.106127" label="right-pupil" ry="1.7768617" id="right-pupil"/>
</g>
</g>
<metadata id="metadata30760">
<rdf:RDF>
<cc:Work about="">
<dc:rights>
<cc:Agent>
<dc:title>Blobfox team (https://git.shadamethyst.xyz/adri326/blobfox), licensed under the Apache 2.0 License</dc:title>
</cc:Agent>
</dc:rights>
<dc:title>blobcat</dc:title>
<dc:creator>
<cc:Agent>
<dc:title>Feuerfuchs</dc:title>
</cc:Agent>
</dc:creator>
<dc:source>https://git.shadamethyst.xyz/adri326/blobfox</dc:source>
</cc:Work>
</rdf:RDF>
</metadata>
</svg>

After

Width:  |  Height:  |  Size: 8.9 KiB

@ -0,0 +1,2 @@
name = "blobamber"
base = "../blobcat/"

@ -0,0 +1,15 @@
{{! Left ear }}
{{#base}}#left-ear{{/base}}
{{#base}}#body{{/base}}
{{#base}}#belly{{/base}}
{{#base}}#hair{{/base}}
{{! Right ear }}
{{#base}}#right-ear{{/base}}
{{#base}}#right-ear-fluff{{/base}}
{{! Whiskers }}
{{^tags.hands-reach}}
{{>whiskers}}
{{/tags.hands-reach}}

@ -0,0 +1,3 @@
{{#blobamber.base}}#blobamber-defs{{/blobamber.base}}
<!-- Hello world -->
{{>blobcat.eyes}}

@ -0,0 +1,16 @@
{{#tags.hand-3c}}
{{#tags.holding}}
<g transform="translate(0.5 -1)">
{{/tags.holding}}
{{^tags.holding}}
<g transform="translate(1.2 -2.9)">
{{/tags.holding}}
{{/tags.hand-3c}}
{{#set-fill}}
#6a6862 | {{>blobfox.hands}}
{{/set-fill}}
{{#tags.hand-3c}}
</g>
{{/tags.hand-3c}}

@ -1,30 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg5" space="preserve" height="128" docname="blobcat.svg" viewBox="0 0 33.866668 33.866668" width="128" version="1.2.1 (9c6d41e410, 2022-07-14)">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" docname="blobcat.svg" width="128" id="svg5" height="128" viewBox="0 0 33.866668 33.866668" version="1.2.1 (9c6d41e410, 2022-07-14)" space="preserve">
<title id="title30762">blobcat</title>
<sodipodi:namedview bordercolor="#ffffff" showpageshadow="2" document-units="mm" zoom="3.8198421" window-y="0" borderopacity="1" cy="67.542059" pagecheckerboard="1" pageshadow="0" pageopacity="0" pagecolor="#505050" id="namedview7" units="px" window-x="0" cx="40.839384" window-maximized="1" window-height="779" showgrid="false" deskcolor="#505050" window-width="1536" current-layer="layer3">
<inkscape:grid type="xygrid" id="grid10"/>
<sodipodi:namedview pagecolor="#505050" borderopacity="1" document-units="mm" current-layer="layer1" pageopacity="0" pageshadow="0" cx="28.096333" showgrid="false" window-maximized="1" showpageshadow="2" bordercolor="#ffffff" cy="-15.452983" window-width="1536" deskcolor="#505050" pagecheckerboard="1" window-y="0" zoom="2.13551" window-height="779" window-x="0" units="px" id="namedview7">
<inkscape:grid id="grid10" type="xygrid"/>
</sodipodi:namedview>
<defs id="defs2"/>
<g style="display:none" label="ref" groupmode="layer" id="ref">
<image x="0.45707837" preserveAspectRatio="none" style="display:none;image-rendering:optimizeSpeed" height="56.029915" id="blobfoxmsnuggleleftcat" label="blobfoxmsnuggleleftcat" y="-16.623016" width="56.029915" href="../original/blobfoxmsnuggleleftcat.png"/>
<image height="44.290115" preserveAspectRatio="none" style="display:none;image-rendering:optimizeSpeed" width="44.290115" href="../original/blobfoxnomcat.png" y="-10.339302" x="-3.1429539" id="blobfoxnomcat" label="blobfoxnomcat"/>
<image href="../original/blobfoxmsnugglecentercat.png" preserveAspectRatio="none" width="55.942009" y="-17.482618" id="blobfoxmsnugglecentercat" x="-11.634965" height="55.942009" style="display:none;image-rendering:optimizeSpeed" label="blobfoxmsnugglecentercat"/>
<image height="33.866665" x="0" style="display:none;image-rendering:optimizeSpeed" preserveAspectRatio="none" href="../original/blobfox.png" width="33.866665" label="blobfox" id="blobfox" y="0"/>
<g style="display:none" groupmode="layer" label="ref" id="ref">
<image preserveAspectRatio="none" href="../original/blobfoxmsnuggleleftcat.png" y="-16.623016" width="56.029915" height="56.029915" id="blobfoxmsnuggleleftcat" x="0.45707837" label="blobfoxmsnuggleleftcat" style="display:none;image-rendering:optimizeSpeed"/>
<image height="44.290115" id="blobfoxnomcat" href="../original/blobfoxnomcat.png" label="blobfoxnomcat" width="44.290115" style="display:none;image-rendering:optimizeSpeed" y="-10.339302" x="-3.1429539" preserveAspectRatio="none"/>
<image href="../original/blobfoxmsnugglecentercat.png" x="-11.634965" label="blobfoxmsnugglecentercat" width="55.942009" style="display:none;image-rendering:optimizeSpeed" y="-17.482618" height="55.942009" preserveAspectRatio="none" id="blobfoxmsnugglecentercat"/>
<image width="33.866665" href="../original/blobfox.png" y="0" style="display:none;image-rendering:optimizeSpeed" preserveAspectRatio="none" label="blobfox" x="0" height="33.866665" id="blobfox"/>
</g>
<g groupmode="layer" style="display:inline" id="Base" label="Base">
<path style="fill:#e9ae20;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="left-ear" d="M 4.0778933,12.468497 C 2.0572046,7.4297489 2.5604085,3.6951828 2.6743801,2.856386 2.7720357,2.1376698 3.4357646,1.7692645 4.1639818,1.8924422 7.3443941,2.430408 10.157621,4.0991994 12.720122,6.1421708 9.2129023,8.1547016 5.9854952,10.31934 4.0778933,12.468497 Z" nodetypes="csscc" label="left-ear"/>
<path style="fill:#fcc21b;fill-opacity:1;stroke:none;stroke-width:0.999999px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.4501" label="body" id="body" nodetypes="sccsssssss" transform="scale(0.26458333)" d="M 49.112445,21.099228 C 22.954714,27.711036 1.527486,58.455986 0,95 c 0,0 0.14555099,8.03117 2.203125,14.33203 5.6666732,6.49391 20.789398,15.3256 40.376953,17.79492 18.881266,2.38028 43.113333,-0.44591 58.314452,-3.86328 15.20113,-3.41737 22.82639,-13.27959 23.81641,-15.80664 0.99,-2.52705 0.10795,-7.720166 -0.5586,-9.939452 -0.81185,-2.70308 -2.0586,-6.277707 -0.39843,-11.148437 1.66016,-4.87073 6.29813,-26.667335 -1.93795,-40.330311 C 104.00212,16.487149 60.621666,18.190078 49.112445,21.099228 Z"/>
<path nodetypes="cssssccscc" id="right-ear" style="fill:#e9ae20;fill-opacity:1;stroke-width:1.065;stroke-linecap:round" label="right-ear" d="m 22.327555,5.7244503 c 1.295051,-1.2796236 3.500332,-2.9878384 7.386322,-3.5963965 0.537632,-0.084195 1.143941,-0.1550213 1.7273,0.7015614 1.469977,2.1584583 1.173915,6.0445604 0.6116,9.0693588 -0.117183,0.630353 -0.257711,1.453438 -0.632576,1.684499 -0.320739,0.197698 -0.580104,0.184392 -0.718333,-0.06853 C 30.272125,10.961178 26.453622,8.9536838 24.896724,10.183999 23.826653,9.6235262 22.962471,8.7347198 22.619988,8.1437471 22.194453,7.4094641 21.964165,6.144611 22.327555,5.7244523 Z"/>
<path style="fill:#8a6135;fill-opacity:1;stroke:none;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1" id="right-ear-fluff" d="m 24.892986,10.184048 c 1.125933,-1.215965 1.462231,-2.7360641 2.132129,-4.2954731 0.725687,-1.6892791 2.107058,-2.4070084 2.893408,-2.7287788 0.596644,-0.2441436 0.788066,-0.075182 0.935394,0.4300284 0.147325,0.5052097 1.075655,6.4176515 -0.150808,9.9265275 -0.672899,-1.745206 -1.860977,-2.691313 -2.721842,-3.119965 0.308581,0.43608 0.264187,0.774385 0.08088,1.27261 -0.798459,-0.541977 -1.099302,-0.858099 -1.429826,-1.583679 -0.503826,0.411547 -1.236317,0.401682 -1.739336,0.09873 z" nodetypes="cssscccccc" label="right-ear-fluff"/>
<path style="fill:#e9ae20;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="left-ear" d="M 4.2225247,12.78287 C 2.021009,7.5103594 2.5604085,3.6951828 2.6743801,2.856386 2.7720357,2.1376698 3.4357646,1.7692645 4.1639818,1.8924422 7.3443941,2.430408 10.157621,4.0991994 12.720122,6.1421708 9.2129023,8.1547016 6.1301266,10.633713 4.2225247,12.78287 Z" label="left-ear" nodetypes="csscc"/>
<path style="fill:#fcc21b;fill-opacity:1;stroke:none;stroke-width:0.999999px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.4501" label="body" transform="scale(0.26458333)" d="M 49.112445,21.099228 C 22.954714,27.711036 1.527486,58.455986 0,95 c 0,0 0.14555099,8.03117 2.203125,14.33203 5.6666732,6.49391 20.789398,15.3256 40.376953,17.79492 18.881266,2.38028 43.113333,-0.44591 58.314452,-3.86328 15.20113,-3.41737 22.82639,-13.27959 23.81641,-15.80664 0.99,-2.52705 0.10795,-7.720166 -0.5586,-9.939452 -0.81185,-2.70308 -2.0586,-6.277707 -0.39843,-11.148437 1.66016,-4.87073 6.29813,-26.667335 -1.93795,-40.330311 C 104.00212,16.487149 60.621666,18.190078 49.112445,21.099228 Z" nodetypes="sccsssssss" id="body"/>
<path label="right-ear" style="fill:#e9ae20;fill-opacity:1;stroke-width:1.065;stroke-linecap:round" d="m 22.327555,5.7244503 c 1.295051,-1.2796236 4.29637,-3.1081967 8.159348,-3.8489133 0.726869,-0.1393755 1.275878,-0.3385914 1.507105,0.671644 0.5493,2.3998947 0.260115,6.1627772 -0.183624,9.290803 -0.09005,0.634797 -0.13748,0.926935 -0.401908,1.157661 -0.166663,0.145421 -0.348874,0.03458 -0.480691,-0.205428 C 30.498042,10.236452 29.514494,9.1033428 28.085198,11.198105 26.729927,10.941604 23.64993,8.8809175 22.973987,7.9348896 22.480603,7.2443656 21.964165,6.144611 22.327555,5.7244523 Z" id="right-ear" nodetypes="cssssccscc"/>
<path d="m 27.879768,10.88962 c 0.917454,-3.4533158 1.871544,-6.9096158 2.936108,-7.9180511 0.333617,-0.3160271 0.701301,-0.3066452 0.810217,0.2082143 0.180668,0.8540374 0.07574,5.863623 -0.69645,9.6117088 -0.490708,-0.870889 -0.688315,-1.352738 -1.168669,-1.673583 -0.03662,0.434725 -0.09026,0.799186 -0.158405,0.986263 -0.340904,-0.13671 -0.718058,-0.734496 -0.70563,-1.270164 -0.31728,0.467008 -1.20166,0.497588 -1.017178,0.05561 z" id="right-ear-fluff" nodetypes="csscccccc" label="right-ear-fluff" style="fill:#8a6135;fill-opacity:1;stroke:none;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1"/>
</g>
<g id="Features" label="Features" groupmode="layer">
<path d="m 7.3527787,14.424665 c 0.1797912,-1.565032 1.4709763,-2.669662 2.4784762,-2.637439 1.0481491,0.03352 1.7111831,1.106758 1.6559461,1.895304 -0.109337,1.560853 -0.980796,2.946701 -2.4842238,2.935699 -0.9121407,-0.0067 -1.7841833,-1.027265 -1.6501985,-2.193564 z" id="left-eye" label="left-eye" nodetypes="sssss" style="fill:#313131;fill-opacity:1;stroke:none;stroke-width:0.265;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.46432"/>
<path nodetypes="sssss" style="fill:#313131;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.46432" d="m 19.490943,16.103085 c 0.179791,-1.80508 1.475044,-2.789355 2.482544,-2.757132 1.04815,0.03352 1.921875,1.215376 1.852143,2.278752 -0.113562,1.731761 -1.084893,2.877453 -2.588321,2.866451 -0.912141,-0.0067 -1.862721,-1.219882 -1.746366,-2.388071 z" label="right-eye" id="right-eye"/>
<path style="fill:none;stroke:#313131;stroke-width:1.165;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="m 9.9318896,19.995623 c 0.5486154,1.686713 1.0637784,2.752111 1.5767164,3.423841 0.992384,-0.828422 2.25927,-1.977918 2.761386,-2.480155 0.783749,1.274883 1.856673,2.745088 2.294365,3.345841 1.285631,-1.024786 2.518532,-2.115492 3.025709,-2.688925" id="mouth" nodetypes="ccccc" label="mouth"/>
<path style="fill:none;fill-opacity:1;stroke:#313131;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1" nodetypes="cc" label="left-whisker-2" d="M 6.1830023,19.578813 C 4.1871054,17.828608 2.4340957,16.609582 1.3611551,16.012965" id="left-whisker-2"/>
<path style="fill:none;fill-opacity:1;stroke:#313131;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1" id="left-whisker" nodetypes="cc" label="left-whisker" d="M 5.9107876,21.690708 C 3.9277707,21.232921 1.7485086,21.187496 0.54513174,21.179815"/>
<path id="right-whisker-2" d="m 23.430617,22.366051 c 2.540328,-0.912678 4.284056,-1.105124 4.982397,-1.142629" style="fill:none;fill-opacity:1;stroke:#313131;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1" label="right-whisker-2"/>
<path id="right-whisker" label="right-whisker" d="m 22.565965,24.701884 c 1.919035,0.580733 3.985374,1.582507 4.971704,2.283901" style="fill:none;fill-opacity:1;stroke:#313131;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1"/>
<g groupmode="layer" id="Features" label="Features">
<path id="left-eye" label="left-eye" d="m 7.3527787,14.424665 c 0.1797912,-1.565032 1.4709763,-2.669662 2.4784762,-2.637439 1.0481491,0.03352 1.7111831,1.106758 1.6559461,1.895304 -0.109337,1.560853 -0.980796,2.946701 -2.4842238,2.935699 -0.9121407,-0.0067 -1.7841833,-1.027265 -1.6501985,-2.193564 z" nodetypes="sssss" style="fill:#313131;fill-opacity:1;stroke:none;stroke-width:0.265;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.46432"/>
<path label="right-eye" d="m 19.490943,16.103085 c 0.179791,-1.80508 1.475044,-2.789355 2.482544,-2.757132 1.04815,0.03352 1.921875,1.215376 1.852143,2.278752 -0.113562,1.731761 -1.084893,2.877453 -2.588321,2.866451 -0.912141,-0.0067 -1.862721,-1.219882 -1.746366,-2.388071 z" nodetypes="sssss" id="right-eye" style="fill:#313131;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.46432"/>
<path id="mouth" nodetypes="ccccc" style="fill:none;stroke:#313131;stroke-width:1.165;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" label="mouth" d="m 9.9318896,19.995623 c 0.5486154,1.686713 1.0637784,2.752111 1.5767164,3.423841 0.992384,-0.828422 2.25927,-1.977918 2.761386,-2.480155 0.783749,1.274883 1.856673,2.745088 2.294365,3.345841 1.285631,-1.024786 2.518532,-2.115492 3.025709,-2.688925"/>
<path style="fill:none;fill-opacity:1;stroke:#313131;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1" d="M 6.1830023,19.578813 C 4.1871054,17.828608 2.4340957,16.609582 1.3611551,16.012965" label="left-whisker-2" nodetypes="cc" id="left-whisker-2"/>
<path d="M 5.9107876,21.690708 C 3.9277707,21.232921 1.7485086,21.187496 0.54513174,21.179815" style="fill:none;fill-opacity:1;stroke:#313131;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1" id="left-whisker" label="left-whisker" nodetypes="cc"/>
<path style="fill:none;fill-opacity:1;stroke:#313131;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1" id="right-whisker-2" label="right-whisker-2" d="m 23.430617,22.366051 c 2.540328,-0.912678 4.284056,-1.105124 4.982397,-1.142629"/>
<path id="right-whisker" label="right-whisker" style="fill:none;fill-opacity:1;stroke:#313131;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1" d="m 22.565965,24.701884 c 1.919035,0.580733 3.985374,1.582507 4.971704,2.283901"/>
</g>
<metadata id="metadata30760">
<rdf:RDF>

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

@ -1,3 +1,3 @@
<g id="hand-boop" transform="translate(1.5 -1)">
{{>parent.hand-boop}}
{{>blobfox.hand-boop}}
</g>

@ -1,3 +1,3 @@
{{#set-fill}}
#fcc21b | {{>parent.hands}}
#fcc21b | {{>blobfox.hands}}
{{/set-fill}}

@ -4,7 +4,7 @@
{{#tags.mouth-hmpf}}
<g transform="translate(0.5 0)">
{{/tags.mouth-hmpf}}
{{>parent.mouth}}
{{>blobfox.mouth}}
{{#tags.boop}}
</g>
{{/tags.boop}}

@ -1,17 +1,17 @@
{{#tags.body-snug}}
<g transform="translate(1.5 0)">
{{#parent.base}}#nose{{/parent.base}}
{{#blobfox.base}}#nose{{/blobfox.base}}
</g>
{{/tags.body-snug}}
{{#tags.boop}}
<g transform="translate(1.5 -0.5)">
{{#parent.base}}#nose{{/parent.base}}
{{#blobfox.base}}#nose{{/blobfox.base}}
</g>
{{/tags.boop}}
{{#tags.mouth-hmpf}}
<g transform="translate(0.7 -0.2)">
{{#parent.base}}#nose{{/parent.base}}
{{#blobfox.base}}#nose{{/blobfox.base}}
</g>
{{/tags.mouth-hmpf}}

@ -1 +1 @@
{{#set-fill}}#fcc21b|{{>parent.tail}}{{/set-fill}}
{{#set-fill}}#fcc21b|{{>blobfox.tail}}{{/set-fill}}

@ -46,10 +46,10 @@ impl RenderingContext {
}
pub fn get_data(&self, variant_name: &str) -> Data {
self.get_builder(variant_name).build()
self.get_builder(variant_name, true).build()
}
fn get_builder(&self, variant_name: &str) -> MapBuilder {
fn get_builder(&self, variant_name: &str, include_parent: bool) -> MapBuilder {
let mut builder = MapBuilder::new();
builder = builder.insert_map("variant", |mut builder| {
@ -124,12 +124,20 @@ impl RenderingContext {
}
});
if let Some(ref parent) = self.parent {
let parent = parent.clone();
let variant_name = variant_name.to_string();
builder = builder.insert_map("parent", move |_| {
parent.get_builder(&variant_name)
});
if include_parent {
let mut this = self.clone();
loop {
builder = builder.insert_map(&this.species.name, |_| {
this.get_builder(variant_name, false)
});
if let Some(ref parent) = this.parent {
this = *parent.clone();
} else {
break
}
}
}
// TODO: memoize the builder to this stage
@ -197,16 +205,30 @@ impl PartialLoader for RenderingContext {
fn load(&self, name: impl AsRef<Path>) -> Result<String, mustache::Error> {
let name = name.as_ref().to_str().ok_or(mustache::Error::InvalidStr)?;
if let Some(ref parent) = self.parent {
if name.starts_with("parent.") {
return parent.load(&name[7..]);
}
}
let components = name.split('.').collect::<Vec<_>>();
if let Some(path) = self.species.template_paths.get(name) {
Ok(std::fs::read_to_string(path)?)
if components.len() == 1 {
if let Some(path) = self.species.template_paths.get(name) {
Ok(std::fs::read_to_string(path)?)
} else {
eprintln!("No template named {}", name);
Err(mustache::Error::NoFilename)
}
} else if components.len() == 2 {
if components[0] == self.species.name {
self.load(components[1])
} else if let Some(ref parent) = self.parent {
parent.load(name)
} else {
eprintln!(
"Cannot get template named {}: no species called {} in the inheritance tree",
name,
components[0]
);
Err(mustache::Error::NoFilename)
}
} else {
eprintln!("No template named {}", name);
eprintln!("Cannot get template named {}: expected `name` or `species.name`", name);
Err(mustache::Error::NoFilename)
}
}

@ -28,15 +28,15 @@
inkscape:pagecheckerboard="1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="3.8198421"
inkscape:cx="40.839384"
inkscape:cy="67.542059"
inkscape:zoom="2.13551"
inkscape:cx="28.096333"
inkscape:cy="-15.452983"
inkscape:window-width="1536"
inkscape:window-height="779"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer3"
inkscape:current-layer="layer1"
units="px"
inkscape:showpageshadow="2"
inkscape:deskcolor="#505050"><inkscape:grid
@ -88,7 +88,7 @@
id="layer1"
style="display:inline"><path
style="fill:#e9ae20;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 4.0778933,12.468497 C 2.0572046,7.4297489 2.5604085,3.6951828 2.6743801,2.856386 2.7720357,2.1376698 3.4357646,1.7692645 4.1639818,1.8924422 7.3443941,2.430408 10.157621,4.0991994 12.720122,6.1421708 9.2129023,8.1547016 5.9854952,10.31934 4.0778933,12.468497 Z"
d="M 4.2225247,12.78287 C 2.021009,7.5103594 2.5604085,3.6951828 2.6743801,2.856386 2.7720357,2.1376698 3.4357646,1.7692645 4.1639818,1.8924422 7.3443941,2.430408 10.157621,4.0991994 12.720122,6.1421708 9.2129023,8.1547016 6.1301266,10.633713 4.2225247,12.78287 Z"
id="path20678"
sodipodi:nodetypes="csscc"
inkscape:label="left-ear" /><path
@ -99,14 +99,14 @@
sodipodi:nodetypes="sccsssssss"
inkscape:label="body" /><path
style="fill:#e9ae20;fill-opacity:1;stroke-width:1.065;stroke-linecap:round"
d="m 22.327555,5.7244503 c 1.295051,-1.2796236 3.500332,-2.9878384 7.386322,-3.5963965 0.537632,-0.084195 1.143941,-0.1550213 1.7273,0.7015614 1.469977,2.1584583 1.173915,6.0445604 0.6116,9.0693588 -0.117183,0.630353 -0.257711,1.453438 -0.632576,1.684499 -0.320739,0.197698 -0.580104,0.184392 -0.718333,-0.06853 C 30.272125,10.961178 26.453622,8.9536838 24.896724,10.183999 23.826653,9.6235262 22.962471,8.7347198 22.619988,8.1437471 22.194453,7.4094641 21.964165,6.144611 22.327555,5.7244523 Z"
d="m 22.327555,5.7244503 c 1.295051,-1.2796236 4.29637,-3.1081967 8.159348,-3.8489133 0.726869,-0.1393755 1.275878,-0.3385914 1.507105,0.671644 0.5493,2.3998947 0.260115,6.1627772 -0.183624,9.290803 -0.09005,0.634797 -0.13748,0.926935 -0.401908,1.157661 -0.166663,0.145421 -0.348874,0.03458 -0.480691,-0.205428 C 30.498042,10.236452 29.514494,9.1033428 28.085198,11.198105 26.729927,10.941604 23.64993,8.8809175 22.973987,7.9348896 22.480603,7.2443656 21.964165,6.144611 22.327555,5.7244523 Z"
id="path501"
sodipodi:nodetypes="cssssccscc"
inkscape:label="right-ear" /><path
style="fill:#8a6135;fill-opacity:1;stroke:none;stroke-width:1.065;stroke-linecap:round;stroke-opacity:1"
d="m 24.892986,10.184048 c 1.125933,-1.215965 1.462231,-2.7360641 2.132129,-4.2954731 0.725687,-1.6892791 2.107058,-2.4070084 2.893408,-2.7287788 0.596644,-0.2441436 0.788066,-0.075182 0.935394,0.4300284 0.147325,0.5052097 1.075655,6.4176515 -0.150808,9.9265275 -0.672899,-1.745206 -1.860977,-2.691313 -2.721842,-3.119965 0.308581,0.43608 0.264187,0.774385 0.08088,1.27261 -0.798459,-0.541977 -1.099302,-0.858099 -1.429826,-1.583679 -0.503826,0.411547 -1.236317,0.401682 -1.739336,0.09873 z"
d="m 27.879768,10.88962 c 0.917454,-3.4533158 1.871544,-6.9096158 2.936108,-7.9180511 0.333617,-0.3160271 0.701301,-0.3066452 0.810217,0.2082143 0.180668,0.8540374 0.07574,5.863623 -0.69645,9.6117088 -0.490708,-0.870889 -0.688315,-1.352738 -1.168669,-1.673583 -0.03662,0.434725 -0.09026,0.799186 -0.158405,0.986263 -0.340904,-0.13671 -0.718058,-0.734496 -0.70563,-1.270164 -0.31728,0.467008 -1.20166,0.497588 -1.017178,0.05561 z"
id="path4922"
sodipodi:nodetypes="cssscccccc"
sodipodi:nodetypes="csscccccc"
inkscape:label="right-ear-fluff" /></g><g
inkscape:groupmode="layer"
id="layer3"

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

Loading…
Cancel
Save