SahelFllh / opencollada

Automatically exported from code.google.com/p/opencollada
0 stars 0 forks source link

[ColladaMAX] Material names have an unnecessary and sometimes inconsisten suffix "_1" #144

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make a scene in MAX where two objects use the same material.
2. Export it with the plugin default options.

What is the expected output? What do you see instead?
The tag for the polylist contains a material name like this for the first of 
the objects:
<polylist material="MATERIALNAME_1" count="596">

and like this for the second one (and third and forth...), which looks better:
<polylist material="MATERIALNAME" count="596">

Both materials are then pointing to the same effect, which is correct. The 
problem is only in the name of the first of them having an extra "_1". The 
problem is in the function

What version of the product are you using? On what operating system?
This happens with the current trunk, in any os and MAX version.

Please provide any additional information below.

The problem i s in the addId function called from addSymbol. The first time, 
addSymbol is called from the exportSimpleEffect and then again from the 
exportStandardEffect (which adds the "_1"). The second other objects already 
find the generated material (the one added from exportSimpleEffect, with the 
unmodifed name) so they are ok.

I attached the patch i use to solve it, however, it should be tested with 
multiple (composite?) materials, as i only tested with simple ones.

It just checks for the name before adding it, and it doesn't add it if it 
points to the same node.

Thanks!

Original issue reported on code.google.com by camin...@gmail.com on 6 Dec 2010 at 2:37

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for providing this patch. It has been applied in revision 787.

Original comment by opencollada2@googlemail.com on 15 Dec 2010 at 2:04