How to use b3d in blender?

User avatar
Tcll
Member
Posts: 87
Joined: Thu Jul 25, 2019 21:43
GitHub: Tcll
IRC: Tcll Tcll5850 DarkPikachu
In-game: Tcll
Location: The Gates of Darkness.

Re: How to use b3d in blender?

by Tcll » Post

cronvel wrote:
Mon Sep 07, 2020 12:48
Damn, so we are tied with a file format without anything but deprecated exporter? :/
I'll try and see what I can do to maybe rush something out sooner, just to give you guys something decent to work with...
just keep in mind, it'll probably be very basic as I've had to break a few things to redo the code.

to explain a bit, I'm trying to organize everything first before writing, rather than re-iterate through everything numerous times like every other script does.
I got caught up on bone matrices, and properly organizing the ROOT node before life decided to shove me in a hole...
I wish there was more official documentation so I could know how much slack I had with the format (how I could organize things more effectively)

EDIT:
btw, regarding your animations being lost
B3D is similar to IQM in that there's no individual animations
all animations are just 1 large animation indexed by frame number

though the script I'm working with (2.79) does support iterating both ipo and action animations
there could be changes in 2.8 causing issues with animation referencing the script is not aware of.
I'm just guessing at this point though cause I can't test... =3=

EDIT2:
just so nobody gets discouraged, life finally cut me some slack (not sure for how long), and I've gotten some free time to work on things a bit better...
and working have I been these past few days, though I've currently hit a snag with animation data and am currently working on a HexEdit template to help me get past it:
Image
older shots:
Spoiler
Image
Image
Image
figured it'd also help document the format a bit better :)

eventually I'll have the structs colored so stuff is easier to make out on the hex side, much like my old works with other model formats:
Spoiler
HAL HSD:
Image
so yeah, progress is finally on the way again ;D

EDIT3:
oh cool, Minetest ignores the global MESH chunk material and just defaults to 0 per TRIS chunk :srs:

Code: Select all

        if (triangle_brush_id != -1)
	{
		loadTextures(Materials[triangle_brush_id]);
		B3dMaterial = &Materials[triangle_brush_id];
		meshBuffer->Material = B3dMaterial->Material;
	}
	else
		B3dMaterial = 0; // this should be the MESH material ID
why does Minetest keep disappointing me... u.u

though it's good to know multi-material IS supported at least...

EDIT4:
the HexEdit template is mostly functional and should work for most proper B3D files
if anyone would like me to release it as is, let me know :)
otherwise, after I finish the export script, I'll work on coloring the structs and providing more info to make things less cryptic ;)

