[X3D-Public] VRML to X3D converter

Campbell Barton ideasman42 at gmail.com
Wed Jul 27 21:07:32 PDT 2011


On Thu, Jul 28, 2011 at 4:11 AM, Michalis Kamburelis
<michalis.kambi at gmail.com> wrote:
> 2011/7/1 Campbell Barton wrote:
>> I would like a simple command line application or library (preferably
>> C/C++) to convert VRML to X3D, so we can drop VRML support in
>> Blender3D and have the importer call the converter when its needed.
>> This way I can just make use of an XML library and not have a VRML
>> parser which is not that good anyway.
>>
>> Anyone know of a good converter?
>>
>
> Hi,
>
> The latest release of view3dscene 3.10.1 was shamelessly done so I can
> answer: yes, you can use view3dscene to convert VRML2->X3D :) It
> includes a stable (preserves VRML/X3D nodes graph fully), GPLed
> converter from VRML 2 to X3D. Can be used interactively ("File -> Save
> As.." menu options), or from command-line ("view3dscene --write
> --write=encoding=xml input.wrl > output.x3d"). You can also use
> tovrmlx3d, to have a small binary that doesn't need GUI libs installed
> ("tovrmlx3d --encoding=xml input.wrl > output.x3d").
>
> You can also use it to convert X3D classic encoding into X3D XML
> encoding. I guess you will find this useful, if the idea is to get rid
> of parsing classic VRML/X3D content in Blender and only deal with XML
> flavor.
>
> Get view3dscene from http://vrmlengine.sourceforge.net/view3dscene.php
> . Converter notes are on the same page,
> http://vrmlengine.sourceforge.net/view3dscene.php#section_converting .
>
> My engine is LGPL (>= 2). view3dscene and tovrmlx3d are strict GPL (>=
> 2). (although LGPL can be negotiated for tovrmlx3d if needed, as it's
> such trivial program :)
>
> This is "normal" native code, so it can be compiled into an .so / .dll
> if you prefer to have a library instead of a callable program. This is
> not C/C++ (this is ObjectPascal, compiled by open-source
> cross-platform http://www.freepascal.org/), but it's still normal
> native code, so integration with C is trivial.
>
> This can be used for more than just VRML 2 / X3D -> X3D. You can even
> use this to import other formats (like 3DS or MD3) into Blender
> through X3D XML. If needed, I could also add some special conversion
> modes that "expand" some stuff, for example converting difficult X3D
> shapes (like NURBS or Extrusion) into simpler (like IndexedFaceSet);
> such conversions are done "under the hood" anyway in my engine, so
> making them available for output should not be difficult, if they
> would be useful.
>
> Michalis
>

Hi Michalis, great to see you got this working.

But I don't think I can justify adding freepascal compiler as a
dependency for building blender3d, even though what you say is correct
and it can be made to link and run correctly.

It could be made an optional dependency and we just make sure binary
releases include it (so only release maintainers have to have it), if
this was a key file-format like Collada or FBX I'd consider this, but
for support for a fairly old, deprecated format - adding another
compiler is really not justifiable for us, There is also the issue
that we would need to get this working for out buildsystems -
cmake/scons  on mac/windows/linux - While I'm sure its possible it
does add more complication.

Another approach is not to try integrate it and just run the
executable if its found in the $PATH for example, this would work fine
but means the users have to go and download the tools, which IMHO is a
worse situation then we are in now (with my crappy VRML parser).

These are mainly our own issues with re-distribution, so I'm sure this
tool can come in handy for others still.

-- 
- Campbell



More information about the X3D-Public mailing list