Kenshi
bspawn Apr 23, 2018 @ 11:45pm
Exporting collision mesh from Blender?
Using the latest Kenshi Blender (v2.79) plugin, I have parented a box to the object mesh, even went so far as to add a collision modifier to it (probably not necessary, just trying to get it to work).

I have the box selected when exporting collision (xml), but it gives me an error message saying there is "no collsion selected for export". (note: "collsion" instead of "collision" - not my typo)
< >
Showing 1-8 of 8 comments
oi__io Apr 24, 2018 @ 4:01am 
In a thread earlier this month, someone wrote this:

Originally posted by someone:
The blender plugin can export collision files.
Add rigid bodies to some objects in blender, select box, capsule, convex hull or mesh for the collision shapes and export with file>export>kenshi collision.
You can use this tool to preview mesh and collision files: https://www.lofigames.com/phpBB3/download/file.php?id=5920

I have never tried playing around with collision files myself but maybe it'll work if you add rigid bodies to the mesh instead of parenting a box to the mesh?
bspawn Apr 24, 2018 @ 5:04am 
Thank you, that did put me on the right track: rigid body must be added (i used 'passive') to the mesh that is supposed to become the collision mesh, which can be just a box and does not need to be parented to the object mesh.
SnugSnug Apr 5, 2019 @ 2:36pm 
necro but hopefully relevent.

trying to make custom.xml for furniture mesh in blender via export.

I tried exporting with rigid active and got a valid collision.xml to generate. But after attaching it to the mesh in FCS and testing it in the game it doesn't seem to recognise it.

Telltale signs are once built the mesh is non-selectable, non-interactive and characters run through it. If i swap to a vanilla collision.xml. of similar size the object gets recognised properly.

oi__io Apr 5, 2019 @ 6:02pm 
When generating collision for my custom structures, I usually just use the default settings. The only thing that is important in my experience is the collision shape. I use "box" for most of the structures in the resource mod but I use a combination of "box" and "mesh" depending on the shape of the parts for my octagon mod.

If your furniture is mostly rectangular and you want a simple collision, I suggest you use "box". Just make sure the collision is positioned correctly corresponding to the mesh in Blender. Sometimes I make a dummy simple shaped wireframe box mesh that encapsulate my structure and then generate the collision on that wireframe box when I'm using "box" shape collision.
SnugSnug Apr 6, 2019 @ 6:33am 
Okay i'm obviously missing a step somewhere in Blender then. Is box different to cube?

If i build a mesh, and try to export it's collisions it says no valid physics to export.
If i build a mesh, add it to active rigid in physics tab, i can export it but it doesn't do anything.
If i build a cube same size, (position,relation, scale all saved) as mesh it exports as above but no in-game affect either.
If i have cube and mesh (visible or hidden) in blender, and add active cube to rigid and export then i get this message after ctd when trying to complete build order ie when it generates the scaffold mesh in-game.
If i use vanilla collision as proxy it all works fine. (although bounding box is taller tahn the mesh it surrounds... which may be issue?)

14:15:08: Mesh: Loading sandbag_divide00.mesh.
14:15:08: Mesh: Loading sandbag_divide01.mesh.
14:15:23: OGRE EXCEPTION(887a0005:RenderingAPIException): Error Presenting surfaces. Description: hr = 0x887A0005
(Reason: 0x887A0006). Reason: 2289696774 in D3D11RenderWindowSwapChainBased::swapBuffers at ..\..\..\RenderSystems\Direct3D11\src\OgreD3D11RenderWindow.cpp (line 632)
oi__io Apr 6, 2019 @ 8:05am 
Originally posted by SnugSnug:
Is box different to cube?
I think you're getting confused between "box" collision shape with a cube mesh here. Since it is easier to illustrate what I'm talking about with pictures, I made a mini guide on how to generate custom collision. Here's the imgur link to the guide.[imgur.com]

I'm not entirely sure if that is the proper way to do it but that's how I made it for my custom structures and it kinda work for me. Like mentioned in my previous comment I use "box" for most of the structures in the resource mod but I use a combination of "box" and "mesh" depending on the shape of the parts for my octagon mod.

When I use "mesh", I usually make a simplified dummy bounding box first so that the collision will not be overly complicated since I think that could cause performance issue. If anyone knows more about this, please feel free to correct me if I'm wrong.
SnugSnug Apr 6, 2019 @ 8:26am 
Originally posted by oi__io:
Originally posted by SnugSnug:
Thanks for that, i was missing the physics button (and particles), thought the bar ended at textures. Had been using the left hand physics tab.

I will play with it later.


Cattrina May 13, 2021 @ 7:47am 
Necro, but relevant https://youtu.be/ng0qJcjKbco
< >
Showing 1-8 of 8 comments
Per page: 1530 50

Date Posted: Apr 23, 2018 @ 11:45pm
Posts: 8