EDIT5:
ok so going through the animation code, I realized I needed a little bit more out of my template for validation purposes...
does anyone know of a good quat to euler code that doesn't need branching logic to handle singularities, or better yet doesn't deal with atan2() at all??
(I'm actually going for a quat -> mtx33 -> euler as the codes there seem more solid)

I'd prefer a code that maintains the original value as much possible...
or in other words, maintaining crazy values like 720 degrees instead of substituting 0 degrees for a gimbal lock case
is it possible to passively ignore gimbal lock with a better equation??

EDIT5.5: after some research, I still haven't found what I'm looking for... (gotta love DDG)
it appears what I'm talking about prior would be extrinsic rotation about the original axis (how OpenGL actually works)
(frame rotation (every euler equation ever) is intrinsic and causes singularities)
is there an extrinsic quat -> euler or mtx33 -> euler equation anywhere??

cronvel
Member
Posts: 41
Joined: Fri Jan 11, 2019 16:50
GitHub: cronvel

Re: How to use b3d in blender?

by cronvel » Post

So, I have a new question for the Blender Guru ^^
I'm currently working on a mod that manage player/entities 's skins/models/animations/gears. That mod include a brand new model, and I have some trouble with animation/armature.

If I'm not wrong, for exporting to b3d for Minetest, you first need to join all objects. During my tests, only the first object will appear in MT. But since it's very UNpractical (especially with the texture “overlay” of minecraft 1.8 skins), I prefer to work with multiple objects, and only join them just before exporting.

Each object (e.g. head, arm, body) are assigned to a bone, but when I join them all, all bone assignments are lost, so the workaround for me was to assign that big object to the armature using right-click > “Parent” > “with automatic weight”.

Automatic weight was doing well at the beginning, but now that my model is more and more complicated, with more bones dedicated for gear's attachments (e.g. wielded item, hat, ...), it is not working anymore, vertices get assigned to the wrong bone and everything is messy.

So my question is: how to preserve bone assignments in the join process?

User avatar
Tcll
Member
Posts: 87
Joined: Thu Jul 25, 2019 21:43
GitHub: Tcll
IRC: Tcll Tcll5850 DarkPikachu
In-game: Tcll
Location: The Gates of Darkness.

Re: How to use b3d in blender?

by Tcll » Post

cronvel wrote:
Wed Sep 16, 2020 07:41
So, I have a new question for the Blender Guru ^^
I'm currently working on a mod that manage player/entities 's skins/models/animations/gears. That mod include a brand new model, and I have some trouble with animation/armature.

If I'm not wrong, for exporting to b3d for Minetest, you first need to join all objects. During my tests, only the first object will appear in MT. But since it's very UNpractical (especially with the texture “overlay” of minecraft 1.8 skins), I prefer to work with multiple objects, and only join them just before exporting.

Each object (e.g. head, arm, body) are assigned to a bone, but when I join them all, all bone assignments are lost, so the workaround for me was to assign that big object to the armature using right-click > “Parent” > “with automatic weight”.

Automatic weight was doing well at the beginning, but now that my model is more and more complicated, with more bones dedicated for gear's attachments (e.g. wielded item, hat, ...), it is not working anymore, vertices get assigned to the wrong bone and everything is messy.

So my question is: how to preserve bone assignments in the join process?
just to note, I'm not a guru, I just know a somewhat decent amount of stuff. ;)

first off, a minor comment on the multiple objects bit
my test export of Brawl Pikachu was actually done with multiple objects linked to 1 armature in 2.79b, which created a NODE ROOT in the B3D data that those objects were assigned to...
so this may likely be an issue with the 2.8 script as, with a quick glance, it does appear to do things differently (the problem with code ports) >_>
but yes, the 2.79b script works appropriately here.

as for the weight issue, I haven't looked to see if that's just related to the 2.8 script...
try a 2.79b export and see if that fixes your issue, I might be able to get a better understanding if not.


btw, I haven't stopped working on my exporter, I'm just waiting on a response on another forum...
currently this is what I have, but I still need to replace atan2() to get it to work for HexEdit:

Code: Select all

from math import atan2, degrees
def quaternion_to_euler(x, y, z, w):
    return degrees(atan2(
        2.*(w*x+y*z),
        1-2.*(x*x+y*y)
    )), degrees(atan2(
        2.*(w*y-z*x),
        1-2.*(x*x+z*z)
    )), degrees(atan2(
        2.*(w*z+x*y),
        1-2.*(y*y+z*z)
    ))
^ I expect the Y axis to break as I'm no mathematician, this is just some scotch-tape work
(I need this for export verification on my exporter (comparison with Blender))

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: How to use b3d in blender?

by Nathan.S » Post

Last I exported B3d files I used this exporter, https://github.com/GreenXenith/io_scene_b3d
From what I remember it exported every object in the scene, so objects I didn't want I just moved to another layer thing.(I forget what the layers are called in 2.8.2, collections maybe)

Using automatic weights for lowpoly models is probably a bad idea. I don't know what your model looks like, but if the limbs are all their own boxes, you should just do vertex groups for the bones, those will be preserved when joining meshes together. (I'm a little surprised that automatic weights aren't, as they are also vertex groups, but I don't use those so I'm not too familiar with the inner workings of them.)

Always make sure you have a sane naming convention for your bones and then when you parent the mesh to the armature select 'Armature Deform - With Empty Groups' This will add a empty vertex group to your mesh for every bone, named the same as the bone. You can then go through the mesh in edit mode and assign the vertices to the groups as needed. If you ever decide to add more bones to the armature you can manually add a new vertex group to the mesh and it will follow the newly added bone. Assuming of course you give them both the same name.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

Re: How to use b3d in blender?

by GreenXenith » Post

Nathan.S wrote:
Fri Sep 18, 2020 13:44
Last I exported B3d files I used this exporter, https://github.com/GreenXenith/io_scene_b3d
From what I remember it exported every object in the scene, so objects I didn't want I just moved to another layer thing.(I forget what the layers are called in 2.8.2, collections maybe)
There should be a checkbox in the export options to export all or just selected, and it works fine for me. The exporter itself is a mess as the original port was not great. The only thing I did was fix some export errors. I may rewrite it myself sometime.
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

cronvel
Member
Posts: 41
Joined: Fri Jan 11, 2019 16:50
GitHub: cronvel

Re: How to use b3d in blender?

by cronvel » Post

Yes I'm already using GreenXenith's fork for exporting.
I usually unselect everything before saving, I had trouble multiple times when something was selected (the Python script have tendencies to throw an exception in that case).
I will give a try to Nathan solution, but for instance I don't know how to assign vertices to vertex group.

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: How to use b3d in blender?

by Nathan.S » Post

You should find exactly what you need here, https://youtu.be/YmZpGt2Jg90?t=661 :)
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

cronvel
Member
Posts: 41
Joined: Fri Jan 11, 2019 16:50
GitHub: cronvel

Re: How to use b3d in blender?

by cronvel » Post

@Nathan.S Oh yes it works! Thanks a lot!

bzt
Member
Posts: 217
Joined: Tue Sep 24, 2019 14:26

Re: How to use b3d in blender?

by bzt » Post

Hi Tcll,

I'm just curious, since you've figured out a lot about the B3D format, did you documented that? If you haven't already, could you please create such a document?

I'm working on a 3D model converter, and right now I'm using Assimp. As you have noticed, support for B3D is quite rudimentary in Assimp, and I'd like to write my own B3D parser instead. That's why I'm asking for a file format spec.

(ATM that M3D format is not supported by Minetest, but could be. It has an stb-style single header C/C++ SDK, so easy to integrate, and it is capable of storing everything Minetest needs, including multiple skeletal animations and voxel images for structures. I'm planning to add support for it into Minetest, but that's no good if I can't convert already existing models. I've already solved the issue of structures with MTS, but I'm clueless with B3D.)

Cheers,
bzt

User avatar
Tcll
Member
Posts: 87
Joined: Thu Jul 25, 2019 21:43
GitHub: Tcll
IRC: Tcll Tcll5850 DarkPikachu
In-game: Tcll
Location: The Gates of Darkness.

Re: How to use b3d in blender?

by Tcll » Post

hey bzt, trust me, I know all about ASSIMP and how garbage it is ;)
I've actually improved the python modern OpenGL previewer for the examples, though I'm not sure if they've posted it anywhere...

but anyways, while I don't have any official documentation for the format, I do have that unfinished template I'd worked on earlier for HexEdit5, which should greatly help ;)
gimme a little bit and I'll have that uploaded for you

