# Hide Custom Properties by BoolProperties

I am trying to create add-on in order to control the color from RGB node and struck at how to hide the custom Properties with the material of the selected object does not have included the RGB node. Let's say the Plastic material has included an RGB node, the diffuse color parameter is shown; while the other material(which does not have included an RGB node), the diffuse color won't be shown in the property panel

My command is like this:

 class MaterialParameterPanel(bpy.types.Panel):

bl_label = "Material Color"
bl_idname = "MATERIAL_PT_PANEL"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Material Parameter"

def draw(self, context):
layout = self.layout
ob = bpy.context.active_object
ma =ob.active_material
row=layout.row()
row.prop(ma.slot_setting, "rgb")

def updateRGB(self, context):
mat = self.id_data
node = mat.node_tree.nodes
nodes = [k for k in node

for k in nodes:
k.outputs[0].default_value = self.rgb

class rgbSet(bpy.types.PropertyGroup):

RGBisTrue: BoolProperty(...)
rgb: FloatVectorProperty(....
update=updateRGB)

def register():
bpy.utils.register_class(MaterialParameterPanel)
bpy.utils.register_class(rgbSet)
bpy.types.Material.slot_setting=PointerProperty(type=rgbSet)

def unregister():
bpy.utils.register_class(MaterialParameterPanel)
bpy.utils.register_class(rgbSet)
del bpy.types.Material.slot_setting

if __name__ == "__main__":
register()


• Hello, please add a screenshot of what you are trying to hide Dec 10 '20 at 10:31
• I have added two screenshots to explain what I am trying to hide Dec 11 '20 at 2:24