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

Morph targets vertices array in Blender exporter wrong #7724

Closed
inear opened this issue Dec 3, 2015 · 5 comments
Closed

Morph targets vertices array in Blender exporter wrong #7724

inear opened this issue Dec 3, 2015 · 5 comments

Comments

@inear
Copy link

inear commented Dec 3, 2015

In the Blender Export 4.4 there is an issue with the vertices of morph targets. They are parsed as triplets of arrays: [[x,y,z],[x,y,z],...] but should be one singel array [x,y,z,x,y,z].

I'm not good enough with python to make the change, but I think it's extend([vertex.co.x, vertex.co.y, vertex.co.z]) that should be extend((vertex.co.x, vertex.co.y, vertex.co.z)) on line 409 in mesh.py.

I't worked for me when changing in the exported json object directly.

@inear
Copy link
Author

inear commented Dec 3, 2015

No, it was the morph.append([co.x, co.y, co.z]) in def blend_shapes( that should be extend instead. But let me know if I'm using "blend shapes" and "morph targets" in a wrong way. I don't understand the difference since both output morph-targets.

@AndrewRayCode
Copy link
Contributor

Just hit this too, all of the examples use a flat array of verts. @mrdoob this isn't an enhancement, it's currently impossible to export morph targets from blender. Ping @phfatmonkey

Did this ever work? How did any of the example files like http://threejs.org/examples/models/animated/horse.js with a flat list of verts get built? the blend file for that example isn't in this repo.

@AndrewRayCode
Copy link
Contributor

I made a small script to flatten the vertex array of your output json file. It modifies the file in place. use at your own risk! https://gist.github.com/DelvarWorld/15340499495afea654e45d9ace113d28

@mrdoob
Copy link
Owner

mrdoob commented Apr 23, 2016

Did this ever work? How did any of the example files like http://threejs.org/examples/models/animated/horse.js with a flat list of verts get built? the blend file for that example isn't in this repo.

That file was not done with Blender. It was done in Maya, exported as a series of OBJs and combined using the converter: https://github.com/mrdoob/three.js/blob/master/utils/converters/obj/convert_obj_three.py

@donmccurdy
Copy link
Collaborator

Closing as duplicate of #8710, which has more recent updates.

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

4 participants