Changing Material Explorer Properties from the Script Editor


I’d like to change the material explorer properties in MODE from the script editor. I haven’t found a way to do this from previous topics on KX or from the library of scripting commands. To be clear, I want to change properties in the Material Explorer, not the properties of a material in the material library.


1 Like

I’ve managed to figure this one out on my own. Here is how to change the Material Explorer settings in MODE via the script:

There are two sections of importance in the Material Explorer, the “Material settings” section and the “Simulation bandwidth settings” section. As far as I can tell, the third section listed (“View settings”) has no impact on the actual material fits and is only for viewing convenience.

The first section, “Materials settings,” is set by using the “setmaterial();” command for each material you’d like to set. You can check all the different properties available to change with this command by typing the following into the script prompt:


where materialname is a variable containing the name of your material as a string.

The “Simulation bandwidth settings” were a little bit harder to find, but they can be changed by first adding a solver (such as the FDE solver) and then using the “set();” command. If I want to fit my materials with a multi-coefficient model I would do it with the following lines of code:

set(“fit materials with multi-coefficient model”,1);

As with the setmaterial(); command, “?set;” can be used to see which properties you can change with the “set();” command. Note that you have to have the FDE solver selected before using “?set;” (this can be done by either using “?set;” right after using “addfde;” or by using “select(“FDE”);” before using “?set;”).

I hope someone else finds this helpful.