unfortunately Andrew hasn't made HexEdit5 easily available, so if you need a download link, I have the second-last release backed up on MEGA...
(the latest release fixed the need for patching the BinaryFileFormat.DTD for color support and also improved performance and even added some functionality, but unfortunately my experience with numerous Western Digital (and partner) HDDs has not been very good)
if you don't like MEGA, I do have a FOSS alpha-software solution I can move that to :)
(I'm actually waiting for it to mature a little before I fully commit to it, as it's absolutely 100x better)

EDIT:
alright, I got everything uploaded, I even ported over HexEdit from MEGA, because whatever...
here are all the downloads:
HexEdit (mfc100.dll is included if missing)
_b3d.xml (R-click, save-as)

also +1 for GitLab ;)

EDIT2:
I just took a peek at your M3D format, and while I will say it appears a bit noob-ish in design-comparison to some of the game formats I've worked with
it does at least seem to support everything needed for most models... :)
(or in other words, this appears to be a really good format for numerous engines to take advantage of) ;D

the only thing I'm left questioning is how well does it support per-vertex multi-material and multi-channel UV layers??
as someone who's worked (and is still working on) on a universal model API myself, I'm doing a few things not even Blender is capable of ;)
that includes vertex-less model formats :)

bzt
Member
Posts: 217
Joined: Tue Sep 24, 2019 14:26

