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:
authorJoseph Eagar <joeedh@gmail.com>2011-02-27 09:19:40 +0300
committerJoseph Eagar <joeedh@gmail.com>2011-02-27 09:19:40 +0300
commitf01261d040be27337db9f9996d648a279c89b7c4 (patch)
treec448230939b3c90d53ce8852dd00925d6052e3a4 /source/blender/editors/space_buttons
parentdcaeda5c4e3a0687251b8511de4f2e8b85ef75c0 (diff)
parent2198cfdb2deec8b2e85e242c74a032f43d0b26ca (diff)
merge with/from trunk at r35190
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r--source/blender/editors/space_buttons/CMakeLists.txt20
-rw-r--r--source/blender/editors/space_buttons/Makefile55
-rw-r--r--source/blender/editors/space_buttons/SConscript4
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c88
-rw-r--r--source/blender/editors/space_buttons/buttons_header.c38
-rw-r--r--source/blender/editors/space_buttons/buttons_intern.h4
-rw-r--r--source/blender/editors/space_buttons/buttons_ops.c46
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c33
8 files changed, 170 insertions, 118 deletions
diff --git a/source/blender/editors/space_buttons/CMakeLists.txt b/source/blender/editors/space_buttons/CMakeLists.txt
index bb50ac0cc86..94b3f1c3926 100644
--- a/source/blender/editors/space_buttons/CMakeLists.txt
+++ b/source/blender/editors/space_buttons/CMakeLists.txt
@@ -19,16 +19,24 @@
#
# ***** END GPL LICENSE BLOCK *****
-FILE(GLOB SRC *.c)
-
-SET(INC
+set(INC
+ ../include
../../blenkernel
+ ../../blenloader
../../blenlib
- ../include
- ../../../../intern/guardedalloc
../../makesdna
../../makesrna
../../windowmanager
+ ../../../../intern/guardedalloc
+)
+
+set(SRC
+ buttons_context.c
+ buttons_header.c
+ buttons_ops.c
+ space_buttons.c
+
+ buttons_intern.h
)
-BLENDERLIB(bf_editor_space_buttons "${SRC}" "${INC}")
+blender_add_lib(bf_editor_space_buttons "${SRC}" "${INC}")
diff --git a/source/blender/editors/space_buttons/Makefile b/source/blender/editors/space_buttons/Makefile
deleted file mode 100644
index 28758fb168b..00000000000
--- a/source/blender/editors/space_buttons/Makefile
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# The Original Code is Copyright (C) 2007 Blender Foundation
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): none yet.
-#
-# ***** END GPL LICENSE BLOCK *****
-#
-# Makes module object directory and bounces make to subdirectories.
-
-LIBNAME = ed_buttons
-DIR = $(OCGDIR)/blender/$(LIBNAME)
-
-include nan_compile.mk
-
-CFLAGS += $(LEVEL_1_C_WARNINGS)
-
-CPPFLAGS += -I$(NAN_GLEW)/include
-CPPFLAGS += -I$(OPENGL_HEADERS)
-
-# not very neat....
-CPPFLAGS += -I../../windowmanager
-CPPFLAGS += -I../../blenloader
-CPPFLAGS += -I../../blenkernel
-CPPFLAGS += -I../../blenlib
-CPPFLAGS += -I../../makesdna
-CPPFLAGS += -I../../makesrna
-CPPFLAGS += -I../../imbuf
-CPPFLAGS += -I../../python
-CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
-CPPFLAGS += -I../../render/extern/include
-
-# own include
-
-CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_buttons/SConscript b/source/blender/editors/space_buttons/SConscript
index b82f0db49a0..38a65cadfab 100644
--- a/source/blender/editors/space_buttons/SConscript
+++ b/source/blender/editors/space_buttons/SConscript
@@ -5,7 +5,11 @@ sources = env.Glob('*.c')
incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+<<<<<<< .working
incs += ' ../../makesrna ../../render/extern/include ../../bmesh'
+=======
+incs += ' ../../makesrna ../../render/extern/include ../../blenloader'
+>>>>>>> .merge-right.r35190
defs = []
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 343237dee5e..486cc462584 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -1,4 +1,4 @@
-/**
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -30,6 +30,9 @@
#include "MEM_guardedalloc.h"
+#include "BLI_listbase.h"
+#include "BLI_utildefines.h"
+
#include "DNA_armature_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
@@ -38,8 +41,6 @@
#include "DNA_world_types.h"
#include "DNA_brush_types.h"
-#include "BLI_listbase.h"
-
#include "BKE_context.h"
#include "BKE_action.h"
#include "BKE_material.h"
@@ -48,7 +49,7 @@
#include "BKE_particle.h"
#include "BKE_screen.h"
#include "BKE_texture.h"
-#include "BKE_utildefines.h"
+
#include "RNA_access.h"
@@ -65,6 +66,7 @@ typedef struct ButsContextPath {
PointerRNA ptr[8];
int len;
int flag;
+ int tex_ctx;
} ButsContextPath;
static int set_pointer_type(ButsContextPath *path, bContextDataResult *result, StructRNA *type)
@@ -305,7 +307,12 @@ static int buttons_context_path_particle(ButsContextPath *path)
{
Object *ob;
ParticleSystem *psys;
+ PointerRNA *ptr= &path->ptr[path->len-1];
+ /* if we already have (pinned) particle settings, we're done */
+ if(RNA_struct_is_a(ptr->type, &RNA_ParticleSettings)) {
+ return 1;
+ }
/* if we have an object, get the active particle system */
if(buttons_context_path_object(path)) {
ob= path->ptr[path->len-1].data;
@@ -323,7 +330,7 @@ static int buttons_context_path_particle(ButsContextPath *path)
return 0;
}
-static int buttons_context_path_brush(const bContext *C, ButsContextPath *path)
+static int buttons_context_path_brush(ButsContextPath *path)
{
Scene *scene;
Brush *br= NULL;
@@ -352,12 +359,13 @@ static int buttons_context_path_brush(const bContext *C, ButsContextPath *path)
return 0;
}
-static int buttons_context_path_texture(const bContext *C, ButsContextPath *path)
+static int buttons_context_path_texture(ButsContextPath *path)
{
Material *ma;
Lamp *la;
Brush *br;
World *wo;
+ ParticleSystem *psys;
Tex *tex;
PointerRNA *ptr= &path->ptr[path->len-1];
int orig_len = path->len;
@@ -367,7 +375,7 @@ static int buttons_context_path_texture(const bContext *C, ButsContextPath *path
return 1;
}
/* try brush */
- if((path->flag & SB_BRUSH_TEX) && buttons_context_path_brush(C, path)) {
+ if((path->tex_ctx == SB_TEXC_BRUSH) && buttons_context_path_brush(path)) {
br= path->ptr[path->len-1].data;
if(br) {
@@ -379,7 +387,7 @@ static int buttons_context_path_texture(const bContext *C, ButsContextPath *path
}
}
/* try world */
- if((path->flag & SB_WORLD_TEX) && buttons_context_path_world(path)) {
+ if((path->tex_ctx == SB_TEXC_WORLD) && buttons_context_path_world(path)) {
wo= path->ptr[path->len-1].data;
if(wo && GS(wo->id.name)==ID_WO) {
@@ -390,6 +398,28 @@ static int buttons_context_path_texture(const bContext *C, ButsContextPath *path
return 1;
}
}
+ /* try particles */
+ if((path->tex_ctx == SB_TEXC_PARTICLES) && buttons_context_path_particle(path)) {
+ if(path->ptr[path->len-1].type == &RNA_ParticleSettings) {
+ ParticleSettings *part = path->ptr[path->len-1].data;
+
+ tex= give_current_particle_texture(part);
+ RNA_id_pointer_create(&tex->id, &path->ptr[path->len]);
+ path->len++;
+ return 1;
+ }
+ else {
+ psys= path->ptr[path->len-1].data;
+
+ if(psys && psys->part && GS(psys->part->id.name)==ID_PA) {
+ tex= give_current_particle_texture(psys->part);
+
+ RNA_id_pointer_create(&tex->id, &path->ptr[path->len]);
+ path->len++;
+ return 1;
+ }
+ }
+ }
/* try material */
if(buttons_context_path_material(path)) {
ma= path->ptr[path->len-1].data;
@@ -416,7 +446,7 @@ static int buttons_context_path_texture(const bContext *C, ButsContextPath *path
}
/* try brushes again in case of no material, lamp, etc */
path->len = orig_len;
- if(buttons_context_path_brush(C, path)) {
+ if(buttons_context_path_brush(path)) {
br= path->ptr[path->len-1].data;
if(br) {
@@ -441,6 +471,7 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma
memset(path, 0, sizeof(*path));
path->flag= flag;
+ path->tex_ctx = sbuts->texture_context;
/* if some ID datablock is pinned, set the root pointer */
if(sbuts->pinid) {
@@ -485,7 +516,7 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma
found= buttons_context_path_material(path);
break;
case BCONTEXT_TEXTURE:
- found= buttons_context_path_texture(C, path);
+ found= buttons_context_path_texture(path);
break;
case BCONTEXT_BONE:
found= buttons_context_path_bone(path);
@@ -515,7 +546,7 @@ static int buttons_shading_context(const bContext *C, int mainb)
return 0;
}
-static int buttons_shading_new_context(const bContext *C, int flag, int mainb)
+static int buttons_shading_new_context(const bContext *C, int flag)
{
Object *ob= CTX_data_active_object(C);
@@ -533,13 +564,12 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts)
{
ButsContextPath *path;
PointerRNA *ptr;
- int a, pflag, flag= 0;
+ int a, pflag= 0, flag= 0;
if(!sbuts->path)
sbuts->path= MEM_callocN(sizeof(ButsContextPath), "ButsContextPath");
path= sbuts->path;
- pflag= (sbuts->flag & (SB_WORLD_TEX|SB_BRUSH_TEX));
/* for each context, see if we can compute a valid path to it, if
* this is the case, we know we have to display the button */
@@ -568,7 +598,7 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts)
if((flag & (1 << sbuts->mainb)) == 0) {
if(sbuts->flag & SB_SHADING_CONTEXT) {
/* try to keep showing shading related buttons */
- sbuts->mainb= buttons_shading_new_context(C, flag, sbuts->mainb);
+ sbuts->mainb= buttons_shading_new_context(C, flag);
}
else if(flag & BCONTEXT_OBJECT) {
sbuts->mainb= BCONTEXT_OBJECT;
@@ -602,6 +632,12 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts)
/************************* Context Callback ************************/
+const char *buttons_context_dir[] = {
+ "world", "object", "mesh", "armature", "lattice", "curve",
+ "meta_ball", "lamp", "camera", "material", "material_slot",
+ "texture", "texture_slot", "bone", "edit_bone", "pose_bone", "particle_system", "particle_system_editable",
+ "cloth", "soft_body", "fluid", "smoke", "collision", "brush", NULL};
+
int buttons_context(const bContext *C, const char *member, bContextDataResult *result)
{
SpaceButs *sbuts= CTX_wm_space_buts(C);
@@ -612,13 +648,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
/* here we handle context, getting data from precomputed path */
if(CTX_data_dir(member)) {
- static const char *dir[] = {
- "world", "object", "mesh", "armature", "lattice", "curve",
- "meta_ball", "lamp", "camera", "material", "material_slot",
- "texture", "texture_slot", "bone", "edit_bone", "pose_bone", "particle_system", "particle_system_editable",
- "cloth", "soft_body", "fluid", "smoke", "collision", "brush", NULL};
-
- CTX_data_dir_set(result, dir);
+ CTX_data_dir_set(result, buttons_context_dir);
return 1;
}
else if(CTX_data_equals(member, "world")) {
@@ -731,6 +761,12 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
if(br)
CTX_data_pointer_set(result, &br->id, &RNA_BrushTextureSlot, &br->mtex);
}
+ else if((ptr=get_pointer_type(path, &RNA_ParticleSystem))) {
+ ParticleSettings *part= ((ParticleSystem *)ptr->data)->part;
+
+ if(part)
+ CTX_data_pointer_set(result, &part->id, &RNA_ParticleSettingsTextureSlot, part->mtex[(int)part->texact]);
+ }
return 1;
}
@@ -821,7 +857,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
/************************* Drawing the Path ************************/
-static void pin_cb(bContext *C, void *arg1, void *arg2)
+static void pin_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2))
{
SpaceButs *sbuts= CTX_wm_space_buts(C);
@@ -909,6 +945,14 @@ ID *buttons_context_id_path(const bContext *C)
for(a=path->len-1; a>=0; a--) {
ptr= &path->ptr[a];
+ /* pin particle settings instead of system, since only settings are an idblock*/
+ if(sbuts->mainb == BCONTEXT_PARTICLE && sbuts->flag & SB_PIN_CONTEXT) {
+ if(ptr->type == &RNA_ParticleSystem && ptr->data) {
+ ParticleSystem *psys = (ParticleSystem *)ptr->data;
+ return &psys->part->id;
+ }
+ }
+
if(ptr->id.data) {
return ptr->id.data;
break;
diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c
index ab756b638fa..cf0ae07d891 100644
--- a/source/blender/editors/space_buttons/buttons_header.c
+++ b/source/blender/editors/space_buttons/buttons_header.c
@@ -1,4 +1,4 @@
-/**
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -29,16 +29,16 @@
#include <string.h>
#include <stdio.h>
-
-
#include "BLI_blenlib.h"
+#include "BLI_utildefines.h"
+
#include "BKE_context.h"
#include "ED_screen.h"
#include "ED_types.h"
-
+#include "DNA_object_types.h"
#include "UI_interface.h"
#include "UI_resources.h"
@@ -50,7 +50,29 @@
#define B_CONTEXT_SWITCH 101
#define B_BUTSPREVIEW 102
-static void do_buttons_buttons(bContext *C, void *arg, int event)
+static void set_texture_context(bContext *C, SpaceButs *sbuts)
+{
+ switch(sbuts->mainb) {
+ case BCONTEXT_MATERIAL:
+ sbuts->texture_context = SB_TEXC_MAT_OR_LAMP;
+ break;
+ case BCONTEXT_DATA:
+ {
+ Object *ob = CTX_data_active_object(C);
+ if(ob && ob->type==OB_LAMP)
+ sbuts->texture_context = SB_TEXC_MAT_OR_LAMP;
+ break;
+ }
+ case BCONTEXT_WORLD:
+ sbuts->texture_context = SB_TEXC_WORLD;
+ break;
+ case BCONTEXT_PARTICLE:
+ sbuts->texture_context = SB_TEXC_PARTICLES;
+ break;
+ }
+}
+
+static void do_buttons_buttons(bContext *C, void *UNUSED(arg), int event)
{
SpaceButs *sbuts= CTX_wm_space_buts(C);
@@ -62,11 +84,7 @@ static void do_buttons_buttons(bContext *C, void *arg, int event)
case B_BUTSPREVIEW:
ED_area_tag_redraw(CTX_wm_area(C));
- /* silly exception */
- if(sbuts->mainb == BCONTEXT_WORLD)
- sbuts->flag |= SB_WORLD_TEX;
- else if(sbuts->mainb != BCONTEXT_TEXTURE)
- sbuts->flag &= ~SB_WORLD_TEX;
+ set_texture_context(C, sbuts);
sbuts->preview= 1;
break;
diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h
index 9478168f35a..dda64ae1b40 100644
--- a/source/blender/editors/space_buttons/buttons_intern.h
+++ b/source/blender/editors/space_buttons/buttons_intern.h
@@ -1,4 +1,4 @@
-/**
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -65,6 +65,8 @@ void buttons_context_draw(const struct bContext *C, struct uiLayout *layout);
void buttons_context_register(struct ARegionType *art);
struct ID *buttons_context_id_path(const struct bContext *C);
+extern const char *buttons_context_dir[]; /* doc access */
+
/* buttons_ops.c */
void BUTTONS_OT_file_browse(struct wmOperatorType *ot);
void BUTTONS_OT_toolbox(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c
index c4357008a9c..b2edff87f9c 100644
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@ -1,4 +1,4 @@
-/**
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -33,8 +33,14 @@
#include "DNA_userdef_types.h"
#include "BLI_fileops.h"
+#include "BLI_path_util.h"
+#include "BLI_storage.h"
+#include "BLI_string.h"
+#include "BLI_utildefines.h"
#include "BKE_context.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -49,7 +55,7 @@
/********************** toolbox operator *********************/
-static int toolbox_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int toolbox_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event))
{
bScreen *sc= CTX_wm_screen(C);
SpaceButs *sbuts= CTX_wm_space_buts(C);
@@ -59,7 +65,7 @@ static int toolbox_invoke(bContext *C, wmOperator *op, wmEvent *event)
RNA_pointer_create(&sc->id, &RNA_SpaceProperties, sbuts, &ptr);
- pup= uiPupMenuBegin(C, "Align", 0);
+ pup= uiPupMenuBegin(C, "Align", ICON_NULL);
layout= uiPupMenuLayout(pup);
uiItemsEnumR(layout, &ptr, "align");
uiPupMenuEnd(C, pup);
@@ -89,12 +95,32 @@ typedef struct FileBrowseOp {
static int file_browse_exec(bContext *C, wmOperator *op)
{
FileBrowseOp *fbo= op->customdata;
- char *str;
+ ID *id;
+ char *base, *str, path[FILE_MAX];
if (RNA_property_is_set(op->ptr, "filepath")==0 || fbo==NULL)
return OPERATOR_CANCELLED;
str= RNA_string_get_alloc(op->ptr, "filepath", 0, 0);
+
+ /* add slash for directories, important for some properties */
+ if(RNA_property_subtype(fbo->prop) == PROP_DIRPATH) {
+ char name[FILE_MAX];
+
+ id = fbo->ptr.id.data;
+ base = (id && id->lib)? id->lib->filepath: G.main->name;
+
+ BLI_strncpy(path, str, FILE_MAX);
+ BLI_path_abs(path, base);
+
+ if(BLI_is_dir(path)) {
+ str = MEM_reallocN(str, strlen(str)+2);
+ BLI_add_slash(str);
+ }
+ else
+ BLI_splitdirstring(str, name);
+ }
+
RNA_property_string_set(&fbo->ptr, fbo->prop, str);
RNA_property_update(C, &fbo->ptr, fbo->prop);
MEM_freeN(str);
@@ -103,7 +129,7 @@ static int file_browse_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-static int file_browse_cancel(bContext *C, wmOperator *op)
+static int file_browse_cancel(bContext *UNUSED(C), wmOperator *op)
{
MEM_freeN(op->customdata);
op->customdata= NULL;
@@ -154,10 +180,12 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event)
RNA_string_set(op->ptr, "filepath", str);
MEM_freeN(str);
- if(RNA_struct_find_property(op->ptr, "relative_path"))
- if(!RNA_property_is_set(op->ptr, "relative_path"))
- RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
-
+ if(RNA_struct_find_property(op->ptr, "relative_path")) {
+ if(!RNA_property_is_set(op->ptr, "relative_path")) {
+ /* annoying exception!, if were dealign with the user prefs, default relative to be off */
+ RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS && (ptr.data != &U));
+ }
+ }
WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL;
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 0b6e752574b..b6feb4ee1d6 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -1,4 +1,4 @@
-/**
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -29,16 +29,17 @@
#include <string.h>
#include <stdio.h>
-
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_rand.h"
+#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_screen.h"
+#include "ED_space_api.h"
#include "ED_screen.h"
#include "BIF_gl.h"
@@ -55,7 +56,7 @@
/* ******************** default callbacks for buttons space ***************** */
-static SpaceLink *buttons_new(const bContext *C)
+static SpaceLink *buttons_new(const bContext *UNUSED(C))
{
ARegion *ar;
SpaceButs *sbuts;
@@ -69,7 +70,7 @@ static SpaceLink *buttons_new(const bContext *C)
BLI_addtail(&sbuts->regionbase, ar);
ar->regiontype= RGN_TYPE_HEADER;
- ar->alignment= RGN_ALIGN_BOTTOM;
+ ar->alignment= RGN_ALIGN_TOP;
#if 0
/* context area */
@@ -103,7 +104,7 @@ static void buttons_free(SpaceLink *sl)
}
/* spacetype; init callback */
-static void buttons_init(struct wmWindowManager *wm, ScrArea *sa)
+static void buttons_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa)
{
SpaceButs *sbuts= sa->spacedata.first;
@@ -177,13 +178,13 @@ static void buttons_main_area_draw(const bContext *C, ARegion *ar)
sbuts->mainbo= sbuts->mainb;
}
-void buttons_operatortypes(void)
+static void buttons_operatortypes(void)
{
WM_operatortype_append(BUTTONS_OT_toolbox);
WM_operatortype_append(BUTTONS_OT_file_browse);
}
-void buttons_keymap(struct wmKeyConfig *keyconf)
+static void buttons_keymap(struct wmKeyConfig *keyconf)
{
wmKeyMap *keymap= WM_keymap_find(keyconf, "Property Editor", SPACE_BUTS, 0);
@@ -191,7 +192,7 @@ void buttons_keymap(struct wmKeyConfig *keyconf)
}
/* add handlers, stuff you only do once or on area/region changes */
-static void buttons_header_area_init(wmWindowManager *wm, ARegion *ar)
+static void buttons_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar)
{
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
}
@@ -203,7 +204,7 @@ static void buttons_header_area_draw(const bContext *C, ARegion *ar)
glClear(GL_COLOR_BUFFER_BIT);
/* set view2d view matrix for scrolling (without scrollers) */
- UI_view2d_view_ortho(C, &ar->v2d);
+ UI_view2d_view_ortho(&ar->v2d);
buttons_header_buttons(C, ar);
@@ -235,12 +236,8 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
buttons_area_redraw(sa, BCONTEXT_RENDER);
break;
case ND_FRAME:
- buttons_area_redraw(sa, BCONTEXT_RENDER);
- buttons_area_redraw(sa, BCONTEXT_MATERIAL);
- buttons_area_redraw(sa, BCONTEXT_TEXTURE);
- buttons_area_redraw(sa, BCONTEXT_WORLD);
- buttons_area_redraw(sa, BCONTEXT_DATA);
- buttons_area_redraw(sa, BCONTEXT_PHYSICS);
+ /* any buttons area can have animated properties so redraw all */
+ ED_area_tag_redraw(sa);
sbuts->preview= 1;
break;
case ND_OB_ACTIVE:
@@ -263,6 +260,7 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
switch(wmn->data) {
case ND_TRANSFORM:
buttons_area_redraw(sa, BCONTEXT_OBJECT);
+ buttons_area_redraw(sa, BCONTEXT_DATA); /* autotexpace flag */
break;
case ND_POSE:
case ND_BONE_ACTIVE:
@@ -284,6 +282,7 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
case ND_PARTICLE:
if (wmn->action == NA_EDITED)
buttons_area_redraw(sa, BCONTEXT_PARTICLE);
+ sbuts->preview= 1;
break;
case ND_DRAW:
buttons_area_redraw(sa, BCONTEXT_OBJECT);
@@ -351,6 +350,10 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
break;
}
break;
+ case NC_NODE:
+ if(wmn->action==NA_SELECTED)
+ ED_area_tag_redraw(sa);
+ break;
/* Listener for preview render, when doing an global undo. */
case NC_WINDOW:
ED_area_tag_redraw(sa);