[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15729] trunk/blender/source/blender/src/ outliner.c: * Added the ability to toggle visibility/ renderability for modifiers, from the outliner
Matt Ebb
matt at mke3.net
Thu Jul 24 08:04:04 CEST 2008
Revision: 15729
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15729
Author: broken
Date: 2008-07-24 08:04:03 +0200 (Thu, 24 Jul 2008)
Log Message:
-----------
* Added the ability to toggle visibility/renderability for modifiers, from the outliner
Modified Paths:
--------------
trunk/blender/source/blender/src/outliner.c
Modified: trunk/blender/source/blender/src/outliner.c
===================================================================
--- trunk/blender/source/blender/src/outliner.c 2008-07-24 04:52:37 UTC (rev 15728)
+++ trunk/blender/source/blender/src/outliner.c 2008-07-24 06:04:03 UTC (rev 15729)
@@ -68,6 +68,7 @@
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_modifier.h"
+#include "BKE_object.h"
#include "BKE_screen.h"
#include "BKE_scene.h"
#include "BKE_utildefines.h"
@@ -698,6 +699,7 @@
for (index=0,md=ob->modifiers.first; md; index++,md=md->next) {
TreeElement *te = outliner_add_element(soops, &temod->subtree, ob, temod, TSE_MODIFIER, index);
te->name= md->name;
+ te->directdata = md;
if (md->type==eModifierType_Lattice) {
outliner_add_element(soops, &te->subtree, ((LatticeModifierData*) md)->object, te, TSE_LINKED_OB, 0);
@@ -3523,6 +3525,20 @@
allqueue(REDRAWBUTSSCENE, 0);
}
+static void restrictbutton_modifier_cb(void *poin, void *poin2)
+{
+ Object *ob = (Object *)poin;
+
+ DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
+ object_handle_update(ob);
+ countall();
+
+ allqueue(REDRAWOOPS, 0);
+ allqueue(REDRAWVIEW3D, 0);
+ allqueue(REDRAWBUTSEDIT, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
+}
+
static void namebutton_cb(void *tep, void *oldnamep)
{
SpaceOops *soops= curarea->spacedata.first;
@@ -3685,6 +3701,28 @@
uiBlockSetEmboss(block, UI_EMBOSS);
}
+ else if(tselem->type==TSE_MODIFIER) {
+ ModifierData *md= (ModifierData *)te->directdata;
+ ob = (Object *)tselem->id;
+
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+ bt= uiDefIconButBitI(block, ICONTOGN, eModifierMode_Realtime, REDRAWALL, ICON_RESTRICT_VIEW_OFF,
+ (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, &(md->mode), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");
+ uiButSetFunc(bt, restrictbutton_modifier_cb, ob, NULL);
+ uiButSetFlag(bt, UI_NO_HILITE);
+
+ /*
+ bt= uiDefIconButBitI(block, ICONTOGN, eModifierMode_Editmode, REDRAWALL, VICON_EDIT,
+ (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, te->ys, 17, OL_H-1, &(md->mode), 0, 0, 0, 0, "Restrict/Allow selection in the 3D View");
+ uiButSetFunc(bt, restrictbutton_modifier_cb, ob, NULL);
+ uiButSetFlag(bt, UI_NO_HILITE);
+ */
+
+ bt= uiDefIconButBitI(block, ICONTOGN, eModifierMode_Render, REDRAWALL, ICON_RESTRICT_RENDER_OFF,
+ (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, te->ys, 17, OL_H-1, &(md->mode), 0, 0, 0, 0, "Restrict/Allow renderability");
+ uiButSetFunc(bt, restrictbutton_modifier_cb, ob, NULL);
+ uiButSetFlag(bt, UI_NO_HILITE);
+ }
}
if((tselem->flag & TSE_CLOSED)==0) outliner_draw_restrictbuts(block, soops, &te->subtree);
More information about the Bf-blender-cvs
mailing list