Re: How to use b3d in blender?

by bzt » Post

Tcll wrote:
Sun Oct 11, 2020 11:19
I've actually improved the python modern OpenGL previewer for the examples, though I'm not sure if they've posted it anywhere...
Do you mean you have a working B3D viewer in python? Could you please upload it somewhere (if the license allows it, of course).
Tcll wrote:
Sun Oct 11, 2020 11:19
but anyways, while I don't have any official documentation for the format
Yeah, that's pretty much non existent, that's why I was hoping you have something like a "home-made" spec.
Tcll wrote:
Sun Oct 11, 2020 11:19
I do have that unfinished template I'd worked on earlier for HexEdit5, which should greatly help ;)
Thank you, but I don't use Windows, and I prefer not to mess around with wine, which means no HexEdit5. I've downloaded the xml template though, maybe I can use it (convert it into some other template format or write a little tool that uses it). Thank you, this is already much more than the non-existent spec :-D

But a home-made spec in txt or html would be the best!
Tcll wrote:
Sun Oct 11, 2020 11:19
I just took a peek at your M3D format, and while I will say it appears a bit noob-ish in design-comparison to some of the game formats I've worked with
Don't let the simplicity fool you! Actually I've put enormous efforts into make it look noob-ish. Simplicity is the ultimate sophistication! :-) But read the file format spec (unlike B3D it has one ;-) ), you'll see it's not simple after all, and every single bit in the file is well-defined, no questions left unanswered.
Tcll wrote:
Sun Oct 11, 2020 11:19
it does at least seem to support everything needed for most models... :)
(or in other words, this appears to be a really good format for numerous engines to take advantage of) ;D
Thanks! That was the intention btw, to figure out what's the very minimal needed information for animated models, and just let's drop everything else to simplify engines without sacrificing features.

I'm just curious, have you also checked the M3D WebGL JS polyfill on the webpage?
Tcll wrote:
Sun Oct 11, 2020 11:19
the only thing I'm left questioning is how well does it support per-vertex multi-material
Each polygon can belong to a different material. This means adjacent polygons sharing the same vertices might use different materials, so in this regard a vertex can belong to multiple materials. You can't specify a different material for each vertex directly, however for simple material-less models you can specify a different diffuse color for each vertex. (FYI the format is capable of storing many different polygons, triangles, quads, etc. but ATM only triangles are implemented in the SDK. Also note that the SDK does rearrange polygons to minimize material context switches, meaning adjacent polygons are not necessarily stored in the file contiguously.)
Tcll wrote:
Sun Oct 11, 2020 11:19
and multi-channel UV layers??
Absolutely not. I've found multi-channel UV layers an insane overcomplicated mess. I believe that skinning should be implemented with a single UV map per object, replacing textures underneath that UV map, or adding constant offsets to UV values (when Texture Atlas used). That's much more manageable for everyone (for both the engine writers and also for the model designers and end-user modders).
Tcll wrote:
Sun Oct 11, 2020 11:19
as someone who's worked (and is still working on) on a universal model API myself, I'm doing a few things not even Blender is capable of ;)
that includes vertex-less model formats :)
Yeah, then Model3D must be of your liking :-) It can store voxels as well as parameterized mathematical shapes (like NURBS, however technically it stores the control points just like any other vertex points), not to mention the procedural meshes (currently with Lua binding) :-)

Cheers,
bzt

User avatar
Tcll
Member
Posts: 87
Joined: Thu Jul 25, 2019 21:43
GitHub: Tcll
IRC: Tcll Tcll5850 DarkPikachu
In-game: Tcll
Location: The Gates of Darkness.

Re: How to use b3d in blender?

by Tcll » Post

bzt wrote:
Sun Oct 11, 2020 17:33
Do you mean you have a working B3D viewer in python?
oh lol woops, no, sorry for that confusion, just a general previewer for ASSIMP ;)
bzt wrote:
Sun Oct 11, 2020 17:33
Thank you, but I don't use Windows, and I prefer not to mess around with wine, which means no HexEdit5.
ah, alright :)
it works very well in Wine though, I'll say that much ;)
(the devs do intend to write a linux port later on, but that won't be for some time)
hopefully my screenshots above serve to give you enough of an understanding as to how it's supposed to work

and yeah, I'll work on a page eventually if nobody beats me to it
but that'll likely be after I get my primary project off the ground >_>
bzt wrote:
Sun Oct 11, 2020 17:33
I'm just curious, have you also checked the M3D WebGL JS polyfill on the webpage?
I gave it a quick glance, and I'm intrigued, I'll definitely look into it more down the road, likely for support within my primary project :D
(I'm working on a software suite around that universal API, though currently I'm trying to figure out how to launch it with encrypted IPC through anonymous pipes)
bzt wrote:
Sun Oct 11, 2020 17:33
Each polygon can belong to a different material. This means adjacent polygons sharing the same vertices might use different materials, so in this regard a vertex can belong to multiple materials. You can't specify a different material for each vertex directly, however for simple material-less models you can specify a different diffuse color for each vertex. (FYI the format is capable of storing many different polygons, triangles, quads, etc. but ATM only triangles are implemented in the SDK.)
that's good to hear

though that miiiiiight pose a problem when you want to support tri-fans or quad-strips and have different materials assigned to individual faces of those primitives ;)
buuuut it's not like that can't be worked out with proper indexing :)
(most game engines parse the format into an internal format definition anyways, so it's not like load-time optimizations for that really matter much)
^ this sucks in the case of IQM/ZYM where the format consists of near-direct GL vertex-array data that could be loaded almost instantly.
bzt wrote:
Sun Oct 11, 2020 17:33
Tcll wrote:
Sun Oct 11, 2020 11:19
and multi-channel UV layers??
Absolutely not. I've found multi-channel UV layers an insane overcomplicated mess. I believe that skinning should be implemented with a single UV map per object, replacing textures underneath that UV map, or adding constant offsets to UV values (when Texture Atlas used). That's much more manageable for everyone (for both the engine writers and also for the model designers and end-user modders).
lol it's really not THAT difficult XD
maybe that could be added in a future update as you're kinda going against your own standards here ;)
but otherwise, for more advanced purposes, these could be used for more realistic overlay effects that aren't provided by the engine itself

these are generally used when you want to have some sort of dynamic texture effect that can't simply be baked, mainly for terrain applications or decals
I haven't really dabbled in this too much myself, but I do know there's a lot of ways in which these can be used.
1 effect of which you can't really add via materials is a portal effect with 2 textures rotating on top of each other at different speeds
(this could alternatively be done with a basic texture frame animation with only 1 rotation applied, but you get the point)
bzt wrote:
Sun Oct 11, 2020 17:33
Yeah, then Model3D must be of your liking :-) It can store voxels as well as parameterized mathematical shapes (like NURBS, however technically it stores the control points just like any other vertex points), not to mention the procedural meshes (currently with Lua binding) :-)
indeed, the option for potential support is always useful as new emerging standards enter the game space ;D
heck, even IQM allows for custom arrays for this very purpose :)

I wish the best of luck to your format here, and I hope it takes off ;)

bzt
Member
Posts: 217
Joined: Tue Sep 24, 2019 14:26

Re: How to use b3d in blender?

by bzt » Post

Tcll wrote:
Sun Oct 11, 2020 18:25
and yeah, I'll work on a page eventually if nobody beats me to it
but that'll likely be after I get my primary project off the ground >_>
That would be great!
Tcll wrote:
Sun Oct 11, 2020 18:25
(I'm working on a software suite around that universal API, though currently I'm trying to figure out how to launch it with encrypted IPC through anonymous pipes)
I can help you with those. I've several decades of experience with crypto coding as well as with the POSIX standard (if you meant POSIX anonymous pipes). Drop me an email: bztemail at gmail.

