Easiest way to get animated mesh from Blender to MiniB3D?

Started by nokkusuu, July 28, 2018, 07:25:24

Previous topic - Next topic

nokkusuu

What I'm trying to accomplish is use Blender for basically all my modelling work; I'd rather not animate meshes in other software as I'm used to Blender. Is there any way to bring an animated mesh from Blender to MiniB3D at all?

I've tried numerous methods, from importing into Fragmotion (animation didn't even load properly, tried a ton of different ways) to finding 3rd-party addons for Blender to export to the b3d format. None of these worked.

Any help or input is appreciated.

markcwm

I suppose you've tried the B3D Export plugins by Gandaldf, Minetest or Joric. Gandaldf is the original author, the other ones are almost the same fork that is supposed to be slightly improved, I've not tested any of them. Joric also has an importer but no animations yet. Links here.

nokkusuu

I did use some version of Gandaldf's exporter; now that I mention it, I was probably using a version of Blender too new for the exporter. Did some digging around with this information and ended up finding what seems to be Minetest's version, which worked perfectly!

Thanks! ;D

markcwm

Ah great, glad you got it working.

Yes, Gandaldf says his exporter works with an older Blender version, he never updated it. The credits for the later versions say MTLZ made it compatible with 2.63, and I think it continued to work with 2.7x.

Kippykip

Quote from: markcwm on July 30, 2018, 16:13:21
Ah great, glad you got it working.

Yes, Gandaldf says his exporter works with an older Blender version, he never updated it. The credits for the later versions say MTLZ made it compatible with 2.63, and I think it continued to work with 2.7x.

Hmm I found that animated models exported with .B3D blender addons with OpenB3D causes either:
*Polygons appear in front where they shouldn't - EDIT: Turns out to just be me using the Alpha flag on everything, oops...
*Animations either don't work at all, or cause an EXCEPTION_ACCESS_VIOLATION, or just have polygons glitch across the whole screen.
*Will crash on UpdateWorld when a different model is free'd/replaced with another TEntity

Although the blender exported models work just fine in fragMOTION and original Blitz3D EDIT: Nevermind, it's just as crash prone on Blitz3D aswell, sometimes it works, other times it crashes with EXCEPTIONACCESSVIOLATION.

It's especially weird how animations are handled though. Here's a clock model I made today, it has 3 bones in fragMOTION (which is odd as there's only one bone in the whole thing in blender)
Opening this model in Blitz3D works, but claims "There's no animation" when trying to animate it.
Opening it in OpenB3D has the UpdateWorld issue.

Strange, well this kinda sucks as I was hoping to make the switch to blender for my game.
Hopefully a better .B3D exporter comes out at somepoint.

RemiD

Fragmotion is a great modeling, rigging skining, uvmapping tool to use with Blitz3d, so most likely with Minib3d/openb3d too!

Kippykip

Quote from: RemiD on October 18, 2018, 16:55:02
Fragmotion is a great modeling, rigging skining, uvmapping tool to use with Blitz3d, so most likely with Minib3d/openb3d too!
Really? I've just been using it for converting .MS3D files between .B3D

EDIT: I have an update on the ordering issues, it also happens when exporting to .OBJ files on other software such as MilkShape 3D.... Hmmm
EDIT 2: I had transparency in my .PNG texture, and on top of that I had TextureFilter set to add an Alpha flag on everything, which is why I was having so much Z-Ordering issues.

RemiD

@Kippykip>>if you want to do a test of animation with a rigged skinned mesh (.b3d) you can download one here (with code example) : https://www.syntaxbomb.com/index.php/topic,4353.0.html

Kippykip

Ah, I figured out what was causing all the weird see through effect with my clock model.
It was because I had a:
TextureFilter("", 1 + 2)
Which basically makes everything load with alpha flags. I needed to do this because the scythe weapon in my game would lose it's alpha the moment you looked at an Entity with EntityAlpha used on it.

Not looking at any EntityAlpha meshes/Transparent materials


Looking at EntityAlpha meshes/Transparent materials


Probably a bug, but the TextureFilter workaround to fix the scythe only works if you do:
MeshLoader("c++")
before any of the meshes load, you can also use "cpp", "c++", "lib", "library".

Adding the meshloader line also makes .3DS models load correctly. I eventually settled on adding this instead of making everything have an alpha flag:
TextureFilter("M#", 1 + 4)
TextureFilter("m#", 1 + 4)
TextureFilter("A#", 1 + 2)
TextureFilter("a#", 1 + 2)


So only the textures that have a "A#" at the beginning of the filename will load with those flags, that fixed my scythe. Although I had to re-export my scythe model to use the texture with the different filename.
Although this workaround doesn't work at all with the default MeshLoader("bmx"), where no matter what you do with the alpha flags, it will always remove the alpha on whatever is in view of a entity edited with EntityAlpha (or looking at a model with a transparent material).
Works fine with masked textures on both MeshLoader's though.

I think this alpha flag mess when a EntityAlpha/Transparent Material is in view must be a somewhat new bug dating a few months back. Because before there was even a MeshLoader function in the first place, the scythe worked just fine without having to mess with TextureFilter.

Also if you're wondering what was wrong with the clock when everything has an alpha flag:



There was another bug with this change when using MeshLoader("c++") and loading .3DS models, where textures that had pitch black pixels were masked:

Not sure if this bug is still in the latest version, it was only there once the MeshLoader function was added.
I ended up doing a workaround where I replaced all #000000 pixels with #000001 instead.

@markcwm
Probably should have let you know about this a few months earlier :-X

markcwm

Hi Kippykip,

unfortunately I am not well at the moment, I have sciatica which will take some weeks to recover from so I can't code very well as I can't concentrate with the pain.

I do intend to keep working on Openb3d but I have to admit I am not familiar with most modellers having spent most of my time coding, so in the case of model issues I would appreciate it if you could email me your models so I can bug test with them, that would be awesome help.

At the moment I have been adding the 1.25 shader changes and I've to get that done before anything else.

RemiD

@markcwm>>if you don't know about it, take a look at "inversion table", my father got better thanks to that... (relieve the pressure between vertebraes)

markcwm

Thanks RemiD, I'll have a look but I'm using something called Gravity Life which is pretty good at relieving pain.

Kippykip

Quote from: markcwm on October 20, 2018, 02:25:51
Hi Kippykip,

unfortunately I am not well at the moment, I have sciatica which will take some weeks to recover from so I can't code very well as I can't concentrate with the pain.

I do intend to keep working on Openb3d but I have to admit I am not familiar with most modellers having spent most of my time coding, so in the case of model issues I would appreciate it if you could email me your models so I can bug test with them, that would be awesome help.

At the moment I have been adding the 1.25 shader changes and I've to get that done before anything else.
Really sorry to hear that man, hope you feel better soon. :( In the meantime I'll write an example and hopefully save you headaches for the future.