Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release/scripts/ui/properties_data_armature.py4
-rw-r--r--release/scripts/ui/properties_data_curve.py4
-rw-r--r--release/scripts/ui/properties_data_mesh.py4
-rw-r--r--release/scripts/ui/properties_data_metaball.py4
-rw-r--r--release/scripts/ui/properties_object.py2
-rw-r--r--source/blender/editors/animation/drivers.c2
-rw-r--r--source/blender/editors/interface/interface_templates.c4
-rw-r--r--source/blender/makesrna/RNA_types.h4
-rw-r--r--source/blender/makesrna/intern/rna_object.c2
9 files changed, 16 insertions, 14 deletions
diff --git a/release/scripts/ui/properties_data_armature.py b/release/scripts/ui/properties_data_armature.py
index 57ac8ff7e2d..c3d3c358dbe 100644
--- a/release/scripts/ui/properties_data_armature.py
+++ b/release/scripts/ui/properties_data_armature.py
@@ -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):
diff --git a/release/scripts/ui/properties_data_curve.py b/release/scripts/ui/properties_data_curve.py
index d13232ca2e1..f7cfb1bb8bf 100644
--- a/release/scripts/ui/properties_data_curve.py
+++ b/release/scripts/ui/properties_data_curve.py
@@ -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):
diff --git a/release/scripts/ui/properties_data_mesh.py b/release/scripts/ui/properties_data_mesh.py
index 52ac88ba168..ecaafa3c66c 100644
--- a/release/scripts/ui/properties_data_mesh.py
+++ b/release/scripts/ui/properties_data_mesh.py
@@ -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):
diff --git a/release/scripts/ui/properties_data_metaball.py b/release/scripts/ui/properties_data_metaball.py
index 115a20682a9..bbe027c5ea4 100644
--- a/release/scripts/ui/properties_data_metaball.py
+++ b/release/scripts/ui/properties_data_metaball.py
@@ -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):
diff --git a/release/scripts/ui/properties_object.py b/release/scripts/ui/properties_object.py
index c16dc052b86..ce04f73294e 100644
--- a/release/scripts/ui/properties_object.py
+++ b/release/scripts/ui/properties_object.py
@@ -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')
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index ec431d34995..902fa2f789f 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -212,7 +212,7 @@ short ANIM_add_driver (ReportList *reports, ID *id, const char rna_path[], int a
/* Main Driver Management API calls:
* Remove the driver for the specified property on the given ID block (if available)
*/
-short ANIM_remove_driver (ReportList *reports, ID *id, const char rna_path[], int array_index, short UNUSED(flag))
+short ANIM_remove_driver (ReportList *UNUSED(reports), ID *id, const char rna_path[], int array_index, short UNUSED(flag))
{
AnimData *adt;
FCurve *fcu;
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index b034ddf7827..03e7f058b05 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -450,7 +450,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
}
/* delete button */
- if(id && (flag & UI_ID_DELETE)) {
+ if(id && (flag & UI_ID_DELETE) && (RNA_property_flag(template->prop) & PROP_NEVER_UNLINK)==0) {
if(unlinkop) {
but= uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL);
/* so we can access the template from operators, font unlinking needs this */
@@ -494,8 +494,6 @@ static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, const
flag |= UI_ID_ADD_NEW;
if(openop)
flag |= UI_ID_OPEN;
- if(unlinkop && strcmp(unlinkop, "None") == 0)
- flag &= ~UI_ID_DELETE;
type= RNA_property_pointer_type(ptr, prop);
template->idlb= which_libbase(CTX_data_main(C), RNA_type_to_ID_code(type));
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index b3077f01baf..8d5f999ae10 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -167,6 +167,10 @@ typedef enum PropertyFlag {
* only apply this to types that are derived from an ID ()*/
PROP_ID_SELF_CHECK = 1<<20,
PROP_NEVER_NULL = 1<<18,
+ /* currently only used for UI, this is similar to PROP_NEVER_NULL
+ * except that the value may be NULL at times, used for ObData, where an Empty's will be NULL
+ * but setting NULL on a mesh object is not possible. So, if its not NULL, setting NULL cant be done! */
+ PROP_NEVER_UNLINK = 1<<25,
/* flag contains multiple enums.
* note: not to be confused with prop->enumbitflags
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 6dbf6fca108..978171997ef 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1680,7 +1680,7 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "ID");
RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_data_set", "rna_Object_data_typef", NULL);
RNA_def_property_editable_func(prop, "rna_Object_data_editable");
- RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK);
RNA_def_property_ui_text(prop, "Data", "Object data");
RNA_def_property_update(prop, 0, "rna_Object_internal_update_data");