About my file format, I think you misunderstood a bit the concept. It's purposely stores information from the model's perspective, and nothing else. Strictly one model per file, no scene (no lights or camera descriptions, because those does not belong to the model). Yes, this means some additional code must be written in engines, but that's unavoidable if you're aiming at an engine-neutral format.
Tcll wrote:
Sun Oct 11, 2020 18:25
though that miiiiiight pose a problem when you want to support tri-fans or quad-strips and have different materials assigned to individual faces of those primitives ;)
I believe you're referring to an engine specific feature here :-) From the model's perspective a specific part of the surface always belongs to one material only (regardless how that material is actually represented in an engine in run-time in certain instances of the model).
Tcll wrote:
Sun Oct 11, 2020 18:25
lol it's really not THAT difficult XD
No, the implementation wouldn't be difficult. Explaining it to designers to use it right and supporting it in simpler engines is :-)
Tcll wrote:
Sun Oct 11, 2020 18:25
maybe that could be added in a future update
I don't think so. With your example, a dynamic texture effect is not supposed to be stored with the model (as that's an engine specific feature and not property of the model). For example, a stargate model should only contain a reference to a "woosh" texture, and it is up to the engine to generate that particular texture with rotating 2 other textures to get that portal look. A simpler engine could just use a plain texture, use a pre-recorded water-animation or generate a bumpmap-light effect or whatever.

With another example, in an engine-neutral format the model has a material "steel", then it stores that this material has to be metallic, but it's not storing effect descriptions. That part is up to the engine. A simple engine could just use the gray texture giving it a small emission to make it "shiny" depending on the light source, while a more advanced raytracer could reflect the whole environment on the surface to make it truly "chrome-y". In both case from the model's point of view it's just "steel" material, regardless how steel is visualized in a particular engine.

The same model supposed to be loaded in an ancient OpenGL 1 engine just as well as in an engine with a cutting-edge Disney PBR shader. The wireframe and the animations would be exactly the same in both, however the model would look much better in the latter. This backward (and possible forward) compatibility wouldn't be possible if the effects were stored directly in the model (as they are in current formats, and look how many formats there are and how incompatible those formats are).

Does this make sense to you?
Tcll wrote:
Sun Oct 11, 2020 18:25
I wish the best of luck to your format here, and I hope it takes off ;)
Thanks! Let me know if you need help with the encryption and pipes!

Cheers,
bzt

User avatar
Tcll
Member
Posts: 87
Joined: Thu Jul 25, 2019 21:43
GitHub: Tcll
IRC: Tcll Tcll5850 DarkPikachu
In-game: Tcll
Location: The Gates of Darkness.

Re: How to use b3d in blender?

by Tcll » Post

sorry for the late reply, I haven't been at my PC :P
bzt wrote:
Mon Oct 12, 2020 16:10
That would be great!
lol keep in mind, that likely won't be for some time, unless I'm pushed enough to change the priority. ;)
bzt wrote:
Mon Oct 12, 2020 16:10
Drop me an email
uuuuuh, I'm not a fan of sending anything to Google knowing they'd sell it... they really can't be trusted with anything these days.
I tend to prefer more secure, or at least trustworthy measures these days, knowing how irresponsible big-tech has become. ;)

I wouldn't mind PM-ing here though if that's alright with you, or maybe even Tox chat if you'd like something more real-time :)
bzt wrote:
Mon Oct 12, 2020 16:10
I believe you're referring to an engine specific feature here :-) From the model's perspective a specific part of the surface always belongs to one material only (regardless how that material is actually represented in an engine in run-time in certain instances of the model).
actually no, that's why I referred to proper indexing ;)

