BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Exporting from Blender to x format

3 posters

Go down

Exporting from Blender to x format Empty Exporting from Blender to x format

Post by ecreek Fri Oct 15, 2021 1:42 pm

I have been using this exporter for Blender -

https://github.com/DodgeeSoftware/io_scene_directx

It works quite well when I open the .x file in Object Viewer but when I load a route with that same .x file I get an error to say that there is no plugin capable of loading that object.

It works in Object Viewer with both the new and assimp parser.

ecreek

Posts : 62
Join date : 2011-08-23

Back to top Go down

Exporting from Blender to x format Empty Re: Exporting from Blender to x format

Post by leezer3 Sat Oct 16, 2021 2:37 pm

That's odd.

If it works in one, it *should* work in all, that was the whole point of converting things to plugins.
Any chance of a small sample file?

leezer3

Posts : 1961
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Exporting from Blender to x format Empty Re: Exporting from Blender to x format

Post by ecreek Sun Oct 17, 2021 12:16 am

I didn't realise that there were options in the main program to choose the NewXParser. The files now load in game. However, I still get the errors in Route Viewer where there seems to be no options to choose the NewXParser.

ecreek

Posts : 62
Join date : 2011-08-23

Back to top Go down

Exporting from Blender to x format Empty Re: Exporting from Blender to x format

Post by leezer3 Sun Oct 17, 2021 8:05 pm

Interesting, you're right.

Never seems to have been added as an option to Route Viewer, although I now have.

I've found at least one of the issues (original parser *really* doesn't like empty texture strings), but if it's still broken, I'll need a sample file.

If you want to specifically control the X parser in use, there is the following routefile command available:
Options.XParser
Arguments:
0- Original X parser
1- New X parser
2- Assimp X parser

This is deliberately undocumented (The new X parser is set as default unless specifically user-changed in the main program), and primarily intended for backwards compatibility hacks usage.
I'd much rather find the bugs in the parsers than have this changed though Smile

leezer3

Posts : 1961
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Exporting from Blender to x format Empty Re: Exporting from Blender to x format

Post by ecreek Sun Oct 17, 2021 11:11 pm

Thanks Chris. The new build has everything working.

ecreek

Posts : 62
Join date : 2011-08-23

Back to top Go down

Exporting from Blender to x format Empty Re: Exporting from Blender to x format

Post by ecreek Mon Oct 18, 2021 5:09 am

When I export a file with more than one object it seems that ObjectViewer only sees one of them. If I combined the two objects it has no problem. In most other 3d viewers the two objects are displayed. 
Here is a blend file(Blender2.93) with the two objects I have tested -


ecreek

Posts : 62
Join date : 2011-08-23

Back to top Go down

Exporting from Blender to x format Empty Re: Exporting from Blender to x format

Post by leezer3 Mon Oct 18, 2021 11:28 am

Your file isn't public (I've requested access) Wink


Thanks.
The trouble is that we've got two root frames, but with differing transform matrices, which we don't seem to handle well.
Should be able to fix this for the new X parser and Assimp, but the original parser may be more difficult.

leezer3

Posts : 1961
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Exporting from Blender to x format Empty Re: Exporting from Blender to x format

Post by leezer3 Mon Oct 18, 2021 12:09 pm

NewXParser and Assimp now fixed.

The original X parser doesn't support frame transform matrices full-stop unfortunately. Not really intending on adding this, as it's major work.

I may well deprecate the original X parser by removing it as a selectable option for the next major release (but keep it available for forcing via the above routefile command / hacks if people really want it)

leezer3

Posts : 1961
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Exporting from Blender to x format Empty Re: Exporting from Blender to x format

Post by ecreek Mon Oct 18, 2021 12:25 pm

Thanks Chris!
I don't think I would have stuck with OpenBVE all these years if it wasn't for your dedicated support for the program.

ecreek

Posts : 62
Join date : 2011-08-23

Back to top Go down

Exporting from Blender to x format Empty Re: Exporting from Blender to x format

Post by ecreek Thu Oct 21, 2021 4:18 am

It seems the newXparser can handle 0,0,0 black in the ObjectViewer but not in Route Viewer or in game. See attached sample.

https://drive.google.com/file/d/1_DNs8FzjXwnqmxnYSYvEePanRnKha8Zk/view?usp=sharing

ecreek

Posts : 62
Join date : 2011-08-23

Back to top Go down

Exporting from Blender to x format Empty Re: Exporting from Blender to x format

Post by leezer3 Sat Oct 23, 2021 1:43 pm

That's hitting a BVE4 edge-case, and is technically as designed.
No good way to solve it, either way is likely to break things.

TLDR:
BVE4 introduced support for X files.
However, it only still supported BMP textures in 32-bit or 256 colors. Obviously, this is a problem, as neither of these support the use of an alpha channel.
Hence, pure black (0,0,0) was reserved for color-key transparency usage. This is actually in the developer documentation too: https://openbve-project.net/documentation_hugo/en/objects/other/x.html

The issue is that there's no reliable way to detect whether a route was designed for BVE4 or OpenBVE (and the for that matter the older BRSigs etc. libraries still use this) and change this behaviour.

leezer3

Posts : 1961
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Exporting from Blender to x format Empty Re: Exporting from Blender to x format

Post by Quork Mon Oct 25, 2021 9:19 am

Maybe have a bool "BlackIsAlphaInX" at the beginning of a route, default setting "true"? 🤔
Quork
Quork

Posts : 1438
Join date : 2012-05-05
Age : 32
Location : Hofheim a.T., Hessen (Hesse), European Union

Back to top Go down

Exporting from Blender to x format Empty Re: Exporting from Blender to x format

Post by leezer3 Mon Oct 25, 2021 1:08 pm

Quork wrote:Maybe have a bool "BlackIsAlphaInX" at the beginning of a route, default setting "true"? 🤔

That would work, but having what's techincally broken behaviour (according to the X specification) on by default isn't what I'd call a good idea.....
I *could* possibly try and detect older X files, but I don't know off the top of my head whether any of the older stuff used exported 3D models *and* this trick. I'd hope not, but the amount of random mess I've found in some routes is unreal Smile
At the minute, I think having it documented as a 'quirk' of the engine is the best thing to do, unless anyone else wants to comment. Also need to check what BVE5 actually does for that matter......

Something like this would ideally be removed with the introduction of a new routefile format, but that's not likely to happen any time soon Sad

leezer3

Posts : 1961
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Exporting from Blender to x format Empty Re: Exporting from Blender to x format

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum