You may not like the answer, but I'm afraid the way you possibly imagine it is not meaningful to implement. Basically there are two ways to expand Blender programmatically: Either with an add-on (via pyhton API) or by hacking the C++ files. The latter means that you have to compile your own version of Blender every time a new official update appears. Gone are the days when you simply pressed the download button and installed it. That also means that you have to mess around with things like compiler choice and dependency management (which can be very painfull in C environments). If you are not familiar with it, then I would rather advise against this.
The far more convenient way would be to write a small addon and use the Pyhton API provided for this use-cases. However, this has the disadvantage that you have to press your own button for your adapted material, similar to what you are used to from other addons. But, as long as the Pyhton API doesn't change much, you can still download and install new Blender versions as usual and nothing will break.
Take a look at the following script and run it in Blender to test whether you would like to go the path of an add-on. If you need further help with the adaptation, feel free to ask me, but in principle you only have to expand or add a few lines to adapt it to your needs.
You can easily test it by pressing "Shift - F11", creating a new file and inserting the script. Then press the play button. Then, as with many other add-ons, another menu should be available in which you can create your material with a mouse-click (don't forget to select a mesh). I have tested the script but it is far from "bullet-proof" so do not test it in your project that you have to hand in tomorrow ;). Hope that helps.
bl_label = "Add Hashed Material Panel"
bl_idname = "MYADDON_PT_main_panel"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = 'My Default Material'
def draw(self, context):
layout = self.layout
bl_label = "Add My Material"
bl_idname = "addonname.addbasic_operator"
def execute(self, context):
material_basic = bpy.data.materials.new(name= "Basic")
material_basic.use_nodes = True
material_basic.blend_method = "HASHED"
material_basic.shadow_method = "HASHED"
bpy.context.object.active_material = material_basic
def invoke(self, context, event):
classes = [ADDONNAME_PT_main_panel, ADDONNAME_OT_add_basic]
for cls in classes:
for cls in classes:
if __name__ == "__main__":