Skip to content

Instantly share code, notes, and snippets.

@kerkkoh
Created October 31, 2021 12:31
Show Gist options
  • Save kerkkoh/bfad0eb3e383e82e5c29d1864a110a12 to your computer and use it in GitHub Desktop.
Save kerkkoh/bfad0eb3e383e82e5c29d1864a110a12 to your computer and use it in GitHub Desktop.
Blender to DayZ workflow for 3D models

This is a quick look into how to easily get a model from Blender to OB.

This is what it looks like when you export an FBX from OB and then re-import it into OB:

image

What you should notice here is the naming scheme for objects. It is as follows:

componentName_LODname

and additionally for resolution LODs:

componentName_LOD__resolution

You can see an alternative naming scheme here https://community.bistudio.com/wiki/LOD#Exporting_.fbx_with_LODs

Additionally in the import window, you should notice the LODs checkbox on the left. This means that these objects will be assigned to their proper LODs in OB.

So how do we create a simple object in blender? Here's a simple box with the same box copied for the geometry LOD:

image

Here you can notice the naming scheme in action. I have a Component1 selection, which will be assigned to the Geometry LOD in OB, it's name is thus in Blender Component1_LODGeometry.

Additionally the visible first lod has a selection called LOD0 and it is placed in the resolution lod 0.00, and thus its name in Blender is LOD0_LOD__0.000. If I wanted to place it in resolution 1.000, its name would be LOD0_LOD_1.000.

Now export this as FBX in blender and then importing to OB, it looks like this:

image

You can notice the LODs checkbox is available and checked.

Additionally, for me, I need to change the Master scale to 0.01 as Blender for some reason exports the object 100x larger. So if your objects are huge/not visible, try setting Master scale to 0.01. 

When importing is done, you can see the LODs and proper selections are automatically created:

image

What you might want to do next is go to Geometry LOD, and then from the top menu choose Structure > Convexity > Component Convex Hull, if you have not made the components convex in blender and named them properly i.e. ComponentX (in blender you can go into edit mode and choose Mesh > Convex Hull).

image

Additionally, if you are bothered by the triangulated mesh, you can do Structure > Squarize all LODs.

Finally, if you have assigned textures to your model in blender, they are probably in .png form like in my LOD0:

image

This is a png that I created with Tex View from a DayZ texture. I just need to change the .png to .paa and the p3d is ready to go in game. You can do this in Face Properties (select faces and press E) or in the resource view on the left under Current Model > Textures, but renaming the texture is often grayed out for some reason. My go-to in this situation is to use a text editor like Notepad++ or VSCode and open the p3d, and replace ".png" with ".paa" and save the p3d. This will not corrupt the model in any way and you can re-open the p3d in OB to check that the references are now to .paa files.

Cool, huh? The only thing you really have to do in OB is import and squarize all LODs if you make the Geometry properly in Blender. This means that you can do all of your OB work in Blender and you don't really need to touch OB and waste time in its antiquated UI.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment