3ds max Collada exporter v2.10 bug

Hi there!

There is a small bug in exporter. I’m trying to export scene with morphing animation( “Bezier float” controller ). And it seems that output tangents are adding to weights.

here is the resulting collada file code snippet:


<animation id="">
  <source id="time">
    <float_array id="time-array" count="3">0 0.966667 2.966667</float_array>
      <technique_common>
        <accessor source="#time-array" count="3">
          <param name="TIME" type="float"></param>
        </accessor>
       </technique_common>
  </source>
  <source id="value">
    <float_array id="value-array" count="3">00 0.7619090.199717 0.9964780</float_array>
     <technique_common>
       <accessor source="#value-array" count="3">
         <param name="WEIGHT" type="float"></param>
       </accessor>
     </technique_common>
  </source>
  <source id="interp">
    <Name_array id="nterp-array" count="3">BEZIER BEZIER BEZIER</Name_array>
      <technique_common>
        <accessor source="#interp-array" count="3">
          <param name="WEIGHT" type="Name"></param>
        </accessor>
       </technique_common>
   </source>
   <source id="intgt">
     <float_array id="intgt-array" count="3">0 -0.199717 0</float_array>
       <technique_common>
        <accessor source="#intgt-array" count="3">
          <param name="WEIGHT" type="float"></param>
        </accessor>
       </technique_common>
   </source>
   <source id="outtgt">
     <float_array id="outtgt-array" count="3"></float_array>
       <technique_common>
        <accessor source="#outtgt-array" count="3">
          <param name="WEIGHT" type="float"></param>
        </accessor>
       </technique_common>
   </source>
   <sampler id="sampler">
     <input semantic="INPUT" source="#time"></input>
     <input semantic="OUTPUT" source="#value"></input>
     <input semantic="INTERPOLATION" source="#nterp"></input>
     <input semantic="IN_TANGENT" source="#intgt"></input>
     <input semantic="OUT_TANGENT" source="#outtgt"></input>
   </sampler>
   <channel source="#sampler" target="Sphere01-obj[0]"></channel>
</animation>

and here is code snippet from ColladaExporter.cpp(lines 1515-1521):
–> - my comments :))


    case HYBRIDINTERP_FLOAT_CLASS_ID:	
	ki->GetKey(i, &bfk); keyTime = bfk.time;
	vString.append(ap.mapper->Map(bfk.val));
	// tangents
	itString.append(bfk.intan * fr);

-->   // i think there is a mistype in the next line...
 	vString.append(bfk.outtan * fr);

-->   // and it should be like this
-->	otString.append(bfk.outtan * fr);

	break;

Best regards,
Sergey V. Kuyvalaynen

and one more thing…

  1. Collada specification 1.4

The target attribute syntax has several parts:

skipped

• The final part is optional. If this part is absent, all member values of the target element are targeted (for example, all values of a matrix). If this part is present, it can take one of two forms:
o The name of the member value (field) indicating symbolic access. This notation consists of: A literal period (.)indicating member selection access. The symbolic name of the member value (field). The "Common Glossary” section in Chapter 4 documents values for this field under the common profile.
o The cardinal position of the member value (field) indicating array access. This notation consists of:
A literal left parenthesis ( ( )indicating array selection access.
A number of the field, starting at zero for the first field.
A literal right parenthesis ( ) )closing the expression.

  1. 3ds max exporter result
<channel source="#sampler" target="Sphere01-obj[0]"></channel>

square brackets instead of parenthesis…

is it ok? or is it a bug?

Thanks Sergey to spot this out. There was another bug reorted by yoshi on normals in the exporter.
I will shortly post a new version of the exporter with your two fixes.
Regarding the ‘[’ vs ‘(’, I will wait before moving on this.

Regards,
Jean-Luc.