Document toolboxDocument toolbox

Blender Optimization package (BOP)

Welcome on documentation page for a Blender addon called Blender Optimization package. Shortly BOP. Documentation provide all necessary explanations including tutorial how to install addon


 


 

What is BOP ?

BOP stands for Blender Optimization package. It is a python script made in Blender and is meant to be used for a Twinzo clients and automatization processes specific for Twinzo use-case. Script uses multiple Build in functions which can greatly help with 3D model optimization and save time.

 

How it looks like ?

image-20240529-120605.png

What individual functions does script use ?

Script uses these functions:

It will delete all mesh faces which normals are facing down (Z-). Function also ignore objects with active modifiers

It will smooth out mesh normals to default value. Usually its 30°

Custom Split Normals are a way to tweak/fake shading by pointing them towards other directions than default, auto-computed ones. By deleting them 3D model switch to default one provided by Blender

It will delete duplicated meshes which are roughly at the same location and same shape

It will convert Triangulated mesh into the Quads for a Unity


How to install addon ?

 

Software needed:

 

  1. Download zip file called BOP

  2. Then we head to Blender and install addon. Click on edit panel in top left corner, then choose Preferences.

    image-20240529-120642.png

    1. If you are using Blender 4.1 or older

      1. Then choose Add-ons and click on Install in top right corner.

      2. Find the downloaded ZIP file and click again on Install button.

      3. After that make sure you enabled addon.

    2. If you are using Blender 4.2 or newer

      1. Then head to Extensions, click on drop down arrow in top right corner and choose option Install Legacy Add-on or Install from Disk

      2. Find downloaded ZIP file and click again on Install button.

      3. After that make sure you enabled addon


How to use it ?

  1. After we installed addon we need to press N to bring up side panel and locate it under Twinzo section

  1. Now you should see this panel:

  2. There are 4 Buttons.

    1. FIX my Classic Model

    2. FIX my Scanned Model

    3. RESET

    4. Need help ?

  3. There are 8 drop down menus

    1. Individual Functions

    2. Object Separator

    3. Object Instancer

    4. Analyze scene

    5. Decimator v5

    6. Exporter

    7. Documentation

    8. Updater

FIX my Classic Model button:

This button execute multiple functions which are specifically designed for a Classic Models like Demo Factory or Demo Office which you can check in app

You can use this button also for a Scanned Models but its not specifically designed for them

This button execute individual functions automatically in this order

  1. Delete Animations

  2. Delete any Armature and Bones

  3. Reset Origin

  4. Reset Scale to 1

  5. Recalculate Mesh Normals

  6. Auto Smooth All

  7. Delete Custom split Normals

  8. Convert triangulated mesh into quads

  9. Merge Close vertices

  10. Remove Unused datablocks

  11. Delete Bloat

  12. Merge Similar Materials

  13. Delete Downward faces

  14. Create Instanced meshes

  15. Decimator_v5

  16. Adjust LOD names

  17. Reparent

FIX my Scanned Model button:

This button execute multiple functions which are suitable for a Scanned Models via Lidar and similar technologies. Which are scanned models ? You can check Construction house or Twinzo office inside Twinzo app

You can use this button also for a Classic Models but its not specifically designed for them

  1. Delete Animations

  2. Delete any Armature and Bones

  3. Reset Origin

  4. Reset Scale to 1

  5. Delete Custom split Normals

  6. Merge Close vertices

  7. Remove Unused datablocks

  8. Delete Bloat

  9. Fix Scan rotation

  10. Merge Similar Materials

  11. Decimator_v5

  12. Adjust LOD names

  13. Reparent

RESET button:

Reset button will reset whole scene into the original state. Depending on your previous steps it may not resets everything as you expect.

Use this button with CAUTION!

Need help ? button:

Need help ? button is located under the drop down menu of Documentation and it will bring you to the addon documentation webpage


Individual functions

 

Drop down menu contain all individual functions which can be executed manually in any order as you like

You can also search for each individual function by pressing F3 or Spacebar


Object Separator

Object Separator will separate objects by loose parts (Mesh parts which are not connected to anything) and deletes meshes with Z-dimensions equal to 0


Object Instancer

Object Instancer will make identic or very similar objects as instanced one. Its doing it by checking distances between mesh vertices. Script will also remake already instanced meshes.


Analyze scene

Analyze scene will do exactly what is says. By pressing button Calculate Statistics, script will analyze scene and write statistics down bellow. There are two panels:

  1. Statistics

    1. In statistics panel are stored various information about currently opened scene

  2. Results

    1. In Results panel are stored Potentional Issues which are based on collected statistics in currently opened scene. Potentional Issues means that your model exceeded certain limit and may not work in Twinzo app


Decimator v5

Decimator v5 is a tool, designed to reduce vertex count while mostly preserving model shape and keeping textures mapping untouched. Tool is compatible with multi-user objects (Meshes with shared geometry). You can use Decimator v5 even on Scanned meshes but if your scan has significantly less vertexes than 750K, function can be too aggressive.

Tool is utilizing Blender native Decimate (Collapse) function with dynamic ratio values. Ratio values are dynamically calculated based on object face count and dimensions.

Conditions:

  1. If object has less faces, decimate function will be less aggressive

  2. If object dimensions are smaller than specified limit, decimate function will use aggressive decimate ratio since those objects are prompt to be less visible in app

  3. Non multi-user objects are processed separately

More details can be found in addon code


Exporter

Exporter will do exactly what is says. In order to export your model, you need to specify valid export location. You can do that by pressing folder icon next to predefined text "Choose path".

Couple things to know:

  1. Exported file format will be always FBX

  2. You don't need to write .fbx file extension while choosing export destination and file name. Exporter will automatically add it for you

  3. Why my exported file include name "BOP" before file format extension ?

    1. "BOP" text before file format extension will let us know that you used our addon and that can speed up processing if file will be uploaded through automatic Twinzo platform

 


Documentation

Documentation contain button which direct you to this page


Updater

Updater drop down menu contain button for checking available updates


Known limitations

Since every 3D model is build differently with unique purpose in mind, sometimes addon will not perform as you expected. BOP is build to cover most of the general optimization steps to help you prepare your 3D model for a Twinzo app. If addon fails in some point to process your 3D model, you may consider to try fix it manually or try to use functions in different order. We also provide guideline to help you with it: https://twinzo.atlassian.net/l/cp/ZLbu2p6W

When addon tends to get slow or fail:

  1. When trying to optimize large number of objects at once (like 1000 and more)

  2. When trying to optimize very dense meshes with millions of polygons (1M and more), (Doesn't count for Lidar or photogrammetry based meshes)

  3. Function Merge close vertices relies on model scale units. If due to unit conversion, model scaling is about the values like 0.001 or negative -0.001 and more, it may require manual adjustment

 

Code snippet (Python)

 

If you encounter any issues or need assistance with using this product, please do not hesitate to reach out for support. Our team is here to help you resolve any problems and answer any questions you may have.
To create a support ticket, visit our support portal at https://partner.twinzo.eu/helpdesk/customer-care-1