revert part of Tons commit r33884.
- rather then use unlink="None", just don't pass unlink as a keyword. This is more pythonic. - added an RNA flag for properties which cant be unlinked by setting to None.
This commit is contained in:
@@ -43,9 +43,9 @@ class DATA_PT_context_arm(ArmatureButtonsPanel, bpy.types.Panel):
|
||||
space = context.space_data
|
||||
|
||||
if ob:
|
||||
layout.template_ID(ob, "data", unlink="None")
|
||||
layout.template_ID(ob, "data")
|
||||
elif arm:
|
||||
layout.template_ID(space, "pin_id", unlink="None")
|
||||
layout.template_ID(space, "pin_id")
|
||||
|
||||
|
||||
class DATA_PT_skeleton(ArmatureButtonsPanel, bpy.types.Panel):
|
||||
|
||||
@@ -60,9 +60,9 @@ class DATA_PT_context_curve(CurveButtonsPanel, bpy.types.Panel):
|
||||
space = context.space_data
|
||||
|
||||
if ob:
|
||||
layout.template_ID(ob, "data", unlink="None")
|
||||
layout.template_ID(ob, "data")
|
||||
elif curve:
|
||||
layout.template_ID(space, "pin_id", unlink="None") # XXX: broken
|
||||
layout.template_ID(space, "pin_id") # XXX: broken
|
||||
|
||||
|
||||
class DATA_PT_shape_curve(CurveButtonsPanel, bpy.types.Panel):
|
||||
|
||||
@@ -71,9 +71,9 @@ class DATA_PT_context_mesh(MeshButtonsPanel, bpy.types.Panel):
|
||||
space = context.space_data
|
||||
|
||||
if ob:
|
||||
layout.template_ID(ob, "data", unlink="None")
|
||||
layout.template_ID(ob, "data")
|
||||
elif mesh:
|
||||
layout.template_ID(space, "pin_id", unlink="None")
|
||||
layout.template_ID(space, "pin_id")
|
||||
|
||||
|
||||
class DATA_PT_normals(MeshButtonsPanel, bpy.types.Panel):
|
||||
|
||||
@@ -43,9 +43,9 @@ class DATA_PT_context_metaball(DataButtonsPanel, bpy.types.Panel):
|
||||
space = context.space_data
|
||||
|
||||
if ob:
|
||||
layout.template_ID(ob, "data", unlink="None")
|
||||
layout.template_ID(ob, "data")
|
||||
elif mball:
|
||||
layout.template_ID(space, "pin_id", unlink="None")
|
||||
layout.template_ID(space, "pin_id")
|
||||
|
||||
|
||||
class DATA_PT_metaball(DataButtonsPanel, bpy.types.Panel):
|
||||
|
||||
@@ -37,7 +37,7 @@ class OBJECT_PT_context_object(ObjectButtonsPanel, bpy.types.Panel):
|
||||
ob = context.object
|
||||
|
||||
if space.use_pin_id:
|
||||
layout.template_ID(space, "pin_id", unlink="None")
|
||||
layout.template_ID(space, "pin_id")
|
||||
else:
|
||||
row = layout.row()
|
||||
row.label(text="", icon='OBJECT_DATA')
|
||||
|
||||
Reference in New Issue
Block a user