Page MenuHome

ui.py get_panels error
Closed, ResolvedPublic

Description

System Information
Win32 Nvidea

Blender Version
Broken: Blender 2.69 rce89355
Worked: Blender 2.XX rXXXXXX

get_panels in ui.py crashes if you unregister a panel class that is listed there. In my case 'DATA_PT_context_speaker" which I unregister to create a new panel for an addon I am creating. I suggest a hasattr(bpy.types, "DATA_PT_context_speaker") type of checking.

Have an addon unregister any of the panels listed in ui.py get_panels() will do the trick.

Event Timeline

Peter Staples (batfinger) raised the priority of this task from to 90.
Peter Staples (batfinger) updated the task description. (Show Details)
Peter Staples (batfinger) edited a custom field.

This does the trick

[code]
def get_panels():

types = bpy.types
panels = ["RENDER_PT_render",
    "RENDER_PT_output",
    "RENDER_PT_encoding",
    "RENDER_PT_dimensions",
    "RENDER_PT_stamp",
    "RENDERLAYER_PT_layers",
    "SCENE_PT_scene",
    "SCENE_PT_color_management",
    "SCENE_PT_custom_props",
    "SCENE_PT_audio",
    "SCENE_PT_unit",
    "SCENE_PT_keying_sets",
    "SCENE_PT_keying_set_paths",
    "SCENE_PT_physics",
    "WORLD_PT_context_world",
    "WORLD_PT_custom_props",
    "DATA_PT_context_mesh",
    "DATA_PT_context_camera",
    "DATA_PT_context_lamp",
    "DATA_PT_context_speaker",
    "DATA_PT_texture_space",
    "DATA_PT_curve_texture_space",
    "DATA_PT_mball_texture_space",
    "DATA_PT_vertex_groups",
    "DATA_PT_shape_keys",
    "DATA_PT_uv_texture",
    "DATA_PT_vertex_colors",
    "DATA_PT_camera",
    "DATA_PT_camera_display",
    "DATA_PT_lens",
    "DATA_PT_speaker",
    "DATA_PT_distance",
    "DATA_PT_cone",
    "DATA_PT_customdata",
    "DATA_PT_custom_props_mesh",
    "DATA_PT_custom_props_camera",
    "DATA_PT_custom_props_lamp",
    "DATA_PT_custom_props_speaker",
    "DATA_PT_custom_props_arm",
    "DATA_PT_custom_props_curve",
    "DATA_PT_custom_props_lattice",
    "DATA_PT_custom_props_metaball",
    "TEXTURE_PT_custom_props",
    "TEXTURE_PT_clouds",
    "TEXTURE_PT_wood",
    "TEXTURE_PT_marble",
    "TEXTURE_PT_magic",
    "TEXTURE_PT_blend",
    "TEXTURE_PT_stucci",
    "TEXTURE_PT_image",
    "TEXTURE_PT_image_sampling",
    "TEXTURE_PT_image_mapping",
    "TEXTURE_PT_musgrave",
    "TEXTURE_PT_voronoi",
    "TEXTURE_PT_distortednoise",
    "TEXTURE_PT_voxeldata",
    "TEXTURE_PT_pointdensity",
    "TEXTURE_PT_pointdensity_turbulence",
    "TEXTURE_PT_mapping",
    "TEXTURE_PT_influence",
    "TEXTURE_PT_colors",
    "PARTICLE_PT_context_particles",
    "PARTICLE_PT_custom_props",
    "PARTICLE_PT_emission",
    "PARTICLE_PT_hair_dynamics",
    "PARTICLE_PT_cache",
    "PARTICLE_PT_velocity",
    "PARTICLE_PT_rotation",
    "PARTICLE_PT_physics",
    "SCENE_PT_rigid_body_world",
    "SCENE_PT_rigid_body_cache",
    "SCENE_PT_rigid_body_field_weights",
    "PARTICLE_PT_boidbrain",
    "PARTICLE_PT_render",
    "PARTICLE_PT_draw",
    "PARTICLE_PT_children",
    "PARTICLE_PT_field_weights",
    "PARTICLE_PT_force_fields",
    "PARTICLE_PT_vertexgroups",
    "MATERIAL_PT_custom_props",
    "BONE_PT_custom_props",
    "OBJECT_PT_custom_props"]
return [getattr(types,p) for p in panels if hasattr(types, p)]

[/code]

Peter Staples (batfinger) changed the task status from Unknown Status to Resolved.Dec 14 2013, 6:00 PM

Closed by commit rB4a141022c39c.