Post #3533: This is what i’m talking about

šŸ“‹ Metadata

šŸ·ļø Tags

pie-menu hotkeys intermediate solved

  • Python Scripting
  • Pie Menu Editor
  • Hotkey Configuration

šŸ’¬ Content

This is what i’m talking about

import bpy

if bpy.context.object.type == 'MESH':
    
    if bpy.context.object.data.polygons[0].use_smooth :
    
        bpy.ops.object.shade_flat()    
    else:
    
        bpy.ops.object.shade_smooth()
        
elif bpy.context.object.type == 'CURVE':
    
    if bpy.context.object.data.splines[0].use_smooth :
    
        bpy.ops.object.shade_flat()    
    else:
    
        bpy.ops.object.shade_smooth()

I put it in external script, and now when i pressing hotkey for pie, the script executes and also there is no button :woozy_face:

https://i.gyazo.com/9558d2953c057a2063bbc2c712a3cf08.mp4

By the way Is it possible to write it as a command?
UPD: solved execute_script was in custom tab :slight_smile:


šŸ”— View on Blender Artists