mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.58k stars 35.37k forks source link

Blender 2.63 Exporter Fails #1940

Closed perry64 closed 12 years ago

perry64 commented 12 years ago

I'm a Noob to both Blender and three, so the problem is probably on my end.

I'm using the three exporter for Blender 2.63 and am having trouble getting it to work. After a more complex scene failed to save with a similar error, I created a simple scene with just a cube. I can export it as other formats (X3D and 3DS), but trying to export using the three exporter as a .js fails. I downloaded the three python files today (5/18/12) to the specified directory, but it still fails.

The three lowest lines of the error are:

File "C:...\io_mesh_threejs\export_threejs.py", line 578, in extract_vertex_normals 143

AttributeError: 'Mesh' object has no attribute 'faces'

location::-1

Please let me know what I am doing wrong, either in Blender or installing the exporter.

mrdoob commented 12 years ago

Make sure you're using the latest version of the exporter. It got updated some days ago:

https://github.com/mrdoob/three.js/tree/master/utils/exporters/blender

perry64 commented 12 years ago

I copied the three python files from the io_mesh_threejs directory to the same directory in the correct Blender subdirectory this morning and it still didn't work.

mrdoob commented 12 years ago

Ah, I guess it hasn't been fully fixed yet...

alteredq commented 12 years ago

It's possible, Blender changed in a fundamental way (everything is now n-gons). We fixed only some things that were blocking basic exports, we didn't do thorough review of everything.

Though cube should work. I specifically tested with cube ;). See #1866

perry64 commented 12 years ago

I just tried it with every one of Blender's basic meshes and they all gave me the same error,

I found this, I don't know if it helps - it says that mesh.faces was replaced by mesh.tessfaces. I don't know if that's what you fixed a couple of weeks ago.

http://lists.blender.org/pipermail/bf-python/2012-March/005837.html

alteredq commented 12 years ago

Just to be sure, which exact version of Blender do you use?

You can see this in a splash screen ("Help -> Splash screen").

E.g. mine is 2.63.0 r45996 (and exporter seem to work ok for random meshes).

perry64 commented 12 years ago

Mine is 2.63.0 R46461:46487M.

alteredq commented 12 years ago

So I just updated to that version (on Blender site they call it 2.63a) and exporter still works on my side.

Could you post somewhere blend file which fails for you?

perry64 commented 12 years ago

Attached.

Thanks. Perry

