Expose a Python property and/or operator to set the visibility of a node parameter panel
I'd like to be able to use a Python script to unhide a specific parameter panel of a node (e.g. the Specular panel of Principled BSDF). I've looked through the bpy docs and haven't found a way to do this, so I'm assuming it's not currently possible.
Preferably, this should let you be able to set the visibility to a specific true/false value, as well as let you toggle it.
1 Comment
There is a way to hide socket, not sure how to hide whole panel
mat = bpy.context.active_object.active_materialnodes = mat.node_tree.nodesprincipled_node = nodes.get("Principled BSDF")if principled_node:→ socket = principled_node.inputs.get("Subsurface Weight")→ if socket:→ → socket.hide = TrueResult:
But You can just hide all properties inside pannel and it will hide:
subsurface_sockets = ["Subsurface Weight", "Subsurface Radius", "Subsurface Scale", "Subsurface IOR", "Subsurface Anisotropy"]if principled_node:→ for socket_name in subsurface_sockets:→ → socket = principled_node.inputs.get(socket_name)→ → if socket:→ → → socket.hide = TrueResult:
No idea how to preserve tabulators in markdown code, so i placed "→ " symbol.