dae2egg Assertion Failed

The Collada exporter in Blender 2.5 is friendly and much nicer to use than that of 2.49, however, When trying to convert a 2.5 exported dae to egg, I get this message:

Assertion failed: (csource->GetStride() == 4), function process_mesh, file pandatool/src/daeegg/daeToEggConverter.cxx, line 418.

My model is a simple default cube. (light and camera deleted)

Normally, I’d assume that the new dae exporter in 2.5 isn’t yet functioning correctly but Mac OS 10.6.4 is able to generate a neat, interactive 3D preview of the file from the finder, so Preview.app understands it just fine. Ironically, when exporting the same cube with the Blender 2.49 exporter, Mac OS is unable to read the file and displays a default icon in place of a preview, but dae2egg is working as intended.

Is this a compatability thing between Collada 1.4 and Collada 1.5?

Hmm, it appears like the Blender COLLADA exporter specifies 3-channel colours, while dae2egg only accepts 4-channel colours.
I can easily modify it to also accept 3-channel colours. Could you e-mail me the .dae file, so I can test my changes?

OK, I just checked in a fix to CVS. I haven’t actually tested it yet though, so I’d still like to see a .dae file with the problem.

I’m tearing up the floorboards on my server presently… so you get copypasta XML. You should be able to get this same file with blender 2.5.3 by deleting the default light and camera, then exporting the remaining cube.

<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
  <asset>
    <created>2010-08-26T22:53:04</created>
    <modified>2010-08-26T22:53:04</modified>
    <unit name="decimetre" meter="0.1"/>
    <up_axis>Z_UP</up_axis>
  </asset>
  <library_cameras/>
  <library_lights/>
  <library_images/>
  <library_effects>
    <effect id="Material-effect">
      <profile_COMMON>
        <technique sid="common">
          <lambert>
            <emission>
              <color>0 0 0 1</color>
            </emission>
            <ambient>
              <color>0 0 0 1</color>
            </ambient>
            <diffuse>
              <color>0.800000011921 0.800000011921 0.800000011921 1</color>
            </diffuse>
            <reflective>
              <color>1 1 1 1</color>
            </reflective>
            <reflectivity>
              <float>0.5</float>
            </reflectivity>
            <transparent>
              <color>0 0 0 1</color>
            </transparent>
            <transparency>
              <float>1</float>
            </transparency>
            <index_of_refraction>
              <float>1</float>
            </index_of_refraction>
          </lambert>
        </technique>
        <extra>
          <technique profile="GOOGLEEARTH">
            <double_sided>1</double_sided>
          </technique>
        </extra>
      </profile_COMMON>
      <extra><technique profile="MAX3D"><double_sided>1</double_sided></technique></extra>
    </effect>
  </library_effects>
  <library_materials>
    <material id="Material" name="Material">
      <instance_effect url="#Material-effect"/>
    </material>
  </library_materials>
  <library_geometries>
    <geometry id="Cube-mesh">
      <mesh>
        <source id="Cube-mesh-positions">
          <float_array id="Cube-mesh-positions-array" count="24">1 0.999999940395 -1 1 -1 -1 -1 -0.999999821186 -1 -0.999999642372 1 -1 1 0.999999463558 1 0.999999344348 -1.000001 1 -1 -0.999999642372 1 -0.999999940395 1 1</float_array>
          <technique_common>
            <accessor source="#Cube-mesh-positions-array" count="8" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="Cube-mesh-normals">
          <float_array id="Cube-mesh-normals-array" count="18">0 0 -1 0 0 1 1 -2.83122e-7 0 -2.83122e-7 -1 0 -1 2.23517e-7 -1.3411e-7 2.38419e-7 1 2.08616e-7</float_array>
          <technique_common>
            <accessor source="#Cube-mesh-normals-array" count="6" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="Cube-mesh-map-0">
          <float_array id="Cube-mesh-map-0-array" count="48">0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1</float_array>
          <technique_common>
            <accessor source="#Cube-mesh-map-0-array" count="24" stride="2">
              <param name="S" type="float"/>
              <param name="T" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="Cube-mesh-colors">
          <float_array id="Cube-mesh-colors-array" count="72">1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</float_array>
          <technique_common>
            <accessor source="#Cube-mesh-colors-array" count="24" stride="3">
              <param name="R" type="float"/>
              <param name="G" type="float"/>
              <param name="B" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <vertices id="Cube-mesh-vertices">
          <input semantic="POSITION" source="#Cube-mesh-positions"/>
        </vertices>
        <polylist material="Material" count="6">
          <input semantic="VERTEX" source="#Cube-mesh-vertices" offset="0"/>
          <input semantic="NORMAL" source="#Cube-mesh-normals" offset="1"/>
          <input semantic="TEXCOORD" source="#Cube-mesh-map-0" offset="2" set="0"/>
          <input semantic="COLOR" source="#Cube-mesh-colors" offset="3"/>
          <vcount>4 4 4 4 4 4 </vcount>
          <p>0 0 0 0 1 0 1 1 2 0 2 2 3 0 3 3 4 1 4 4 7 1 5 5 6 1 6 6 5 1 7 7 0 2 8 8 4 2 9 9 5 2 10 10 1 2 11 11 1 3 12 12 5 3 13 13 6 3 14 14 2 3 15 15 2 4 16 16 6 4 17 17 7 4 18 18 3 4 19 19 4 5 20 20 0 5 21 21 3 5 22 22 7 5 23 23</p>
        </polylist>
      </mesh>
    </geometry>
  </library_geometries>
  <library_animations/>
  <library_controllers/>
  <library_visual_scenes>
    <visual_scene id="Scene" name="Scene">
      <node id="Cube" type="NODE">
        <translate sid="location">0 0 0</translate>
        <rotate sid="rotationZ">0 0 1 0</rotate>
        <rotate sid="rotationY">0 1 0 0</rotate>
        <rotate sid="rotationX">1 0 0 0</rotate>
        <scale sid="scale">1 1 1</scale>
        <instance_geometry url="#Cube-mesh">
          <bind_material>
            <technique_common>
              <instance_material symbol="Material" target="#Material">
                <bind_vertex_input semantic="UVTex" input_semantic="TEXCOORD" input_set="0"/>
              </instance_material>
            </technique_common>
          </bind_material>
        </instance_geometry>
      </node>
    </visual_scene>
  </library_visual_scenes>
  <scene>
    <instance_visual_scene url="#Scene"/>
  </scene>
</COLLADA>

I’ll build the tool from the latest snapshot as soon as I finish getting my developer tools installed. (brand new iMac! :3 )

OK, I can confirm that this converts correctly now. Thank you.

Note that you don’t need to build anything to try the latest snapshot version - there are daily compiled builds here:
panda3d.org/buildbot/

Excellent, you’ve just improved my quality of life, good sir. Thank you very much.

If I were to wrap your clever binary inside an OS X package so that it would function as a drag and drop converter, would that be something worthy of distributing with the API? Or is the community not as lazy as me and converting through the command line is sufficiently trivial.

Nevermind I made it anyway.
https://discourse.panda3d.org/viewtopic.php?t=9872