I have more experience with Nintendo's GX architecture than anything else, so I tend to follow their display-list formatting as a professional example.
(HAL's HSD archive format is actually my favorite general format as you can do literally anything with it for game resource)
^ it requires pre-defined structs be known per game, so it's not really viable for a general model format unlike Havok's BRMDL format (my avatar)

fun fact: my avatar actually consists of 5 models sharing 3 materials (or 4 with multi-texture)
(BRMDL also supports 8 UV channels, just like B3D)

but getting back on topic, supporting GL1 up to Vulkan really isn't that difficult and can easily be managed with mesh, material, texture, and image flags. ;)
(the flags should define what the model supports, and can be used to align with GL vertex attribute, blend, texture environment, and even transformation specs)

btw BRMDL is from a mesh perspective, here's what Brawl Pikachu looks like without bone transformations (raw vertex positions):
Spoiler
Image
ignore the look of my ugly program, what I'm working on now will be greatly improved, though still using an OpenGL UI. :P
bzt wrote:
Mon Oct 12, 2020 16:10
Explaining it to designers to use it right and supporting it in simpler engines is :-)
lol, NeHe's examples actually did a really good job of helping me understand. :)
but yeah I can agree it's not a simple thing to explain when designing for it.
bzt wrote:
Mon Oct 12, 2020 16:10
Does this make sense to you?
honestly, I think I'd really have to take a close look at your format before recommending anything
but afterwards, I'm still sure I could still probably think of some way to do it :)

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: How to use b3d in blender?

by Blockhead » Post

I have had some mixed successes with b3d, as long as I triangulate my faces before uses one of the various exporters we have hanging around. I'm rather annoyed however by the lack of a working importer for 2.8/2.9 series blender. I have fiddled with a bunch of forks of Gandadlf's original code, most of which are forks of GreenXenith's code. But I can't actually get one working right now.

Why is this an issue? Because I am trying to improve models for which there is no original .blend file available, but that still are freely licensed. Mostly this is mbb's old work for advtrains. Even if the original files still exist, mbb isn't around in this community any more to give them to me. They were also made under 2.79 or earlier, which may cause compatibility issues. Thankfully for the static models without animation, I can use the earlier advice from ExterData and use an online converter to convert them to obj. For ones with animation however, I haven't found anything free (as in freedom OR beer) that will work.

Tried:
  • 3d-convert.com - hangs on animated b3d
  • anyconv - obj only, hangs on animated b3d
  • NCH Sofware Spin 3D - no animation, no smoothed normals, discards UV map info
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
Tcll
Member
Posts: 87
Joined: Thu Jul 25, 2019 21:43
GitHub: Tcll
IRC: Tcll Tcll5850 DarkPikachu
In-game: Tcll
Location: The Gates of Darkness.

Re: How to use b3d in blender?

by Tcll » Post

