ui.py get_panels error #37816

Closed
opened 2013-12-14 17:15:24 +01:00 by Peter Staples · 9 comments

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.

**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.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @PeterStaples

Added subscriber: @PeterStaples
Author

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]

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]

This issue was referenced by blender/blender-addons-contrib@4a141022c3

This issue was referenced by blender/blender-addons-contrib@4a141022c39cefd422e66772714f54ccb3ec7733

This issue was referenced by blender/blender@4a141022c3

This issue was referenced by blender/blender@4a141022c39cefd422e66772714f54ccb3ec7733
Author

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author

Closed by commit blender/blender@4a141022c3.

Closed by commit blender/blender@4a141022c3.

Added subscriber: @brecht

Added subscriber: @brecht

Committed, thanks!

Committed, thanks!
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#37816
No description provided.