ive converting troubles

89 views
Skip to first unread message

Vadim V. Balashoff

unread,
Aug 18, 2022, 7:32:08 AM8/18/22
to vsg-...@googlegroups.com
Hello!

I've try to convert models from osg project https://github.com/goost/BrainTrain to vsgt/vsgb, but there are some troubles.
About my system:
I have Gentoo x86_64. There is dev-games/openscenegraph-3.6.5-r112 installed with flag collada set to on (dev-libs/collada-dom-2.5.0-r1 is builded to satisfy dependence).
I've git pulled all vsg* projects and recompile it.
So. I try to convert ive file (https://github.com/goost/BrainTrain/blob/master/BlenderFiles/exports/Train.ive) to vsgt/vsgb.
First of all, I've try to load ive model directly to vsgviewer. It says:
---
Unable to load file vvb/Train.ive
---
It's not that I want, but I've tried it anyway.
So, now to conversion. My goal is to have editable format (dae/obj with textures in separate files), which i can easily edit, then convert to vsgt/vsgb and load to vsg.

1. ive->dae
Ok, I've used osgconv and try to convert to dae.
----
osgconv -O OutputTextureFiles Train.ive Train.dae

COLLADA dae plugin: unrecognized option "OutputTextureFiles
Can't create directory for file 'Image_1.tga'. May fail creating the image file.
Can't create directory for file 'Image_2.tga'. May fail creating the image file.
Can't create directory for file 'Image_3.tga'. May fail creating the image file.
Can't create directory for file 'Image_4.tga'. May fail creating the image file.
Can't create directory for file 'Image_5.tga'. May fail creating the image file.
Can't create directory for file 'Image_6.tga'. May fail creating the image file.
Can't create directory for file 'Image_7.tga'. May fail creating the image file.
Data written to 'Train.dae'.
----
osgconv saves all Images_*.tga, but there is NO Train.dae. Even if it says there is data written to it.
Running "osgconv Train.ive Train.dae" gives same result. No dae, all tga files are here.

2. ive->obj
So, I'm trying to convert ive to obj.
---
osgconv -O OutputTextureFiles Train.ive Train.obj
Data written to 'Train.obj'.
---
Now I have two files:
Train.obj and Train.mtl
But there is no textures and no links to textures in mtl file.

3. ive->vsgt/vsgb
I've try to convert directly ive to vsg native format, but it fails.
---
vsgconv Train.ive Train.vsgt
Failed to load Train.ive
No files loaded.
---

4. obj->vsgt/vsgb
---
vsgconv Train.obj Train.vsgt
---
It creates Train.vsgt file. Train.vsgt shows well in vsgviewer. But only as a mesh. Because of missing textures in Train.obj, there are no textures in Train.vsgt.

5. ive->osg
I've try to convert ive to osg:
---
osgconv -O OutputTextureFiles Train.ive Train.osg
---
It creates Train.osg file and textures (Train_*.dds).

6. osg->vsgt
---
vsgconv Train.osg Train.vsgt
Failed to load Train.osg
No files loaded.
---

So, I'm lost at this point.

v.v.b.

Robert Osfield

unread,
Aug 18, 2022, 8:05:36 AM8/18/22
to vsg-...@googlegroups.com
Hi Vadim,

The best way to convert OSG data to VSG is to use build/install osg2vsg then build vsgXchane. I wouldn't bother with intermediate formats as the two scene graph have a far better chance of 1:1 mapping of features than 3rd part formats.

The 5 & 6 approaches above should work, but as you are getting a "Failed to load" it suggests you haven't built osg2vsg before building vsgXchange.

osg2vsg can be found on vsg-dev:


There is a range of options you can use to hint to osg2vsg of how to do the conversion, search through previous discussions here on vsg-users about osg2vsg, BuildOptions.

You can also lists features supported by vsgXchange by running:

   vsgconv  --features

Best of luck,
Robert

Vadim V. Balashoff

unread,
Aug 18, 2022, 9:16:58 AM8/18/22
to vsg-...@googlegroups.com
On Thu, Aug 18, 2022 at 01:05:23PM +0100, Robert Osfield wrote:
> Hi Vadim,
>
> The best way to convert OSG data to VSG is to use build/install osg2vsg
> then build vsgXchane. I wouldn't bother with intermediate formats as the
> two scene graph have a far better chance of 1:1 mapping of features than
> 3rd part formats.
>
> The 5 & 6 approaches above should work, but as you are getting a "Failed to
> load" it suggests you haven't built osg2vsg before building vsgXchange.

After build/install osg2vsg and rebuild vsgXchange I can convert
ive->vsgt/vsgb:
---
vsgconv Train.ive Train.vsgt
vsgconv Train.ive Train.vsgb
---
It creates Train.vsgt/vsgb and models are displayed well in vsgviewer.
It solves one little problem for this case.
But I still want to have possibility to modify 3d models/textures anytime I
want.
I've tried:
---
vsgconv Train.ive Train.mdl
vsgconv Train.ive Train.dae
vsgconv Train.osg Train.dae
vsgconv Train.vsgt Train.dae
vsgconv Train.vsgt Train.fbx
---
It says nothing and does not produce anything.

One more little question. Why ive with embedded textures is 4 Mb, and vsbg is
22 Mb (5! times bigger).

v.v.b.

Robert Osfield

unread,
Aug 18, 2022, 9:37:53 AM8/18/22
to vsg-...@googlegroups.com
Hi Vadim,

vsgXchange doesn't currently support writing to 3rd party formats. If you look at the output from vsgconv --featires you'll see what read/write facilities are supported for each format.

The VSG focus has been on rendering models rather than working as a model interchange/processing tool.  This will remain the focus for the 1.0 release.

If you need to write scene graphs to 3rd party format then you could look at what the Assimp project provides, it may be possible to write a converter from VSG to Assimp data structure and then get Assimp to write it out.

The file size between .ive and .vsgb might be down to many things, and will likely vary from model to model used and the settings used when writing out to .ive and .vsgb.  It could be that your particular .ive file uses compressed images, or overall compression.

In the case of the VSG it read/write data in close to raw memory form to make it efficient.  

Cheers,
Robert

Vadim V. Balashoff

unread,
Aug 19, 2022, 2:14:36 AM8/19/22
to vsg-...@googlegroups.com
Hello!

Still have something thoughts about behavior of osg/vsg converters.

1. osgconv ive->obj
"osgconv -O OutputTextureFiles Train.ive Train.obj"
It does not write any textures. It produces only obj and mtl files.

2. osgconv ive->dae
"osgconv Train.ive Train.dae"
---
Can't create directory for file 'Image_1.tga'. May fail creating the image file.
Can't create directory for file 'Image_2.tga'. May fail creating the image file.
Can't create directory for file 'Image_3.tga'. May fail creating the image file.
Can't create directory for file 'Image_4.tga'. May fail creating the image file.
Can't create directory for file 'Image_5.tga'. May fail creating the image file.
Can't create directory for file 'Image_6.tga'. May fail creating the image file.
Can't create directory for file 'Image_7.tga'. May fail creating the image file.
Data written to 'Train.dae'."
---
It writes *.tga files, but there is no dae.

3. vsgconv --batch
It seems vsgconv does not like "batch" option:

---
vsgconv --batch Train3.obj Train3.vsgb
Failed to load --batch
---

---
vsgconv --batch Train3.obj
Failed to load --batch
No files loaded.
---

4. vsgconv obj->vsgb
I've convert all tga texture files from step 2 to png files. So, tga are 16 Mb, result png are 9 Mb.
Then I've manually combine *.png, obj and mtl files. Manually add links to textures in mtl.
osgviewer correctly shows model with textures.
Then I try to convert obj to vsgb with vsgconv.
"vsgconv Train.obj Train.vsgb"
Obj file is 6 Mb, textures are 9 Mb. Total is 14 Mb. And result vsgb file is 21 Mb. Why?
Obj is plain text file. If I manually create tar.gz file from obj/mtl/png files, archive is 9 Mb. Why binary vsgb file is 3 times larger?
I've try
"vsgconv --rgb Train.obj Train.vsgb"
but still get 21 Mb.

v.v.b.

Robert Osfield

unread,
Aug 19, 2022, 3:55:29 AM8/19/22
to vsg-users : VulkanSceneGraph Developer Discussion Group
Could you please avoid just copying and pasting previous posts, I've already replied to them. If there is something specific to ask then write a new post so we know what bit you need to know.

Vadim V. Balashoff

unread,
Aug 19, 2022, 3:59:17 AM8/19/22
to vsg-...@googlegroups.com
It's a new one post from me. It's about some strange behavior of osg and vsg
converters.

v.v.b.

Robert Osfield

unread,
Aug 19, 2022, 4:16:11 AM8/19/22
to vsg-users : VulkanSceneGraph Developer Discussion Group
Looks very similar to your first post. I far as I could see at best you could call it rehash.

Comments about OSG really don't belong on vsg-users, you'll need to post them osg-users.  I won't answer them here and neither should you should expect anyone else.

I have broken right arm just below the wrist, all my typing is my left wrist and very slow, so please be succinct and if when I reply try to investigate things further at your end based on my replies.

The only bit I think I can add is that textures stored in format like png are compressed, but when loaded into the VSG become raw RGB/RGBA data and when written to .vsgb/.vsgt will not be compressed so you should expect a size difference. Please check the contexts of a .vsgt to see what is going on.
 
Reply all
Reply to author
Forward
0 new messages