Giter Club home page Giter Club logo

Comments (4)

Jason0214 avatar Jason0214 commented on May 28, 2024

Yes, currently we are fixing the up axis different in blender and godot by adding a rotation around x-axis. This suggestion is quite good, I am also thinking about directly applying the rotation into vertex data, and keep the transform matrix same as it was in blender, this also avoids overheads in exported material shader scripts.

For the gimbal lock, I think you can always stored rotation as quaternion or a matrix to avoid it (correct me if I am wrong).

Anyway, this is a wanted feature, thank you for suggestion.

from godot-blender-exporter.

Warlaan avatar Warlaan commented on May 28, 2024

The gimbal lock issue happens in the inspector. The rotation of a node is expressed as Euler angles, so if the node starts rotated by 90 degrees there is no linear interpolation of a x-, y- or z-value that expresses a rotation around the world z axis.
You are right though that I could add a (redundant) quaternion as an exported variable and animate that.

I was able to create a workaround by importing the scene with subscenes and then adding a new parent node to the object that was supposed to be animated, but it would of course be nice to have a more straightforward workflow.

Thanks for the reply.

from godot-blender-exporter.

Jason0214 avatar Jason0214 commented on May 28, 2024

sorry, I had a bad memory of our implementation of axis fix, my first reply is totally incorrect...
I checked the code again and I remembered this addon has a fix to every vectors position through

def fix_vertex(vtx):
    """Changes a single position vector from y-up to z-up"""
    return mathutils.Vector((vtx.x, vtx.z, -vtx.y))

and also swap the up axis of every transform matrix,(if you are curios, see here)

There is a rotation -90 degree around x axis, but it is not related to transform. You may found the rotation in DirectionalLight or Camera node, it is a direction fix, because in blender these node are default have z-up with identity transform, while in godot they are y-up. So I think there is nothing to do about it. If gimbal lock really troubles you, maybe think about recreate the node in godot if it's simple.

from godot-blender-exporter.

Jason0214 avatar Jason0214 commented on May 28, 2024

Close for now, if you have more questions, feel free to reopen.

from godot-blender-exporter.

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.