hi
I’m still learning python and I want to move panel between UI sections… for example:
I’m pull apart the code of diffuse material and slots:
the code is:
class MaterialPanelX(bpy.types.Panel): bl_idname = "MATERIAL_PANELX"
bl_label = "Material Presets"
#bl_space_type = 'VIEW_3D'
#bl_region_type = 'TOOLS'
#bl_category = "z basic"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "material"
bl_options = {'HIDE_HEADER'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@classmethod
def poll(cls, context):
# An exception, don't call the parent poll func because
# this manages materials for all engine types
engine = context.scene.render.engine
return (context.material or context.object) and (engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = context.material
ob = context.object
slot = context.material_slot
space = context.space_data
#imagen previa material
self.layout.template_preview(context.material)
#cajones de lista de materiales
if ob:
row = layout.row()
row.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=1)
#cambio de color dinamico
mat = active_node_mat(context.material)
split = layout.split()
col = split.column()
col.prop(mat, "diffuse_color", text="color activo")
the idea is move that seccion for example:
I thought at this moment that was so simple that change this part of the code… but not!:
bl_idname = "MATERIAL_PANELX" bl_label = "Material Presets"
#bl_space_type = 'VIEW_3D'
#bl_region_type = 'TOOLS'
#bl_category = "z basic"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "material"
some ideas?? or are impossible?
thanks for help
Diego