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

Blender exporter option to remove global transforms #5841

Closed
Densaugeo opened this issue Jan 1, 2015 · 3 comments
Closed

Blender exporter option to remove global transforms #5841

Densaugeo opened this issue Jan 1, 2015 · 3 comments

Comments

@Densaugeo
Copy link
Contributor

The Blender exporter automatically bakes global transforms into meshes, but sometimes I need to export models without applying their global transform. Mostly, this is for exporting several separate models from the same Blender project.

Right now this can be done by commenting out lines 1,617 and 1,618 in export_threejs.py:

def extract_meshes(objects, scene, export_single_model, option_scale, flipyz):

    # Other stuff...

            if export_single_model:

                if flipyz:

                    # that's what Blender's native export_obj.py does to flip YZ

                    X_ROT = mathutils.Matrix.Rotation(-math.pi/2, 4, 'X')
                    mesh.transform(X_ROT * object.matrix_world)

                # When these next two lines are commented out, global transform is not applied:
                # else:
                    # mesh.transform(object.matrix_world)

            # More other stuff...

    return meshes

I'd like to have this as an option in the export script (similar to the 'flipyz' option). Is this something other people would use, and is it likely to affect other stuff? (The exporter handles a lot of bones and animations and stuff I don't know anything about).

@repsac
Copy link
Contributor

repsac commented Jan 1, 2015

That may be doable but will need to be tested against anim/morph scenes. Can't really comment if this would be easy or not. It seems to be one of those things that you just dive into and see what breaks.

fyi: flipyz was removed, I felt that should just be included to compensate for blender's Z up and three's Y up differences

@kimasendorf
Copy link

My export always ends up distorted, the mesh was modeled directly in Blender. When I remove the Armature Modifier before the export (that works well in the r69 exporter) than I get some errors.

@Mugen87
Copy link
Collaborator

Mugen87 commented May 31, 2018

The JSON Blender exporter has been removed with R93 (#14117).

Also see: https://threejs.org/docs/#manual/introduction/Loading-3D-models

@Mugen87 Mugen87 closed this as completed May 31, 2018
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

6 participants