I would like to add a custom colour picker for a custom material section. The colour picker should be below the red line in the image:
I found a code but this make the colour picker on the "tool panel" and not on the "material panel". This is the code:
import bpy
class POSE_PT_test(bpy.types.Panel):
bl_label = "Test"
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'
bl_category = "Testing"
@classmethod
def poll(self, context):
return True
def draw(self, context):
self.layout.prop(context.scene, "test_color", text='Detail Color')
def register():
bpy.utils.register_class(POSE_PT_test)
bpy.types.Scene.test_color = bpy.props.FloatVectorProperty(
name="myColor",
subtype="COLOR",
size=4,
min=0.0,
max=1.0,
default=(1.0, 1.0, 1.0, 1.0)
)
register()
Hope someone can help me to change this code so that it will be on material panel and below the red line. Thanks in advance.
bl_space_type = 'PROPERTIES'
andbl_region_type = 'WINDOW'
andbl_context = "material"
. As for adding under red line in image above, (without an ugly hack) would need to edit into the draw code of that panel. $\endgroup$bpy.utils.register_class(POSE_PT_test)
$\endgroup$