some XSLT bugfixes

metadata
Wenzel Jakob 2012-05-25 06:25:44 +12:00
parent 98ea89edfe
commit fd02fb9924
1 changed files with 13 additions and 13 deletions

View File

@ -43,13 +43,21 @@
</lookAt> </lookAt>
</xsl:template> </xsl:template>
<xsl:template match="shape">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<!-- The vertical component of OBJ texture coordinates is now <!-- The vertical component of OBJ texture coordinates is now
flipped, which seems to be the standard behavior. Undo flipped, which seems to be the standard behavior. Undo
this change for consistency in old scenes. --> this change for consistency in old scenes. -->
<xsl:template match="shape[@type='obj']"> <xsl:if test="@type='obj'">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<boolean name="flipTexCoords" value="false"/> <boolean name="flipTexCoords" value="false"/>
</xsl:if>
<!-- Apply a diffuse material to shapes that don't have any media or BSDFs -->
<xsl:if test="not(bsdf) and not(ref) and not(medium) and not(subsurface)">
<bsdf type="diffuse"/>
</xsl:if>
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>
@ -150,14 +158,6 @@
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<!-- Apply a diffuse material to shapes that don't have any media or BSDFs -->
<xsl:template match="shape[not(bsdf) and not(ref) and not(medium)]">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<bsdf type="diffuse"/>
</xsl:copy>
</xsl:template>
<!-- Update the parameters of the sphere plugin --> <!-- Update the parameters of the sphere plugin -->
<xsl:template match="shape[@type='sphere']/boolean[@name='inverted']/@name"> <xsl:template match="shape[@type='sphere']/boolean[@name='inverted']/@name">
<xsl:attribute name="name">flipNormals</xsl:attribute> <xsl:attribute name="name">flipNormals</xsl:attribute>