[Bf-blender-cvs] [4a14102] master: Fix T37816: make cycles panel registration work better with addons.
Peter Staples
noreply at git.blender.org
Sat Dec 14 18:00:31 CET 2013
Commit: 4a141022c39cefd422e66772714f54ccb3ec7733
Author: Peter Staples
Date: Sat Dec 14 17:56:47 2013 +0100
http://developer.blender.org/rB4a141022c39cefd422e66772714f54ccb3ec7733
Fix T37816: make cycles panel registration work better with addons.
This would give an error when an addon removed a panel.
===================================================================
M intern/cycles/blender/addon/ui.py
===================================================================
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 05d3c15..8f81e93 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1273,91 +1273,92 @@ def draw_pause(self, context):
def get_panels():
types = bpy.types
- return (
- types.RENDER_PT_render,
- types.RENDER_PT_output,
- types.RENDER_PT_encoding,
- types.RENDER_PT_dimensions,
- types.RENDER_PT_stamp,
- types.RENDERLAYER_PT_layers,
- types.SCENE_PT_scene,
- types.SCENE_PT_color_management,
- types.SCENE_PT_custom_props,
- types.SCENE_PT_audio,
- types.SCENE_PT_unit,
- types.SCENE_PT_keying_sets,
- types.SCENE_PT_keying_set_paths,
- types.SCENE_PT_physics,
- types.WORLD_PT_context_world,
- types.WORLD_PT_custom_props,
- types.DATA_PT_context_mesh,
- types.DATA_PT_context_camera,
- types.DATA_PT_context_lamp,
- types.DATA_PT_context_speaker,
- types.DATA_PT_texture_space,
- types.DATA_PT_curve_texture_space,
- types.DATA_PT_mball_texture_space,
- types.DATA_PT_vertex_groups,
- types.DATA_PT_shape_keys,
- types.DATA_PT_uv_texture,
- types.DATA_PT_vertex_colors,
- types.DATA_PT_camera,
- types.DATA_PT_camera_display,
- types.DATA_PT_lens,
- types.DATA_PT_speaker,
- types.DATA_PT_distance,
- types.DATA_PT_cone,
- types.DATA_PT_customdata,
- types.DATA_PT_custom_props_mesh,
- types.DATA_PT_custom_props_camera,
- types.DATA_PT_custom_props_lamp,
- types.DATA_PT_custom_props_speaker,
- types.DATA_PT_custom_props_arm,
- types.DATA_PT_custom_props_curve,
- types.DATA_PT_custom_props_lattice,
- types.DATA_PT_custom_props_metaball,
- types.TEXTURE_PT_custom_props,
- types.TEXTURE_PT_clouds,
- types.TEXTURE_PT_wood,
- types.TEXTURE_PT_marble,
- types.TEXTURE_PT_magic,
- types.TEXTURE_PT_blend,
- types.TEXTURE_PT_stucci,
- types.TEXTURE_PT_image,
- types.TEXTURE_PT_image_sampling,
- types.TEXTURE_PT_image_mapping,
- types.TEXTURE_PT_musgrave,
- types.TEXTURE_PT_voronoi,
- types.TEXTURE_PT_distortednoise,
- types.TEXTURE_PT_voxeldata,
- types.TEXTURE_PT_pointdensity,
- types.TEXTURE_PT_pointdensity_turbulence,
- types.TEXTURE_PT_mapping,
- types.TEXTURE_PT_influence,
- types.TEXTURE_PT_colors,
- types.PARTICLE_PT_context_particles,
- types.PARTICLE_PT_custom_props,
- types.PARTICLE_PT_emission,
- types.PARTICLE_PT_hair_dynamics,
- types.PARTICLE_PT_cache,
- types.PARTICLE_PT_velocity,
- types.PARTICLE_PT_rotation,
- types.PARTICLE_PT_physics,
- types.SCENE_PT_rigid_body_world,
- types.SCENE_PT_rigid_body_cache,
- types.SCENE_PT_rigid_body_field_weights,
- types.PARTICLE_PT_boidbrain,
- types.PARTICLE_PT_render,
- types.PARTICLE_PT_draw,
- types.PARTICLE_PT_children,
- types.PARTICLE_PT_field_weights,
- types.PARTICLE_PT_force_fields,
- types.PARTICLE_PT_vertexgroups,
- types.MATERIAL_PT_custom_props,
- types.BONE_PT_custom_props,
- types.OBJECT_PT_custom_props,
- )
-
+ 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)]
def register():
bpy.types.RENDER_PT_render.append(draw_device)
More information about the Bf-blender-cvs
mailing list