-----Original Message----- From: AlteredQualia [mailto:reply@reply.github.com] Sent: Friday, May 18, 2012 3:33 PM To: perry64 Subject: Re: [three.js] Blender 2.63 Exporter Fails (#1940)

So I just updated to that version (on Blender site they call it 2.63a) and exporter still works on my side.

Could you post somewhere blend file which fails for you?


Reply to this email directly or view it on GitHub: https://github.com/mrdoob/three.js/issues/1940#issuecomment-5797170

mrdoob commented 12 years ago

Email attachments don't work on @github issues... https://github.com/mrdoob/three.js/issues/1940

perry64 commented 12 years ago

Hey, do you have a good way to get you the file? I need your e-mail to share it on Dropbox.

Or you can send me your e-mail and I'll e-mail it to you; mine is perry mcdowell google's mail service.

perry64 commented 12 years ago

Oops, it didn't like the symbols.

perry [dot] mcdowell [at] google's mail service, although you could probably figure it out.

alteredq commented 12 years ago

You can make it public DropBox link, after all it's just a cube ;).

perry64 commented 12 years ago

Okay, I've removed all the classified info from it and uploaded it to my public directory. ;-). Actually, not having used Dropbox much, I wasn't aware there was a fully public directory.

http://dl.dropbox.com/u/263149/cube.blend

Thanks. Perry

-----Original Message----- From: AlteredQualia [mailto:reply@reply.github.com] Sent: Friday, May 18, 2012 7:41 PM To: perry64 Subject: Re: [three.js] Blender 2.63 Exporter Fails (#1940)

You can make it public DropBox link, after all it's just a cube ;).


Reply to this email directly or view it on GitHub: https://github.com/mrdoob/three.js/issues/1940#issuecomment-5799008

alteredq commented 12 years ago

Your blend file exports fine here, so I guess the trouble is probably somewhere in your Blender installation.

It's possible you have the right exporter files at the wrong place (and wrong files at the right place); Blender can be quite confusing about placement of its scripts.

For example on Windows 7, current place for putting Blender exporter PY files should be here:

C:\Users\yourusername\Application Data\Blender Foundation\Blender\2.63\scripts\addons\io_mesh_threejs\

Also make sure you clear __pycache__ folder and restart Blender.

For OSX / Linux, somebody else would need to chime in.

perry64 commented 12 years ago

Thanks, but I'm getting the same error.

I've verified that the three files are in the directory you have below, except that they are in "\Apps\roaming" rather than "Application Data", since I couldn't get into "Application Data".

Is it possible that I am not setting the exporter correctly? When I go to the add-on properties, it tells me that the file is

"C:\Users[my name]\AppData\Roaming\Blender Foundation\Blender\2.63\scripts\addons\io_mesh_threejsinit.py"

And the version is 1.2.0.

Any other thoughts?

Thanks. Perry

-----Original Message----- From: AlteredQualia [mailto:reply@reply.github.com] Sent: Monday, May 21, 2012 9:18 AM To: perry64 Subject: Re: [three.js] Blender 2.63 Exporter Fails (#1940)

Your blend file exports fine here, so I guess the trouble is probably somewhere in your Blender installation.

It's possible you have the right exporter files at the wrong place (and wrong files at the right place); Blender can be quite confusing about placement of its scripts.

For example on Windows 7, current place for putting Blender exporter PY files should be here:

C:\Users\yourusername\Application Data\Blender Foundation\Blender\2.63\scripts\addons\io_mesh_threejs\

Also make sure you clear __pycache__ folder and restart Blender.

For OSX / Linux, somebody else would need to chime in.


Reply to this email directly or view it on GitHub: https://github.com/mrdoob/three.js/issues/1940#issuecomment-5826764

alteredq commented 12 years ago

And the version is 1.2.0.

Yes, you have an old version. Latest one is 1.3.0:

https://github.com/mrdoob/three.js/blob/master/utils/exporters/blender/2.63/scripts/addons/io_mesh_threejs/__init__.py#L27

I've verified that the three files are in the directory you have below, except that they are in "\Apps\roaming" rather than "Application Data", since I couldn't get into "Application Data".

I see the same in my Blender UI. I guess this is some Windows folder alias.

Maybe you installed Blender in some different way that uses different folders?

I used 64-bit installer from here:

http://www.blender.org/dl/http://download.blender.org/release/Blender2.63/blender-2.63a-release-windows64.exe

BTW could you please not use email to reply to issues. This creates tons of junk. GitHub's web interface is much more preferable.

perry64 commented 12 years ago

Sorry about e-mail - I didn't realize it caused issues.

I really appreciate the time you've taken on this, and I apologize for having so many problems with something that I know should be easy. Unfortunately, I seem to be moving backwards - now, I can't even get the add-on to show up in the list of add-ons. I think I must be missing something very basic, so I'm going to go through all the steps that I've done.

1) Reinstall Blender, v 2.63 (64 bits) r46461:46487M on Win7 64 bit system;

2) Downloaded (from https://github.com/mrdoob/three.js/tree/master/utils/exporters/blender/2.63/scripts/addons/io_mesh_threejs) the three files (init.py, import_threejs.py, export_threejs.py) and placed them in c:/Users/[loginName]/Blender Foundation/Blender/2.63/scripts/addons/io_mesh_threejs .

3) Opened Blender, selected "File->User Preferences->Addons". The three installer is not present, so I click the"Install Addon..." button.

4) I navigate to C:\Users\mcdowell\AppData\Roaming\Blender Foundation\Blender\2.63\scripts\addons\io_mesh_threejs\, select init.py, and click the "Install Addon..." button, which returns me to the previous screen.

5) The three import-Export is not on the list of Addons.

6) There is a new file, init.py now in C:\Users\mcdowell\AppData\Roaming\Blender Foundation\Blender\2.63\scripts\addons. If I try to add that file as a new add-on, I get an error message telling me that it is already in the addon path.

Any help would be greatly appreciated.

alteredq commented 12 years ago

Unfortunately, I seem to be moving backwards - now, I can't even get the add-on to show up in the list of add-ons.

That's actually a good sign ;)

It means you still didn't put PY files into the right folder. Normally three.js exporter should just appear there and all you need to do is to enable it.

Try to find where Blender created it's own internal per-user config folder. Your user-space scripts should go to subfolder of its sibling scripts folder.

E.g. here is my root:

C:\Users\username\Application Data\Blender Foundation\Blender\

And underneath are these folders:

2.63
    config
    scripts
        addons
            io_mesh_threejs

You can for example search your filesystem for startup.blend file which is inside this config folder.

perry64 commented 12 years ago

Thanks again for your reply.

I think that is where I've put it. I've attached an image of my directory structure if you'd like to verify it.

http://dl.dropbox.com/u/263149/blenderDirectoryStructure.png

I shouldn't have to install Python, other than the installation that Blender did on installation, should I?

alteredq commented 12 years ago

Your folders look like mine, I'm starting to run out of ideas :/

Maybe this can be something about Windows permissions, or some broken installation of some older Blender version from some time before (not sure if at some point of time it wasn't asking about where to keep local settings).

One suspicious thing is that you don't have there autogenerated __pycache__ folder in io_mesh_threejs folder, though this is somehow expected, if your Blender could find the files, it would generate it and exporter would run.

I shouldn't have to install Python, other than the installation that Blender did on installation, should I?

You shouldn't need to, Blender uses its own.

perry64 commented 12 years ago

That's not good :(.

I've tried downloading and compiling the three.js library myself and those files didn't work either.

Thanks for all the help. I'll keep plugging away at it, and if anything occurs to you, please let me know.