X3D Importer for Blender: alpha release!

Hi all!

I’d like to introduce a short script I’ve written in the last few weeks during my internship in a French compagny.
It’s an X3D Importer script that imports X3D scenes into Blender (only .x3d, not .x3dv neither binary files)
I know that some of you had already started such a script, but all I could find were aborted projects…

So I wrote everything from scratch and here we are with this alpha release of the plugin.

It currently supports most of the commun used X3D nodes (no animation right now) : IndexedfaceSet, ElevationGrid, primitives, etc. And I will improve it and add new features as long as possible.

You can download it from here: outdated link removed
Here’s a file showing which X3D nodes are supported or not right now: outdated link removed

Note: the option “keep / apply transformation structure” in the GUI is not yet implemented.

Any comments, suggestions, bug reports are welcome!!
(if you notice a bug, or that one of your X3D files can’t be imported with the script, can you please send it to me at matmdx [at] gmail.com, thanks a lot!)


Matt

PS: I sent a request to BF Projects to host this plugin (still waiting for their approval), so I hope I’ll soon have a good bug tracking system that you’ll be able to use! :slight_smile:

Hi, nice importer!

Read through your code, some advice.
enumerate(f) can replace enumerate(f.v)

and more importamtly

deepDuplicate function looks like it would be better implimented as dupligroups.

Hi!

Thanks for those advices, I’ll fix that.
For the deepDuplicate function, when I began the plugin I thought that I would have some issues with dupligroups, but now, looking at what I have done, it seems that there would be no problem at all using them, and that it would improve the Blender scene structure. So I’ll give it a try and report asap! Maybe I’ll keep both of them with an option in the GUI: I think it could be interesting to have some “post-processing” options in the importer.

Update (see first post for links):

  • Thanks to ideasman42’s advice, I now use dupligroups for <transform> nodes.
  • I also updated a little bit the documentation and corrected a few bugs

Next week I’ll add new nodes and features to the importer.

PS: I didn’t receive any news from BF Projects. Does it still host new projects?

Hello Matmdx,

very cool! I’m one of the authors of the X3D/ VRML exporter and the Developer of the BS Exporter for Blender. Many people asked me about writing an importer but didn’t had the time to write one.

I will test it!

Hi Bart,

I can’t wait for your feedback, and I will really appreciate your comments!

I think it would be great for end users that we ensure a maximum of compatibily between our two plugins: like to import a x3d model into Blender, edit it, and then export it back to x3d for web distribution purpose, but without loosing any information or data structure in the meantime.

I’ve still got a lot to do on the importer, but what do you think of that?

** Updates: alpha 0.2 **

  • Addition of a new nodes (Geometry2D and Triangles & Quads) :
    TriangleSet, IndexedTriangleSet , TriangleFanSet, IndexedTriangleFanSet, TriangleStripSet, IndexedTriangleStripSet, QuadSet, IndexedQuadSet, Arc2D, ArcClose2D, Circle2D, Disk2D, Polyline2D, Polypoint2D, Rectangle2D, TriangleSet2D

  • Addition of an Analysis mode : it can analyse one or multiple x3d files at once and it points out issues that could occure if you import those files, and also points out ignored x3d nodes and attributes.

++

Hey, this works pretty good!

A couple of issues:

  1. For a lot of materials I get spec=1.25, hard=1, which looks terrible;

  2. There is some redraw or displist issue that affects spheres: when I import spheres they all appear at the origin until I try to translate them.

Did you manage to get your project hosted at projects.blender.org?

Regards,
Chris

Hi!

  1. spec=1.25 is set for all materials, and the import equation of hardeness was the closest thing to x3d scenes I could find. But maybe I didn’t make it accurate enough. I’ll have a look by the end of february when I’ll continue the importer development.

  2. Can you upload one of yours x3d files that causes this issue?

  3. Yes, project has been accepted at projects.blender.org. But there seems to be an access rights problem, cause I can’t upload anything. I though it would resolve itself by waiting, but it seems not. I’ll send a mail to project team to get proper rights.

Hi Matthieu,

Here is an x3d with 2 spheres that exhibits both the issue of spheres at the origin, and the nasty looking specularity (hard=1.0 rarely gives nice results):

http://bebop.cns.ualberta.ca/~cwant/blend_test.x3d

Regarding your issue with you project, I have admin rights on projects.blender.org so if you give me your project name and username I can look into it.

Regards,
Chris

Hi,

I had a look at your file, and it’s not compliant with X3D specifications. I based myself on the W3C X3D 3.0 spec. In your file, the attribute shininess is equal to 8, whereas in the spec it should be in [0 ; 1.0]. Unfortunately, the importer do not detect such mistake.
(your file can’t be opened with XJ3D which is my reference viewer)

Regarding bf-project, it would be awesome if you could help me here! :slight_smile:
Project name: x3d-importer
Username: matmdx
(I can’t upload anything in the files or documents parts of the project, neither in the svn)
Thanks in advance!

Hi,

Thanks for the tip about the inappropriate shininess value!

Regarding SVN, I don’t see anything out of the ordinary when I log into the server. The method to get your source in should be to put your script into a directory, enter that directory and enter:

svn import --username madmdx \
https://svn.projects.blender.org/svnroot/x3d-importer/trunk

If this doesn’t work, what is the error message?

Regards,
Chris

I just PMed you about the issues I got.
Thanks again for your time!

Thanks, I needed an .x3d importer for blender. Much appreciated!

Well, it’s long ago since you published it, but I have to say this importer saved my life ;). Thanks for your great work!

Greetings, Michael

the links aren’t working

The links are dead!!!

Dead links

Have you seen the date of the original post with the links. Nearly 7 years old. Any script that old would be for blender 2.4x so would be useless with any version of blender released in the last 4 years.

First try the .x3d importer that actually comes with blender and I believe enabled by default from the import menu

As this thread is so outdated, CLOSED