diff options
author | Juha Mäki-Kanto <ih5235252@gmail.com> | 2012-02-18 19:41:09 +0400 |
---|---|---|
committer | Juha Mäki-Kanto <ih5235252@gmail.com> | 2012-02-18 19:41:09 +0400 |
commit | e6b708b36bb77ff2287439f20fc79097c275c822 (patch) | |
tree | 921b792697a78b96e6a1ea331f46f05f4f0aa6bd /source/blender | |
parent | 2478db9d374e87807c90f5844939c8eddb256785 (diff) |
Minor change collada export; don't even run the parentinv-test when ob->parent is NULL
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/collada/TransformWriter.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/source/blender/collada/TransformWriter.cpp b/source/blender/collada/TransformWriter.cpp index c806cd48587..0cf26a03107 100644 --- a/source/blender/collada/TransformWriter.cpp +++ b/source/blender/collada/TransformWriter.cpp @@ -95,20 +95,24 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob) */ /* Using parentinv should allow use of existing curves */ - // If parentinv is identity don't add it. - bool add_parinv = false; - for(int i = 0; i < 16; ++i) + if(ob->parent) { - float f = (i%4 == i/4) ? 1.0f : 0.0f ; - if(ob->parentinv[i%4][i/4] != f) add_parinv = true; - } - - if(add_parinv && ob->parent) - { - double dmat[4][4]; - UnitConverter converter; - converter.mat4_to_dae_double(dmat, ob->parentinv); - node.addMatrix("parentinverse", dmat); + // If parentinv is identity don't add it. + bool add_parinv = false; + + for(int i = 0; i < 16; ++i) + { + float f = (i%4 == i/4) ? 1.0f : 0.0f ; + add_parinv |= (ob->parentinv[i%4][i/4] != f); + } + + if(add_parinv) + { + double dmat[4][4]; + UnitConverter converter; + converter.mat4_to_dae_double(dmat, ob->parentinv); + node.addMatrix("parentinverse", dmat); + } } add_transform(node, ob->loc, ob->rot, ob->size); |