Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash loading 2.68a file with armature generated via rigify #316

Open
GoogleCodeExporter opened this issue Mar 27, 2015 · 1 comment
Open

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Rig a model using rigify
2. "play" this file in gamekit, see that it works as expected
3. Append all assets in another (new) file.  
4. "play" this file in gamekit, see that it crashes when trying to use a 
garbage root bone transform

What is the expected output? What do you see instead?

file loads


What version of the product are you using? On what operating system?

2.68a blender,  win 7 64bit, svn gamekit

Please provide any additional information below.

I've looked into this.  

In:

void gkBlenderSceneConverter::convert(bool createGroupInstances)

...

while (roots.hasMoreElements())
                    {
                        gkBone* bone = roots.getNext();
                        gkMatrix4 eobmat = gkMathUtils::getFromFloat(obMe->obmat);
                        gkMatrix4 sobmat = gkMathUtils::getFromFloat(obAr->obmat);

                        bone->applyRootTransform(eobmat.inverse() * sobmat);
                    }

                }
            }
        }
    }

    m_logic->resolveLinks();
}

The eobmat matrices in the original armature file all seem to be the indentity 
matrix.  In the appended file the values look like junk and end up making the 
roots m_bind matrix a series of +/- INFINITY values, which then crashes game 
kit in:

void gkSkeletonLoader::recurseBone(Ogre::Skeleton* skel, gkBone* cur, 
Ogre::Bone* par)
{
    GK_ASSERT(cur);

    Ogre::Bone* obone = skel->createBone(cur->getName());
    cur->_setOgreBone(obone);


    if (par != 0)
        par->addChild(obone);

    const gkTransformState& rest = cur->getRest();
    obone->setPosition(rest.loc);
    obone->setOrientation(rest.rot);
    obone->setScale(rest.scl);
    obone->setBindingPose();
    obone->setManuallyControlled(true);


    gkBone::BoneList& bl = cur->getChildren();
    for (UTsize i = 0; i < bl.size(); ++i)
        recurseBone(skel, bl[i], obone);
}

When setting the bones rest position.

I've attached two files. model_girl.blend loads fine, bugtest.blend crashes 
although it *should* have the same content, but must have some differences.

Original issue reported on code.google.com by [email protected] on 18 Aug 2013 at 7:03

Attachments:

@GoogleCodeExporter
Copy link
Author

Invalid root bone transform is ignored in latest revision.
but, I don't know the exact reason of a invalid value.

Thanks for repoting.

Original comment by [email protected] on 26 Aug 2013 at 7:34

  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant