Results 1 to 3 of 3

Thread: Collada Export File Vertex Weights Problem

  1. #1
    Newbie
    Join Date
    Feb 2018
    Posts
    2

    Collada Export File Vertex Weights Problem

    Hello,

    i have a problem, i exported a cube elebow with 3 bones from Maya in collada and want to load it in my project, so i read the docu about Vertex Weights and Bone Indices.

    The docu says that vcount in library_controllers has the same count as the total vertices count in the mesh, but in my case, i tried it with many different meshes, is the vertex weights count everytime smaller as the total vertices count in the mesh.

    My elbow cube has total 60 vertices, but in the library_controller has the vertex weights vcount only 12

    How do i get/calculate the influence of the other 48 Vertices Weights/Bones Indices

    Greets
    Benjamin

    Here is a image of my model
    https://www2.pic-upload.de/img/34788569/01.jpg

    Here is a image of my model, only display the vertices that has a vertex weight
    https://www2.pic-upload.de/img/34788568/02.jpg

    Here is the Model Collada File

    Code :
          <triangles count="20" material="lambert1"><input semantic="VERTEX" offset="0" source="#pCube1-VERTEX"/><input semantic="NORMAL" offset="1" source="#pCube1-Normal0"/><input semantic="TEXCOORD" offset="2" set="0" source="#pCube1-UV0"/><p> 3 0 3 2 1 2 0 2 0 3 3 3 0 4 0 1 5 1 3 6 3 5 7 5 2 8 2 2 9 2 5 10 5 4 11 4 7 12 7 6 13 6 4 14 4 7 15 7 4 16 4 5 17 5 1 18 9 0 19 8 6 20 6 1 21 9 6 22 6 7 23 7 11 24 17 9 25 14 10 26 16 9 27 14 8 28 15 10 29 16 2 30 2 6 31 12 0 32 0 6 33 12 2 34 2 4 35 13 7 36 10 8 37 15 1 38 1 9 39 14 1 40 1 8 41 15 5 42 11 10 43 16 7 44 10 8 45 15 7 46 10 10 47 16 11 48 17 5 49 11 3 50 3 5 51 11 11 52 17 10 53 16 1 54 1 9 55 14 3 56 3 11 57 17 3 58 3 9 59 14</p></triangles>
          </mesh>
        </geometry>
      </library_geometries>
      <library_controllers>
        <controller id="pCube1Controller">
          <skin source="#pCube1-lib">
            <bind_shape_matrix>1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000
    </bind_shape_matrix>
            <source id="pCube1Controller-Joints">
              <Name_array id="pCube1Controller-Joints-array" count="3">
     joint1 joint2 joint3</Name_array>
              <technique_common>
                <accessor source="#pCube1Controller-Joints-array" count="3">
                  <param type="name"/>
                </accessor>
              </technique_common>
            </source>
            <source id="pCube1Controller-Matrices">
              <float_array id="pCube1Controller-Matrices-array" count="48">
     
    0.999999 0.001040 0.000000 0.375687 -0.001040 0.999999 0.000000 -0.000391 0.000000 -0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000
    0.999783 -0.000978 0.020814 -1.665093 0.000978 1.000000 0.000021 -0.003751 -0.020814 -0.000001 0.999783 0.034664 0.000000 0.000000 0.000000 1.000000
    1.000000 0.000000 -0.000000 -3.833521 -0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.045135 0.000000 0.000000 0.000000 1.000000</float_array>
              <technique_common>
                <accessor source="#pCube1Controller-Matrices-array" count="3" stride="16">
                  <param type="float4x4"/>
                </accessor>
              </technique_common>
            </source>
            <source id="pCube1Controller-Weights">
              <float_array id="pCube1Controller-Weights-array" count="33">
     
    1.000000 0.989534 0.009756 0.708022 0.289010 0.002968 0.989518 0.009771 0.708398 0.288669 0.002933 0.989525 0.009771 0.708446 0.288689 0.002866
    0.989540 0.009756 0.708070 0.289030 0.002900 0.004697 0.497651 0.497651 0.003326 0.498337 0.498337 0.004704 0.497648 0.497648 0.003331 0.498334
    0.498334</float_array>
              <technique_common>
                <accessor source="#pCube1Controller-Weights-array" count="33">
                  <param type="float"/>
                </accessor>
              </technique_common>
            </source>
            <joints>
              <input semantic="JOINT" source="#pCube1Controller-Joints"/>
              <input semantic="INV_BIND_MATRIX" source="#pCube1Controller-Matrices"/>
            </joints>
                <vertex_weights count="12">
              <input semantic="JOINT" offset="0" source="#pCube1Controller-Joints"/>
              <input semantic="WEIGHT" offset="1" source="#pCube1Controller-Weights"/>
              <vcount>2 3 2 3 2 3 2 3 3 3 3 3</vcount>
              <v>0 1 1 2 0 3 1 4 2 5 0 6 1 7 0 8 1 9 2 10 0 11 1 12 0 13 1 14 2 15 0 16 1 17 0 18 1 19 2 20 0 21 1 22 2 23 0 24 1 25 2 26 0 27 1 28 2 29 0 30 1 31 2 32</v>
            </vertex_weights>
          </skin>
        </controller>
      </library_controllers>

  2. #2
    Senior Member
    Join Date
    Mar 2016
    Posts
    111
    Just a guess, your picture has a model that appears to have 12 vertices. Is it possible the exporter is bound to that model?

    EDITED: In case you see this, <skin source="#pCube1-lib"> should have 12 vertices from the looks of this. Is that the <geometry> that you want? In hindsight (unrelated) it's a shame that the controllers can't be reused with different sources via <instance_controller> but that's the least of COLLADA's deficiencies.
    Last edited by Mick P.; 02-06-2018 at 07:05 AM. Reason: observation
    This account can Moderator spam in the COLLADA forum.
    ColladaDOM 3 (COLLADA-DOM 2016)
    https://sourceforge.net/p/collada-do...ussion/531263/

  3. #3
    Newbie
    Join Date
    Feb 2018
    Posts
    2
    I already solve the problem.

    My mistake was to think, that the 12 vertices are the indices of my final vertices array in my geometry, but it's linked to the positon array of the geomtry in the file

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean