Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#33168] Collada export from Blender 2.64a has incorrect material names

Date:
2012-11-13 20:24
Priority:
3
State:
Closed
Submitted by:
Michael Bean (cannos)
Assigned to:
Gaia Clary (gaiaclary)
Category:
Import/Export
Status:
Fixed / Closed
Relates to:
Duplicates:
Patches:
 
Summary:
Collada export from Blender 2.64a has incorrect material names
Detailed description
In Blender version 2.64a, the Collada exporter isn't exporting material names. It appears to be copying the material node ID name as the material name.

I have attached files that demonstrate the issue. There is a default cube with a material named "TestMatName[extra]".

If exported to Collada with 2.63, the material name is correct:
<material id="TestMatName_extra_-material" name="TestMatName[extra]">

If exported to Collada with 2.64, the material name is incorrect (the name matches the id):
<material id="TestMatName_extra_-material" name="TestMatName_extra_-material">


Exporting the correct material names are critical for tools that use naming conventions to specify material userdata.

Followup

Message
  • Date: 2012-11-27 21:54
  • Sender: Brecht Van Lommel
  • I agree the -material postfix should not be there. However I'm not sure [ and ] are valid tokens for names, sketchup seems to convert them to _ when saving, and preview refuses to open collada files with these tokens in names.
  • Date: 2012-11-27 22:27
  • Sender: Brecht Van Lommel
  • I meant characters rather than tokens of course.

    Anyway, I found out that in Collada 1.4 the material name attribute is defined as "xs:NCName", which is not allowed to contain brackets. Collada 1.5 on the other hand has it defined as "xs:token" which can contain any character. We are still writing Collada 1.4 files currently, so writing the [ character would not be valid. The problem is that Collada 1.5 is not backwards compatible so switching to that is not a simple decision (and outside the scope of this bug report anyway).

    I removed the -material postfix now in svn, but further we will only preserve these character according to the spec:
    http://www.w3.org/TR/2000/WD-xml-2e-20000814#NT-NameChar
  • Date: 2012-11-28 00:06
  • Sender: Michael Bean
  • Okay, so I guess it was a bug in Blender 2.63 that it supported those special characters in the material name? Thanks.
  • Date: 2012-11-28 00:39
  • Sender: Brecht Van Lommel
  • Indeed, that was a bug which caused some applications to fail opening our collada files. I fear you'll have to find a different syntax to specify that material userdata.
  • Date: 2012-11-28 01:17
  • Sender: Michael Bean
  • Yeah, I'll figure out some other workaround, or continue to use 2.63 for a while. Are there any other plans to export material userdata to Collada? Collada does have some "extra" nodes in materials for this type of information.
 

Attached Files:

Name Date Download
matnametest264.dae 2012-11-13 20:24 Download
matnametest263.dae 2012-11-13 20:24 Download
matnametest.blend 2012-11-13 20:24 Download

Changes:

Field Old Value Date By
status_idOpen2012-11-27 22:27blendix
close_dateNone2012-11-27 22:27blendix
StatusInvestigate2012-11-27 22:27blendix
assigned_tonone2012-11-13 20:56gaiaclary
StatusNew2012-11-13 20:56gaiaclary
File Added22752: matnametest.blend2012-11-13 20:24cannos
File Added22753: matnametest263.dae2012-11-13 20:24cannos
File Added22754: matnametest264.dae2012-11-13 20:24cannos