Horde3D is a small 3D rendering and animation engine. It is written in an effort to create an engine being as lightweight and conceptually clean as possible.
Without this patch, ColladaConv will use the name attribute (if available) of each material to generate the .material.xml filenames.
The problem is that, sometimes, this material.name contains special reserved characters that will cause unexpected issues with some file-system, and renaming each material in the "DCC tool-chain" might be time consuming.
As the id attribute of each material follows the XML schema xs:ID rule, it should be safer to use it to make .material.xml filenames.
This patch adds a new -useMaterialId command line argument that tells to ColladaConv to use material.id instead of material.name.
Regarding : https://github.com/horde3d/Horde3D/issues/193
Without this patch,
ColladaConv
will use thename
attribute (if available) of each material to generate the.material.xml
filenames.The problem is that, sometimes, this
material.name
contains special reserved characters that will cause unexpected issues with some file-system, and renaming each material in the "DCC tool-chain" might be time consuming.As the
id
attribute of each material follows the XML schemaxs:ID
rule, it should be safer to use it to make.material.xml
filenames.This patch adds a new
-useMaterialId
command line argument that tells toColladaConv
to usematerial.id
instead ofmaterial.name
.Rationalisation :
Ok, so according to Collada Spec 1.4 page 8.54 : the
id
attribute of<material>
is of typexs:ID
.According to xml-schema :
xs:ID
is derived fromxs:NCName
.According to xml-schema : the
xs:NCName
valid pattern is[\i-[:]][\c-[:]]*
.And according to this page:
\i
could translates to[_:A-Za-z]
and\c
could translates to[-._:A-Za-z0-9]
-[:]
excludes:
from the\i
and\c
classes of characters.So,
[\i-[:]][\c-[:]]*
translates into english to :_
, followed by any number of unicode letters, digits,_
or-
or.
So, if this is correct, using the
id
attribute of<material>
to generate the.material.xml
filenames is safer than using its name attribute.