Post #487: : post_00488
🏷️ Tags
beginner macro conditional-logic unsolved
⚙️ Related PME Features
- Macro Editor
- Python Scripting
- Custom Panels
- Conditional Drawing
💬 Content
roaoao:
You can split that panel into 2 panels (main and sub-panel). And draw sub-panel in the main panel only when the object has materials (Custom tab):
your_condition_here and draw_menu("sub-panel") for example "object has materials" condition: ao = C.active_object; ao and len(ao.material_slots) and ao.material_slots[ao.active_material_index].material and draw_menu("sub-panel")Here is a json: [ATTACH]465135[/ATTACH]
wow that was awesome , man , but i dont understand how it works … i mean
like in this case
ao = active object ,
but i see you have not added if statement anywhere ? only “and” and then draw_menu? what is that … i mean how to do that if this then that thing ???
suppose i want to turn on Xray of an object if wireframe is turned on then ,
if ao.wire == True:
ao.xray = True
how