Git Product home page Git Product logo

Comments (2)

ttencate avatar ttencate commented on July 18, 2024 1

I was also bitten by this. I suspect that the FBX exporter in Blender has changed since the wiki page was written, so it does not only store the axis system into the FBX file, but also transforms the actual geometry into that axis system. Thus, the conversion that fbx-conv applies simply undoes that, and you end up with the default coordinate system in fbx-conv (Y-up, Z-forward, right-handed) no matter what you do.

If you comment out the axis.ConvertScene(scene) line in FbxConverter.h, it is possible to get different results for different settings in Blender. For me, setting Z-up and Y-forward worked well after this change.

I don't want to keep carrying around a hacked up fbx-conv fork though, so I just added some code to rotate the model nodes after loading:

    modelData.nodes.forEach { node ->
        node.translation = node.translation ?: Vector3()
        node.rotation = node.rotation ?: Quaternion()
        // This uses the same underlying code as Node#calculateLocalTransform()
        val nodeTransform = Matrix4(node.translation, node.rotation, identityScale)

        val newNodeTransform = Matrix4(preRotation)
        newNodeTransform.mul(nodeTransform)

        newNodeTransform.getTranslation(node.translation)
        newNodeTransform.getRotation(node.rotation)
    }

It's Kotlin but I hope the idea is clear. Note that I'm not rotating node.scale, because this breaks the output. I think this is because the scale is applied before the rotation, but I haven't checked.

from fbx-conv.

drenghel avatar drenghel commented on July 18, 2024

For what it's worth, I'm also wondering why it doesnt look like my export options in Blender (forward and up) are without effect..

from fbx-conv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.