RNA Types metaclass registration
See mailing list posts for details [1][2][3] Addons still need to be fixed; Campbell said he'd do it today. See any of the py files (outside netrender) in this commit for how to do it (it's rather simple). [1] http://lists.blender.org/pipermail/bf-committers/2010-February/026328.html [2] http://lists.blender.org/pipermail/bf-committers/2010-August/028311.html [3] http://lists.blender.org/pipermail/bf-committers/2010-August/028321.html
This commit is contained in:
@@ -21,7 +21,7 @@ import bpy
|
||||
|
||||
narrowui = bpy.context.user_preferences.view.properties_width_check
|
||||
|
||||
class View3DPanel(bpy.types.Panel):
|
||||
class View3DPanel():
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'TOOLS'
|
||||
|
||||
@@ -29,7 +29,7 @@ class View3DPanel(bpy.types.Panel):
|
||||
# ********** default tools for objectmode ****************
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_objectmode(View3DPanel):
|
||||
class VIEW3D_PT_tools_objectmode(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "objectmode"
|
||||
bl_label = "Object Tools"
|
||||
|
||||
@@ -79,7 +79,7 @@ class VIEW3D_PT_tools_objectmode(View3DPanel):
|
||||
# ********** default tools for editmode_mesh ****************
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_meshedit(View3DPanel):
|
||||
class VIEW3D_PT_tools_meshedit(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "mesh_edit"
|
||||
bl_label = "Mesh Tools"
|
||||
|
||||
@@ -147,7 +147,7 @@ class VIEW3D_PT_tools_meshedit(View3DPanel):
|
||||
row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_meshedit_options(View3DPanel):
|
||||
class VIEW3D_PT_tools_meshedit_options(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "mesh_edit"
|
||||
bl_label = "Mesh Options"
|
||||
|
||||
@@ -166,7 +166,7 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel):
|
||||
# ********** default tools for editmode_curve ****************
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_curveedit(View3DPanel):
|
||||
class VIEW3D_PT_tools_curveedit(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "curve_edit"
|
||||
bl_label = "Curve Tools"
|
||||
|
||||
@@ -220,7 +220,7 @@ class VIEW3D_PT_tools_curveedit(View3DPanel):
|
||||
# ********** default tools for editmode_surface ****************
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_surfaceedit(View3DPanel):
|
||||
class VIEW3D_PT_tools_surfaceedit(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "surface_edit"
|
||||
bl_label = "Surface Tools"
|
||||
|
||||
@@ -260,7 +260,7 @@ class VIEW3D_PT_tools_surfaceedit(View3DPanel):
|
||||
# ********** default tools for editmode_text ****************
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_textedit(View3DPanel):
|
||||
class VIEW3D_PT_tools_textedit(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "text_edit"
|
||||
bl_label = "Text Tools"
|
||||
|
||||
@@ -293,7 +293,7 @@ class VIEW3D_PT_tools_textedit(View3DPanel):
|
||||
# ********** default tools for editmode_armature ****************
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_armatureedit(View3DPanel):
|
||||
class VIEW3D_PT_tools_armatureedit(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "armature_edit"
|
||||
bl_label = "Armature Tools"
|
||||
|
||||
@@ -330,7 +330,7 @@ class VIEW3D_PT_tools_armatureedit(View3DPanel):
|
||||
row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_armatureedit_options(View3DPanel):
|
||||
class VIEW3D_PT_tools_armatureedit_options(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "armature_edit"
|
||||
bl_label = "Armature Options"
|
||||
|
||||
@@ -345,7 +345,7 @@ class VIEW3D_PT_tools_armatureedit_options(View3DPanel):
|
||||
# ********** default tools for editmode_mball ****************
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_mballedit(View3DPanel):
|
||||
class VIEW3D_PT_tools_mballedit(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "mball_edit"
|
||||
bl_label = "Meta Tools"
|
||||
|
||||
@@ -373,7 +373,7 @@ class VIEW3D_PT_tools_mballedit(View3DPanel):
|
||||
# ********** default tools for editmode_lattice ****************
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_latticeedit(View3DPanel):
|
||||
class VIEW3D_PT_tools_latticeedit(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "lattice_edit"
|
||||
bl_label = "Lattice Tools"
|
||||
|
||||
@@ -405,7 +405,7 @@ class VIEW3D_PT_tools_latticeedit(View3DPanel):
|
||||
# ********** default tools for posemode ****************
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_posemode(View3DPanel):
|
||||
class VIEW3D_PT_tools_posemode(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "posemode"
|
||||
bl_label = "Pose Tools"
|
||||
|
||||
@@ -453,7 +453,7 @@ class VIEW3D_PT_tools_posemode(View3DPanel):
|
||||
row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_posemode_options(View3DPanel):
|
||||
class VIEW3D_PT_tools_posemode_options(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "posemode"
|
||||
bl_label = "Pose Options"
|
||||
|
||||
@@ -469,7 +469,7 @@ class VIEW3D_PT_tools_posemode_options(View3DPanel):
|
||||
# ********** default tools for paint modes ****************
|
||||
|
||||
|
||||
class PaintPanel(bpy.types.Panel):
|
||||
class PaintPanel():
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'TOOLS'
|
||||
|
||||
@@ -490,7 +490,7 @@ class PaintPanel(bpy.types.Panel):
|
||||
return False
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_brush(PaintPanel):
|
||||
class VIEW3D_PT_tools_brush(PaintPanel, bpy.types.Panel):
|
||||
bl_label = "Brush"
|
||||
|
||||
def poll(self, context):
|
||||
@@ -735,7 +735,7 @@ class VIEW3D_PT_tools_brush(PaintPanel):
|
||||
#row.prop(brush, "use_jitter_pressure", toggle=True, text="")
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_brush_texture(PaintPanel):
|
||||
class VIEW3D_PT_tools_brush_texture(PaintPanel, bpy.types.Panel):
|
||||
bl_label = "Texture"
|
||||
bl_default_closed = True
|
||||
|
||||
@@ -837,7 +837,7 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel):
|
||||
col.active = tex_slot.map_mode in ('FIXED', 'TILED') and brush.use_texture_overlay
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_brush_tool(PaintPanel):
|
||||
class VIEW3D_PT_tools_brush_tool(PaintPanel, bpy.types.Panel):
|
||||
bl_label = "Tool"
|
||||
bl_default_closed = True
|
||||
|
||||
@@ -866,7 +866,7 @@ class VIEW3D_PT_tools_brush_tool(PaintPanel):
|
||||
col.prop(brush, "vertexpaint_tool", expand=False, text="")
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_brush_stroke(PaintPanel):
|
||||
class VIEW3D_PT_tools_brush_stroke(PaintPanel, bpy.types.Panel):
|
||||
bl_label = "Stroke"
|
||||
bl_default_closed = True
|
||||
|
||||
@@ -963,7 +963,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel):
|
||||
# row.prop(brush, "use_spacing_pressure", toggle=True, text="")
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_brush_curve(PaintPanel):
|
||||
class VIEW3D_PT_tools_brush_curve(PaintPanel, bpy.types.Panel):
|
||||
bl_label = "Curve"
|
||||
bl_default_closed = True
|
||||
|
||||
@@ -987,7 +987,7 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel):
|
||||
row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE'
|
||||
row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX'
|
||||
|
||||
class VIEW3D_PT_sculpt_options(PaintPanel):
|
||||
class VIEW3D_PT_sculpt_options(PaintPanel, bpy.types.Panel):
|
||||
bl_label = "Options"
|
||||
bl_default_closed = True
|
||||
|
||||
@@ -1105,7 +1105,7 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel):
|
||||
# ********** default tools for weightpaint ****************
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_weightpaint(View3DPanel):
|
||||
class VIEW3D_PT_tools_weightpaint(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "weightpaint"
|
||||
bl_label = "Weight Tools"
|
||||
|
||||
@@ -1120,7 +1120,7 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel):
|
||||
col.operator("object.vertex_group_levels", text="Levels")
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_weightpaint_options(View3DPanel):
|
||||
class VIEW3D_PT_tools_weightpaint_options(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "weightpaint"
|
||||
bl_label = "Options"
|
||||
|
||||
@@ -1157,7 +1157,7 @@ class VIEW3D_PT_tools_weightpaint_options(View3DPanel):
|
||||
# ********** default tools for vertexpaint ****************
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_vertexpaint(View3DPanel):
|
||||
class VIEW3D_PT_tools_vertexpaint(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "vertexpaint"
|
||||
bl_label = "Options"
|
||||
|
||||
@@ -1186,7 +1186,7 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel):
|
||||
# ********** default tools for texturepaint ****************
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_projectpaint(View3DPanel):
|
||||
class VIEW3D_PT_tools_projectpaint(View3DPanel, bpy.types.Panel):
|
||||
bl_context = "texturepaint"
|
||||
bl_label = "Project Paint"
|
||||
|
||||
@@ -1294,7 +1294,7 @@ class VIEW3D_MT_tools_projectpaint_stencil(bpy.types.Menu):
|
||||
prop.value = i
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_particlemode(View3DPanel):
|
||||
class VIEW3D_PT_tools_particlemode(View3DPanel, bpy.types.Panel):
|
||||
'''default tools for particle mode'''
|
||||
bl_context = "particlemode"
|
||||
bl_label = "Options"
|
||||
@@ -1361,49 +1361,12 @@ class VIEW3D_PT_tools_particlemode(View3DPanel):
|
||||
sub.prop(pe, "fade_frames", slider=True)
|
||||
|
||||
|
||||
classes = [
|
||||
VIEW3D_PT_tools_weightpaint,
|
||||
VIEW3D_PT_tools_objectmode,
|
||||
VIEW3D_PT_tools_meshedit,
|
||||
VIEW3D_PT_tools_meshedit_options,
|
||||
VIEW3D_PT_tools_curveedit,
|
||||
VIEW3D_PT_tools_surfaceedit,
|
||||
VIEW3D_PT_tools_textedit,
|
||||
VIEW3D_PT_tools_armatureedit,
|
||||
VIEW3D_PT_tools_armatureedit_options,
|
||||
VIEW3D_PT_tools_mballedit,
|
||||
VIEW3D_PT_tools_latticeedit,
|
||||
VIEW3D_PT_tools_posemode,
|
||||
VIEW3D_PT_tools_posemode_options,
|
||||
VIEW3D_PT_tools_brush,
|
||||
VIEW3D_PT_tools_brush_texture,
|
||||
VIEW3D_PT_tools_brush_stroke,
|
||||
VIEW3D_PT_tools_brush_curve,
|
||||
VIEW3D_PT_tools_brush_appearance,
|
||||
VIEW3D_PT_tools_brush_tool,
|
||||
VIEW3D_PT_sculpt_symmetry,
|
||||
VIEW3D_PT_sculpt_options,
|
||||
VIEW3D_PT_tools_vertexpaint,
|
||||
VIEW3D_PT_tools_weightpaint_options,
|
||||
VIEW3D_PT_imagepaint_options,
|
||||
|
||||
VIEW3D_PT_tools_projectpaint,
|
||||
VIEW3D_MT_tools_projectpaint_clone,
|
||||
VIEW3D_MT_tools_projectpaint_stencil,
|
||||
|
||||
VIEW3D_PT_tools_particlemode]
|
||||
|
||||
|
||||
def register():
|
||||
register = bpy.types.register
|
||||
for cls in classes:
|
||||
register(cls)
|
||||
pass
|
||||
|
||||
|
||||
def unregister():
|
||||
unregister = bpy.types.unregister
|
||||
for cls in classes:
|
||||
unregister(cls)
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
register()
|
||||
|
Reference in New Issue
Block a user