well, I come bringing news everyone's going to dread
but I'm afraid I'll no longer be working on the improved B3D export script for Blender :(

I do still have the source if anyone wants to try and improve on my optimizations
but I've pretty much lost all faith in Minetest as well as my motivation...

there's just so much wrong with minetest it was actually boring me of the genre, so I had to stop playing it before I went insane
there's too much I can't do with mods, and too much lack of common sense for the API to be useful
not to mention the horrible performance (10 FPS at 30 blocks high on a Strix (R9 390) GPU)

anyways, I'm gonna stop here before I write a paragraph of all the problems with minetest that drive me insane (like broken collision)
I'm willing to bet I'll have a minecraft clone of my own written in python that'll be more performant than minetest before minetest's major issues are fixed...

so anyways, if anyone wants the broken code, let me know, and I'll see what I can do to send it freely. ;)

User avatar
Midnight
Member
Posts: 168
Joined: Sun Dec 19, 2021 13:56
GitHub: MidnightPhantom
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: How to use b3d in blender?

by Midnight » Post

Please can anyone tell me how I export blitz3D files from blender 3.2.1

User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

Re: How to use b3d in blender?

by Mr. Rar » Post

Midnight wrote:
Fri Jun 02, 2023 10:53
Please can anyone tell me how I export blitz3D files from blender 3.2.1
I know of no way to do that. You need Blender 2.93.5 and this B3D exporter: https://github.com/GreenXenith/io_scene_b3d

See: viewtopic.php?f=47&t=28969
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II

User avatar
apercy
Member
Posts: 640
Joined: Wed Mar 25, 2020 16:31
GitHub: APercy
In-game: APercy
Location: Pinheiral - RJ - Brazil

Re: How to use b3d in blender?

by apercy » Post

Mr. Rar wrote:
Fri Jun 02, 2023 12:55
Midnight wrote:
Fri Jun 02, 2023 10:53
Please can anyone tell me how I export blitz3D files from blender 3.2.1
I know of no way to do that. You need Blender 2.93.5 and this B3D exporter: https://github.com/GreenXenith/io_scene_b3d

See: viewtopic.php?f=47&t=28969
Im using this on blender 3.3.0
https://github.com/GreenXenith/io_scene ... ag/f6bc3f1

User avatar
Mr. Rar
Member
Posts: 109
Joined: Tue Oct 04, 2016 20:13
GitHub: MrRar
In-game: MrRar

Re: How to use b3d in blender?

by Mr. Rar » Post

apercy wrote:
Fri Jun 02, 2023 13:45
Mr. Rar wrote:
Fri Jun 02, 2023 12:55
Midnight wrote:
Fri Jun 02, 2023 10:53
Please can anyone tell me how I export blitz3D files from blender 3.2.1
I know of no way to do that. You need Blender 2.93.5 and this B3D exporter: https://github.com/GreenXenith/io_scene_b3d

See: viewtopic.php?f=47&t=28969
Im using this on blender 3.3.0
https://github.com/GreenXenith/io_scene ... ag/f6bc3f1
I'm not doing any modeling work right now by I went ahead and tested Blender 3.3.0 and it does indeed work. I'm glad to have found a newer version that works. Thanks!
"Only in Christ do we find real love, and the fullness of life. And so I invite you today to look to Christ." - St. John Paul II

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: How to use b3d in blender?

by Wuzzy » Post

Mr. Rar wrote:
Fri Jun 02, 2023 12:55
Midnight wrote:
Fri Jun 02, 2023 10:53
Please can anyone tell me how I export blitz3D files from blender 3.2.1
I know of no way to do that. You need Blender 2.93.5 and this B3D exporter: https://github.com/GreenXenith/io_scene_b3d

See: viewtopic.php?f=47&t=28969
I just tried that and I got a B3D file out of it and I can load the model. But the animation does not seem to play in Minetest after I call set_animation. Am I doing something wrong?

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: How to use b3d in blender?

by Nathan.S » Post

From what I recall the export only exports frames that are in the active range in Blender. I think you also needed to have the mesh and armature selected when exporting. Lastly animations that are node-based or otherwise not keyframed aren't exported. There is a way to bake the animation to keyframes, but offhand I don't recall how I went about doing that.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: How to use b3d in blender?

by Wuzzy » Post

The exporter works when I export the MTG character.blend file but fails when I try it with my own dummy/test model.

Okay so the problem isn't with the exporter, I just don't know how to use Blender. XD

I did what you said but still fail. I also made sure to make sure the mesh and armature is selected, also the boxes are ticked in the export dialog.
I guess the exporter seems to silently expect something else as well, and I don't know what else it might need.

It's all very confusing. I guess I'll write a how-to page for the wiki once I get this stuff working.

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: How to use b3d in blender?

by Nathan.S » Post

What exporter and version of Blender are you using?
I have Blender 3.6.1 and the exporter from GreenXenith, found here: https://github.com/GreenXenith/io_scene_b3d
When I export a model there are no export options listed.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: How to use b3d in blender?

by Wuzzy » Post

So it seems this is more like an user problem (i.e.: me).
With the tools I managed to export the Minetest Game character with animations, but when I export my own model, it doesn't work. So there is something I must have done wrong but I don't know what. So it seems the tools work, I just don't know how to use them. >_> Blender is hard lol.

It's been a while since I last tried it and I don't remember the version numbers. I will report back once I tried it again.

There is another problem with using an ancient Blender version: I can only get it to work with the software renderer which is *extremely* laggy.

Working with legacy software and legacy file formats is PAIN. I hope Minetest will support a more modern format eventually.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests