Skip to content

Change_Blender_export_defaults

Sergejs edited this page Aug 26, 2022 · 2 revisions

Change Blender mesh2input.py export defaults


About

It is possible to change the default Blender export settings to always have correct paths and options pre-set (to minimize manual setup and user-errors when using Blender Mesh2HRTF project exporter's graphical user interface).

The arguments why you should NOT do this, because:

  1. If you will only simulate 1-5 projects one after another, these steps are not worth your time.

  2. These changes will be re-set to defaults in case you ever install an updated version of mesh2input.py

  3. There is Scriptability of Blender and Export feature which allows to create custom Python script that will always override your export settings and can in other ways automate the Blender exporting process. This exact method is used in the Fast Project Export script suggested in the basic tutorial (if you use the Fast method or similar scriptability based export approach, then these Blender export defaults will not affect anything at all).

How-to

So, to change the GUI defaults:

  • find the mesh2input.py script that is installed in Blender (see installation instructions how to find the exact path). Usually, on Windows it can be found in C:\Users\%username%\AppData\Roaming\Blender Foundation\Blender\<version>\scripts\addons\mesh2input.py
  • Open exportMesh2HRTF.py file with a text editor.

Here are the options to change:

  1. Change the "Mesh2HRTF-path" to the files which are copied into every Mesh2HRTF project folder:

    • Search for programPath: StringProperty(
    • Change the line default=r"/path/to/mesh2hrtf", to the absolute path of the mesh2hrtf folder inside your your main Mesh2HRTF directory, for a Linux/Mac example: default=r"/home/goofy/mesh2hrtf-git/mesh2hrtf", or on Windows: default=r"C:\Git_SourceForge\mesh2hrtf-git\mesh2hrtf",
  2. Fix the tick-boxes necessary to simulate most HRTFs:

    • Search for programPath: reference: BoolProperty(`
    • Change the line default=False, to default=True,
    • Then follows line computeHRIRs: BoolProperty(
    • Again change default=False, to default=True,
  3. Fix the default frequncy settings (to your favorite settings - example settings given):

    • Search for minFrequency: FloatProperty(
    • Change the line default=100, to default=0,
    • Then follows line maxFrequency: FloatProperty(
    • Change default=20000, to default=24000,
    • Then follows line frequencyVectorValue: FloatProperty(
    • Change default=100, to default=150,

Following the same principle, it is possible to change also other defaults to fit your needs.