GithubHelp home page GithubHelp logo

greenxenith / io_scene_b3d Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joric/io_scene_b3d

40.0 7.0 9.0 130 KB

Blender 2.8+ Export for b3d files (forked from joric/io_scene_b3d)

License: GNU General Public License v2.0

Python 100.00%

io_scene_b3d's Introduction

io_scene_b3d

Blender Import-Export script for Blitz 3D .b3d files.
Should work with versions 2.8x, 2.9x, and 3.x.

Installation

Download the ZIP file:

Then follow the add-on installation instructions for your Blender version:

TODO

Import

  • Animation is not yet implemented in version 1.0. Check master branch for updates.
  • Nodes use original quaternion rotation that affects user interface. Maybe convert them into euler angles.

History

Blitz3D was a game engine developed by Blitz Research (Mark Sibly) in 2001 utilizing the Blitz BASIC language and bringing with it the B3D format.
Source | Website | Wikipedia

Blender addon:

  • 2008 - Developed for Blender 2.45 by Diego "GaNDaLDF" Parisi
  • 2010 - Lightmap fixes by Capricorn 76 Pty. Ltd (date estimated)
  • 2011 - Changes by Marianne Gagnon and Joerg Henrichs from supertuxkart
  • 2013 - Blender 2.62 and 2.63 compatibility work from MTLZ (aka "is06", date estimated)
  • 2018 - Blender 2.8 compatibility and importer by Joric
  • 2020 - Blender 2.9 compatibility by GreenXenith
  • 2023 - Blender 3.0 compatibility by GreenXenith

License

This software is covered by GPL 2.0. Pull requests are welcome.

  • The import script based on a heavily rewriten (new reader) script from Glogow Poland Mariusz Szkaradek.
  • The export script uses portions of script by Diego 'GaNDaLDF' Parisi (ported to Blender 2.8) under GPL license.
  • The b3d format documentation (b3dfile_specs.txt) doesn't have a clear license (Public Domain assumed).

Alternatives

io_scene_b3d's People

Contributors

greenxenith avatar joric avatar x2048 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

io_scene_b3d's Issues

Blitz3D v1.106 support?

Can we get a version that works with Blitz3D v1.106?

This would be immensely helpful as there are still games that use it and the other methods currently used to develop content for them is so archaic (fragMotion)

One example that is still being maintained today is the following game:

https://sonicworldfangame.com/

Specifically imported .b3ds get exported with bigger filesize for some reason and can cause Memory Access Violation errors when trying to load them into the game, this seems to happen with models that are big in filesize. fragMotion doesn't suffer from this issue but it's very dated and doesn't have vertex alpha texture/material flag.

Materials are exported in the wrong order

I'm using Blender 2.83

The exporter iterates through the mesh and outputs materials as they are found used on polygons. So the material assigned to the first created polygon will be first to be listed in the B3D file. The exporter goes from oldest polygon to newest polygon finding materials.

The exporter should instead get the list of materials on the mesh and output those in order.

The order of materials is very important because Irrlicht works on material indices not material names.

The relevant function in the exporter is: write_brus

I found a workaround that worked for me:
It is possible to move a material to last in the list. Go to edit mode. Press A then A on the keyboard to deselect everything. Select the material and press select to select all polygons assigned to the material. Then press Mesh->Separate->Selection to create a new object from the selected polygons. Go to object mode. Drag the new object on top of the old object while pressing shift and drop it. This will parent the new object to the old object. Then select the old object and the new object and press Ctrl+J to join the objects back together.

Does this still work in 2024?

I'm trying to export an animated door, attached is the blender file. Animations won't work. I can export it and load the model in Irrlicht but the animations won't play. I think this is broken again. ninja.b3d works, just not anything exported with this.

doortest.zip

Vertices are duplicated

It appears that the exporter goes through the faces to collect vertices and doesn't deduplicate them afterwards. Vertices will thus be written multiple times, bloating the resulting B3Ds.

Bugs with exporting in Blender 3.0.0.

I have found two bugs in the exporting models when using Blender 3.0.0 and they are no when using the older versions. Particularly, there's a broken compatibility between the Blender's coordinate system and Minetest's one because the exporter mismatches the coordinate axes between the first and the second, i.e. if 'X' then 'X', 'Y' then 'Y'. Here is a result of that wrong matching:

A model in Blender 3.0.0:
Снимок экрана от 2022-01-06 01-19-46

The same model in Minetest exported by this exporter:
Снимок экрана от 2022-01-06 01-20-02

Other bug is it exports only selected objects. Unselected ones look like in the game just transparent.

Animated mesh appears to be scaled based on assigned bones

I have a rigged and animated spider which I've exported using this addon for usage with mobkit within Minetest.

However, once ingame, the mesh is scaled, apparently relative to the assigned bones.
image

I am not sure if this is a Minetest-specific issue or an addon-specific issue, because when I import the b3d back into Blender (using this addon), it appears normal. When importing the b3d back into Blender, the rig is messed up and the animation is lost.

Consider working on the bones feature in the VirtualBrightPlayz fork.

The fork binds the animations to empty objects.
I have a script which tries to post-process them into bones. It isn't working yet, but it serves as example code for creating a hierarchy of bones: https://github.com/poikilos/EnlivenMinetest/blob/master/utilities/blender/hierarchy_of_empties_to_bones.py

  • Creating the bones instead of the empties inside the io_scene_b3d project would be a better solution since it would be more straightforward and less redundant.

Some mesh faces look transparent or disrupted.

Hi, I`ve exported a model into this format, but this look just dire. Some faces are either fully transparent or disrupted. The normals are directed properly (see the screens below).

As in Blender 2.8
Screenshot_20200622_154920

As in game
Screenshot_20200622_154800

However, I discovered it works properly with obj exporter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.