- Messages
- 442
- Country
Hi,
I would like to get some info if anybody can help me create some custom color picker script which will be positioned under Material panel in blender. I want to position it under the red line as in the image below:
Code sample from other source:
The above sample code doesn't help to position below the red line. Hope someone could identify what is the issue in the codes there.
Thank you,
Manochvarma Raman
I would like to get some info if anybody can help me create some custom color picker script which will be positioned under Material panel in blender. I want to position it under the red line as in the image below:
Code sample from other source:
Code:
import bpy
class DetailColor(bpy.types.Panel):
bl_label = "Detail Color"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "material"
def draw(self, context):
self.layout.prop(context.scene, "DetailColor", text='Detail Color')
row = layout.row()
# Material Property Added
mat = context.active_object.active_material
row.prop(mat, "DetailColor", text="")
def register():
bpy.utils.register_class(DetailColor)
bpy.types.Scene.DetailColor = bpy.props.FloatVectorProperty(
name = "DetailColor",
subtype = "COLOR",
size = 4,
min = 0.0,
max = 1.0,
default = (1.0,1.0,1.0,1.0)
)
def unregister():
bpy.utils.unregister_class(DetailColor)
if __name__ == "__main__":
register()
Thank you,
Manochvarma Raman