sidebar features
sidebar content

Go Back   Blender Artists Forums > General Forums > Python & Plugins

Reply
 
Thread Tools
matmdx matmdx is offline
Member
 
Join Date: Aug 2007
Posts: 60
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: link
Here's a file showing which X3D nodes are supported or not right now: link

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 matthieu.delanoe [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!
#1   Old 09-Oct-07, 16:28   
Reply With Quote


ideasman42's Avatar
ideasman42 ideasman42 is offline
Member
 
Join Date: Mar 2004
Location: Australia
Posts: 3,421
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.
............................................
BPython Cookbook * How to get features into Blender * Code Metrics
Hire Me
ideasman42<at>gmail.com
#2   Old 10-Oct-07, 23:09   
Reply With Quote
matmdx matmdx is offline
Member
 
Join Date: Aug 2007
Posts: 60
Quote:
Originally Posted by ideasman42 View Post
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.
#3   Old 11-Oct-07, 08:41   
Reply With Quote
matmdx matmdx is offline
Member
 
Join Date: Aug 2007
Posts: 60
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?
#4   Old 16-Nov-07, 14:58   
Reply With Quote
Bart's Avatar
Bart Bart is offline
Member
 
Join Date: Oct 2002
Location: Berlin
Posts: 239
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!
............................................
Karamba!
Bart.

familie redlich :systeme - http://www.systeme.familie-redlich.de/
Webcuts - Internet Film Fest Berlin - http://www.webcuts.org
Linux for Designers - http://my.opera.com/area42
SweeTS - delicious TypoScript development - http://typo3.area42.de/
#5   Old 17-Nov-07, 16:01   
Reply With Quote
matmdx matmdx is offline
Member
 
Join Date: Aug 2007
Posts: 60
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?
#6   Old 21-Nov-07, 09:43   
Reply With Quote
matmdx matmdx is offline
Member
 
Join Date: Aug 2007
Posts: 60
** 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.


++
#7   Old 29-Nov-07, 11:37   
Reply With Quote
Hos Hos is offline
Member
 
Join Date: Mar 2002
Location: Canada (Edmonton)
Posts: 379
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
#8   Old 24-Jan-08, 21:29   
Reply With Quote
matmdx matmdx is offline
Member
 
Join Date: Aug 2007
Posts: 60
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.
#9   Old 25-Jan-08, 10:01   
Reply With Quote
Hos Hos is offline
Member
 
Join Date: Mar 2002
Location: Canada (Edmonton)
Posts: 379
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
#10   Old 25-Jan-08, 16:40   
Reply With Quote
matmdx matmdx is offline
Member
 
Join Date: Aug 2007
Posts: 60
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!
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!
#11   Old 28-Jan-08, 09:32   
Reply With Quote
Hos Hos is offline
Member
 
Join Date: Mar 2002
Location: Canada (Edmonton)
Posts: 379
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/svn...importer/trunk

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

Regards,
Chris
#12   Old 28-Jan-08, 18:51   
Reply With Quote
matmdx matmdx is offline
Member
 
Join Date: Aug 2007
Posts: 60
I just PMed you about the issues I got.
Thanks again for your time!
#13   Old 30-Jan-08, 16:45   
Reply With Quote
random order random order is offline
Member
 
Join Date: Mar 2009
Posts: 14
Thanks, I needed an .x3d importer for blender. Much appreciated!
#14   Old 08-Apr-09, 14:11   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 17:27.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists