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:
authorCampbell Barton <ideasman42@gmail.com>2008-04-24 01:17:47 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-04-24 01:17:47 +0400
commit408fcd6a33b1a2bd4c5314d54a7b10f881896cc3 (patch)
treecc98b899bb695c05daaedd60b6ef08d9a8d5a8f6 /source/blender/src/buttons_object.c
parentb0db68ccb0e4d1cb4be0975e6f6478b4dc19e37b (diff)
disallow changes to linked groups
Diffstat (limited to 'source/blender/src/buttons_object.c')
-rw-r--r--source/blender/src/buttons_object.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c
index d85e854c90c..d96d13e2ed9 100644
--- a/source/blender/src/buttons_object.c
+++ b/source/blender/src/buttons_object.c
@@ -2130,7 +2130,6 @@ void pointcache_bake(PTCacheID *pid, int startframe)
BKE_ptcache_id_time(pid, 0.0f, &cstart, &cend, NULL);
cache->flag &= ~PTCACHE_BAKING;
-
BKE_ptcache_id_reset(pid, PTCACHE_RESET_OUTDATED);
}
else {
@@ -2529,15 +2528,18 @@ static uiBlock *add_groupmenu(void *arg_unused)
uiDefBut(block, BUTM, B_NOP, "ADD NEW", 0, 20, 160, 19, NULL, 0.0, 0.0, 1, -1, "");
for(group= G.main->group.first; group; group= group->id.next, index++) {
- if(group->id.lib) strcpy(str, "L ");
- else strcpy(str, " ");
- strcat(str, group->id.name+2);
- uiDefBut(block, BUTM, B_NOP, str, xco*160, -20*yco, 160, 19, NULL, 0.0, 0.0, 1, index, "");
- yco++;
- if(yco>24) {
- yco= 0;
- xco++;
+ /*if(group->id.lib) strcpy(str, "L ");*/ /* we cant allow adding objects inside linked groups, it wont be saved anyway */
+ if(group->id.lib==0) {
+ strcpy(str, " ");
+ strcat(str, group->id.name+2);
+ uiDefBut(block, BUTM, B_NOP, str, xco*160, -20*yco, 160, 19, NULL, 0.0, 0.0, 1, index, "");
+
+ yco++;
+ if(yco>24) {
+ yco= 0;
+ xco++;
+ }
}
}
@@ -2606,21 +2608,25 @@ static void object_panel_object(Object *ob)
xco= 160;
uiBlockBeginAlign(block);
+ uiSetButLock(GET_INT_FROM_POINTER(group->id.lib), ERROR_LIBDATA_MESSAGE); /* We cant actually use this button */
but = uiDefBut(block, TEX, B_IDNAME, "GR:", 10, 120-yco, 150, 20, group->id.name+2, 0.0, 21.0, 0, 0, "Displays Group name. Click to change.");
uiButSetFunc(but, test_idbutton_cb, group->id.name, NULL);
+ uiClearButLock();
if(group->id.lib) {
but= uiDefIconBut(block, BUT, B_NOP, ICON_PARLIB, 160, 120-yco, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Make Group local");
uiButSetFunc(but, group_local, group, NULL);
xco= 180;
+ } else { /* cant remove objects from linked groups */
+ but = uiDefIconBut(block, BUT, B_NOP, VICON_X, xco, 120-yco, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Remove Group membership");
+ uiButSetFunc(but, group_ob_rem, group, ob);
}
- but = uiDefIconBut(block, BUT, B_NOP, VICON_X, xco, 120-yco, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Remove Group membership");
- uiButSetFunc(but, group_ob_rem, group, ob);
yco+= 20;
xco= 10;
/* layers */
+ uiSetButLock(GET_INT_FROM_POINTER(group->id.lib), ERROR_LIBDATA_MESSAGE);
uiBlockBeginAlign(block);
for(a=0; a<5; a++)
uiDefButBitI(block, TOG, 1<<a, REDRAWVIEW3D, "", (short)(xco+a*(dx/2)), 120-yco, (short)(dx/2), (short)(dy/2), (int *)&(group->layer), 0, 0, 0, 0, "");
@@ -2635,7 +2641,8 @@ static void object_panel_object(Object *ob)
uiDefButBitI(block, TOG, 1<<(a+10), REDRAWVIEW3D, "", (short)(xco+a*(dx/2)), 105-yco, (short)(dx/2), (short)(dy/2), (int *)&(group->layer), 0, 0, 0, 0, "");
uiBlockEndAlign(block);
-
+ uiClearButLock();
+
yco+= 40;
}
}