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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-09-29 23:12:12 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-09-29 23:12:12 +0400
commit15d07720e515a2e9caada6ee9900c388c5e06490 (patch)
tree8154e70a86e3b9b0cf42a581db95f0a7d4029238 /source/blender
parent7f5dc4644f72ffb56d23db79cc3208dbca2d5eab (diff)
Sorry, three commits in one, became difficult to untangle..
Editors Modules * render/ module added in editors, moved the preview render code there and also shading related operators. * physics/ module made more consistent with other modules. renaming files, making a single physics_ops.c for operators and keymaps. Also move all particle related operators here now. * space_buttons/ now should have only operators relevant to the buttons specificially. Updates & Notifiers * Material/Texture/World/Lamp can now be passed to DAG_id_flush_update, which will go back to a callback in editors. Eventually these should be in the depsgraph itself, but for now this gives a unified call for doing updates. * GLSL materials are now refreshed on changes. There's still various cases missing, * Preview icons now hook into this system, solving various update cases that were missed before. * Also fixes issue in my last commit, where some preview would not render, problem is avoided in the new system. Icon Rendering * On systems with support for non-power of two textures, an OpenGL texture is now used instead of glDrawPixels. This avoids problems with icons get clipped on region borders. On my Linux desktop, this gives an 1.1x speedup, and on my Mac laptop a 2.3x speedup overall in redrawing the full window, with the default setup. The glDrawPixels implementation on Mac seems to have a lot of overhread. * Preview icons are now drawn using proper premul alpha, and never faded so you can see them clearly. * Also tried to fix issue with texture node preview rendering, globals can't be used with threads reliably.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_depsgraph.h3
-rw-r--r--source/blender/blenkernel/BKE_node.h2
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c18
-rw-r--r--source/blender/editors/Makefile2
-rw-r--r--source/blender/editors/SConscript2
-rw-r--r--source/blender/editors/include/ED_particle.h17
-rw-r--r--source/blender/editors/include/ED_physics.h7
-rw-r--r--source/blender/editors/include/ED_render.h (renamed from source/blender/editors/include/ED_previewrender.h)25
-rw-r--r--source/blender/editors/include/UI_interface_icons.h6
-rw-r--r--source/blender/editors/interface/interface_icons.c309
-rw-r--r--source/blender/editors/interface/interface_templates.c2
-rw-r--r--source/blender/editors/interface/interface_widgets.c16
-rw-r--r--source/blender/editors/object/object_intern.h4
-rw-r--r--source/blender/editors/object/object_ops.c3
-rw-r--r--source/blender/editors/physics/particle_boids.c (renamed from source/blender/editors/physics/physics_boids.c)100
-rw-r--r--source/blender/editors/physics/particle_edit.c (renamed from source/blender/editors/physics/editparticle.c)64
-rw-r--r--source/blender/editors/physics/particle_object.c575
-rw-r--r--source/blender/editors/physics/physics_fluid.c (renamed from source/blender/editors/physics/ed_fluidsim.c)7
-rw-r--r--source/blender/editors/physics/physics_intern.h66
-rw-r--r--source/blender/editors/physics/physics_ops.c173
-rw-r--r--source/blender/editors/physics/physics_pointcache.c (renamed from source/blender/editors/physics/ed_pointcache.c)24
-rw-r--r--source/blender/editors/render/Makefile (renamed from source/blender/editors/preview/Makefile)2
-rw-r--r--source/blender/editors/render/SConscript (renamed from source/blender/editors/preview/SConscript)2
-rw-r--r--source/blender/editors/render/render_intern.h (renamed from source/blender/editors/preview/previewrender_intern.h)20
-rw-r--r--source/blender/editors/render/render_ops.c54
-rw-r--r--source/blender/editors/render/render_preview.c (renamed from source/blender/editors/preview/previewrender.c)37
-rw-r--r--source/blender/editors/render/render_shading.c645
-rw-r--r--source/blender/editors/space_api/spacetypes.c10
-rw-r--r--source/blender/editors/space_buttons/buttons_intern.h27
-rw-r--r--source/blender/editors/space_buttons/buttons_ops.c986
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c29
-rw-r--r--source/blender/editors/space_file/file_draw.c6
-rw-r--r--source/blender/editors/space_node/node_draw.c15
-rw-r--r--source/blender/editors/space_node/node_edit.c2
-rw-r--r--source/blender/editors/space_node/space_node.c2
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c9
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h21
-rw-r--r--source/blender/makesdna/DNA_object_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_brush.c40
-rw-r--r--source/blender/makesrna/intern/rna_internal.h2
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c165
-rw-r--r--source/blender/makesrna/intern/rna_material.c403
-rw-r--r--source/blender/makesrna/intern/rna_texture.c344
-rw-r--r--source/blender/makesrna/intern/rna_world.c97
-rw-r--r--source/blender/nodes/intern/TEX_util.c14
-rw-r--r--source/blender/nodes/intern/TEX_util.h2
-rw-r--r--source/blender/render/intern/source/texture.c2
-rw-r--r--source/blender/windowmanager/WM_types.h9
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c8
49 files changed, 2534 insertions, 1846 deletions
diff --git a/source/blender/blenkernel/BKE_depsgraph.h b/source/blender/blenkernel/BKE_depsgraph.h
index 17a4749f704..44f8238d4d9 100644
--- a/source/blender/blenkernel/BKE_depsgraph.h
+++ b/source/blender/blenkernel/BKE_depsgraph.h
@@ -115,5 +115,8 @@ void DAG_ids_flush_update(int time);
/* (re)-create dependency graph for armature pose */
void DAG_pose_sort(struct Object *ob);
+
+ /* callback for editors module to do updates */
+void DAG_editors_update_cb(void (*func)(struct Main *bmain, struct ID *id));
#endif
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index ea1707c19bf..b1e7dcaff02 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -426,7 +426,7 @@ extern struct ListBase node_all_textures;
/* API */
int ntreeTexTagAnimated(struct bNodeTree *ntree);
void ntreeTexSetPreviewFlag(int);
-void ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, float *dxt, float *dyt, short thread, struct Tex *tex, short which_output, int cfra);
+void ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, float *dxt, float *dyt, short thread, struct Tex *tex, short which_output, int cfra, int preview);
void ntreeTexCheckCyclics(struct bNodeTree *ntree);
char* ntreeTexOutputMenu(struct bNodeTree *ntree);
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 4c2b2f3ec12..608cfe03b72 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -1607,6 +1607,21 @@ void graph_print_adj_list(void)
/* ************************ API *********************** */
+/* mechanism to allow editors to be informed of depsgraph updates,
+ to do their own updates based on changes... */
+static void (*EditorsUpdateCb)(Main *bmain, ID *id)= NULL;
+
+void DAG_editors_update_cb(void (*func)(Main *bmain, ID *id))
+{
+ EditorsUpdateCb= func;
+}
+
+static void dag_editors_update(Main *bmain, ID *id)
+{
+ if(EditorsUpdateCb)
+ EditorsUpdateCb(bmain, id);
+}
+
/* groups with objects in this scene need to be put in the right order as well */
static void scene_sort_groups(Scene *sce)
{
@@ -2239,6 +2254,9 @@ void DAG_id_flush_update(ID *id, short flag)
}
}
}
+
+ /* update editors */
+ dag_editors_update(bmain, id);
}
/* flush to other objects that depend on this one */
diff --git a/source/blender/editors/Makefile b/source/blender/editors/Makefile
index 6a9d695ab0e..e259168a4ef 100644
--- a/source/blender/editors/Makefile
+++ b/source/blender/editors/Makefile
@@ -43,7 +43,7 @@ DIRS = armature \
metaball \
gpencil \
physics \
- preview \
+ render \
uvedit \
space_outliner \
space_time \
diff --git a/source/blender/editors/SConscript b/source/blender/editors/SConscript
index ccffbdb15d5..226e9247f91 100644
--- a/source/blender/editors/SConscript
+++ b/source/blender/editors/SConscript
@@ -14,7 +14,7 @@ SConscript(['datafiles/SConscript',
'curve/SConscript',
'gpencil/SConscript',
'physics/SConscript',
- 'preview/SConscript',
+ 'render/SConscript',
'sound/SConscript',
'space_buttons/SConscript',
'space_file/SConscript',
diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h
index 28807caa255..a052142102d 100644
--- a/source/blender/editors/include/ED_particle.h
+++ b/source/blender/editors/include/ED_particle.h
@@ -38,6 +38,7 @@ struct RadialControl;
struct rcti;
struct wmWindowManager;
struct PTCacheEdit;
+struct Scene;
/* particle edit mode */
void PE_free_ptcache_edit(struct PTCacheEdit *edit);
@@ -46,7 +47,7 @@ int PE_start_edit(struct PTCacheEdit *edit);
/* access */
struct PTCacheEdit *PE_get_current(struct Scene *scene, struct Object *ob);
int PE_minmax(struct Scene *scene, float *min, float *max);
-struct ParticleEditSettings *PE_settings(Scene *scene);
+struct ParticleEditSettings *PE_settings(struct Scene *scene);
/* update calls */
void PE_hide_keys_time(struct Scene *scene, struct PTCacheEdit *edit, float cfra);
@@ -59,15 +60,11 @@ int PE_circle_select(struct bContext *C, int selecting, short *mval, float rad);
int PE_lasso_select(struct bContext *C, short mcords[][2], short moves, short select);
/* undo */
-void PE_undo_push(Scene *scene, char *str);
-void PE_undo_step(Scene *scene, int step);
-void PE_undo(Scene *scene);
-void PE_redo(Scene *scene);
-void PE_undo_menu(Scene *scene, Object *ob);
-
-/* operators */
-void ED_operatortypes_particle(void);
-void ED_keymap_particle(struct wmWindowManager *wm);
+void PE_undo_push(struct Scene *scene, char *str);
+void PE_undo_step(struct Scene *scene, int step);
+void PE_undo(struct Scene *scene);
+void PE_redo(struct Scene *scene);
+void PE_undo_menu(struct Scene *scene, struct Object *ob);
#endif /* ED_PARTICLE_H */
diff --git a/source/blender/editors/include/ED_physics.h b/source/blender/editors/include/ED_physics.h
index 6ab804230d0..ee340c54e7d 100644
--- a/source/blender/editors/include/ED_physics.h
+++ b/source/blender/editors/include/ED_physics.h
@@ -31,11 +31,8 @@
#define ED_PHYSICS_H
/* operators */
-
-void ED_operatortypes_boids(void);
-void ED_operatortypes_pointcache(void);
-void ED_operatortypes_fluid(void);
-//void ED_keymap_pointcache(struct wmWindowManager *wm);
+void ED_operatortypes_physics(void);
+void ED_keymap_physics(struct wmWindowManager *wm);
#endif /* ED_PHYSICS_H */
diff --git a/source/blender/editors/include/ED_previewrender.h b/source/blender/editors/include/ED_render.h
index b858a269236..be93bf92e5e 100644
--- a/source/blender/editors/include/ED_previewrender.h
+++ b/source/blender/editors/include/ED_render.h
@@ -21,22 +21,29 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef ED_PREVIEWRENDER_H
-#define ED_PREVIEWRENDER_H
+#ifndef ED_RENDER_H
+#define ED_RENDER_H
#include "DNA_vec_types.h"
-struct View3D;
-struct SpaceButs;
-struct RenderInfo;
-struct Scene;
-struct Image;
-struct Render;
struct bContext;
struct ID;
+struct Main;
struct MTex;
+struct Render;
+struct RenderInfo;
+
+/* render_ops.c */
+
+void ED_operatortypes_render(void);
+
+/* render_shading.c */
+
+void ED_render_id_flush_update(struct Main *bmain, struct ID *id);
+
+/* render_preview.c */
-#define PREVIEW_RENDERSIZE 140
+#define _RENDERSIZE 140
/* stores rendered preview - is also used for icons */
typedef struct RenderInfo {
diff --git a/source/blender/editors/include/UI_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h
index bf160b4ad68..afe6a2b9dcb 100644
--- a/source/blender/editors/include/UI_interface_icons.h
+++ b/source/blender/editors/include/UI_interface_icons.h
@@ -57,9 +57,9 @@ int UI_icon_get_height(int icon_id);
void UI_icon_draw(float x, float y, int icon_id);
void UI_icon_draw_preview(float x, float y, int icon_id, int nocreate);
-void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect);
-void UI_icon_draw_aspect_blended(float x, float y, int icon_id, float aspect, int shade);
-void UI_icon_draw_size_blended(float x, float y, int size, int icon_id, int shade);
+void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect, float alpha);
+void UI_icon_draw_aspect_color(float x, float y, int icon_id, float aspect, float *rgb);
+void UI_icon_draw_size(float x, float y, int size, int icon_id, float alpha);
void UI_icons_free();
void UI_icons_free_drawinfo(void *drawinfo);
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 0c11e64c0bb..1153c475339 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -59,7 +59,7 @@
#include "BIF_glutil.h"
#include "ED_datafiles.h"
-#include "ED_previewrender.h"
+#include "ED_render.h"
#include "UI_interface.h"
#include "UI_interface_icons.h"
@@ -86,23 +86,45 @@ typedef struct IconImage {
typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha);
+#define ICON_TYPE_PREVIEW 0
+#define ICON_TYPE_TEXTURE 1
+#define ICON_TYPE_BUFFER 2
+#define ICON_TYPE_VECTOR 3
+
typedef struct DrawInfo {
+ int type;
+
+ union {
+ /* type specific data */
+ struct {
+ VectorDrawFunc func;
+ } vector;
+ struct {
+ IconImage* image;
+ } buffer;
+ struct {
+ int x, y, w, h;
+ } texture;
+ } data;
+} DrawInfo;
+
+typedef struct IconTexture {
+ GLuint id;
int w;
int h;
- float aspect;
- VectorDrawFunc drawFunc; /* If drawFunc is defined then it is a vector icon, otherwise use rect */
- IconImage* icon;
-} DrawInfo;
+ float invw;
+ float invh;
+} IconTexture;
/* ******************* STATIC LOCAL VARS ******************* */
/* static here to cache results of icon directory scan, so it's not
* scanning the filesystem each time the menu is drawn */
static struct ListBase iconfilelist = {0, 0};
-
+static IconTexture icongltex = {0, 0, 0, 0.0f, 0.0f};
/* **************************************************** */
-static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs, int size)
+static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs, int size, int type)
{
Icon *new_icon = NULL;
IconImage *iimg = NULL;
@@ -116,23 +138,28 @@ static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs, int
new_icon->type = 0;
di = MEM_callocN(sizeof(DrawInfo), "drawinfo");
- di->drawFunc = 0;
- di->w = size;
- di->h = size;
- di->aspect = 1.0f;
-
- iimg = MEM_mallocN(sizeof(IconImage), "icon_img");
- iimg->rect = MEM_mallocN(size*size*sizeof(unsigned int), "icon_rect");
- iimg->w = size;
- iimg->h = size;
+ di->type= type;
- /* Here we store the rect in the icon - same as before */
- imgsize = bbuf->x;
- for (y=0; y<size; y++) {
- memcpy(&iimg->rect[y*size], &bbuf->rect[(y+yofs)*imgsize+xofs], size*sizeof(int));
+ if(type == ICON_TYPE_TEXTURE) {
+ di->data.texture.x= xofs;
+ di->data.texture.y= yofs;
+ di->data.texture.w= size;
+ di->data.texture.h= size;
}
+ else if(type == ICON_TYPE_BUFFER) {
+ iimg = MEM_mallocN(sizeof(IconImage), "icon_img");
+ iimg->rect = MEM_mallocN(size*size*sizeof(unsigned int), "icon_rect");
+ iimg->w = size;
+ iimg->h = size;
+
+ /* Here we store the rect in the icon - same as before */
+ imgsize = bbuf->x;
+ for (y=0; y<size; y++) {
+ memcpy(&iimg->rect[y*size], &bbuf->rect[(y+yofs)*imgsize+xofs], size*sizeof(int));
+ }
- di->icon = iimg;
+ di->data.buffer.image = iimg;
+ }
new_icon->drawinfo_free = UI_icons_free_drawinfo;
new_icon->drawinfo = di;
@@ -151,11 +178,8 @@ static void def_internal_vicon( int icon_id, VectorDrawFunc drawFunc)
new_icon->type = 0;
di = MEM_callocN(sizeof(DrawInfo), "drawinfo");
- di->drawFunc =drawFunc;
- di->w = ICON_DEFAULT_HEIGHT;
- di->h = ICON_DEFAULT_HEIGHT;
- di->aspect = 1.0f;
- di->icon = NULL;
+ di->type= ICON_TYPE_VECTOR;
+ di->data.vector.func =drawFunc;
new_icon->drawinfo_free = 0;
new_icon->drawinfo = di;
@@ -431,7 +455,7 @@ static void init_internal_icons()
{
bTheme *btheme= U.themes.first;
ImBuf *bbuf= NULL;
- int x, y;
+ int x, y, icontype;
char iconfilestr[FILE_MAXDIR+FILE_MAXFILE];
char filenamestr[FILE_MAXFILE+16]; // 16 == strlen(".blender/icons/")+1
@@ -451,17 +475,54 @@ static void init_internal_icons()
printf("\n***WARNING***\nIcons file %s too small.\nUsing built-in Icons instead\n", iconfilestr);
IMB_freeImBuf(bbuf);
bbuf= NULL;
+ }
}
}
- }
if(bbuf==NULL)
bbuf = IMB_ibImageFromMemory((int *)datatoc_blenderbuttons, datatoc_blenderbuttons_size, IB_rect);
+ if(bbuf) {
+ /* free existing texture if any */
+ if(icongltex.id) {
+ glDeleteTextures(1, &icongltex.id);
+ icongltex.id= 0;
+ }
+
+ /* we only use a texture for cards with non-power of two */
+ if(GLEW_ARB_texture_non_power_of_two) {
+ glGenTextures(1, &icongltex.id);
+
+ if(icongltex.id) {
+ icongltex.w = bbuf->x;
+ icongltex.h = bbuf->y;
+ icongltex.invw = 1.0f/bbuf->x;
+ icongltex.invh = 1.0f/bbuf->y;
+
+ glBindTexture(GL_TEXTURE_2D, icongltex.id);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bbuf->x, bbuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, bbuf->rect);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glBindTexture(GL_TEXTURE_2D, 0);
+
+ if(glGetError() == GL_OUT_OF_MEMORY) {
+ glDeleteTextures(1, &icongltex.id);
+ icongltex.id= 0;
+ }
+ }
+ }
+ }
+
+ if(icongltex.id)
+ icontype= ICON_TYPE_TEXTURE;
+ else
+ icontype= ICON_TYPE_BUFFER;
+
for (y=0; y<ICON_GRID_ROWS; y++) {
for (x=0; x<ICON_GRID_COLS; x++) {
def_internal_icon(bbuf, BIFICONID_FIRST + y*ICON_GRID_COLS + x,
x*(ICON_GRID_W+ICON_GRID_MARGIN)+ICON_GRID_MARGIN,
- y*(ICON_GRID_H+ICON_GRID_MARGIN)+ICON_GRID_MARGIN, ICON_GRID_W);
+ y*(ICON_GRID_H+ICON_GRID_MARGIN)+ICON_GRID_MARGIN, ICON_GRID_W,
+ icontype);
}
}
@@ -588,6 +649,11 @@ ListBase *UI_iconfile_list(void)
void UI_icons_free()
{
+ if(icongltex.id) {
+ glDeleteTextures(1, &icongltex.id);
+ icongltex.id= 0;
+ }
+
free_iconfile_list(&iconfilelist);
BKE_icons_free();
}
@@ -596,12 +662,14 @@ void UI_icons_free_drawinfo(void *drawinfo)
{
DrawInfo *di = drawinfo;
- if (di)
- {
- if (di->icon) {
- MEM_freeN(di->icon->rect);
- MEM_freeN(di->icon);
+ if(di) {
+ if(di->type == ICON_TYPE_BUFFER) {
+ if(di->data.buffer.image) {
+ MEM_freeN(di->data.buffer.image->rect);
+ MEM_freeN(di->data.buffer.image);
+ }
}
+
MEM_freeN(di);
}
}
@@ -611,12 +679,7 @@ static DrawInfo *icon_create_drawinfo()
DrawInfo *di = NULL;
di = MEM_callocN(sizeof(DrawInfo), "di_icon");
-
- di->drawFunc = 0;
- di->w = ICON_DEFAULT_HEIGHT;
- di->h = ICON_DEFAULT_HEIGHT;
- di->icon = NULL;
- di->aspect = 1.0f;
+ di->type= ICON_TYPE_PREVIEW;
return di;
}
@@ -640,7 +703,7 @@ int UI_icon_get_width(int icon_id)
}
if (di)
- return di->w;
+ return ICON_DEFAULT_HEIGHT;
return 0;
}
@@ -665,7 +728,7 @@ int UI_icon_get_height(int icon_id)
}
if (di)
- return di->h;
+ return ICON_DEFAULT_HEIGHT;
return 0;
}
@@ -718,12 +781,23 @@ static void icon_set_image(bContext *C, ID *id, PreviewImage* prv_img, int miple
prv_img->w[miplevel], prv_img->h[miplevel]);
}
-static void icon_draw_rect(float x, float y, int w, int h, float aspect, int rw, int rh, unsigned int *rect)
+static void icon_draw_rect(float x, float y, int w, int h, float aspect, int rw, int rh, unsigned int *rect, float alpha, float *rgb)
{
-
+ /* modulate color */
+ if(alpha != 1.0f)
+ glPixelTransferf(GL_ALPHA_SCALE, alpha);
+
+ if(rgb) {
+ glPixelTransferf(GL_RED_SCALE, rgb[0]);
+ glPixelTransferf(GL_GREEN_SCALE, rgb[1]);
+ glPixelTransferf(GL_BLUE_SCALE, rgb[2]);
+ }
+
+ /* position */
glRasterPos2f(x, y);
// XXX ui_rasterpos_safe(x, y, aspect);
+ /* draw */
if((w<1 || h<1)) {
// XXX - TODO 2.5 verify whether this case can happen
// and only print in debug
@@ -731,23 +805,68 @@ static void icon_draw_rect(float x, float y, int w, int h, float aspect, int rw,
}
/* rect contains image in 'rendersize', we only scale if needed */
else if(rw!=w && rh!=h) {
- ImBuf *ima;
if(w>2000 || h>2000) { /* something has gone wrong! */
printf("insane icon size w=%d h=%d\n",w,h);
- return;
}
- /* first allocate imbuf for scaling and copy preview into it */
- ima = IMB_allocImBuf(rw, rh, 32, IB_rect, 0);
- memcpy(ima->rect, rect, rw*rh*sizeof(unsigned int));
-
- /* scale it */
- IMB_scaleImBuf(ima, w, h);
- glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, ima->rect);
-
- IMB_freeImBuf(ima);
+ else {
+ ImBuf *ima;
+
+ /* first allocate imbuf for scaling and copy preview into it */
+ ima = IMB_allocImBuf(rw, rh, 32, IB_rect, 0);
+ memcpy(ima->rect, rect, rw*rh*sizeof(unsigned int));
+
+ /* scale it */
+ IMB_scaleImBuf(ima, w, h);
+ glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, ima->rect);
+
+ IMB_freeImBuf(ima);
+ }
}
else
glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, rect);
+
+ /* restore color */
+ if(alpha != 0.0f)
+ glPixelTransferf(GL_ALPHA_SCALE, 1.0f);
+
+ if(rgb) {
+ glPixelTransferf(GL_RED_SCALE, 1.0f);
+ glPixelTransferf(GL_GREEN_SCALE, 1.0f);
+ glPixelTransferf(GL_BLUE_SCALE, 1.0f);
+ }
+}
+
+static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy, int iw, int ih, float alpha, float *rgb)
+{
+ float x1, x2, y1, y2;
+
+ if(rgb) glColor4f(rgb[0], rgb[1], rgb[2], alpha);
+ else glColor4f(1.0f, 1.0f, 1.0f, alpha);
+
+ x1= ix*icongltex.invw;
+ x2= (ix + ih)*icongltex.invw;
+ y1= iy*icongltex.invh;
+ y2= (iy + ih)*icongltex.invh;
+
+ glEnable(GL_TEXTURE_2D);
+ glBindTexture(GL_TEXTURE_2D, icongltex.id);
+
+ glBegin(GL_QUADS);
+ glTexCoord2f(x1, y1);
+ glVertex2f(x, y);
+
+ glTexCoord2f(x2, y1);
+ glVertex2f(x+w, y);
+
+ glTexCoord2f(x2, y2);
+ glVertex2f(x+w, y+h);
+
+ glTexCoord2f(x1, y2);
+ glVertex2f(x, y+h);
+ glEnd();
+
+ glBindTexture(GL_TEXTURE_2D, 0);
+ glDisable(GL_TEXTURE_2D);
}
/* Drawing size for preview images at level miplevel */
@@ -760,10 +879,12 @@ static int preview_size(int miplevel)
return 0;
}
-static void icon_draw_size(float x, float y, int icon_id, float aspect, int miplevel, int draw_size, int nocreate)
+static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, float *rgb, int miplevel, int draw_size, int nocreate)
{
Icon *icon = NULL;
DrawInfo *di = NULL;
+ IconImage *iimg;
+ int w, h;
icon = BKE_icon_get(icon_id);
@@ -771,7 +892,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, int mipl
printf("icon_draw_mipmap: Internal error, no icon for icon ID: %d\n", icon_id);
return;
}
-
+
di = (DrawInfo*)icon->drawinfo;
if (!di) {
@@ -781,31 +902,38 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, int mipl
icon->drawinfo_free = UI_icons_free_drawinfo;
}
- di->aspect = aspect;
/* scale width and height according to aspect */
- di->w = (int)(draw_size/di->aspect + 0.5f);
- di->h = (int)(draw_size/di->aspect + 0.5f);
+ w = (int)(draw_size/aspect + 0.5f);
+ h = (int)(draw_size/aspect + 0.5f);
- if (di->drawFunc) {
+ if(di->type == ICON_TYPE_VECTOR) {
/* vector icons use the uiBlock transformation, they are not drawn
with untransformed coordinates like the other icons */
- di->drawFunc(x, y, ICON_DEFAULT_HEIGHT, ICON_DEFAULT_HEIGHT, 1.0f);
+ di->data.vector.func(x, y, ICON_DEFAULT_HEIGHT, ICON_DEFAULT_HEIGHT, 1.0f);
}
- else if (di->icon) {
+ else if(di->type == ICON_TYPE_TEXTURE) {
+ icon_draw_texture(x, y, w, h, di->data.texture.x, di->data.texture.y,
+ di->data.texture.w, di->data.texture.h, alpha, rgb);
+ }
+ else if(di->type == ICON_TYPE_BUFFER) {
/* it is a builtin icon */
- if (!di->icon->rect) return; /* something has gone wrong! */
+ iimg= di->data.buffer.image;
- icon_draw_rect(x,y,di->w, di->h, di->aspect, di->icon->w, di->icon->h, di->icon->rect);
+ if(!iimg->rect) return; /* something has gone wrong! */
+
+ icon_draw_rect(x, y, w, h, aspect, iimg->w, iimg->h, iimg->rect, alpha, rgb);
}
- else {
+ else if(di->type == ICON_TYPE_PREVIEW) {
PreviewImage* pi = BKE_previewimg_get((ID*)icon->obj);
- if (pi) {
+ if(pi) {
/* no create icon on this level in code */
+ if(!pi->rect[miplevel]) return; /* something has gone wrong! */
- if (!pi->rect[miplevel]) return; /* something has gone wrong! */
-
- icon_draw_rect(x,y,di->w, di->h, di->aspect, pi->w[miplevel], pi->h[miplevel], pi->rect[miplevel]);
+ /* preview images use premul alpha ... */
+ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ icon_draw_rect(x, y, w, h, aspect, pi->w[miplevel], pi->h[miplevel], pi->rect[miplevel], 1.0f, NULL);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
}
}
@@ -847,50 +975,35 @@ int ui_id_icon_get(bContext *C, ID *id)
return iconid;
}
-static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, int miplevel, int nocreate)
+static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, float alpha, int miplevel, int nocreate)
{
int draw_size = preview_size(miplevel);
- icon_draw_size(x,y,icon_id, aspect, miplevel, draw_size, nocreate);
+ icon_draw_size(x, y, icon_id, aspect, alpha, NULL, miplevel, draw_size, nocreate);
}
+void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect, float alpha)
+{
+ icon_draw_mipmap(x, y, icon_id, aspect, alpha, PREVIEW_MIPMAP_ZERO, 0);
+}
-void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect)
+void UI_icon_draw_aspect_color(float x, float y, int icon_id, float aspect, float *rgb)
{
- icon_draw_mipmap(x,y,icon_id, aspect, PREVIEW_MIPMAP_ZERO, 0);
+ int draw_size = preview_size(PREVIEW_MIPMAP_ZERO);
+ icon_draw_size(x, y, icon_id, aspect, 1.0f, rgb, PREVIEW_MIPMAP_ZERO, draw_size, 0);
}
void UI_icon_draw(float x, float y, int icon_id)
{
- UI_icon_draw_aspect(x, y, icon_id, 1.0f);
+ UI_icon_draw_aspect(x, y, icon_id, 1.0f, 1.0f);
}
-void UI_icon_draw_size_blended(float x, float y, int size, int icon_id, int shade)
+void UI_icon_draw_size(float x, float y, int size, int icon_id, float alpha)
{
- if(shade < 0) {
- float r= (128+shade)/128.0f;
- glPixelTransferf(GL_ALPHA_SCALE, r);
- }
-
- icon_draw_size(x,y,icon_id, 1.0f, 0, size, 1);
-
- if(shade < 0)
- glPixelTransferf(GL_ALPHA_SCALE, 1.0f);
+ icon_draw_size(x, y, icon_id, 1.0f, alpha, NULL, 0, size, 1);
}
void UI_icon_draw_preview(float x, float y, int icon_id, int nocreate)
{
- icon_draw_mipmap(x,y,icon_id, 1.0f, PREVIEW_MIPMAP_LARGE, nocreate);
+ icon_draw_mipmap(x, y, icon_id, 1.0f, 1.0f, PREVIEW_MIPMAP_LARGE, nocreate);
}
-void UI_icon_draw_aspect_blended(float x, float y, int icon_id, float aspect, int shade)
-{
- if(shade < 0) {
- float r= (128+shade)/128.0f;
- glPixelTransferf(GL_ALPHA_SCALE, r);
- }
-
- UI_icon_draw_aspect(x, y, icon_id, aspect);
-
- if(shade < 0)
- glPixelTransferf(GL_ALPHA_SCALE, 1.0f);
-}
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index d7b136cd661..57dc484f975 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -40,7 +40,7 @@
#include "BKE_utildefines.h"
#include "ED_screen.h"
-#include "ED_previewrender.h"
+#include "ED_render.h"
#include "RNA_access.h"
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index d9a6c50315a..007a57fb67a 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -697,7 +697,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
/* icons have been standardized... and this call draws in untransformed coordinates */
#define ICON_HEIGHT 16.0f
-static void widget_draw_icon(uiBut *but, BIFIconID icon, int blend, rcti *rect)
+static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, rcti *rect)
{
int xs=0, ys=0;
float aspect, height;
@@ -724,7 +724,7 @@ static void widget_draw_icon(uiBut *but, BIFIconID icon, int blend, rcti *rect)
if ELEM4(but->type, TOG, ROW, TOGN, LISTROW) {
if(but->flag & UI_SELECT);
else if(but->flag & UI_ACTIVE);
- else blend= -60;
+ else alpha= 0.5f;
}
glEnable(GL_BLEND);
@@ -757,14 +757,14 @@ static void widget_draw_icon(uiBut *but, BIFIconID icon, int blend, rcti *rect)
ys= (rect->ymin+rect->ymax- height)/2;
}
- UI_icon_draw_aspect_blended(xs, ys, icon, aspect, blend);
+ UI_icon_draw_aspect(xs, ys, icon, aspect, alpha);
}
if(but->flag & UI_ICON_SUBMENU) {
xs= rect->xmax-17;
ys= (rect->ymin+rect->ymax- height)/2;
- UI_icon_draw_aspect_blended(xs, ys, ICON_RIGHTARROW_THIN, aspect, blend);
+ UI_icon_draw_aspect(xs, ys, ICON_RIGHTARROW_THIN, aspect, alpha);
}
glDisable(GL_BLEND);
@@ -902,7 +902,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
/* check for button text label */
if (but->type == ICONTEXTROW) {
- widget_draw_icon(but, (BIFIconID) (but->icon+but->iconadd), 0, rect);
+ widget_draw_icon(but, (BIFIconID) (but->icon+but->iconadd), 1.0f, rect);
}
else {
@@ -913,14 +913,14 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
else if(but->pointype==INT)
dualset= BTST( *(((int *)but->poin)+1), but->bitnr);
- widget_draw_icon(but, ICON_DOT, dualset?0:-100, rect);
+ widget_draw_icon(but, ICON_DOT, dualset?1.0f:0.25f, rect);
}
/* If there's an icon too (made with uiDefIconTextBut) then draw the icon
and offset the text label to accomodate it */
if (but->flag & UI_HAS_ICON) {
- widget_draw_icon(but, but->icon+but->iconadd, 0, rect);
+ widget_draw_icon(but, but->icon+but->iconadd, 1.0f, rect);
rect->xmin += UI_icon_get_width(but->icon+but->iconadd);
@@ -2581,7 +2581,7 @@ void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, char *name, int iconid,
int xs= rect->xmin+4;
int ys= 1 + (rect->ymin+rect->ymax- ICON_HEIGHT)/2;
glEnable(GL_BLEND);
- UI_icon_draw_aspect_blended(xs, ys, iconid, 1.2f, 0); /* XXX scale weak get from fstyle? */
+ UI_icon_draw_aspect(xs, ys, iconid, 1.2f, 0.5f); /* XXX scale weak get from fstyle? */
glDisable(GL_BLEND);
}
}
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index 87c4560916d..c5499ef8f5d 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -175,5 +175,9 @@ void OBJECT_OT_game_property_remove(struct wmOperatorType *ot);
void OBJECT_OT_shape_key_add(struct wmOperatorType *ot);
void OBJECT_OT_shape_key_remove(struct wmOperatorType *ot);
+/* object_group.c */
+void OBJECT_OT_group_add(struct wmOperatorType *ot);
+void OBJECT_OT_group_remove(struct wmOperatorType *ot);
+
#endif /* ED_OBJECT_INTERN_H */
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index 7397cead505..3f975d1e807 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -176,6 +176,9 @@ void ED_operatortypes_object(void)
WM_operatortype_append(LATTICE_OT_select_all_toggle);
WM_operatortype_append(LATTICE_OT_make_regular);
+
+ WM_operatortype_append(OBJECT_OT_group_add);
+ WM_operatortype_append(OBJECT_OT_group_remove);
/* macros */
ot= WM_operatortype_append_macro("OBJECT_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
diff --git a/source/blender/editors/physics/physics_boids.c b/source/blender/editors/physics/particle_boids.c
index 148359068ad..47d073e2dbb 100644
--- a/source/blender/editors/physics/physics_boids.c
+++ b/source/blender/editors/physics/particle_boids.c
@@ -25,35 +25,21 @@
* ***** END GPL LICENSE BLOCK *****
*/
-//#include <stdlib.h>
-//#include <string.h>
-//
+#include <stdlib.h>
+
#include "MEM_guardedalloc.h"
#include "DNA_boid_types.h"
#include "DNA_particle_types.h"
-//#include "DNA_curve_types.h"
#include "DNA_object_types.h"
-//#include "DNA_material_types.h"
-//#include "DNA_texture_types.h"
#include "DNA_scene_types.h"
-//#include "DNA_world_types.h"
#include "BKE_boids.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
-//#include "BKE_font.h"
-//#include "BKE_library.h"
-//#include "BKE_main.h"
-//#include "BKE_material.h"
#include "BKE_particle.h"
-//#include "BKE_texture.h"
-//#include "BKE_utildefines.h"
-//#include "BKE_world.h"
-//#include "BLI_editVert.h"
#include "BLI_listbase.h"
-//
#include "RNA_access.h"
#include "RNA_enum_types.h"
#include "RNA_define.h"
@@ -61,13 +47,10 @@
#include "WM_api.h"
#include "WM_types.h"
-//#include "ED_curve.h"
-//#include "ED_mesh.h"
-//
-//#include "buttons_intern.h" // own include
+#include "physics_intern.h"
/************************ add/del boid rule operators *********************/
-static int boidrule_add_exec(bContext *C, wmOperator *op)
+static int rule_add_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
@@ -101,23 +84,23 @@ static int boidrule_add_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void BOID_OT_boidrule_add(wmOperatorType *ot)
+void BOID_OT_rule_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Boid Rule";
ot->description = "Add a boid rule to the current boid state.";
- ot->idname= "BOID_OT_boidrule_add";
+ ot->idname= "BOID_OT_rule_add";
/* api callbacks */
ot->invoke= WM_menu_invoke;
- ot->exec= boidrule_add_exec;
+ ot->exec= rule_add_exec;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "type", boidrule_type_items, 0, "Type", "");
}
-static int boidrule_del_exec(bContext *C, wmOperator *op)
+static int rule_del_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
@@ -153,21 +136,21 @@ static int boidrule_del_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void BOID_OT_boidrule_del(wmOperatorType *ot)
+void BOID_OT_rule_del(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Remove Boid Rule";
- ot->idname= "BOID_OT_boidrule_del";
+ ot->idname= "BOID_OT_rule_del";
/* api callbacks */
- ot->exec= boidrule_del_exec;
+ ot->exec= rule_del_exec;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ move up/down boid rule operators *********************/
-static int boidrule_move_up_exec(bContext *C, wmOperator *op)
+static int rule_move_up_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
@@ -194,19 +177,19 @@ static int boidrule_move_up_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void BOID_OT_boidrule_move_up(wmOperatorType *ot)
+void BOID_OT_rule_move_up(wmOperatorType *ot)
{
ot->name= "Move Up Boid Rule";
ot->description= "Move boid rule up in the list.";
- ot->idname= "BOID_OT_boidrule_move_up";
+ ot->idname= "BOID_OT_rule_move_up";
- ot->exec= boidrule_move_up_exec;
+ ot->exec= rule_move_up_exec;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-static int boidrule_move_down_exec(bContext *C, wmOperator *op)
+static int rule_move_down_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
@@ -233,13 +216,13 @@ static int boidrule_move_down_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void BOID_OT_boidrule_move_down(wmOperatorType *ot)
+void BOID_OT_rule_move_down(wmOperatorType *ot)
{
ot->name= "Move Down Boid Rule";
ot->description= "Move boid rule down in the list.";
- ot->idname= "BOID_OT_boidrule_move_down";
+ ot->idname= "BOID_OT_rule_move_down";
- ot->exec= boidrule_move_down_exec;
+ ot->exec= rule_move_down_exec;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -247,7 +230,7 @@ void BOID_OT_boidrule_move_down(wmOperatorType *ot)
/************************ add/del boid state operators *********************/
-static int boidstate_add_exec(bContext *C, wmOperator *op)
+static int state_add_exec(bContext *C, wmOperator *op)
{
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
ParticleSystem *psys= ptr.data;
@@ -273,20 +256,20 @@ static int boidstate_add_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void BOID_OT_boidstate_add(wmOperatorType *ot)
+void BOID_OT_state_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Boid State";
ot->description = "Add a boid state to the particle system.";
- ot->idname= "BOID_OT_boidstate_add";
+ ot->idname= "BOID_OT_state_add";
/* api callbacks */
- ot->exec= boidstate_add_exec;
+ ot->exec= state_add_exec;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-static int boidstate_del_exec(bContext *C, wmOperator *op)
+static int state_del_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
@@ -327,21 +310,21 @@ static int boidstate_del_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void BOID_OT_boidstate_del(wmOperatorType *ot)
+void BOID_OT_state_del(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Remove Boid State";
- ot->idname= "BOID_OT_boidstate_del";
+ ot->idname= "BOID_OT_state_del";
/* api callbacks */
- ot->exec= boidstate_del_exec;
+ ot->exec= state_del_exec;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
/************************ move up/down boid state operators *********************/
-static int boidstate_move_up_exec(bContext *C, wmOperator *op)
+static int state_move_up_exec(bContext *C, wmOperator *op)
{
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
ParticleSystem *psys= ptr.data;
@@ -366,19 +349,19 @@ static int boidstate_move_up_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void BOID_OT_boidstate_move_up(wmOperatorType *ot)
+void BOID_OT_state_move_up(wmOperatorType *ot)
{
ot->name= "Move Up Boid State";
ot->description= "Move boid state up in the list.";
- ot->idname= "BOID_OT_boidstate_move_up";
+ ot->idname= "BOID_OT_state_move_up";
- ot->exec= boidstate_move_up_exec;
+ ot->exec= state_move_up_exec;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-static int boidstate_move_down_exec(bContext *C, wmOperator *op)
+static int state_move_down_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
@@ -403,28 +386,15 @@ static int boidstate_move_down_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void BOID_OT_boidstate_move_down(wmOperatorType *ot)
+void BOID_OT_state_move_down(wmOperatorType *ot)
{
ot->name= "Move Down Boid State";
ot->description= "Move boid state down in the list.";
- ot->idname= "BOID_OT_boidstate_move_down";
+ ot->idname= "BOID_OT_state_move_down";
- ot->exec= boidstate_move_down_exec;
+ ot->exec= state_move_down_exec;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-/*******************************************************************************/
-void ED_operatortypes_boids(void)
-{
- WM_operatortype_append(BOID_OT_boidrule_add);
- WM_operatortype_append(BOID_OT_boidrule_del);
- WM_operatortype_append(BOID_OT_boidrule_move_up);
- WM_operatortype_append(BOID_OT_boidrule_move_down);
-
- WM_operatortype_append(BOID_OT_boidstate_add);
- WM_operatortype_append(BOID_OT_boidstate_del);
- WM_operatortype_append(BOID_OT_boidstate_move_up);
- WM_operatortype_append(BOID_OT_boidstate_move_down);
-}
diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/particle_edit.c
index a5e169eba06..3478d63f67e 100644
--- a/source/blender/editors/physics/editparticle.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -106,7 +106,7 @@ static void PTCacheUndo_clear(PTCacheEdit *edit);
/**************************** utilities *******************************/
-static int PE_poll(bContext *C)
+int PE_poll(bContext *C)
{
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
@@ -120,7 +120,7 @@ static int PE_poll(bContext *C)
return (edit && (ob->mode & OB_MODE_PARTICLE_EDIT));
}
-static int PE_hair_poll(bContext *C)
+int PE_hair_poll(bContext *C)
{
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
@@ -134,7 +134,7 @@ static int PE_hair_poll(bContext *C)
return (edit && edit->psys && (ob->mode & OB_MODE_PARTICLE_EDIT));
}
-static int PE_poll_3dview(bContext *C)
+int PE_poll_3dview(bContext *C)
{
return PE_poll(C) && CTX_wm_area(C)->spacetype == SPACE_VIEW3D &&
CTX_wm_region(C)->regiontype == RGN_TYPE_WINDOW;
@@ -3948,61 +3948,3 @@ void PARTICLE_OT_specials_menu(wmOperatorType *ot)
ot->poll= PE_hair_poll;
}
-/**************************** registration **********************************/
-
-void ED_operatortypes_particle(void)
-{
- WM_operatortype_append(PARTICLE_OT_select_all_toggle);
- WM_operatortype_append(PARTICLE_OT_select_first);
- WM_operatortype_append(PARTICLE_OT_select_last);
- WM_operatortype_append(PARTICLE_OT_select_linked);
- WM_operatortype_append(PARTICLE_OT_select_less);
- WM_operatortype_append(PARTICLE_OT_select_more);
-
- WM_operatortype_append(PARTICLE_OT_hide);
- WM_operatortype_append(PARTICLE_OT_reveal);
-
- WM_operatortype_append(PARTICLE_OT_rekey);
- WM_operatortype_append(PARTICLE_OT_subdivide);
- WM_operatortype_append(PARTICLE_OT_remove_doubles);
- WM_operatortype_append(PARTICLE_OT_delete);
- WM_operatortype_append(PARTICLE_OT_mirror);
-
- WM_operatortype_append(PARTICLE_OT_brush_set);
- WM_operatortype_append(PARTICLE_OT_brush_edit);
- WM_operatortype_append(PARTICLE_OT_brush_radial_control);
-
- WM_operatortype_append(PARTICLE_OT_specials_menu);
-
- WM_operatortype_append(PARTICLE_OT_particle_edit_toggle);
- WM_operatortype_append(PARTICLE_OT_edited_clear);
-}
-
-void ED_keymap_particle(wmWindowManager *wm)
-{
- wmKeyMap *keymap;
-
- keymap= WM_keymap_find(wm, "Particle", 0, 0);
- keymap->poll= PE_poll;
-
- WM_keymap_add_item(keymap, "PARTICLE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
- WM_keymap_add_item(keymap, "PARTICLE_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_add_item(keymap, "PARTICLE_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
- WM_keymap_add_item(keymap, "PARTICLE_OT_select_linked", LKEY, KM_PRESS, 0, 0);
- RNA_boolean_set(WM_keymap_add_item(keymap, "PARTICLE_OT_select_linked", LKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "deselect", 1);
-
- WM_keymap_add_item(keymap, "PARTICLE_OT_delete", XKEY, KM_PRESS, 0, 0);
- WM_keymap_add_item(keymap, "PARTICLE_OT_delete", DELKEY, KM_PRESS, 0, 0);
-
- WM_keymap_add_item(keymap, "PARTICLE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
- WM_keymap_add_item(keymap, "PARTICLE_OT_hide", HKEY, KM_PRESS, 0, 0);
- RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
-
- WM_keymap_add_item(keymap, "PARTICLE_OT_brush_edit", ACTIONMOUSE, KM_PRESS, 0, 0);
- WM_keymap_add_item(keymap, "PARTICLE_OT_brush_edit", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0);
- RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_brush_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
- RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_brush_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
-
- WM_keymap_add_item(keymap, "PARTICLE_OT_specials_menu", WKEY, KM_PRESS, 0, 0);
-}
-
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
new file mode 100644
index 00000000000..cef630b6711
--- /dev/null
+++ b/source/blender/editors/physics/particle_object.c
@@ -0,0 +1,575 @@
+/**
+ * $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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_meshdata_types.h"
+#include "DNA_modifier_types.h"
+#include "DNA_object_types.h"
+#include "DNA_particle_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "BLI_arithb.h"
+#include "BLI_listbase.h"
+
+#include "BKE_context.h"
+#include "BKE_depsgraph.h"
+#include "BKE_DerivedMesh.h"
+#include "BKE_cdderivedmesh.h"
+#include "BKE_main.h"
+#include "BKE_particle.h"
+#include "BKE_pointcache.h"
+#include "BKE_utildefines.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_particle.h"
+
+#include "physics_intern.h"
+
+/********************** particle system slot operators *********************/
+
+static int particle_system_add_exec(bContext *C, wmOperator *op)
+{
+ Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Scene *scene = CTX_data_scene(C);
+
+ if(!scene || !ob)
+ return OPERATOR_CANCELLED;
+
+ object_add_particle_system(scene, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+
+ return OPERATOR_FINISHED;
+}
+
+void OBJECT_OT_particle_system_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Particle System Slot";
+ ot->idname= "OBJECT_OT_particle_system_add";
+ ot->description="Add a particle system.";
+
+ /* api callbacks */
+ ot->exec= particle_system_add_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int particle_system_remove_exec(bContext *C, wmOperator *op)
+{
+ Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Scene *scene = CTX_data_scene(C);
+
+ if(!scene || !ob)
+ return OPERATOR_CANCELLED;
+
+ object_remove_particle_system(scene, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+
+ return OPERATOR_FINISHED;
+}
+
+void OBJECT_OT_particle_system_remove(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Remove Particle System Slot";
+ ot->idname= "OBJECT_OT_particle_system_remove";
+ ot->description="Remove the selected particle system.";
+
+ /* api callbacks */
+ ot->exec= particle_system_remove_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/********************** new particle settings operator *********************/
+
+static int psys_poll(bContext *C)
+{
+ PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
+ return (ptr.data != NULL);
+}
+
+static int new_particle_settings_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene = CTX_data_scene(C);
+ Main *bmain= CTX_data_main(C);
+ ParticleSystem *psys;
+ ParticleSettings *part = NULL;
+ Object *ob;
+ PointerRNA ptr;
+
+ ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
+
+ psys = ptr.data;
+
+ /* add or copy particle setting */
+ if(psys->part)
+ part= psys_copy_settings(psys->part);
+ else
+ part= psys_new_settings("ParticleSettings", bmain);
+
+ ob= ptr.id.data;
+
+ if(psys->part)
+ psys->part->id.us--;
+
+ psys->part = part;
+
+ psys_check_boid_data(psys);
+
+ DAG_scene_sort(scene);
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+
+ return OPERATOR_FINISHED;
+}
+
+void PARTICLE_OT_new(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "New Particle Settings";
+ ot->idname= "PARTICLE_OT_new";
+ ot->description="Add new particle settings.";
+
+ /* api callbacks */
+ ot->exec= new_particle_settings_exec;
+ ot->poll= psys_poll;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/********************** keyed particle target operators *********************/
+
+static int new_particle_target_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene = CTX_data_scene(C);
+ PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
+ ParticleSystem *psys= ptr.data;
+ Object *ob = ptr.id.data;
+
+ ParticleTarget *pt;
+
+ if(!psys)
+ return OPERATOR_CANCELLED;
+
+ pt = psys->targets.first;
+ for(; pt; pt=pt->next)
+ pt->flag &= ~PTARGET_CURRENT;
+
+ pt = MEM_callocN(sizeof(ParticleTarget), "keyed particle target");
+
+ pt->flag |= PTARGET_CURRENT;
+ pt->psys = 1;
+
+ BLI_addtail(&psys->targets, pt);
+
+ DAG_scene_sort(scene);
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+
+ return OPERATOR_FINISHED;
+}
+
+void PARTICLE_OT_new_target(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "New Particle Target";
+ ot->idname= "PARTICLE_OT_new_target";
+ ot->description="Add a new particle target.";
+
+ /* api callbacks */
+ ot->exec= new_particle_target_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int remove_particle_target_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene = CTX_data_scene(C);
+ PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
+ ParticleSystem *psys= ptr.data;
+ Object *ob = ptr.id.data;
+
+ ParticleTarget *pt;
+
+ if(!psys)
+ return OPERATOR_CANCELLED;
+
+ pt = psys->targets.first;
+ for(; pt; pt=pt->next) {
+ if(pt->flag & PTARGET_CURRENT) {
+ BLI_remlink(&psys->targets, pt);
+ MEM_freeN(pt);
+ break;
+ }
+
+ }
+ pt = psys->targets.last;
+
+ if(pt)
+ pt->flag |= PTARGET_CURRENT;
+
+ DAG_scene_sort(scene);
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+
+ return OPERATOR_FINISHED;
+}
+
+void PARTICLE_OT_remove_target(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Remove Particle Target";
+ ot->idname= "PARTICLE_OT_remove_target";
+ ot->description="Remove the selected particle target.";
+
+ /* api callbacks */
+ ot->exec= remove_particle_target_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/************************ move up particle target operator *********************/
+
+static int target_move_up_exec(bContext *C, wmOperator *op)
+{
+ PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
+ ParticleSystem *psys= ptr.data;
+ Object *ob = ptr.id.data;
+ ParticleTarget *pt;
+
+ if(!psys)
+ return OPERATOR_CANCELLED;
+
+ pt = psys->targets.first;
+ for(; pt; pt=pt->next) {
+ if(pt->flag & PTARGET_CURRENT && pt->prev) {
+ BLI_remlink(&psys->targets, pt);
+ BLI_insertlink(&psys->targets, pt->prev->prev, pt);
+
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ break;
+ }
+ }
+
+ return OPERATOR_FINISHED;
+}
+
+void PARTICLE_OT_target_move_up(wmOperatorType *ot)
+{
+ ot->name= "Move Up Target";
+ ot->idname= "PARTICLE_OT_target_move_up";
+ ot->description= "Move particle target up in the list.";
+
+ ot->exec= target_move_up_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/************************ move down particle target operator *********************/
+
+static int target_move_down_exec(bContext *C, wmOperator *op)
+{
+ PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
+ ParticleSystem *psys= ptr.data;
+ Object *ob = ptr.id.data;
+ ParticleTarget *pt;
+
+ if(!psys)
+ return OPERATOR_CANCELLED;
+ pt = psys->targets.first;
+ for(; pt; pt=pt->next) {
+ if(pt->flag & PTARGET_CURRENT && pt->next) {
+ BLI_remlink(&psys->targets, pt);
+ BLI_insertlink(&psys->targets, pt->next, pt);
+
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ break;
+ }
+ }
+
+ return OPERATOR_FINISHED;
+}
+
+void PARTICLE_OT_target_move_down(wmOperatorType *ot)
+{
+ ot->name= "Move Down Target";
+ ot->idname= "PARTICLE_OT_target_move_down";
+ ot->description= "Move particle target down in the list.";
+
+ ot->exec= target_move_down_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/************************ connect/disconnect hair operators *********************/
+
+static void disconnect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
+{
+ ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys);
+ ParticleData *pa;
+ PTCacheEdit *edit;
+ PTCacheEditPoint *point;
+ PTCacheEditKey *ekey = NULL;
+ HairKey *key;
+ int i, k;
+ float hairmat[4][4];
+
+ if(!ob || !psys || psys->flag & PSYS_GLOBAL_HAIR)
+ return;
+
+ if(!psys->part || psys->part->type != PART_HAIR)
+ return;
+
+ edit = psys->edit;
+ point= edit ? edit->points : NULL;
+
+ for(i=0, pa=psys->particles; i<psys->totpart; i++,pa++) {
+ if(point) {
+ ekey = point->keys;
+ point++;
+ }
+
+ psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
+
+ for(k=0,key=pa->hair; k<pa->totkey; k++,key++) {
+ Mat4MulVecfl(hairmat,key->co);
+
+ if(ekey) {
+ ekey->flag &= ~PEK_USE_WCO;
+ ekey++;
+ }
+ }
+ }
+
+ psys_free_path_cache(psys, psys->edit);
+
+ psys->flag |= PSYS_GLOBAL_HAIR;
+
+ PE_update_object(scene, ob, 0);
+}
+
+static int disconnect_hair_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+ Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
+ ParticleSystem *psys= NULL;
+ int all = RNA_boolean_get(op->ptr, "all");
+
+ if(!ob)
+ return OPERATOR_CANCELLED;
+
+ if(all) {
+ for(psys=ob->particlesystem.first; psys; psys=psys->next) {
+ disconnect_hair(scene, ob, psys);
+ }
+ }
+ else {
+ psys = ptr.data;
+ disconnect_hair(scene, ob, psys);
+ }
+
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+
+ return OPERATOR_FINISHED;
+}
+
+void PARTICLE_OT_disconnect_hair(wmOperatorType *ot)
+{
+ ot->name= "Disconnect Hair";
+ ot->description= "Disconnect hair from the emitter mesh.";
+ ot->idname= "PARTICLE_OT_disconnect_hair";
+
+ ot->exec= disconnect_hair_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_boolean(ot->srna, "all", 0, "All hair", "Disconnect all hair systems from the emitter mesh");
+}
+
+static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
+{
+ ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys);
+ ParticleData *pa;
+ PTCacheEdit *edit;
+ PTCacheEditPoint *point;
+ PTCacheEditKey *ekey;
+ HairKey *key;
+ BVHTreeFromMesh bvhtree;
+ BVHTreeNearest nearest;
+ MFace *mface;
+ DerivedMesh *dm = NULL;
+ int numverts;
+ int i, k;
+ float hairmat[4][4], imat[4][4];
+ float v[4][3], vec[3];
+
+ if(!psys || !psys->part || psys->part->type != PART_HAIR)
+ return;
+
+ edit= psys->edit;
+ point= edit ? edit->points : NULL;
+
+ if(psmd->dm->deformedOnly)
+ dm= psmd->dm;
+ else
+ dm= mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
+
+ numverts = dm->getNumVerts (dm);
+
+ memset( &bvhtree, 0, sizeof(bvhtree) );
+
+ /* convert to global coordinates */
+ for (i=0; i<numverts; i++)
+ Mat4MulVecfl (ob->obmat, CDDM_get_vert(dm, i)->co);
+
+ bvhtree_from_mesh_faces(&bvhtree, dm, 0.0, 2, 6);
+
+ for(i=0, pa= psys->particles; i<psys->totpart; i++,pa++) {
+ key = pa->hair;
+
+ nearest.index = -1;
+ nearest.dist = FLT_MAX;
+
+ BLI_bvhtree_find_nearest(bvhtree.tree, key->co, &nearest, bvhtree.nearest_callback, &bvhtree);
+
+ if(nearest.index == -1) {
+ printf("No nearest point found for hair root!");
+ continue;
+ }
+
+ mface = CDDM_get_face(dm,nearest.index);
+
+ VecCopyf(v[0], CDDM_get_vert(dm,mface->v1)->co);
+ VecCopyf(v[1], CDDM_get_vert(dm,mface->v2)->co);
+ VecCopyf(v[2], CDDM_get_vert(dm,mface->v3)->co);
+ if(mface->v4) {
+ VecCopyf(v[3], CDDM_get_vert(dm,mface->v4)->co);
+ MeanValueWeights(v, 4, nearest.co, pa->fuv);
+ }
+ else
+ MeanValueWeights(v, 3, nearest.co, pa->fuv);
+
+ pa->num = nearest.index;
+ pa->num_dmcache = psys_particle_dm_face_lookup(ob,psmd->dm,pa->num,pa->fuv,NULL);
+
+ psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
+ Mat4Invert(imat,hairmat);
+
+ VECSUB(vec, nearest.co, key->co);
+
+ if(point) {
+ ekey = point->keys;
+ point++;
+ }
+
+ for(k=0,key=pa->hair; k<pa->totkey; k++,key++) {
+ VECADD(key->co, key->co, vec);
+ Mat4MulVecfl(imat,key->co);
+
+ if(ekey) {
+ ekey->flag |= PEK_USE_WCO;
+ ekey++;
+ }
+ }
+ }
+
+ free_bvhtree_from_mesh(&bvhtree);
+ if(!psmd->dm->deformedOnly)
+ dm->release(dm);
+
+ psys_free_path_cache(psys, psys->edit);
+
+ psys->flag &= ~PSYS_GLOBAL_HAIR;
+
+ PE_update_object(scene, ob, 0);
+}
+
+static int connect_hair_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+ Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
+ ParticleSystem *psys= NULL;
+ int all = RNA_boolean_get(op->ptr, "all");
+
+ if(!ob)
+ return OPERATOR_CANCELLED;
+
+ if(all) {
+ for(psys=ob->particlesystem.first; psys; psys=psys->next) {
+ connect_hair(scene, ob, psys);
+ }
+ }
+ else {
+ psys = ptr.data;
+ connect_hair(scene, ob, psys);
+ }
+
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+
+ return OPERATOR_FINISHED;
+}
+
+void PARTICLE_OT_connect_hair(wmOperatorType *ot)
+{
+ ot->name= "Connect Hair";
+ ot->description= "Connect hair to the emitter mesh.";
+ ot->idname= "PARTICLE_OT_connect_hair";
+
+ ot->exec= connect_hair_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_boolean(ot->srna, "all", 0, "All hair", "Connect all hair systems to the emitter mesh");
+}
+
diff --git a/source/blender/editors/physics/ed_fluidsim.c b/source/blender/editors/physics/physics_fluid.c
index 093fa3f0a49..126c21a554b 100644
--- a/source/blender/editors/physics/ed_fluidsim.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -93,6 +93,8 @@
#include "WM_api.h"
#include "WM_types.h"
+#include "physics_intern.h" // own include
+
/* enable/disable overall compilation */
#ifndef DISABLE_ELBEEM
@@ -1200,8 +1202,3 @@ void FLUID_OT_bake(wmOperatorType *ot)
ot->poll= ED_operator_object_active;
}
-void ED_operatortypes_fluid(void)
-{
- WM_operatortype_append(FLUID_OT_bake);
-}
-
diff --git a/source/blender/editors/physics/physics_intern.h b/source/blender/editors/physics/physics_intern.h
index e03649575cb..956f26c478d 100644
--- a/source/blender/editors/physics/physics_intern.h
+++ b/source/blender/editors/physics/physics_intern.h
@@ -33,6 +33,72 @@
#ifndef ED_PHYSICS_INTERN_H
#define ED_PHYSICS_INTERN_H
+struct wmOperatorType;
+
+/* particle_edit.c */
+int PE_poll(struct bContext *C);
+int PE_hair_poll(struct bContext *C);
+int PE_poll_3dview(struct bContext *C);
+
+void PARTICLE_OT_select_all_toggle(struct wmOperatorType *ot);
+void PARTICLE_OT_select_first(struct wmOperatorType *ot);
+void PARTICLE_OT_select_last(struct wmOperatorType *ot);
+void PARTICLE_OT_select_linked(struct wmOperatorType *ot);
+void PARTICLE_OT_select_less(struct wmOperatorType *ot);
+void PARTICLE_OT_select_more(struct wmOperatorType *ot);
+
+void PARTICLE_OT_hide(struct wmOperatorType *ot);
+void PARTICLE_OT_reveal(struct wmOperatorType *ot);
+
+void PARTICLE_OT_rekey(struct wmOperatorType *ot);
+void PARTICLE_OT_subdivide(struct wmOperatorType *ot);
+void PARTICLE_OT_remove_doubles(struct wmOperatorType *ot);
+void PARTICLE_OT_delete(struct wmOperatorType *ot);
+void PARTICLE_OT_mirror(struct wmOperatorType *ot);
+
+void PARTICLE_OT_brush_set(struct wmOperatorType *ot);
+void PARTICLE_OT_brush_edit(struct wmOperatorType *ot);
+void PARTICLE_OT_brush_radial_control(struct wmOperatorType *ot);
+
+void PARTICLE_OT_specials_menu(struct wmOperatorType *ot);
+
+void PARTICLE_OT_particle_edit_toggle(struct wmOperatorType *ot);
+void PARTICLE_OT_edited_clear(struct wmOperatorType *ot);
+
+/* particle_object.c */
+void OBJECT_OT_particle_system_add(struct wmOperatorType *ot);
+void OBJECT_OT_particle_system_remove(struct wmOperatorType *ot);
+
+void PARTICLE_OT_new(struct wmOperatorType *ot);
+void PARTICLE_OT_new_target(struct wmOperatorType *ot);
+void PARTICLE_OT_remove_target(struct wmOperatorType *ot);
+void PARTICLE_OT_target_move_up(struct wmOperatorType *ot);
+void PARTICLE_OT_target_move_down(struct wmOperatorType *ot);
+void PARTICLE_OT_connect_hair(struct wmOperatorType *ot);
+void PARTICLE_OT_disconnect_hair(struct wmOperatorType *ot);
+
+/* particle_boids.c */
+void BOID_OT_rule_add(struct wmOperatorType *ot);
+void BOID_OT_rule_del(struct wmOperatorType *ot);
+void BOID_OT_rule_move_up(struct wmOperatorType *ot);
+void BOID_OT_rule_move_down(struct wmOperatorType *ot);
+
+void BOID_OT_state_add(struct wmOperatorType *ot);
+void BOID_OT_state_del(struct wmOperatorType *ot);
+void BOID_OT_state_move_up(struct wmOperatorType *ot);
+void BOID_OT_state_move_down(struct wmOperatorType *ot);
+
+/* physics_fluid.c */
+void FLUID_OT_bake(struct wmOperatorType *ot);
+
+/* physics_pointcache.c */
+void PTCACHE_OT_bake_all(struct wmOperatorType *ot);
+void PTCACHE_OT_free_bake_all(struct wmOperatorType *ot);
+void PTCACHE_OT_bake(struct wmOperatorType *ot);
+void PTCACHE_OT_free_bake(struct wmOperatorType *ot);
+void PTCACHE_OT_bake_from_cache(struct wmOperatorType *ot);
+void PTCACHE_OT_add_new(struct wmOperatorType *ot);
+void PTCACHE_OT_remove(struct wmOperatorType *ot);
#endif /* ED_PHYSICS_INTERN_H */
diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c
new file mode 100644
index 00000000000..a62d3d8fd78
--- /dev/null
+++ b/source/blender/editors/physics/physics_ops.c
@@ -0,0 +1,173 @@
+/**
+ * $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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "DNA_windowmanager_types.h"
+
+#include "RNA_access.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_physics.h"
+
+#include "physics_intern.h" // own include
+
+/***************************** particles ***********************************/
+
+static void operatortypes_particle(void)
+{
+ WM_operatortype_append(PARTICLE_OT_select_all_toggle);
+ WM_operatortype_append(PARTICLE_OT_select_first);
+ WM_operatortype_append(PARTICLE_OT_select_last);
+ WM_operatortype_append(PARTICLE_OT_select_linked);
+ WM_operatortype_append(PARTICLE_OT_select_less);
+ WM_operatortype_append(PARTICLE_OT_select_more);
+
+ WM_operatortype_append(PARTICLE_OT_hide);
+ WM_operatortype_append(PARTICLE_OT_reveal);
+
+ WM_operatortype_append(PARTICLE_OT_rekey);
+ WM_operatortype_append(PARTICLE_OT_subdivide);
+ WM_operatortype_append(PARTICLE_OT_remove_doubles);
+ WM_operatortype_append(PARTICLE_OT_delete);
+ WM_operatortype_append(PARTICLE_OT_mirror);
+
+ WM_operatortype_append(PARTICLE_OT_brush_set);
+ WM_operatortype_append(PARTICLE_OT_brush_edit);
+ WM_operatortype_append(PARTICLE_OT_brush_radial_control);
+
+ WM_operatortype_append(PARTICLE_OT_specials_menu);
+
+ WM_operatortype_append(PARTICLE_OT_particle_edit_toggle);
+ WM_operatortype_append(PARTICLE_OT_edited_clear);
+
+
+ WM_operatortype_append(OBJECT_OT_particle_system_add);
+ WM_operatortype_append(OBJECT_OT_particle_system_remove);
+
+ WM_operatortype_append(PARTICLE_OT_new);
+ WM_operatortype_append(PARTICLE_OT_new_target);
+ WM_operatortype_append(PARTICLE_OT_remove_target);
+ WM_operatortype_append(PARTICLE_OT_target_move_up);
+ WM_operatortype_append(PARTICLE_OT_target_move_down);
+ WM_operatortype_append(PARTICLE_OT_connect_hair);
+ WM_operatortype_append(PARTICLE_OT_disconnect_hair);
+}
+
+static void keymap_particle(wmWindowManager *wm)
+{
+ wmKeyMap *keymap;
+
+ keymap= WM_keymap_find(wm, "Particle", 0, 0);
+ keymap->poll= PE_poll;
+
+ WM_keymap_add_item(keymap, "PARTICLE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "PARTICLE_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "PARTICLE_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "PARTICLE_OT_select_linked", LKEY, KM_PRESS, 0, 0);
+ RNA_boolean_set(WM_keymap_add_item(keymap, "PARTICLE_OT_select_linked", LKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "deselect", 1);
+
+ WM_keymap_add_item(keymap, "PARTICLE_OT_delete", XKEY, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "PARTICLE_OT_delete", DELKEY, KM_PRESS, 0, 0);
+
+ WM_keymap_add_item(keymap, "PARTICLE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
+ WM_keymap_add_item(keymap, "PARTICLE_OT_hide", HKEY, KM_PRESS, 0, 0);
+ RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
+
+ WM_keymap_add_item(keymap, "PARTICLE_OT_brush_edit", ACTIONMOUSE, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "PARTICLE_OT_brush_edit", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0);
+ RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_brush_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
+ RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_brush_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
+
+ WM_keymap_add_item(keymap, "PARTICLE_OT_specials_menu", WKEY, KM_PRESS, 0, 0);
+}
+
+/******************************* boids *************************************/
+
+static void operatortypes_boids(void)
+{
+ WM_operatortype_append(BOID_OT_rule_add);
+ WM_operatortype_append(BOID_OT_rule_del);
+ WM_operatortype_append(BOID_OT_rule_move_up);
+ WM_operatortype_append(BOID_OT_rule_move_down);
+
+ WM_operatortype_append(BOID_OT_state_add);
+ WM_operatortype_append(BOID_OT_state_del);
+ WM_operatortype_append(BOID_OT_state_move_up);
+ WM_operatortype_append(BOID_OT_state_move_down);
+}
+
+/********************************* fluid ***********************************/
+
+static void operatortypes_fluid(void)
+{
+ WM_operatortype_append(FLUID_OT_bake);
+}
+
+/**************************** point cache **********************************/
+
+static void operatortypes_pointcache(void)
+{
+ WM_operatortype_append(PTCACHE_OT_bake_all);
+ WM_operatortype_append(PTCACHE_OT_free_bake_all);
+ WM_operatortype_append(PTCACHE_OT_bake);
+ WM_operatortype_append(PTCACHE_OT_free_bake);
+ WM_operatortype_append(PTCACHE_OT_bake_from_cache);
+ WM_operatortype_append(PTCACHE_OT_add_new);
+ WM_operatortype_append(PTCACHE_OT_remove);
+}
+
+//static void keymap_pointcache(wmWindowManager *wm)
+//{
+// wmKeyMap *keymap= WM_keymap_find(wm, "Pointcache", 0, 0);
+//
+// WM_keymap_add_item(keymap, "PHYSICS_OT_bake_all", AKEY, KM_PRESS, 0, 0);
+// WM_keymap_add_item(keymap, "PHYSICS_OT_free_all", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
+// WM_keymap_add_item(keymap, "PHYSICS_OT_bake_particle_system", PADMINUS, KM_PRESS, KM_CTRL, 0);
+// WM_keymap_add_item(keymap, "PHYSICS_OT_free_particle_system", LKEY, KM_PRESS, 0, 0);
+//}
+
+/****************************** general ************************************/
+
+void ED_operatortypes_physics(void)
+{
+ operatortypes_particle();
+ operatortypes_boids();
+ operatortypes_fluid();
+ operatortypes_pointcache();
+}
+
+void ED_keymap_physics(wmWindowManager *wm)
+{
+ keymap_particle(wm);
+ //keymap_pointcache(wm);
+}
+
+
+
diff --git a/source/blender/editors/physics/ed_pointcache.c b/source/blender/editors/physics/physics_pointcache.c
index ed3aaf0cfd1..26099a18966 100644
--- a/source/blender/editors/physics/ed_pointcache.c
+++ b/source/blender/editors/physics/physics_pointcache.c
@@ -27,6 +27,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <stdlib.h>
+
#include "MEM_guardedalloc.h"
#include "DNA_scene_types.h"
@@ -332,26 +334,4 @@ void PTCACHE_OT_remove(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-/**************************** registration **********************************/
-
-void ED_operatortypes_pointcache(void)
-{
- WM_operatortype_append(PTCACHE_OT_bake_all);
- WM_operatortype_append(PTCACHE_OT_free_bake_all);
- WM_operatortype_append(PTCACHE_OT_bake);
- WM_operatortype_append(PTCACHE_OT_free_bake);
- WM_operatortype_append(PTCACHE_OT_bake_from_cache);
- WM_operatortype_append(PTCACHE_OT_add_new);
- WM_operatortype_append(PTCACHE_OT_remove);
-}
-
-//void ED_keymap_pointcache(wmWindowManager *wm)
-//{
-// wmKeyMap *keymap= WM_keymap_find(wm, "Pointcache", 0, 0);
-//
-// WM_keymap_add_item(keymap, "PHYSICS_OT_bake_all", AKEY, KM_PRESS, 0, 0);
-// WM_keymap_add_item(keymap, "PHYSICS_OT_free_all", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
-// WM_keymap_add_item(keymap, "PHYSICS_OT_bake_particle_system", PADMINUS, KM_PRESS, KM_CTRL, 0);
-// WM_keymap_add_item(keymap, "PHYSICS_OT_free_particle_system", LKEY, KM_PRESS, 0, 0);
-//}
diff --git a/source/blender/editors/preview/Makefile b/source/blender/editors/render/Makefile
index 48e1dc64673..ed25f0be02a 100644
--- a/source/blender/editors/preview/Makefile
+++ b/source/blender/editors/render/Makefile
@@ -28,7 +28,7 @@
#
# Makes module object directory and bounces make to subdirectories.
-LIBNAME = ed_preview
+LIBNAME = ed_render
DIR = $(OCGDIR)/blender/$(LIBNAME)
include nan_compile.mk
diff --git a/source/blender/editors/preview/SConscript b/source/blender/editors/render/SConscript
index 922232822ff..cca2ab9b2ab 100644
--- a/source/blender/editors/preview/SConscript
+++ b/source/blender/editors/render/SConscript
@@ -9,4 +9,4 @@ incs += ' #/intern/guardedalloc ../../gpu'
incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern'
incs += ' ../../blenloader'
-env.BlenderLib ( 'bf_editors_preview', sources, Split(incs), [], libtype=['core'], priority=[45] )
+env.BlenderLib ( 'bf_editors_render', sources, Split(incs), [], libtype=['core'], priority=[45] )
diff --git a/source/blender/editors/preview/previewrender_intern.h b/source/blender/editors/render/render_intern.h
index 74a3aeee754..dccc2d36002 100644
--- a/source/blender/editors/preview/previewrender_intern.h
+++ b/source/blender/editors/render/render_intern.h
@@ -26,12 +26,24 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef PREVIEWRENDER_INTERN_H
-#define PREVIEWRENDER_INTERN_H
+#ifndef RENDER_INTERN_H
+#define RENDER_INTERN_H
-/* internal exports only */
+struct wmOperatorType;
+/* render_shading.c */
+void OBJECT_OT_material_slot_add(struct wmOperatorType *ot);
+void OBJECT_OT_material_slot_remove(struct wmOperatorType *ot);
+void OBJECT_OT_material_slot_assign(struct wmOperatorType *ot);
+void OBJECT_OT_material_slot_select(struct wmOperatorType *ot);
+void OBJECT_OT_material_slot_deselect(struct wmOperatorType *ot);
+void MATERIAL_OT_new(struct wmOperatorType *ot);
+void TEXTURE_OT_new(struct wmOperatorType *ot);
+void WORLD_OT_new(struct wmOperatorType *ot);
-#endif /* PREVIEWRENDER_INTERN_H */
+void SCENE_OT_render_layer_add(struct wmOperatorType *ot);
+void SCENE_OT_render_layer_remove(struct wmOperatorType *ot);
+
+#endif /* RENDER_INTERN_H */
diff --git a/source/blender/editors/render/render_ops.c b/source/blender/editors/render/render_ops.c
new file mode 100644
index 00000000000..8b60582d466
--- /dev/null
+++ b/source/blender/editors/render/render_ops.c
@@ -0,0 +1,54 @@
+/**
+ * $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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "DNA_windowmanager_types.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "render_intern.h" // own include
+
+/***************************** render ***********************************/
+
+void ED_operatortypes_render(void)
+{
+ WM_operatortype_append(OBJECT_OT_material_slot_add);
+ WM_operatortype_append(OBJECT_OT_material_slot_remove);
+ WM_operatortype_append(OBJECT_OT_material_slot_assign);
+ WM_operatortype_append(OBJECT_OT_material_slot_select);
+ WM_operatortype_append(OBJECT_OT_material_slot_deselect);
+
+ WM_operatortype_append(MATERIAL_OT_new);
+ WM_operatortype_append(TEXTURE_OT_new);
+ WM_operatortype_append(WORLD_OT_new);
+
+ WM_operatortype_append(SCENE_OT_render_layer_add);
+ WM_operatortype_append(SCENE_OT_render_layer_remove);
+}
+
diff --git a/source/blender/editors/preview/previewrender.c b/source/blender/editors/render/render_preview.c
index 91928b971f3..81f6badc24b 100644
--- a/source/blender/editors/preview/previewrender.c
+++ b/source/blender/editors/render/render_preview.c
@@ -88,12 +88,12 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_previewrender.h"
+#include "ED_render.h"
#include "ED_view3d.h"
#include "UI_interface.h"
-#include "previewrender_intern.h"
+#include "render_intern.h"
#define PR_XMIN 10
#define PR_YMIN 5
@@ -294,6 +294,14 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
}
sce->r.color_mgt_flag = scene->r.color_mgt_flag;
+ /* exception: don't color manage texture previews or icons */
+ if((sp && sp->pr_method==PR_ICON_RENDER) || id_type == ID_TE)
+ sce->r.color_mgt_flag &= ~R_COLOR_MANAGEMENT;
+ if((sp && sp->pr_method==PR_ICON_RENDER) && id_type != ID_WO)
+ sce->r.alphamode= R_ALPHAPREMUL;
+ else
+ sce->r.alphamode= R_ADDSKY;
+
sce->r.cfra= scene->r.cfra;
if(id_type==ID_MA) {
@@ -364,9 +372,6 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
sce->lay= 1<<MA_TEXTURE;
- /* exception: don't color manage texture previews */
- sce->r.color_mgt_flag &= ~R_COLOR_MANAGEMENT;
-
for(base= sce->base.first; base; base= base->next) {
if(base->object->id.name[2]=='t') {
Material *mat= give_current_material(base->object, base->object->actcol);
@@ -1081,12 +1086,9 @@ void ED_preview_icon_job(const bContext *C, void *owner, ID *id, unsigned int *r
ShaderPreview *sp;
/* XXX ugly global still, but we can't do preview while rendering */
- if(G.rendering)
+ if(G.rendering) {
+ printf("abort icon because rendering\n");
return;
-
- /* XXX this is not correct, can't work with threads */
- if(GS(id->name) == ID_TE) {
- ntreeTexSetPreviewFlag(1);
}
steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner);
@@ -1094,7 +1096,7 @@ void ED_preview_icon_job(const bContext *C, void *owner, ID *id, unsigned int *r
/* customdata for preview thread */
sp->scene= CTX_data_scene(C);
- sp->owner= owner;
+ sp->owner= id;
sp->sizex= sizex;
sp->sizey= sizey;
sp->pr_method= PR_ICON_RENDER;
@@ -1107,9 +1109,6 @@ void ED_preview_icon_job(const bContext *C, void *owner, ID *id, unsigned int *r
WM_jobs_callbacks(steve, common_preview_startjob, NULL, NULL);
WM_jobs_start(CTX_wm_manager(C), steve);
-
- /* signal to rerender icon in menus */
- BKE_icon_changed(BKE_icon_getid(id));
}
void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, MTex *slot, int sizex, int sizey)
@@ -1118,12 +1117,9 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
ShaderPreview *sp;
/* XXX ugly global still, but we can't do preview while rendering */
- if(G.rendering)
+ if(G.rendering) {
+ printf("abort shader because rendering\n");
return;
-
- /* XXX this is not correct, can't work with threads */
- if(GS(id->name) == ID_TE) {
- ntreeTexSetPreviewFlag(1);
}
steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner);
@@ -1145,9 +1141,6 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
WM_jobs_callbacks(steve, common_preview_startjob, NULL, shader_preview_updatejob);
WM_jobs_start(CTX_wm_manager(C), steve);
-
- /* signal to rerender icon in menus */
- BKE_icon_changed(BKE_icon_getid(id));
}
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
new file mode 100644
index 00000000000..a31a60ecbd6
--- /dev/null
+++ b/source/blender/editors/render/render_shading.c
@@ -0,0 +1,645 @@
+/**
+ * $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.
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_curve_types.h"
+#include "DNA_lamp_types.h"
+#include "DNA_material_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_node_types.h"
+#include "DNA_object_types.h"
+#include "DNA_texture_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_world_types.h"
+
+#include "BKE_context.h"
+#include "BKE_depsgraph.h"
+#include "BKE_font.h"
+#include "BKE_icons.h"
+#include "BKE_library.h"
+#include "BKE_main.h"
+#include "BKE_material.h"
+#include "BKE_node.h"
+#include "BKE_scene.h"
+#include "BKE_texture.h"
+#include "BKE_utildefines.h"
+#include "BKE_world.h"
+
+#include "BLI_arithb.h"
+#include "BLI_editVert.h"
+#include "BLI_listbase.h"
+
+#include "GPU_material.h"
+
+#include "RNA_access.h"
+#include "RNA_enum_types.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_curve.h"
+#include "ED_mesh.h"
+#include "ED_render.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+
+#include "render_intern.h" // own include
+
+/***************************** Updates ***********************************
+ * ED_render_id_flush_update gets called from DAG_id_flush_update, to do *
+ * editor level updates when the ID changes. when these ID blocks are in *
+ * the dependency graph, we can get rid of the manual dependency checks */
+
+static int mtex_use_tex(MTex **mtex, int tot, Tex *tex)
+{
+ int a;
+
+ if(!mtex)
+ return 0;
+
+ for(a=0; a<tot; a++)
+ if(mtex[a] && mtex[a]->tex == tex)
+ return 1;
+
+ return 0;
+}
+
+static int nodes_use_tex(bNodeTree *ntree, Tex *tex)
+{
+ bNode *node;
+
+ for(node=ntree->nodes.first; node; node= node->next) {
+ if(node->id) {
+ if(node->id == (ID*)tex) {
+ return 1;
+ }
+ else if(node->type==NODE_GROUP) {
+ if(nodes_use_tex((bNodeTree *)node->id, tex))
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+static void material_changed(Main *bmain, Material *ma)
+{
+ /* icons */
+ BKE_icon_changed(BKE_icon_getid(&ma->id));
+
+ /* glsl */
+ if(ma->gpumaterial.first)
+ GPU_material_free(ma);
+}
+
+static void texture_changed(Main *bmain, Tex *tex)
+{
+ Material *ma;
+ Lamp *la;
+ World *wo;
+
+ /* icons */
+ BKE_icon_changed(BKE_icon_getid(&tex->id));
+
+ /* find materials */
+ for(ma=bmain->mat.first; ma; ma=ma->id.next) {
+ if(mtex_use_tex(ma->mtex, MAX_MTEX, tex));
+ else if(ma->use_nodes && ma->nodetree && nodes_use_tex(ma->nodetree, tex));
+ else continue;
+
+ BKE_icon_changed(BKE_icon_getid(&ma->id));
+
+ if(ma->gpumaterial.first)
+ GPU_material_free(ma);
+ }
+
+ /* find lamps */
+ for(la=bmain->lamp.first; la; la=la->id.next) {
+ if(mtex_use_tex(la->mtex, MAX_MTEX, tex));
+ else continue;
+
+ BKE_icon_changed(BKE_icon_getid(&la->id));
+ }
+
+ /* find worlds */
+ for(wo=bmain->world.first; wo; wo=wo->id.next) {
+ if(mtex_use_tex(wo->mtex, MAX_MTEX, tex));
+ else continue;
+
+ BKE_icon_changed(BKE_icon_getid(&wo->id));
+ }
+}
+
+static void lamp_changed(Main *bmain, Lamp *la)
+{
+ Object *ob;
+ Material *ma;
+
+ /* icons */
+ BKE_icon_changed(BKE_icon_getid(&la->id));
+
+ /* glsl */
+ for(ob=bmain->object.first; ob; ob=ob->id.next)
+ if(ob->data == la && ob->gpulamp.first)
+ GPU_lamp_free(ob);
+
+ for(ma=bmain->mat.first; ma; ma=ma->id.next)
+ if(ma->gpumaterial.first)
+ GPU_material_free(ma);
+}
+
+static void world_changed(Main *bmain, World *wo)
+{
+ Material *ma;
+
+ /* icons */
+ BKE_icon_changed(BKE_icon_getid(&wo->id));
+
+ /* glsl */
+ for(ma=bmain->mat.first; ma; ma=ma->id.next)
+ if(ma->gpumaterial.first)
+ GPU_material_free(ma);
+}
+
+void ED_render_id_flush_update(Main *bmain, ID *id)
+{
+ switch(GS(id->name)) {
+ case ID_MA:
+ material_changed(bmain, (Material*)id);
+ break;
+ case ID_TE:
+ texture_changed(bmain, (Tex*)id);
+ break;
+ case ID_WO:
+ world_changed(bmain, (World*)id);
+ break;
+ case ID_LA:
+ lamp_changed(bmain, (Lamp*)id);
+ break;
+ default:
+ break;
+ }
+}
+
+/********************** material slot operators *********************/
+
+static int material_slot_add_exec(bContext *C, wmOperator *op)
+{
+ Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+
+ if(!ob)
+ return OPERATOR_CANCELLED;
+
+ object_add_material_slot(ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+
+ return OPERATOR_FINISHED;
+}
+
+void OBJECT_OT_material_slot_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Material Slot";
+ ot->idname= "OBJECT_OT_material_slot_add";
+ ot->description="Add a new material slot or duplicate the selected one.";
+
+ /* api callbacks */
+ ot->exec= material_slot_add_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int material_slot_remove_exec(bContext *C, wmOperator *op)
+{
+ Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+
+ if(!ob)
+ return OPERATOR_CANCELLED;
+
+ object_remove_material_slot(ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+
+ return OPERATOR_FINISHED;
+}
+
+void OBJECT_OT_material_slot_remove(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Remove Material Slot";
+ ot->idname= "OBJECT_OT_material_slot_remove";
+ ot->description="Remove the selected material slot.";
+
+ /* api callbacks */
+ ot->exec= material_slot_remove_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int material_slot_assign_exec(bContext *C, wmOperator *op)
+{
+ Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+
+ if(!ob)
+ return OPERATOR_CANCELLED;
+
+ if(ob && ob->actcol>0) {
+ if(ob->type == OB_MESH) {
+ EditMesh *em= ((Mesh*)ob->data)->edit_mesh;
+ EditFace *efa;
+
+ if(em) {
+ for(efa= em->faces.first; efa; efa=efa->next)
+ if(efa->f & SELECT)
+ efa->mat_nr= ob->actcol-1;
+ }
+ }
+ else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ ListBase *editnurb= ((Curve*)ob->data)->editnurb;
+ Nurb *nu;
+
+ if(editnurb) {
+ for(nu= editnurb->first; nu; nu= nu->next)
+ if(isNurbsel(nu))
+ nu->mat_nr= nu->charidx= ob->actcol-1;
+ }
+ }
+ else if(ob->type == OB_FONT) {
+ EditFont *ef= ((Curve*)ob->data)->editfont;
+ int i, selstart, selend;
+
+ if(ef && BKE_font_getselection(ob, &selstart, &selend)) {
+ for(i=selstart; i<=selend; i++)
+ ef->textbufinfo[i].mat_nr = ob->actcol-1;
+ }
+ }
+ }
+
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
+
+ return OPERATOR_FINISHED;
+}
+
+void OBJECT_OT_material_slot_assign(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Assign Material Slot";
+ ot->idname= "OBJECT_OT_material_slot_assign";
+ ot->description="Assign the material in the selected material slot to the selected vertices.";
+
+ /* api callbacks */
+ ot->exec= material_slot_assign_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int material_slot_de_select(bContext *C, int select)
+{
+ Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+
+ if(!ob)
+ return OPERATOR_CANCELLED;
+
+ if(ob->type == OB_MESH) {
+ EditMesh *em= ((Mesh*)ob->data)->edit_mesh;
+
+ if(em) {
+ if(select)
+ EM_select_by_material(em, ob->actcol-1);
+ else
+ EM_deselect_by_material(em, ob->actcol-1);
+ }
+ }
+ else if ELEM(ob->type, OB_CURVE, OB_SURF) {
+ ListBase *editnurb= ((Curve*)ob->data)->editnurb;
+ Nurb *nu;
+ BPoint *bp;
+ BezTriple *bezt;
+ int a;
+
+ for(nu= editnurb->first; nu; nu=nu->next) {
+ if(nu->mat_nr==ob->actcol-1) {
+ if(nu->bezt) {
+ a= nu->pntsu;
+ bezt= nu->bezt;
+ while(a--) {
+ if(bezt->hide==0) {
+ if(select) {
+ bezt->f1 |= SELECT;
+ bezt->f2 |= SELECT;
+ bezt->f3 |= SELECT;
+ }
+ else {
+ bezt->f1 &= ~SELECT;
+ bezt->f2 &= ~SELECT;
+ bezt->f3 &= ~SELECT;
+ }
+ }
+ bezt++;
+ }
+ }
+ else if(nu->bp) {
+ a= nu->pntsu*nu->pntsv;
+ bp= nu->bp;
+ while(a--) {
+ if(bp->hide==0) {
+ if(select) bp->f1 |= SELECT;
+ else bp->f1 &= ~SELECT;
+ }
+ bp++;
+ }
+ }
+ }
+ }
+ }
+
+ WM_event_add_notifier(C, NC_GEOM|ND_SELECT, ob->data);
+
+ return OPERATOR_FINISHED;
+}
+
+static int material_slot_select_exec(bContext *C, wmOperator *op)
+{
+ return material_slot_de_select(C, 1);
+}
+
+void OBJECT_OT_material_slot_select(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Select Material Slot";
+ ot->idname= "OBJECT_OT_material_slot_select";
+ ot->description="Select vertices assigned to the selected material slot.";
+
+ /* api callbacks */
+ ot->exec= material_slot_select_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int material_slot_deselect_exec(bContext *C, wmOperator *op)
+{
+ return material_slot_de_select(C, 0);
+}
+
+void OBJECT_OT_material_slot_deselect(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Deselect Material Slot";
+ ot->idname= "OBJECT_OT_material_slot_deselect";
+ ot->description="Deselect vertices assigned to the selected material slot.";
+
+ /* api callbacks */
+ ot->exec= material_slot_deselect_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/********************** new material operator *********************/
+
+static int new_material_exec(bContext *C, wmOperator *op)
+{
+ Material *ma= CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
+ Object *ob;
+ PointerRNA ptr;
+ int index;
+
+ /* add or copy material */
+ if(ma)
+ ma= copy_material(ma);
+ else
+ ma= add_material("Material");
+
+ ma->id.us--; /* compensating for us++ in assign_material */
+
+ /* attempt to assign to material slot */
+ ptr= CTX_data_pointer_get_type(C, "material_slot", &RNA_MaterialSlot);
+
+ if(ptr.data) {
+ ob= ptr.id.data;
+ index= (Material**)ptr.data - ob->mat;
+
+ assign_material(ob, ma, index+1);
+
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ }
+
+ WM_event_add_notifier(C, NC_MATERIAL|NA_ADDED, ma);
+
+ return OPERATOR_FINISHED;
+}
+
+void MATERIAL_OT_new(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "New Material";
+ ot->idname= "MATERIAL_OT_new";
+ ot->description="Add a new material.";
+
+ /* api callbacks */
+ ot->exec= new_material_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/********************** new texture operator *********************/
+
+static int new_texture_exec(bContext *C, wmOperator *op)
+{
+ Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
+ ID *id;
+ MTex *mtex;
+ PointerRNA ptr;
+
+ /* add or copy texture */
+ if(tex)
+ tex= copy_texture(tex);
+ else
+ tex= add_texture("Texture");
+
+ id_us_min(&tex->id);
+
+ /* attempt to assign to texture slot */
+ ptr= CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot);
+
+ if(ptr.data) {
+ id= ptr.id.data;
+ mtex= ptr.data;
+
+ if(mtex) {
+ if(mtex->tex)
+ id_us_min(&mtex->tex->id);
+ mtex->tex= tex;
+ id_us_plus(&tex->id);
+ }
+
+ /* XXX nodes, notifier .. */
+ }
+
+ WM_event_add_notifier(C, NC_TEXTURE|NA_ADDED, tex);
+
+ return OPERATOR_FINISHED;
+}
+
+void TEXTURE_OT_new(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "New Texture";
+ ot->idname= "TEXTURE_OT_new";
+ ot->description="Add a new texture.";
+
+ /* api callbacks */
+ ot->exec= new_texture_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/********************** new world operator *********************/
+
+static int new_world_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+ World *wo= CTX_data_pointer_get_type(C, "world", &RNA_World).data;
+
+ /* add or copy world */
+ if(wo)
+ wo= copy_world(wo);
+ else
+ wo= add_world("World");
+
+ /* assign to scene */
+ if(scene->world)
+ id_us_min(&scene->world->id);
+ scene->world= wo;
+
+ WM_event_add_notifier(C, NC_WORLD|NA_ADDED, wo);
+
+ return OPERATOR_FINISHED;
+}
+
+void WORLD_OT_new(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "New World";
+ ot->idname= "WORLD_OT_new";
+ ot->description= "Add a new world.";
+
+ /* api callbacks */
+ ot->exec= new_world_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/********************** render layer operators *********************/
+
+static int render_layer_add_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+
+ scene_add_render_layer(scene);
+ scene->r.actlay= BLI_countlist(&scene->r.layers) - 1;
+
+ WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
+
+ return OPERATOR_FINISHED;
+}
+
+void SCENE_OT_render_layer_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Render Layer";
+ ot->idname= "SCENE_OT_render_layer_add";
+ ot->description="Add a render layer.";
+
+ /* api callbacks */
+ ot->exec= render_layer_add_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int render_layer_remove_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+ SceneRenderLayer *rl;
+ int act= scene->r.actlay;
+
+ if(BLI_countlist(&scene->r.layers) <= 1)
+ return OPERATOR_CANCELLED;
+
+ rl= BLI_findlink(&scene->r.layers, scene->r.actlay);
+ BLI_remlink(&scene->r.layers, rl);
+ MEM_freeN(rl);
+
+ scene->r.actlay= 0;
+
+ if(scene->nodetree) {
+ bNode *node;
+ for(node= scene->nodetree->nodes.first; node; node= node->next) {
+ if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
+ if(node->custom1==act)
+ node->custom1= 0;
+ else if(node->custom1>act)
+ node->custom1--;
+ }
+ }
+ }
+
+ WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
+
+ return OPERATOR_FINISHED;
+}
+
+void SCENE_OT_render_layer_remove(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Remove Render Layer";
+ ot->idname= "SCENE_OT_render_layer_remove";
+ ot->description="Remove the selected render layer.";
+
+ /* api callbacks */
+ ot->exec= render_layer_remove_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index 18bc7ec9555..8c563c98d9b 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -46,8 +46,8 @@
#include "ED_markers.h"
#include "ED_mesh.h"
#include "ED_object.h"
-#include "ED_particle.h"
#include "ED_physics.h"
+#include "ED_render.h"
#include "ED_screen.h"
#include "ED_sculpt.h"
#include "ED_space_api.h"
@@ -92,15 +92,13 @@ void ED_spacetypes_init(void)
ED_operatortypes_sculpt();
ED_operatortypes_uvedit();
ED_operatortypes_paint();
- ED_operatortypes_particle();
+ ED_operatortypes_physics();
ED_operatortypes_curve();
ED_operatortypes_armature();
ED_operatortypes_marker();
- ED_operatortypes_pointcache();
- ED_operatortypes_fluid();
ED_operatortypes_metaball();
- ED_operatortypes_boids();
ED_operatortypes_sound();
+ ED_operatortypes_render();
ui_view2d_operatortypes();
@@ -127,7 +125,7 @@ void ED_spacetypes_keymap(wmWindowManager *wm)
ED_keymap_uvedit(wm);
ED_keymap_curve(wm);
ED_keymap_armature(wm);
- ED_keymap_particle(wm);
+ ED_keymap_physics(wm);
ED_keymap_metaball(wm);
ED_keymap_paint(wm);
ED_marker_keymap(wm);
diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h
index 0a5a5714a06..2e95fde8f99 100644
--- a/source/blender/editors/space_buttons/buttons_intern.h
+++ b/source/blender/editors/space_buttons/buttons_intern.h
@@ -64,33 +64,6 @@ void buttons_context_draw(const struct bContext *C, struct uiLayout *layout);
void buttons_context_register(struct ARegionType *art);
/* buttons_ops.c */
-void OBJECT_OT_group_add(struct wmOperatorType *ot);
-void OBJECT_OT_group_remove(struct wmOperatorType *ot);
-
-void OBJECT_OT_material_slot_add(struct wmOperatorType *ot);
-void OBJECT_OT_material_slot_remove(struct wmOperatorType *ot);
-void OBJECT_OT_material_slot_assign(struct wmOperatorType *ot);
-void OBJECT_OT_material_slot_select(struct wmOperatorType *ot);
-void OBJECT_OT_material_slot_deselect(struct wmOperatorType *ot);
-
-void MATERIAL_OT_new(struct wmOperatorType *ot);
-void TEXTURE_OT_new(struct wmOperatorType *ot);
-void WORLD_OT_new(struct wmOperatorType *ot);
-
-void OBJECT_OT_particle_system_add(struct wmOperatorType *ot);
-void OBJECT_OT_particle_system_remove(struct wmOperatorType *ot);
-
-void PARTICLE_OT_new(struct wmOperatorType *ot);
-void PARTICLE_OT_new_target(struct wmOperatorType *ot);
-void PARTICLE_OT_remove_target(struct wmOperatorType *ot);
-void PARTICLE_OT_target_move_up(struct wmOperatorType *ot);
-void PARTICLE_OT_target_move_down(struct wmOperatorType *ot);
-void PARTICLE_OT_connect_hair(struct wmOperatorType *ot);
-void PARTICLE_OT_disconnect_hair(struct wmOperatorType *ot);
-
-void SCENE_OT_render_layer_add(struct wmOperatorType *ot);
-void SCENE_OT_render_layer_remove(struct wmOperatorType *ot);
-
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 4387da19341..2d961f78243 100644
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@ -30,53 +30,14 @@
#include "MEM_guardedalloc.h"
-#include "DNA_boid_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_group_types.h"
-#include "DNA_object_types.h"
-#include "DNA_material_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_node_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "DNA_world_types.h"
-#include "BKE_bvhutils.h"
-#include "BKE_cdderivedmesh.h"
#include "BKE_context.h"
-#include "BKE_depsgraph.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_group.h"
-#include "BKE_font.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_modifier.h"
-#include "BKE_node.h"
-#include "BKE_particle.h"
-#include "BKE_pointcache.h"
-#include "BKE_scene.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-#include "BKE_world.h"
-
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-#include "BLI_listbase.h"
-
-#include "RNA_access.h"
-#include "RNA_enum_types.h"
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_curve.h"
-#include "ED_mesh.h"
-#include "ED_particle.h"
-
#include "RNA_access.h"
#include "RNA_define.h"
@@ -85,953 +46,6 @@
#include "buttons_intern.h" // own include
-
-/********************** material slot operators *********************/
-
-static int material_slot_add_exec(bContext *C, wmOperator *op)
-{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
-
- if(!ob)
- return OPERATOR_CANCELLED;
-
- object_add_material_slot(ob);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-
- return OPERATOR_FINISHED;
-}
-
-void OBJECT_OT_material_slot_add(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Add Material Slot";
- ot->idname= "OBJECT_OT_material_slot_add";
- ot->description="Add a new material slot or duplicate the selected one.";
-
- /* api callbacks */
- ot->exec= material_slot_add_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-static int material_slot_remove_exec(bContext *C, wmOperator *op)
-{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
-
- if(!ob)
- return OPERATOR_CANCELLED;
-
- object_remove_material_slot(ob);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-
- return OPERATOR_FINISHED;
-}
-
-void OBJECT_OT_material_slot_remove(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Remove Material Slot";
- ot->idname= "OBJECT_OT_material_slot_remove";
- ot->description="Remove the selected material slot.";
-
- /* api callbacks */
- ot->exec= material_slot_remove_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-static int material_slot_assign_exec(bContext *C, wmOperator *op)
-{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
-
- if(!ob)
- return OPERATOR_CANCELLED;
-
- if(ob && ob->actcol>0) {
- if(ob->type == OB_MESH) {
- EditMesh *em= ((Mesh*)ob->data)->edit_mesh;
- EditFace *efa;
-
- if(em) {
- for(efa= em->faces.first; efa; efa=efa->next)
- if(efa->f & SELECT)
- efa->mat_nr= ob->actcol-1;
- }
- }
- else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
- ListBase *editnurb= ((Curve*)ob->data)->editnurb;
- Nurb *nu;
-
- if(editnurb) {
- for(nu= editnurb->first; nu; nu= nu->next)
- if(isNurbsel(nu))
- nu->mat_nr= nu->charidx= ob->actcol-1;
- }
- }
- else if(ob->type == OB_FONT) {
- EditFont *ef= ((Curve*)ob->data)->editfont;
- int i, selstart, selend;
-
- if(ef && BKE_font_getselection(ob, &selstart, &selend)) {
- for(i=selstart; i<=selend; i++)
- ef->textbufinfo[i].mat_nr = ob->actcol-1;
- }
- }
- }
-
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
-
- return OPERATOR_FINISHED;
-}
-
-void OBJECT_OT_material_slot_assign(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Assign Material Slot";
- ot->idname= "OBJECT_OT_material_slot_assign";
- ot->description="Assign the material in the selected material slot to the selected vertices.";
-
- /* api callbacks */
- ot->exec= material_slot_assign_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-static int material_slot_de_select(bContext *C, int select)
-{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
-
- if(!ob)
- return OPERATOR_CANCELLED;
-
- if(ob->type == OB_MESH) {
- EditMesh *em= ((Mesh*)ob->data)->edit_mesh;
-
- if(em) {
- if(select)
- EM_select_by_material(em, ob->actcol-1);
- else
- EM_deselect_by_material(em, ob->actcol-1);
- }
- }
- else if ELEM(ob->type, OB_CURVE, OB_SURF) {
- ListBase *editnurb= ((Curve*)ob->data)->editnurb;
- Nurb *nu;
- BPoint *bp;
- BezTriple *bezt;
- int a;
-
- for(nu= editnurb->first; nu; nu=nu->next) {
- if(nu->mat_nr==ob->actcol-1) {
- if(nu->bezt) {
- a= nu->pntsu;
- bezt= nu->bezt;
- while(a--) {
- if(bezt->hide==0) {
- if(select) {
- bezt->f1 |= SELECT;
- bezt->f2 |= SELECT;
- bezt->f3 |= SELECT;
- }
- else {
- bezt->f1 &= ~SELECT;
- bezt->f2 &= ~SELECT;
- bezt->f3 &= ~SELECT;
- }
- }
- bezt++;
- }
- }
- else if(nu->bp) {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a--) {
- if(bp->hide==0) {
- if(select) bp->f1 |= SELECT;
- else bp->f1 &= ~SELECT;
- }
- bp++;
- }
- }
- }
- }
- }
-
- WM_event_add_notifier(C, NC_GEOM|ND_SELECT, ob->data);
-
- return OPERATOR_FINISHED;
-}
-
-static int material_slot_select_exec(bContext *C, wmOperator *op)
-{
- return material_slot_de_select(C, 1);
-}
-
-void OBJECT_OT_material_slot_select(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Select Material Slot";
- ot->idname= "OBJECT_OT_material_slot_select";
- ot->description="Select vertices assigned to the selected material slot.";
-
- /* api callbacks */
- ot->exec= material_slot_select_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-static int material_slot_deselect_exec(bContext *C, wmOperator *op)
-{
- return material_slot_de_select(C, 0);
-}
-
-void OBJECT_OT_material_slot_deselect(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Deselect Material Slot";
- ot->idname= "OBJECT_OT_material_slot_deselect";
- ot->description="Deselect vertices assigned to the selected material slot.";
-
- /* api callbacks */
- ot->exec= material_slot_deselect_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-/********************** new material operator *********************/
-
-static int new_material_exec(bContext *C, wmOperator *op)
-{
- Material *ma= CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
- Object *ob;
- PointerRNA ptr;
- int index;
-
- /* add or copy material */
- if(ma)
- ma= copy_material(ma);
- else
- ma= add_material("Material");
-
- ma->id.us--; /* compensating for us++ in assign_material */
-
- /* attempt to assign to material slot */
- ptr= CTX_data_pointer_get_type(C, "material_slot", &RNA_MaterialSlot);
-
- if(ptr.data) {
- ob= ptr.id.data;
- index= (Material**)ptr.data - ob->mat;
-
- assign_material(ob, ma, index+1);
-
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
- }
-
- WM_event_add_notifier(C, NC_MATERIAL|NA_ADDED, ma);
-
- return OPERATOR_FINISHED;
-}
-
-void MATERIAL_OT_new(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "New Material";
- ot->idname= "MATERIAL_OT_new";
- ot->description="Add a new material.";
-
- /* api callbacks */
- ot->exec= new_material_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-/********************** new texture operator *********************/
-
-static int new_texture_exec(bContext *C, wmOperator *op)
-{
- Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
- ID *id;
- MTex *mtex;
- PointerRNA ptr;
-
- /* add or copy texture */
- if(tex)
- tex= copy_texture(tex);
- else
- tex= add_texture("Texture");
-
- id_us_min(&tex->id);
-
- /* attempt to assign to texture slot */
- ptr= CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot);
-
- if(ptr.data) {
- id= ptr.id.data;
- mtex= ptr.data;
-
- if(mtex) {
- if(mtex->tex)
- id_us_min(&mtex->tex->id);
- mtex->tex= tex;
- id_us_plus(&tex->id);
- }
-
- /* XXX nodes, notifier .. */
- }
-
- WM_event_add_notifier(C, NC_TEXTURE|NA_ADDED, tex);
-
- return OPERATOR_FINISHED;
-}
-
-void TEXTURE_OT_new(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "New Texture";
- ot->idname= "TEXTURE_OT_new";
- ot->description="Add a new texture.";
-
- /* api callbacks */
- ot->exec= new_texture_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-/********************** new world operator *********************/
-
-static int new_world_exec(bContext *C, wmOperator *op)
-{
- Scene *scene= CTX_data_scene(C);
- World *wo= CTX_data_pointer_get_type(C, "world", &RNA_World).data;
-
- /* add or copy world */
- if(wo)
- wo= copy_world(wo);
- else
- wo= add_world("World");
-
- /* assign to scene */
- if(scene->world)
- id_us_min(&scene->world->id);
- scene->world= wo;
-
- WM_event_add_notifier(C, NC_WORLD|NA_ADDED, wo);
-
- return OPERATOR_FINISHED;
-}
-
-void WORLD_OT_new(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "New World";
- ot->idname= "WORLD_OT_new";
- ot->description= "Add a new world.";
-
- /* api callbacks */
- ot->exec= new_world_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-
-
-/********************** particle system slot operators *********************/
-
-static int particle_system_add_exec(bContext *C, wmOperator *op)
-{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
- Scene *scene = CTX_data_scene(C);
-
- if(!scene || !ob)
- return OPERATOR_CANCELLED;
-
- object_add_particle_system(scene, ob);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-
- return OPERATOR_FINISHED;
-}
-
-void OBJECT_OT_particle_system_add(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Add Particle System Slot";
- ot->idname= "OBJECT_OT_particle_system_add";
- ot->description="Add a particle system.";
-
- /* api callbacks */
- ot->exec= particle_system_add_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-static int particle_system_remove_exec(bContext *C, wmOperator *op)
-{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
- Scene *scene = CTX_data_scene(C);
-
- if(!scene || !ob)
- return OPERATOR_CANCELLED;
-
- object_remove_particle_system(scene, ob);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-
- return OPERATOR_FINISHED;
-}
-
-void OBJECT_OT_particle_system_remove(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Remove Particle System Slot";
- ot->idname= "OBJECT_OT_particle_system_remove";
- ot->description="Remove the selected particle system.";
-
- /* api callbacks */
- ot->exec= particle_system_remove_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-/********************** new particle settings operator *********************/
-
-static int psys_poll(bContext *C)
-{
- PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
- return (ptr.data != NULL);
-}
-
-static int new_particle_settings_exec(bContext *C, wmOperator *op)
-{
- Scene *scene = CTX_data_scene(C);
- Main *bmain= CTX_data_main(C);
- ParticleSystem *psys;
- ParticleSettings *part = NULL;
- Object *ob;
- PointerRNA ptr;
-
- ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
-
- psys = ptr.data;
-
- /* add or copy particle setting */
- if(psys->part)
- part= psys_copy_settings(psys->part);
- else
- part= psys_new_settings("ParticleSettings", bmain);
-
- ob= ptr.id.data;
-
- if(psys->part)
- psys->part->id.us--;
-
- psys->part = part;
-
- psys_check_boid_data(psys);
-
- DAG_scene_sort(scene);
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
-
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-
- return OPERATOR_FINISHED;
-}
-
-void PARTICLE_OT_new(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "New Particle Settings";
- ot->idname= "PARTICLE_OT_new";
- ot->description="Add new particle settings.";
-
- /* api callbacks */
- ot->exec= new_particle_settings_exec;
- ot->poll= psys_poll;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-/********************** keyed particle target operators *********************/
-
-static int new_particle_target_exec(bContext *C, wmOperator *op)
-{
- Scene *scene = CTX_data_scene(C);
- PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
- ParticleSystem *psys= ptr.data;
- Object *ob = ptr.id.data;
-
- ParticleTarget *pt;
-
- if(!psys)
- return OPERATOR_CANCELLED;
-
- pt = psys->targets.first;
- for(; pt; pt=pt->next)
- pt->flag &= ~PTARGET_CURRENT;
-
- pt = MEM_callocN(sizeof(ParticleTarget), "keyed particle target");
-
- pt->flag |= PTARGET_CURRENT;
- pt->psys = 1;
-
- BLI_addtail(&psys->targets, pt);
-
- DAG_scene_sort(scene);
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
-
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-
- return OPERATOR_FINISHED;
-}
-
-void PARTICLE_OT_new_target(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "New Particle Target";
- ot->idname= "PARTICLE_OT_new_target";
- ot->description="Add a new particle target.";
-
- /* api callbacks */
- ot->exec= new_particle_target_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-static int remove_particle_target_exec(bContext *C, wmOperator *op)
-{
- Scene *scene = CTX_data_scene(C);
- PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
- ParticleSystem *psys= ptr.data;
- Object *ob = ptr.id.data;
-
- ParticleTarget *pt;
-
- if(!psys)
- return OPERATOR_CANCELLED;
-
- pt = psys->targets.first;
- for(; pt; pt=pt->next) {
- if(pt->flag & PTARGET_CURRENT) {
- BLI_remlink(&psys->targets, pt);
- MEM_freeN(pt);
- break;
- }
-
- }
- pt = psys->targets.last;
-
- if(pt)
- pt->flag |= PTARGET_CURRENT;
-
- DAG_scene_sort(scene);
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
-
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-
- return OPERATOR_FINISHED;
-}
-
-void PARTICLE_OT_remove_target(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Remove Particle Target";
- ot->idname= "PARTICLE_OT_remove_target";
- ot->description="Remove the selected particle target.";
-
- /* api callbacks */
- ot->exec= remove_particle_target_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-/************************ move up particle target operator *********************/
-
-static int target_move_up_exec(bContext *C, wmOperator *op)
-{
- PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
- ParticleSystem *psys= ptr.data;
- Object *ob = ptr.id.data;
- ParticleTarget *pt;
-
- if(!psys)
- return OPERATOR_CANCELLED;
-
- pt = psys->targets.first;
- for(; pt; pt=pt->next) {
- if(pt->flag & PTARGET_CURRENT && pt->prev) {
- BLI_remlink(&psys->targets, pt);
- BLI_insertlink(&psys->targets, pt->prev->prev, pt);
-
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
- break;
- }
- }
-
- return OPERATOR_FINISHED;
-}
-
-void PARTICLE_OT_target_move_up(wmOperatorType *ot)
-{
- ot->name= "Move Up Target";
- ot->idname= "PARTICLE_OT_target_move_up";
- ot->description= "Move particle target up in the list.";
-
- ot->exec= target_move_up_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-/************************ move down particle target operator *********************/
-
-static int target_move_down_exec(bContext *C, wmOperator *op)
-{
- PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
- ParticleSystem *psys= ptr.data;
- Object *ob = ptr.id.data;
- ParticleTarget *pt;
-
- if(!psys)
- return OPERATOR_CANCELLED;
- pt = psys->targets.first;
- for(; pt; pt=pt->next) {
- if(pt->flag & PTARGET_CURRENT && pt->next) {
- BLI_remlink(&psys->targets, pt);
- BLI_insertlink(&psys->targets, pt->next, pt);
-
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
- break;
- }
- }
-
- return OPERATOR_FINISHED;
-}
-
-void PARTICLE_OT_target_move_down(wmOperatorType *ot)
-{
- ot->name= "Move Down Target";
- ot->idname= "PARTICLE_OT_target_move_down";
- ot->description= "Move particle target down in the list.";
-
- ot->exec= target_move_down_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-/************************ connect/disconnect hair operators *********************/
-
-static void disconnect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
-{
- ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys);
- ParticleData *pa;
- PTCacheEdit *edit;
- PTCacheEditPoint *point;
- PTCacheEditKey *ekey = NULL;
- HairKey *key;
- int i, k;
- float hairmat[4][4];
-
- if(!ob || !psys || psys->flag & PSYS_GLOBAL_HAIR)
- return;
-
- if(!psys->part || psys->part->type != PART_HAIR)
- return;
-
- edit = psys->edit;
- point= edit ? edit->points : NULL;
-
- for(i=0, pa=psys->particles; i<psys->totpart; i++,pa++) {
- if(point) {
- ekey = point->keys;
- point++;
- }
-
- psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
-
- for(k=0,key=pa->hair; k<pa->totkey; k++,key++) {
- Mat4MulVecfl(hairmat,key->co);
-
- if(ekey) {
- ekey->flag &= ~PEK_USE_WCO;
- ekey++;
- }
- }
- }
-
- psys_free_path_cache(psys, psys->edit);
-
- psys->flag |= PSYS_GLOBAL_HAIR;
-
- PE_update_object(scene, ob, 0);
-}
-
-static int disconnect_hair_exec(bContext *C, wmOperator *op)
-{
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
- PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
- ParticleSystem *psys= NULL;
- int all = RNA_boolean_get(op->ptr, "all");
-
- if(!ob)
- return OPERATOR_CANCELLED;
-
- if(all) {
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- disconnect_hair(scene, ob, psys);
- }
- }
- else {
- psys = ptr.data;
- disconnect_hair(scene, ob, psys);
- }
-
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-
- return OPERATOR_FINISHED;
-}
-
-void PARTICLE_OT_disconnect_hair(wmOperatorType *ot)
-{
- ot->name= "Disconnect Hair";
- ot->description= "Disconnect hair from the emitter mesh.";
- ot->idname= "PARTICLE_OT_disconnect_hair";
-
- ot->exec= disconnect_hair_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-
- RNA_def_boolean(ot->srna, "all", 0, "All hair", "Disconnect all hair systems from the emitter mesh");
-}
-
-static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
-{
- ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys);
- ParticleData *pa;
- PTCacheEdit *edit;
- PTCacheEditPoint *point;
- PTCacheEditKey *ekey;
- HairKey *key;
- BVHTreeFromMesh bvhtree;
- BVHTreeNearest nearest;
- MFace *mface;
- DerivedMesh *dm = NULL;
- int numverts;
- int i, k;
- float hairmat[4][4], imat[4][4];
- float v[4][3], vec[3];
-
- if(!psys || !psys->part || psys->part->type != PART_HAIR)
- return;
-
- edit= psys->edit;
- point= edit ? edit->points : NULL;
-
- if(psmd->dm->deformedOnly)
- dm= psmd->dm;
- else
- dm= mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
-
- numverts = dm->getNumVerts (dm);
-
- memset( &bvhtree, 0, sizeof(bvhtree) );
-
- /* convert to global coordinates */
- for (i=0; i<numverts; i++)
- Mat4MulVecfl (ob->obmat, CDDM_get_vert(dm, i)->co);
-
- bvhtree_from_mesh_faces(&bvhtree, dm, 0.0, 2, 6);
-
- for(i=0, pa= psys->particles; i<psys->totpart; i++,pa++) {
- key = pa->hair;
-
- nearest.index = -1;
- nearest.dist = FLT_MAX;
-
- BLI_bvhtree_find_nearest(bvhtree.tree, key->co, &nearest, bvhtree.nearest_callback, &bvhtree);
-
- if(nearest.index == -1) {
- printf("No nearest point found for hair root!");
- continue;
- }
-
- mface = CDDM_get_face(dm,nearest.index);
-
- VecCopyf(v[0], CDDM_get_vert(dm,mface->v1)->co);
- VecCopyf(v[1], CDDM_get_vert(dm,mface->v2)->co);
- VecCopyf(v[2], CDDM_get_vert(dm,mface->v3)->co);
- if(mface->v4) {
- VecCopyf(v[3], CDDM_get_vert(dm,mface->v4)->co);
- MeanValueWeights(v, 4, nearest.co, pa->fuv);
- }
- else
- MeanValueWeights(v, 3, nearest.co, pa->fuv);
-
- pa->num = nearest.index;
- pa->num_dmcache = psys_particle_dm_face_lookup(ob,psmd->dm,pa->num,pa->fuv,NULL);
-
- psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
- Mat4Invert(imat,hairmat);
-
- VECSUB(vec, nearest.co, key->co);
-
- if(point) {
- ekey = point->keys;
- point++;
- }
-
- for(k=0,key=pa->hair; k<pa->totkey; k++,key++) {
- VECADD(key->co, key->co, vec);
- Mat4MulVecfl(imat,key->co);
-
- if(ekey) {
- ekey->flag |= PEK_USE_WCO;
- ekey++;
- }
- }
- }
-
- free_bvhtree_from_mesh(&bvhtree);
- if(!psmd->dm->deformedOnly)
- dm->release(dm);
-
- psys_free_path_cache(psys, psys->edit);
-
- psys->flag &= ~PSYS_GLOBAL_HAIR;
-
- PE_update_object(scene, ob, 0);
-}
-
-static int connect_hair_exec(bContext *C, wmOperator *op)
-{
- Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
- PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);
- ParticleSystem *psys= NULL;
- int all = RNA_boolean_get(op->ptr, "all");
-
- if(!ob)
- return OPERATOR_CANCELLED;
-
- if(all) {
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- connect_hair(scene, ob, psys);
- }
- }
- else {
- psys = ptr.data;
- connect_hair(scene, ob, psys);
- }
-
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-
- return OPERATOR_FINISHED;
-}
-
-void PARTICLE_OT_connect_hair(wmOperatorType *ot)
-{
- ot->name= "Connect Hair";
- ot->description= "Connect hair to the emitter mesh.";
- ot->idname= "PARTICLE_OT_connect_hair";
-
- ot->exec= connect_hair_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-
- RNA_def_boolean(ot->srna, "all", 0, "All hair", "Connect all hair systems to the emitter mesh");
-}
-
-/********************** render layer operators *********************/
-
-static int render_layer_add_exec(bContext *C, wmOperator *op)
-{
- Scene *scene= CTX_data_scene(C);
-
- scene_add_render_layer(scene);
- scene->r.actlay= BLI_countlist(&scene->r.layers) - 1;
-
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
-
- return OPERATOR_FINISHED;
-}
-
-void SCENE_OT_render_layer_add(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Add Render Layer";
- ot->idname= "SCENE_OT_render_layer_add";
- ot->description="Add a render layer.";
-
- /* api callbacks */
- ot->exec= render_layer_add_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-static int render_layer_remove_exec(bContext *C, wmOperator *op)
-{
- Scene *scene= CTX_data_scene(C);
- SceneRenderLayer *rl;
- int act= scene->r.actlay;
-
- if(BLI_countlist(&scene->r.layers) <= 1)
- return OPERATOR_CANCELLED;
-
- rl= BLI_findlink(&scene->r.layers, scene->r.actlay);
- BLI_remlink(&scene->r.layers, rl);
- MEM_freeN(rl);
-
- scene->r.actlay= 0;
-
- if(scene->nodetree) {
- bNode *node;
- for(node= scene->nodetree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
- if(node->custom1==act)
- node->custom1= 0;
- else if(node->custom1>act)
- node->custom1--;
- }
- }
- }
-
- WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
-
- return OPERATOR_FINISHED;
-}
-
-void SCENE_OT_render_layer_remove(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Remove Render Layer";
- ot->idname= "SCENE_OT_render_layer_remove";
- ot->description="Remove the selected render layer.";
-
- /* api callbacks */
- ot->exec= render_layer_remove_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
/********************** toolbox operator *********************/
static int toolbox_invoke(bContext *C, wmOperator *op, wmEvent *event)
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 48acaffd580..6ffbb79f273 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -57,7 +57,7 @@
#include "UI_resources.h"
#include "UI_view2d.h"
-#include "ED_previewrender.h"
+#include "ED_render.h"
#include "buttons_intern.h" // own include
@@ -185,33 +185,6 @@ static void buttons_main_area_draw(const bContext *C, ARegion *ar)
void buttons_operatortypes(void)
{
- WM_operatortype_append(OBJECT_OT_group_add);
- WM_operatortype_append(OBJECT_OT_group_remove);
-
- WM_operatortype_append(OBJECT_OT_material_slot_add);
- WM_operatortype_append(OBJECT_OT_material_slot_remove);
- WM_operatortype_append(OBJECT_OT_material_slot_assign);
- WM_operatortype_append(OBJECT_OT_material_slot_select);
- WM_operatortype_append(OBJECT_OT_material_slot_deselect);
-
- WM_operatortype_append(MATERIAL_OT_new);
- WM_operatortype_append(TEXTURE_OT_new);
- WM_operatortype_append(WORLD_OT_new);
-
- WM_operatortype_append(OBJECT_OT_particle_system_add);
- WM_operatortype_append(OBJECT_OT_particle_system_remove);
-
- WM_operatortype_append(PARTICLE_OT_new);
- WM_operatortype_append(PARTICLE_OT_new_target);
- WM_operatortype_append(PARTICLE_OT_remove_target);
- WM_operatortype_append(PARTICLE_OT_target_move_up);
- WM_operatortype_append(PARTICLE_OT_target_move_down);
- WM_operatortype_append(PARTICLE_OT_connect_hair);
- WM_operatortype_append(PARTICLE_OT_disconnect_hair);
-
- WM_operatortype_append(SCENE_OT_render_layer_add);
- WM_operatortype_append(SCENE_OT_render_layer_remove);
-
WM_operatortype_append(BUTTONS_OT_toolbox);
WM_operatortype_append(BUTTONS_OT_file_browse);
}
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 5d02e096228..77a1b671054 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -313,16 +313,16 @@ static int get_file_icon(struct direntry *file)
static void file_draw_icon(int sx, int sy, int icon, int width, int height)
{
float x,y;
- int blend=0;
+ float alpha=1.0f;
x = (float)(sx);
y = (float)(sy-height);
- if (icon == ICON_FILE_BLANK) blend = -80;
+ if (icon == ICON_FILE_BLANK) alpha = 0.375f;
glEnable(GL_BLEND);
- UI_icon_draw_aspect_blended(x, y, icon, 1.f, blend);
+ UI_icon_draw_aspect(x, y, icon, 1.f, alpha);
}
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 1d57f4e0d4c..c7e458b9e87 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -685,7 +685,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
icon_id= ICON_MATERIAL_DATA;
iconofs-= 18.0f;
glEnable(GL_BLEND);
- UI_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, icon_id, snode->aspect, -60);
+ UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY+2, icon_id, snode->aspect, 0.5f);
glDisable(GL_BLEND);
}
if(node->type == NODE_GROUP) {
@@ -693,21 +693,18 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
iconofs-= 18.0f;
glEnable(GL_BLEND);
if(node->id->lib) {
- glPixelTransferf(GL_GREEN_SCALE, 0.7f);
- glPixelTransferf(GL_BLUE_SCALE, 0.3f);
- UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY+2, ICON_NODE, snode->aspect);
- glPixelTransferf(GL_GREEN_SCALE, 1.0f);
- glPixelTransferf(GL_BLUE_SCALE, 1.0f);
+ float rgb[3] = {1.0f, 0.7f, 0.3f};
+ UI_icon_draw_aspect_color(iconofs, rct->ymax-NODE_DY+2, ICON_NODE, snode->aspect, rgb);
}
else {
- UI_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, ICON_NODE, snode->aspect, -60);
+ UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY+2, ICON_NODE, snode->aspect, 0.5f);
}
glDisable(GL_BLEND);
}
if(node->typeinfo->flag & NODE_OPTIONS) {
iconofs-= 18.0f;
glEnable(GL_BLEND);
- UI_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, ICON_BUTS, snode->aspect, -60);
+ UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY+2, ICON_BUTS, snode->aspect, 0.5f);
glDisable(GL_BLEND);
}
{ /* always hide/reveal unused sockets */
@@ -720,7 +717,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
else*/
shade= -90;
glEnable(GL_BLEND);
- UI_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, ICON_PLUS, snode->aspect, shade);
+ UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY+2, ICON_PLUS, snode->aspect, 0.5f);
glDisable(GL_BLEND);
}
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 5fc09408229..5a89851d65b 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -62,7 +62,7 @@
#include "BKE_scene.h"
#include "BKE_utildefines.h"
-#include "ED_previewrender.h"
+#include "ED_render.h"
#include "BIF_gl.h"
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 12a5f33e119..2cfd9d99123 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -48,7 +48,7 @@
#include "BKE_screen.h"
#include "BKE_node.h"
-#include "ED_previewrender.h"
+#include "ED_render.h"
#include "ED_space_api.h"
#include "ED_screen.h"
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 6e415ec731d..c175f835d67 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -448,12 +448,21 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
ED_region_tag_redraw(ar);
break;
}
+ break;
+ case NC_WORLD:
+ switch(wmn->data) {
+ case ND_WORLD_DRAW:
+ ED_region_tag_redraw(ar);
+ break;
+ }
+ break;
case NC_LAMP:
switch(wmn->data) {
case ND_LIGHTING_DRAW:
ED_region_tag_redraw(ar);
break;
}
+ break;
case NC_IMAGE:
/* this could be more fine grained checks if we had
* more context than just the region */
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index bcb85b5f87e..7c76a5c099d 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -1,7 +1,28 @@
/**
+ *
* $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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
*/
+#include "DNA_listBase.h"
+
#ifndef DNA_MODIFIER_TYPES_H
#define DNA_MODIFIER_TYPES_H
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index a6532409e6e..ade22e4ebd4 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -419,7 +419,7 @@ extern Object workob;
#define OB_FROMDUPLI 512
#define OB_DONE 1024
-#define OB_RADIO 2048
+#define OB_RADIO 2048 /* deprecated */
#define OB_FROMGROUP 4096
/* ob->recalc (flag bits!) */
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 15125795e01..d5195110314 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -51,6 +51,9 @@ EnumPropertyItem brush_sculpt_tool_items[] = {
#include "BKE_texture.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
static void rna_Brush_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Brush *brush= (Brush*)ptr->data;
@@ -87,6 +90,12 @@ static void rna_Brush_active_texture_set(PointerRNA *ptr, PointerRNA value)
}
}
+static void rna_Brush_update(bContext *C, PointerRNA *ptr)
+{
+ Brush *br= (Brush*)ptr->data;
+ WM_event_add_notifier(C, NC_BRUSH|NA_EDITED, br);
+}
+
#else
static void rna_def_brush(BlenderRNA *brna)
@@ -118,130 +127,157 @@ static void rna_def_brush(BlenderRNA *brna)
prop= RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_blend_items);
RNA_def_property_ui_text(prop, "Blending mode", "Brush blending mode.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, brush_sculpt_tool_items);
RNA_def_property_ui_text(prop, "Sculpt Tool", "");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_flip_direction_items);
RNA_def_property_ui_text(prop, "Direction", "Mapping type to use for this image in the game engine.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
/* number values */
prop= RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 200);
RNA_def_property_ui_text(prop, "Size", "Diameter of the brush.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "jitter");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spacing");
RNA_def_property_range(prop, 1.0f, 100.0f);
RNA_def_property_ui_text(prop, "Spacing", "Spacing between brush stamps.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 10, 200);
RNA_def_property_ui_text(prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.5, 0.99);
RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rate");
RNA_def_property_range(prop, 0.010f, 1.0f);
RNA_def_property_ui_text(prop, "Rate", "Number of paints per second for Airbrush.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "rgb");
RNA_def_property_ui_text(prop, "Color", "");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Strength", "The amount of pressure on the brush.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
/* flag */
prop= RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH);
RNA_def_property_ui_text(prop, "Airbrush", "Keep applying paint effect while holding mouse (spray).");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_wrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TORUS);
RNA_def_property_ui_text(prop, "Wrap", "Enable torus wrapping while painting.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_strength_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_size_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_jitter_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_JITTER_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Jitter Pressure", "Enable tablet pressure sensitivity for jitter.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_spacing_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACING_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RAKE);
RNA_def_property_ui_text(prop, "Rake", "Rotate the brush texture to match the stroke direction.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ANCHORED);
RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE);
RNA_def_property_ui_text(prop, "Space", "Limit brush application to the distance specified by spacing.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SMOOTH_STROKE);
RNA_def_property_ui_text(prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PERSISTENT);
RNA_def_property_ui_text(prop, "Persistent", "Sculpts on a persistent layer of the mesh.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
/* not exposed in the interface yet
prop= RNA_def_property(srna, "fixed_tex", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FIXED_TEX);
- RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position.");*/
+ RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update"); */
prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
/* texture */
rna_def_mtex_common(srna, "rna_Brush_mtex_begin", "rna_Brush_active_texture_get",
- "rna_Brush_active_texture_set", "TextureSlot");
+ "rna_Brush_active_texture_set", "TextureSlot", "rna_Brush_update");
/* clone tool */
prop= RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clone.image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "clone_opacity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clone.alpha");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Clone Opacity", "Opacity of clone image display.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "clone.offset");
RNA_def_property_ui_text(prop, "Clone Offset", "");
RNA_def_property_ui_range(prop, -1.0f , 1.0f, 10.0f, 3);
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
}
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 3723c05ada0..8e50ffe7b94 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -173,7 +173,7 @@ void RNA_def_world(struct BlenderRNA *brna);
void rna_def_animdata_common(struct StructRNA *srna);
void rna_def_texmat_common(struct StructRNA *srna, const char *texspace_editable);
-void rna_def_mtex_common(struct StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname);
+void rna_def_mtex_common(struct StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname, const char *update);
void rna_def_render_layer_common(struct StructRNA *srna, int scene);
void rna_ID_name_get(struct PointerRNA *ptr, char *value);
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
index d00a0d61bf6..df04fe87bc5 100644
--- a/source/blender/makesrna/intern/rna_lamp.c
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -33,14 +33,17 @@
#include "DNA_material_types.h"
#include "DNA_texture_types.h"
-#include "WM_types.h"
-
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
+#include "BKE_depsgraph.h"
+#include "BKE_main.h"
#include "BKE_texture.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value)
{
Lamp *la= (Lamp*)ptr->data;
@@ -113,6 +116,30 @@ static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr)
}
}
+static void rna_Lamp_update(bContext *C, PointerRNA *ptr)
+{
+ Lamp *la= ptr->id.data;
+
+ DAG_id_flush_update(&la->id, 0);
+ WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING, la);
+}
+
+static void rna_Lamp_draw_update(bContext *C, PointerRNA *ptr)
+{
+ Lamp *la= ptr->id.data;
+
+ DAG_id_flush_update(&la->id, 0);
+ WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING_DRAW, la);
+}
+
+static void rna_Lamp_sky_update(bContext *C, PointerRNA *ptr)
+{
+ Lamp *la= ptr->id.data;
+
+ DAG_id_flush_update(&la->id, 0);
+ WM_event_add_notifier(C, NC_LAMP|ND_SKY, la);
+}
+
#else
static void rna_def_lamp_mtex(BlenderRNA *brna)
@@ -144,24 +171,24 @@ static void rna_def_lamp_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "map_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_COL);
RNA_def_property_ui_text(prop, "Color", "Lets the texture affect the basic color of the lamp.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "map_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_SHAD);
RNA_def_property_ui_text(prop, "Shadow", "Lets the texture affect the shadow color of the lamp.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Color Factor", "Amount texture affects color values.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Shadow Factor", "Amount texture affects shadow.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
static void rna_def_lamp_sky_settings(BlenderRNA *brna)
@@ -203,92 +230,92 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "sky_colorspace");
RNA_def_property_enum_items(prop, prop_skycolorspace_items);
RNA_def_property_ui_text(prop, "Sky Color Space", "Color space to use for internal XYZ->RGB color conversion.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sky_blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "skyblendtype");
RNA_def_property_enum_items(prop, prop_blendmode_items);
RNA_def_property_ui_text(prop, "Sky Blend Mode", "Blend mode for combining sun sky with world sky.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
/* Number values */
prop= RNA_def_property(srna, "horizon_brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Horizon Brightness", "Horizon brightness.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "spread", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Horizon Spread", "Horizon Spread.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sun_brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Brightness", "Sun brightness.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sun_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Size", "Sun size.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "backscattered_light", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Backscattered Light", "Backscattered light.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sun_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Intensity", "Sun intensity.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_turbidity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_turbidity");
RNA_def_property_range(prop, 1.0f, 30.0f);
RNA_def_property_ui_text(prop, "Atmosphere Turbidity", "Sky turbidity.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_inscattering", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_inscattering_factor");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Atmosphere Inscatter", "Scatter contribution factor.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_extinction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_extinction_factor");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Atmosphere Extinction", "Extinction scattering contribution factor.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_distance_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_distance_factor");
RNA_def_property_range(prop, 0.0f, 500.0f);
RNA_def_property_ui_text(prop, "Atmosphere Distance Factor", "Multiplier to convert blender units to physical distance.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sky_blend", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "skyblendfac");
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Sky Blend", "Blend factor with sky.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sky_exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Sky Exposure", "Strength of sky shading exponential exposure correction.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
/* boolean */
prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_SKY);
RNA_def_property_ui_text(prop, "Sky", "Apply sun effect on sky.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_AP);
RNA_def_property_ui_text(prop, "Atmosphere", "Apply sun effect on atmosphere.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
}
static void rna_def_lamp(BlenderRNA *brna)
@@ -312,48 +339,48 @@ static void rna_def_lamp(BlenderRNA *brna)
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of Lamp.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_ui_range(prop, 0, 1000, 1.0, 2);
RNA_def_property_ui_text(prop, "Distance", "Falloff distance - the light is at half the original intensity at this point.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 10.0, 0.1, 2);
RNA_def_property_ui_text(prop, "Energy", "Amount of light that the lamp emits.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "Light color.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER);
RNA_def_property_ui_text(prop, "Layer", "Illuminates objects only on the same layer the lamp is on.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "negative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NEG);
RNA_def_property_ui_text(prop, "Negative", "Lamp casts negative light.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_SPEC);
RNA_def_property_ui_text(prop, "Specular", "Lamp creates specular highlights.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_DIFF);
RNA_def_property_ui_text(prop, "Diffuse", "Lamp does diffuse shading.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
/* textures */
rna_def_mtex_common(srna, "rna_Lamp_mtex_begin", "rna_Lamp_active_texture_get",
- "rna_Lamp_active_texture_set", "LampTextureSlot");
+ "rna_Lamp_active_texture_set", "LampTextureSlot", "rna_Lamp_update");
}
static void rna_def_lamp_falloff(StructRNA *srna)
@@ -371,29 +398,29 @@ static void rna_def_lamp_falloff(StructRNA *srna)
prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_fallofftype_items);
RNA_def_property_ui_text(prop, "Falloff Type", "Intensity Decay with distance.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curfalloff");
RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "sphere", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SPHERE);
RNA_def_property_ui_text(prop, "Sphere", "Sets light intensity to zero beyond lamp distance.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "att1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Linear Attenuation", "Linear distance attentuation.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "quadratic_attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "att2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Quadratic Attenuation", "Quadratic distance attentuation.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
@@ -426,55 +453,55 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, (spot)? prop_spot_shadow_items: prop_shadow_items);
RNA_def_property_ui_text(prop, "Shadow Method", "Method to compute lamp shadow with.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "shdwr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows cast by the lamp.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "only_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_ONLYSHADOW);
RNA_def_property_ui_text(prop, "Only Shadow", "Causes light to cast shadows only without illuminating objects.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_ray_sampling_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ray_samp_method");
RNA_def_property_enum_items(prop, (area)? prop_spot_ray_sampling_method_items: prop_ray_sampling_method_items);
RNA_def_property_ui_text(prop, "Shadow Ray Sampling Method", "Method for generating shadow samples: Adaptive QMC is fastest, Constant QMC is less noisy but slower.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, (area)? "shadow_ray_samples_x": "shadow_ray_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_samp");
RNA_def_property_range(prop, 1, 64);
RNA_def_property_ui_text(prop, (area)? "Shadow Ray Samples": "Shadow Ray Samples X","Amount of samples taken extra (samples x samples).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
if(area) {
prop= RNA_def_property(srna, "shadow_ray_samples_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_sampy");
RNA_def_property_range(prop, 1, 64);
RNA_def_property_ui_text(prop, "Shadow Ray Samples Y", "Amount of samples taken extra (samples x samples).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
prop= RNA_def_property(srna, "shadow_adaptive_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Shadow Adaptive Threshold", "Threshold for Adaptive Sampling (Raytraced shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_soft_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "soft");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Shadow Soft Size", "Light size for ray shadow sampling (Raytraced shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER_SHADOW);
RNA_def_property_ui_text(prop, "Shadow Layer", "Causes only objects on the same layer to cast shadows.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
static void rna_def_point_lamp(BlenderRNA *brna)
@@ -510,41 +537,41 @@ static void rna_def_area_lamp(BlenderRNA *brna)
prop= RNA_def_property(srna, "umbra", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_UMBRA);
RNA_def_property_ui_text(prop, "Umbra", "Emphasize parts that are fully shadowed (Constant Jittered sampling).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "dither", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_DITHER);
RNA_def_property_ui_text(prop, "Dither", "Use 2x2 dithering for sampling (Constant Jittered sampling).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "jitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_JITTER);
RNA_def_property_ui_text(prop, "Jitter", "Use noise for sampling (Constant Jittered sampling).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "area_shape");
RNA_def_property_enum_items(prop, prop_areashape_items);
RNA_def_property_ui_text(prop, "Shape", "Shape of the area lamp.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "area_size");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Size", "Size of the area of the area Lamp, X direction size for Rectangle shapes.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "area_sizey");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Size Y", "Size of the area of the area Lamp in the Y direction for Rectangle shapes.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "k");
RNA_def_property_ui_range(prop, 0.001, 2.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Gamma", "Light gamma correction value.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
}
static void rna_def_spot_lamp(BlenderRNA *brna)
@@ -581,101 +608,101 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
prop= RNA_def_property(srna, "square", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SQUARE);
RNA_def_property_ui_text(prop, "Square", "Casts a square spot light shape.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_HALO);
RNA_def_property_ui_text(prop, "Halo", "Renders spotlight with a volumetric halo (Buffer Shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "haint");
RNA_def_property_ui_range(prop, 0, 5.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Halo Intensity", "Brightness of the spotlight's halo cone (Buffer Shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "halo_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "shadhalostep");
RNA_def_property_range(prop, 0, 12);
RNA_def_property_ui_text(prop, "Halo Step", "Volumetric halo sampling frequency.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "bufsize");
RNA_def_property_range(prop, 512, 10240);
RNA_def_property_ui_text(prop, "Shadow Buffer Size", "Resolution of the shadow buffer, higher values give crisper shadows but use more memory");
RNA_def_property_int_funcs(prop, NULL, "rna_Lamp_buffer_size_set", NULL);
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "filtertype");
RNA_def_property_enum_items(prop, prop_shadbuffiltertype_items);
RNA_def_property_ui_text(prop, "Shadow Filter Type", "Type of shadow filter (Buffer Shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_sample_buffers", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "buffers");
RNA_def_property_enum_items(prop, prop_numbuffer_items);
RNA_def_property_ui_text(prop, "Shadow Sample Buffers", "Number of shadow buffers to render for better AA, this increases memory usage.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spotblend");
RNA_def_property_range(prop, 0.0f ,1.0f);
RNA_def_property_ui_text(prop, "Spot Blend", "The softness of the spotlight edge.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spotsize");
RNA_def_property_range(prop, 1.0f ,180.0f);
RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam in degrees.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "shadow_buffer_clip_start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Clip Start", "Shadow map clip start: objects closer will not generate shadows");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Clip End", "Shadow map clip end beyond which objects will not generate shadows.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bias");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Shadow buffer sampling bias.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_soft", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "soft");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Soft", "Size of shadow buffer sampling area.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samp");
RNA_def_property_range(prop, 1, 16);
RNA_def_property_ui_text(prop, "Samples", "Number of shadow buffer samples.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "buftype");
RNA_def_property_enum_items(prop, prop_shadbuftype_items);
RNA_def_property_ui_text(prop, "Shadow Buffer Type", "Type of shadow buffer.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "auto_clip_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_START);
RNA_def_property_ui_text(prop, "Autoclip Start", "Automatic calculation of clipping-start, based on visible vertices.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "auto_clip_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_END);
RNA_def_property_ui_text(prop, "Autoclip End", "Automatic calculation of clipping-end, based on visible vertices.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
}
static void rna_def_sun_lamp(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index a6f22017aaa..9f7b97dfa05 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -33,6 +33,7 @@
#include "DNA_material_types.h"
#include "DNA_texture_types.h"
+#include "WM_api.h"
#include "WM_types.h"
static EnumPropertyItem prop_texture_coordinates_items[] = {
@@ -53,10 +54,28 @@ static EnumPropertyItem prop_texture_coordinates_items[] = {
#include "MEM_guardedalloc.h"
+#include "BKE_depsgraph.h"
+#include "BKE_main.h"
#include "BKE_texture.h"
#include "ED_node.h"
+static void rna_Material_update(bContext *C, PointerRNA *ptr)
+{
+ Material *ma= ptr->id.data;
+
+ DAG_id_flush_update(&ma->id, 0);
+ WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING, ma);
+}
+
+static void rna_Material_draw_update(bContext *C, PointerRNA *ptr)
+{
+ Material *ma= ptr->id.data;
+
+ DAG_id_flush_update(&ma->id, 0);
+ WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING_DRAW, ma);
+}
+
static PointerRNA rna_Material_mirror_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_MaterialRaytraceMirror, ptr->id.data);
@@ -308,122 +327,122 @@ static void rna_def_material_mtex(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Material_texture_coordinates_itemf");
RNA_def_property_ui_text(prop, "Texture Coordinates", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvname");
RNA_def_property_ui_text(prop, "UV Layer", "UV layer to use for mapping with UV texture coordinates.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "from_dupli", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_DUPLI_MAPTO);
RNA_def_property_ui_text(prop, "From Dupli", "Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "from_original", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_OB_DUPLI_ORIG);
RNA_def_property_ui_text(prop, "From Original", "Dupli's derive their object coordinates from the original objects transformation.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_colordiff", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COL);
RNA_def_property_ui_text(prop, "Diffuse Color", "Causes the texture to affect basic color of the material");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_NORM);
RNA_def_property_ui_text(prop, "Normal", "Causes the texture to affect the rendered normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_colorspec", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COLSPEC);
RNA_def_property_ui_text(prop, "Specular Color", "Causes the texture to affect the specularity color");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_mirror", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COLMIR);
RNA_def_property_ui_text(prop, "Mirror", "Causes the texture to affect the mirror color");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REF);
RNA_def_property_ui_text(prop, "Diffuse", "Causes the texture to affect the value of the materials diffuse reflectivity");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SPEC);
RNA_def_property_ui_text(prop, "Specular", "Causes the texture to affect the value of specular reflectivity");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_ambient", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_AMB);
RNA_def_property_ui_text(prop, "Ambient", "Causes the texture to affect the value of ambient");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_hardness", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_HAR);
RNA_def_property_ui_text(prop, "Hardness", "Causes the texture to affect the hardness value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_raymir", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_RAYMIRR);
RNA_def_property_ui_text(prop, "Ray-Mirror", "Causes the texture to affect the ray-mirror value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ALPHA);
RNA_def_property_ui_text(prop, "Alpha", "Causes the texture to affect the alpha value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_emit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMIT);
RNA_def_property_ui_text(prop, "Emit", "Causes the texture to affect the emit value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_translucency", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_TRANSLU);
RNA_def_property_ui_text(prop, "Translucency", "Causes the texture to affect the translucency value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_displacement", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DISPLACE);
RNA_def_property_ui_text(prop, "Displacement", "Let the texture displace the surface");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_warp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_WARP);
RNA_def_property_ui_text(prop, "Warp", "Let the texture warp texture coordinates of next channels");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "x_mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projx");
RNA_def_property_enum_items(prop, prop_x_mapping_items);
RNA_def_property_ui_text(prop, "X Mapping", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "y_mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projy");
RNA_def_property_enum_items(prop, prop_y_mapping_items);
RNA_def_property_ui_text(prop, "Y Mapping", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "z_mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projz");
RNA_def_property_enum_items(prop, prop_z_mapping_items);
RNA_def_property_ui_text(prop, "Z Mapping", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_mapping_items);
RNA_def_property_ui_text(prop, "Mapping", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* XXX: pmapto, pmaptoneg */
@@ -431,7 +450,7 @@ static void rna_def_material_mtex(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "normapspace");
RNA_def_property_enum_items(prop, prop_normal_map_space_items);
RNA_def_property_ui_text(prop, "Normal Map Space", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* XXX: MTex.which_output */
@@ -441,158 +460,158 @@ static void rna_def_material_mtex(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "dispfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Displacement Factor", "Amount texture displaces the surface.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "warp_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "warpfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Warp Factor", "Amount texture affects texture coordinates of next channels.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "colorspec_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Specular Color Factor", "Amount texture affects specular color.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "colordiff_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Diffuse Color Factor", "Amount texture affects diffuse color.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "mirror_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Mirror Factor", "Amount texture affects mirror color.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "alpha_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Alpha Factor", "Amount texture affects alpha.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Diffuse Factor", "Amount texture affects diffuse reflectivity.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Specular Factor", "Amount texture affects specular reflectivity.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "emit_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Emit Factor", "Amount texture affects emission.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "hardness_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Hardness Factor", "Amount texture affects hardness.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "raymir_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Ray Mirror Factor", "Amount texture affects ray mirror.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "translucency_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Translucency Factor", "Amount texture affects translucency.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ambient_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Ambient Factor", "Amount texture affects ambient.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* volume material */
prop= RNA_def_property(srna, "map_coloremission", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION_COL);
RNA_def_property_ui_text(prop, "Emission Color", "Causes the texture to affect the colour of emission");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_colorabsorption", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ABSORPTION_COL);
RNA_def_property_ui_text(prop, "Absorption Color", "Causes the texture to affect the result colour after absorption");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_density", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DENSITY);
RNA_def_property_ui_text(prop, "Density", "Causes the texture to affect the volume's density");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_emission", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION);
RNA_def_property_ui_text(prop, "Emission", "Causes the texture to affect the volume's emission");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_absorption", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ABSORPTION);
RNA_def_property_ui_text(prop, "Absorption", "Causes the texture to affect the volume's absorption");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_scattering", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SCATTERING);
RNA_def_property_ui_text(prop, "Scattering", "Causes the texture to affect the volume's scattering");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "coloremission_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Emission Color Factor", "Amount texture affects emission color.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "colorabsorption_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Absorpion Color Factor", "Amount texture affects diffuse color.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "density_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Density Factor", "Amount texture affects density.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "emission_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Emission Factor", "Amount texture affects emission.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "absorption_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Absorption Factor", "Amount texture affects absorption.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "scattering_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Scattering Factor", "Amount texture affects scattering.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* end volume material */
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_MaterialTextureSlot_enabled_get", "rna_MaterialTextureSlot_enabled_set");
RNA_def_property_ui_text(prop, "Enabled", "Enable this material texture slot.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "new_bump", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_NEW_BUMP);
RNA_def_property_ui_text(prop, "New Bump", "Use new, corrected bump mapping code (backwards compatibility option).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_colors(StructRNA *srna)
@@ -631,79 +650,79 @@ static void rna_def_material_colors(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Diffuse Color", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "specr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Specular Color", "Specular color of the material.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "mirror_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "mirr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Mirror Color", "Mirror color of the material.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Alpha", "Alpha transparency of the material.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "specular_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "spectra");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Specular Alpha", "Alpha transparency for specular areas.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* Color bands */
prop= RNA_def_property(srna, "use_diffuse_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAMP_COL);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Material_use_diffuse_ramp_set");
RNA_def_property_ui_text(prop, "Use Diffuse Ramp", "Toggle diffuse ramp operations.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ramp_col");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Diffuse Ramp", "Color ramp used to affect diffuse shading.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_specular_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAMP_SPEC);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Material_use_specular_ramp_set");
RNA_def_property_ui_text(prop, "Use Specular Ramp", "Toggle specular ramp operations.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ramp_spec");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Specular Ramp", "Color ramp used to affect specular shading.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_ramp_blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampblend_col");
RNA_def_property_enum_items(prop, prop_ramp_blend_diffuse_items);
RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_ramp_blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampblend_spec");
RNA_def_property_enum_items(prop, prop_ramp_blend_diffuse_items);
RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_ramp_input", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampin_col");
RNA_def_property_enum_items(prop, prop_ramp_input_items);
RNA_def_property_ui_text(prop, "Diffuse Ramp Input", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_ramp_input", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampin_spec");
RNA_def_property_enum_items(prop, prop_ramp_input_items);
RNA_def_property_ui_text(prop, "Specular Ramp Input", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
@@ -723,47 +742,47 @@ static void rna_def_material_diffuse(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "diff_shader");
RNA_def_property_enum_items(prop, prop_diff_shader_items);
RNA_def_property_ui_text(prop, "Diffuse Shader Model", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_intensity", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "ref");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Diffuse Intensity", "Amount of diffuse reflection.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "roughness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 3.14f);
RNA_def_property_ui_text(prop, "Roughness", "Oren-Nayar Roughness");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_toon_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[0]");
RNA_def_property_range(prop, 0.0f, 3.14f);
RNA_def_property_ui_text(prop, "Diffuse Toon Size", "Size of diffuse toon area.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_toon_smooth", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "param[1]");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Diffuse Toon Smooth", "Smoothness of diffuse toon area.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_fresnel", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[1]");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Diffuse Fresnel", "Power of Fresnel.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_fresnel_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[0]");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Diffuse Fresnel Factor", "Blending factor of Frensel.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "darkness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Darkness", "Minnaert darkness.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_raymirror(BlenderRNA *brna)
@@ -784,67 +803,67 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYMIRROR); /* use bitflags */
RNA_def_property_ui_text(prop, "Enabled", "Enable raytraced reflections.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "reflect_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "ray_mirror");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Reflectivity", "Sets the amount mirror reflection for raytrace.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fresnel_mir");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for mirror reflection.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "fresnel_mir_i");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "gloss_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Amount", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "aniso_gloss_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Anisotropy", "The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samp_gloss_mir");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry reflections.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_depth");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Depth", "Maximum allowed number of light inter-reflections.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist_mir");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance of reflected rays. Reflections further than this range fade to sky color or material color.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "fade_to", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "fadeto_mir");
RNA_def_property_enum_items(prop, prop_fadeto_mir_items);
RNA_def_property_ui_text(prop, "Fade-out Color", "The color that rays with no intersection within the Max Distance take. Material color can be best for indoor scenes, sky color for outdoor.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_raytra(BlenderRNA *brna)
@@ -861,61 +880,61 @@ static void rna_def_material_raytra(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "ang");
RNA_def_property_range(prop, 1.0f, 3.0f);
RNA_def_property_ui_text(prop, "IOR", "Sets angular index of refraction for raytraced refraction.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fresnel_tra");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for transparency (Ray or ZTransp).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "fresnel_tra_i");
RNA_def_property_range(prop, 1.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "gloss_tra");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Amount", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samp_gloss_tra");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry refractions.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_tra");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_depth_tra");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Depth", "Maximum allowed number of light inter-refractions.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "filter", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "filter");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Filter", "Amount to blend in the material's diffuse color in raytraced transparency (simulating absorption).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "limit", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "tx_limit");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Limit", "Maximum depth for light to travel through the transparent material before becoming fully filtered (0.0 is disabled).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "tx_falloff");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Falloff", "Falloff power for transmissivity filter effect (1.0 is linear).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_volume(BlenderRNA *brna)
@@ -954,120 +973,120 @@ static void rna_def_material_volume(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "stepsize_type");
RNA_def_property_enum_items(prop, prop_stepsize_items);
RNA_def_property_ui_text(prop, "Step Calculation", "Method of calculating the steps through the volume");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "step_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stepsize");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
RNA_def_property_ui_text(prop, "Step Size", "Distance between subsequent volume depth samples.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shading_step_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shade_stepsize");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
RNA_def_property_ui_text(prop, "Shading Step Size", "Distance between subsequent volume shading samples.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "scattering_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "shade_type");
RNA_def_property_enum_items(prop, prop_scattering_items);
RNA_def_property_ui_text(prop, "Scattering Mode", "Method of shading, attenuating, and scattering light through the volume");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "light_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_PRECACHESHADING); /* use bitflags */
RNA_def_property_ui_text(prop, "Light Cache", "Pre-calculate the shading information into a voxel grid, speeds up shading at slightly less accuracy");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "cache_resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "precache_resolution");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ms_diffusion", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ms_diff");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Diffusion", "Diffusion factor, the strength of the blurring effect");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ms_spread", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ms_steps");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Spread", "Simulation steps, the effective distance over which the light is diffused");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ms_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ms_intensity");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Intensity", "Multiplier for multiple scattered light energy");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "depth_cutoff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "depth_cutoff");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Depth Cutoff", "Stop ray marching early if transmission drops below this luminance - higher values give speedups in dense volumes at the expense of accuracy.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "density");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Density", "The base density of the volume");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "density_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "density_scale");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_ui_text(prop, "Density Scale", "Multiplier for the material's density");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "absorption", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "absorption");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_ui_text(prop, "Absorption", "Amount of light that gets absorbed by the volume - higher values mean light travels less distance");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "absorption_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "absorption_col");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Absorption Color", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "scattering", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scattering");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1 ,3);
RNA_def_property_ui_text(prop, "Scattering", "Amount of light that gets scattered by the volume - values > 1.0 are non-physical");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "emission", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "emission");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_ui_text(prop, "Emission", "Amount of light that gets emitted by the volume");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "emission_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "emission_col");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Emission Color", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "phase_function", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "phasefunc_type");
RNA_def_property_enum_items(prop, prop_phasefunction_items);
RNA_def_property_ui_text(prop, "Phase Function", "Isotropic/Anisotropic scattering");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "asymmetry", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "phasefunc_g");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Asymmetry", "Continuum between forward scattering and back scattering");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
@@ -1085,118 +1104,118 @@ static void rna_def_material_halo(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "hasize");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Size", "Sets the dimension of the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "hardness", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "har");
RNA_def_property_range(prop, 0, 127);
RNA_def_property_ui_text(prop, "Hardness", "Sets the hardness of the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "add", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "add");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Add", "Sets the strength of the add effect.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "rings", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ringc");
RNA_def_property_range(prop, 0, 24);
RNA_def_property_ui_text(prop, "Rings", "Sets the number of rings rendered over the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "line_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "linec");
RNA_def_property_range(prop, 0, 250);
RNA_def_property_ui_text(prop, "Line Number", "Sets the number of star shaped lines rendered over the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "star_tips", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "starc");
RNA_def_property_range(prop, 3, 50);
RNA_def_property_ui_text(prop, "Star Tips", "Sets the number of points on the star shaped halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "seed1");
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Seed", "Randomizes ring dimension and line location.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_FLARE); /* use bitflags */
RNA_def_property_ui_text(prop, "Flare", "Renders halo as a lensflare.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "flaresize");
RNA_def_property_range(prop, 0.1f, 25.0f);
RNA_def_property_ui_text(prop, "Flare Size", "Sets the factor by which the flare is larger than the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_subsize", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "subsize");
RNA_def_property_range(prop, 0.1f, 25.0f);
RNA_def_property_ui_text(prop, "Flare Subsize", "Sets the dimension of the subflares, dots and circles.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_boost", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "flareboost");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Flare Boost", "Gives the flare extra strength.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_seed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "seed2");
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Flare Seed", "Specifies an offset in the flare seed table.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flares_sub", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "flarec");
RNA_def_property_range(prop, 1, 32);
RNA_def_property_ui_text(prop, "Flares Sub", "Sets the number of subflares.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ring", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_RINGS);
RNA_def_property_ui_text(prop, "Rings", "Renders rings over halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "lines", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_LINES);
RNA_def_property_ui_text(prop, "Lines", "Renders star shaped lines over halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "star", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STAR);
RNA_def_property_ui_text(prop, "Star", "Renders halo as a star.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOTEX);
RNA_def_property_ui_text(prop, "Texture", "Gives halo a texture.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "vertex_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOPUNO);
RNA_def_property_ui_text(prop, "Vertex Normal", "Uses the vertex normal to specify the dimension of the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "xalpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_XALPHA);
RNA_def_property_ui_text(prop, "Extreme Alpha", "Uses extreme alpha.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shaded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_SHADE);
RNA_def_property_ui_text(prop, "Shaded", "Lets halo receive light and shadows from external objects.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "soft", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_SOFT);
RNA_def_property_ui_text(prop, "Soft", "Softens the edges of halos at intersections with other geometry.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_sss(BlenderRNA *brna)
@@ -1214,59 +1233,59 @@ static void rna_def_material_sss(BlenderRNA *brna)
RNA_def_property_range(prop, 0.001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001, 10000, 1, 3);
RNA_def_property_ui_text(prop, "Radius", "Mean red/green/blue scattering path length.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "sss_col");
RNA_def_property_ui_text(prop, "Color", "Scattering color.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "error_tolerance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_error");
RNA_def_property_ui_range(prop, 0.0001, 10, 1, 3);
RNA_def_property_ui_text(prop, "Error Tolerance", "Error tolerance (low values are slower and higher quality).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_scale");
RNA_def_property_ui_range(prop, 0.001, 1000, 1, 3);
RNA_def_property_ui_text(prop, "Scale", "Object scale factor.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ior", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_ior");
RNA_def_property_ui_range(prop, 0.1, 2, 1, 3);
RNA_def_property_ui_text(prop, "IOR", "Index of refraction (higher values are denser).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "sss_colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Color Factor", "Blend factor for SSS colors.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "texture_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "sss_texfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Texture Factor", "Texture scatting blend factor.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "front", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_front");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Front", "Front scattering weight.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_back");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Back", "Back scattering weight.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sss_flag", MA_DIFF_SSS);
RNA_def_property_ui_text(prop, "Enabled", "Enable diffuse subsurface scatting effects in a material.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_specularity(StructRNA *srna)
@@ -1285,13 +1304,13 @@ static void rna_def_material_specularity(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "spec_shader");
RNA_def_property_enum_items(prop, prop_specular_shader_items);
RNA_def_property_ui_text(prop, "Specular Shader Model", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "spec");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Specular Intensity", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* NOTE: "har", "param", etc are used for multiple purposes depending on
* settings. This should be fixed in DNA once, for RNA we just expose them
@@ -1302,31 +1321,31 @@ static void rna_def_material_specularity(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "har");
RNA_def_property_range(prop, 1, 511);
RNA_def_property_ui_text(prop, "Specular Hardness", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_ior", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "refrac");
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Specular IOR", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_toon_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[2]");
RNA_def_property_range(prop, 0.0f, 1.53f);
RNA_def_property_ui_text(prop, "Specular Toon Size", "Size of specular toon area.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_toon_smooth", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "param[3]");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Specular Toon Smooth", "Ssmoothness of specular toon area.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_slope", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rms");
RNA_def_property_range(prop, 0, 0.4);
RNA_def_property_ui_text(prop, "Specular Slope", "The standard deviation of surface slope.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_strand(BlenderRNA *brna)
@@ -1342,58 +1361,58 @@ static void rna_def_material_strand(BlenderRNA *brna)
prop= RNA_def_property(srna, "tangent_shading", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_STR);
RNA_def_property_ui_text(prop, "Tangent Shading", "Uses direction of strands as normal for tangent-shading.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "surface_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STR_SURFDIFF);
RNA_def_property_ui_text(prop, "Surface Diffuse", "Make diffuse shading more similar to shading the surface.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "blend_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "strand_surfnor");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Blend Distance", "Worldspace distance over which to blend in the surface normal.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "blender_units", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STR_B_UNITS);
RNA_def_property_ui_text(prop, "Blender Units", "Use Blender units for widths instead of pixels.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "root_size", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "strand_sta");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_start_size_range");
RNA_def_property_ui_text(prop, "Root Size", "Start size of strands in pixels Blender units.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "tip_size", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "strand_end");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_end_size_range");
RNA_def_property_ui_text(prop, "Tip Size", "Start size of strands in pixels or Blender units.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "min_size", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "strand_min");
RNA_def_property_range(prop, 0.001, 10);
RNA_def_property_ui_text(prop, "Minimum Size", "Minimum size of strands in pixels.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shape", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strand_ease");
RNA_def_property_range(prop, -0.9, 0.9);
RNA_def_property_ui_text(prop, "Shape", "Positive values make strands rounder, negative makes strands spiky.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "width_fade", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strand_widthfade");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Width Fade", "Transparency along the width of the strand.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "strand_uvname");
RNA_def_property_ui_text(prop, "UV Layer", "Name of UV layer to override.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_physics(BlenderRNA *brna)
@@ -1461,45 +1480,45 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Material type defining how the object is rendered.");
RNA_def_property_enum_funcs(prop, NULL, "rna_Material_type_set", NULL);
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "transparency", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRANSP);
RNA_def_property_ui_text(prop, "Transparency", "Render material as transparent.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "transparency_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, transparency_items);
RNA_def_property_ui_text(prop, "Transparency Method", "Method to use for rendering transparency.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "amb");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Ambient", "Amount of global ambient color the material receives.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "emit", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 2.0f, 10, 2);
RNA_def_property_ui_text(prop, "Emit", "Amount of light to emit.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "translucency", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Translucency", "Amount of diffuse shading on the back side.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "cubic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_CUBIC);
RNA_def_property_ui_text(prop, "Cubic Interpolation", "Use cubic interpolation for diffuse values, for smoother transitions.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "object_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_OBCOLOR);
RNA_def_property_ui_text(prop, "Object Color", "Modulate the result with a per-object color.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shadow_ray_bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sbias");
@@ -1515,106 +1534,106 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "shad_alpha");
RNA_def_property_range(prop, 0.001, 1);
RNA_def_property_ui_text(prop, "Shadow Casting Alpha", "Shadow casting alpha, only in use for Irregular Shadowbuffer.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "light_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "group");
RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Light Group", "Limit lighting to lamps in this Group.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* flags */
prop= RNA_def_property(srna, "light_group_exclusive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_GROUP_NOLAY);
RNA_def_property_ui_text(prop, "Light Group Exclusive", "Material uses the light group exclusively - these lamps are excluded from other scene lighting.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "traceable", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRACEBLE);
RNA_def_property_ui_text(prop, "Traceable", "Include this material and geometry that uses it in ray tracing calculations.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW);
RNA_def_property_ui_text(prop, "Shadows", "Allows this material to receive shadows.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shadeless", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHLESS);
RNA_def_property_ui_text(prop, "Shadeless", "Makes this material insensitive to light or shadow.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "vertex_color_light", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOL);
RNA_def_property_ui_text(prop, "Vertex Color Light", "Add vertex colors as additional lighting.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "vertex_color_paint", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOLP);
RNA_def_property_ui_text(prop, "Vertex Color Paint", "Replaces object base color with vertex colors (multiplies with 'texture face' face assigned textures).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ZINV);
RNA_def_property_ui_text(prop, "Invert Z Depth", "Renders material's faces with an inverted Z buffer (scanline only).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ENV);
RNA_def_property_ui_text(prop, "Sky", "Renders this material with zero alpha, with sky background in place (scanline only).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "only_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYSHADOW);
RNA_def_property_ui_text(prop, "Only Shadow", "Renders shadows as the material's alpha value, making materials transparent except for shadowed areas.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "face_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE);
RNA_def_property_ui_text(prop, "Face Textures", "Replaces the object's base color with color from face assigned image textures");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "face_texture_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE_ALPHA);
RNA_def_property_ui_text(prop, "Face Textures Alpha", "Replaces the object's base alpha value with alpha from face assigned image textures");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "cast_shadows_only", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYCAST);
RNA_def_property_ui_text(prop, "Cast Shadows Only", "Makes objects with this material appear invisible, only casting shadows (not rendered).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "exclude_mist", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_NOMIST);
RNA_def_property_ui_text(prop, "Exclude Mist", "Excludes this material from mist effects (in world settings)");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "receive_transparent_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW_TRA);
RNA_def_property_ui_text(prop, "Receive Transparent Shadows", "Allow this object to receive transparent shadows casted through other objects");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ray_shadow_bias", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYBIAS);
RNA_def_property_ui_text(prop, "Ray Shadow Bias", "Prevents raytraced shadow errors on surfaces with smooth shaded normals (terminator problem)");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "full_oversampling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FULL_OSA);
RNA_def_property_ui_text(prop, "Full Oversampling", "Force this material to render full shading/textures for all anti-aliasing samples");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "cast_buffer_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADBUF);
RNA_def_property_ui_text(prop, "Cast Buffer Shadows", "Allow this material to cast shadows from shadow buffer lamps");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "tangent_shading", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_V);
RNA_def_property_ui_text(prop, "Tangent Shading", "Use the material's tangent vector instead of the normal for shading - for anisotropic shading effects");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* nested structs */
prop= RNA_def_property(srna, "raytrace_mirror", PROP_POINTER, PROP_NONE);
@@ -1673,7 +1692,7 @@ void RNA_def_material(BlenderRNA *brna)
/* common */
rna_def_animdata_common(srna);
rna_def_mtex_common(srna, "rna_Material_mtex_begin", "rna_Material_active_texture_get",
- "rna_Material_active_texture_set", "MaterialTextureSlot");
+ "rna_Material_active_texture_set", "MaterialTextureSlot", "rna_Material_update");
rna_def_material_colors(srna);
rna_def_material_diffuse(srna);
@@ -1692,7 +1711,7 @@ void RNA_def_material(BlenderRNA *brna)
RNA_api_material(srna);
}
-void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname)
+void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname, const char *update)
{
PropertyRNA *prop;
@@ -1707,13 +1726,13 @@ void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeg
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, activeget, activeset, NULL);
RNA_def_property_ui_text(prop, "Active Texture", "Active texture slot being displayed.");
- RNA_def_property_update(prop, NC_TEXTURE|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, update);
prop= RNA_def_property(srna, "active_texture_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "texact");
RNA_def_property_range(prop, 0, MAX_MTEX-1);
RNA_def_property_ui_text(prop, "Active Texture Index", "Index of active texture slot.");
- RNA_def_property_update(prop, NC_TEXTURE|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, update);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 6fb9a9ca57b..d63f5823b2e 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -40,8 +40,6 @@
#include "BKE_node.h"
-#include "WM_types.h"
-
static EnumPropertyItem texture_filter_items[] = {
{TXF_BOX, "BOX", 0, "Box", ""},
{TXF_EWA, "EWA", 0, "EWA", ""},
@@ -52,9 +50,15 @@ static EnumPropertyItem texture_filter_items[] = {
#ifdef RNA_RUNTIME
+#include "BKE_depsgraph.h"
#include "BKE_texture.h"
+#include "BKE_main.h"
+
#include "ED_node.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
static StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
{
Tex *tex= (Tex*)ptr->data;
@@ -95,6 +99,14 @@ static StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
}
}
+static void rna_Texture_update(bContext *C, PointerRNA *ptr)
+{
+ Tex *tex= ptr->id.data;
+
+ DAG_id_flush_update(&tex->id, 0);
+ WM_event_add_notifier(C, NC_TEXTURE, tex);
+}
+
static void rna_Texture_type_set(PointerRNA *ptr, int value)
{
Tex *tex= (Tex*)ptr->data;
@@ -112,6 +124,28 @@ static void rna_Texture_type_set(PointerRNA *ptr, int value)
tex->type = value;
}
+static void rna_TextureSlot_update(bContext *C, PointerRNA *ptr)
+{
+ ID *id= ptr->id.data;
+
+ DAG_id_flush_update(id, 0);
+
+ switch(GS(id->name)) {
+ case ID_MA:
+ WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING, id);
+ break;
+ case ID_WO:
+ WM_event_add_notifier(C, NC_WORLD, id);
+ break;
+ case ID_LA:
+ WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING, id);
+ break;
+ case ID_BR:
+ WM_event_add_notifier(C, NC_BRUSH, id);
+ break;
+ }
+}
+
static int rna_TextureSlot_name_length(PointerRNA *ptr)
{
MTex *mtex= ptr->data;
@@ -271,13 +305,13 @@ static void rna_def_color_ramp_element(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Color", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "pos");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Position", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_color_ramp(BlenderRNA *brna)
@@ -301,13 +335,13 @@ static void rna_def_color_ramp(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "data", "tot");
RNA_def_property_struct_type(prop, "ColorRampElement");
RNA_def_property_ui_text(prop, "Elements", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ipotype");
RNA_def_property_enum_items(prop, prop_interpolation_items);
RNA_def_property_ui_text(prop, "Interpolation", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texmapping(BlenderRNA *brna)
@@ -321,37 +355,37 @@ static void rna_def_texmapping(BlenderRNA *brna)
prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Rotation", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Scale", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "has_minimum", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN);
RNA_def_property_ui_text(prop, "Has Minimum", "Whether to use minimum clipping value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "has_maximum", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX);
RNA_def_property_ui_text(prop, "Has Maximum", "Whether to use maximum clipping value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_mtex(BlenderRNA *brna)
@@ -398,60 +432,60 @@ static void rna_def_mtex(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Texture");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture", "Texture datablock used by this texture slot.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_TextureSlot_name_get", "rna_TextureSlot_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "Texture slot name.");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_struct_name_property(srna, prop);
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
/* mapping */
prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "ofs");
RNA_def_property_ui_range(prop, -10, 10, 10, 2);
RNA_def_property_ui_text(prop, "Offset", "Fine tunes texture mapping X, Y and Z locations.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_XYZ);
RNA_def_property_ui_range(prop, -100, 100, 10, 2);
RNA_def_property_ui_text(prop, "Size", "Sets scaling for the texture's X, Y and Z sizes.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "The default color for textures that don't return RGB.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blendtype");
RNA_def_property_enum_items(prop, prop_blend_type_items);
RNA_def_property_ui_text(prop, "Blend Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "stencil", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_STENCIL);
RNA_def_property_ui_text(prop, "Stencil", "Use this texture as a blending value on the next texture.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "negate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_NEGATIVE);
RNA_def_property_ui_text(prop, "Negate", "Inverts the values of the texture to reverse its effect.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "rgb_to_intensity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_RGBTOINT);
RNA_def_property_ui_text(prop, "RGB to Intensity", "Converts texture RGB values to intensity (gray) values.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_range(prop, 0, 360);
RNA_def_property_float_funcs(prop, "rna_TextureSlot_angle_get", "rna_TextureSlot_angle_set", NULL);
RNA_def_property_ui_text(prop, "Angle", "Defines brush texture rotation.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "brush_map_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_map_mode_items);
@@ -461,26 +495,26 @@ static void rna_def_mtex(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "def_var");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Default Value", "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "variable_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Variable Factor", "Amount texture affects other values.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "norfac");
RNA_def_property_ui_range(prop, 0, 5, 10, 3);
RNA_def_property_ui_text(prop, "Normal Factor", "Amount texture affects normal values.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "output_node", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "which_output");
RNA_def_property_enum_items(prop, output_node_items);
RNA_def_property_enum_funcs(prop, "rna_TextureSlot_output_node_get", NULL, "rna_TextureSlot_output_node_itemf");
RNA_def_property_ui_text(prop, "Output Node", "Which output node to use, for node-based textures.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
}
static void rna_def_filter_size_common(StructRNA *srna)
@@ -491,14 +525,14 @@ static void rna_def_filter_size_common(StructRNA *srna)
prop= RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_FILTER_MIN);
RNA_def_property_ui_text(prop, "Use Filter", "Use Filter Size as a minimal filter value in pixels");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "filtersize");
RNA_def_property_range(prop, 0.1, 50.0);
RNA_def_property_ui_range(prop, 0.1, 50.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Filter Size", "Multiplies the filter size used by MIP Map and Interpolation");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_environment_map_common(StructRNA *srna)
@@ -515,14 +549,14 @@ static void rna_def_environment_map_common(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_source_items);
RNA_def_property_ui_text(prop, "Source", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* XXX: move this to specific types if needed */
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ima");
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_ui_text(prop, "Image", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_environment_map(BlenderRNA *brna)
@@ -545,28 +579,28 @@ static void rna_def_environment_map(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_range(prop, 0.01, 50, 100, 2);
RNA_def_property_ui_text(prop, "Clip Start", "Objects nearer than this are not visible to map.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_range(prop, 0.10, 20000, 100, 2);
RNA_def_property_ui_text(prop, "Clip End", "Objects further than this are not visible to map.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "viewscale");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_range(prop, 0.5, 5, 100, 2);
RNA_def_property_ui_text(prop, "Zoom", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* XXX: EnvMap.notlay */
@@ -574,12 +608,12 @@ static void rna_def_environment_map(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "cuberes");
RNA_def_property_range(prop, 50, 4096);
RNA_def_property_ui_text(prop, "Resolution", "Pixel resolution of the rendered environment map.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 5);
RNA_def_property_ui_text(prop, "Depth", "Number of times a map will be rendered recursively (mirror effects.)");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static EnumPropertyItem prop_noise_basis_items[] = {
@@ -620,38 +654,38 @@ static void rna_def_texture_clouds(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 6, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_clouds_stype);
RNA_def_property_ui_text(prop, "Color", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_wood(BlenderRNA *brna)
@@ -681,44 +715,44 @@ static void rna_def_texture_wood(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turbul");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_wood_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_wood_noisebasis2);
RNA_def_property_ui_text(prop, "Noise Basis 2", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
@@ -748,51 +782,51 @@ static void rna_def_texture_marble(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turbul");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 6, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_marble_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_marble_noisebasis2);
RNA_def_property_ui_text(prop, "Noise Basis 2", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
@@ -810,14 +844,14 @@ static void rna_def_texture_magic(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 6, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_blend(BlenderRNA *brna)
@@ -848,13 +882,13 @@ static void rna_def_texture_blend(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_blend_progression);
RNA_def_property_ui_text(prop, "Progression", "Sets the style of the color blending");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "flip_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_flip_axis_items);
RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
@@ -878,32 +912,32 @@ static void rna_def_texture_stucci(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_stucci_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_noise(BlenderRNA *brna)
@@ -936,45 +970,45 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_MIPMAP);
RNA_def_property_boolean_funcs(prop, NULL, "rna_ImageTexture_mipmap_set");
RNA_def_property_ui_text(prop, "MIP Map", "Uses auto-generated MIP maps for the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "mipmap_gauss", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_GAUSS_MIP);
RNA_def_property_ui_text(prop, "MIP Map Gauss", "Uses Gauss filter to sample down MIP maps");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "interpolation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_INTERPOL);
RNA_def_property_ui_text(prop, "Interpolation", "Interpolates pixels using Area filter");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* XXX: I think flip_axis should be a generic Texture property, enabled for all the texture types */
prop= RNA_def_property(srna, "flip_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_IMAROT);
RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_USEALPHA);
RNA_def_property_ui_text(prop, "Use Alpha", "Uses the alpha channel information in the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "calculate_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_CALCALPHA);
RNA_def_property_ui_text(prop, "Calculate Alpha", "Calculates an alpha channel based on RGB values in the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "invert_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_NEGALPHA);
RNA_def_property_ui_text(prop, "Invert Alpha", "Inverts all the alpha values in the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
rna_def_filter_size_common(srna);
prop= RNA_def_property(srna, "normal_map", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP);
RNA_def_property_ui_text(prop, "Normal Map", "Uses image RGB values for normal mapping");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* XXX: mtex->normapspace "Sets space of normal map image" "Normal Space %t|Camera %x0|World %x1|Object %x2|Tangent %x3"
* not sure why this goes in mtex instead of texture directly? */
@@ -983,46 +1017,46 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "extend");
RNA_def_property_enum_items(prop, prop_image_extension);
RNA_def_property_ui_text(prop, "Extension", "Sets how the image is stretched in the texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "repeat_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xrepeat");
RNA_def_property_range(prop, 1, 512);
RNA_def_property_ui_text(prop, "Repeat X", "Sets a repetition multiplier in the X direction");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "repeat_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "yrepeat");
RNA_def_property_range(prop, 1, 512);
RNA_def_property_ui_text(prop, "Repeat Y", "Sets a repetition multiplier in the Y direction");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "mirror_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_XMIR);
RNA_def_property_ui_text(prop, "Mirror X", "Mirrors the image repetition on the X direction");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "mirror_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_YMIR);
RNA_def_property_ui_text(prop, "Mirror Y", "Mirrors the image repetition on the Y direction");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "checker_odd", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_ODD);
RNA_def_property_ui_text(prop, "Checker Odd", "Sets odd checker tiles");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "checker_even", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_EVEN);
RNA_def_property_ui_text(prop, "Checker Even", "Sets even checker tiles");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "checker_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "checkerdist");
RNA_def_property_range(prop, 0.0, 0.99);
RNA_def_property_ui_range(prop, 0.0, 0.99, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Checker Distance", "Sets distance between checker tiles");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
#if 0
@@ -1034,7 +1068,7 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_array(prop, 4);
RNA_def_property_range(prop, -10, 10);
RNA_def_property_ui_text(prop, "Crop Rectangle", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
#endif
@@ -1043,40 +1077,40 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Minimum X", "Sets minimum X value to crop the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "crop_min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropymin");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Minimum Y", "Sets minimum Y value to crop the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "crop_max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropxmax");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Maximum X", "Sets maximum X value to crop the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "crop_max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropymax");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Maximum Y", "Sets maximum Y value to crop the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ima");
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* filtering */
prop= RNA_def_property(srna, "filter", PROP_ENUM, PROP_NONE);
@@ -1084,19 +1118,19 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_enum_items(prop, texture_filter_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageTexture_filter_itemf");
RNA_def_property_ui_text(prop, "Filter", "Texture filter to use for sampling image.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "filter_probes", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "afmax");
RNA_def_property_range(prop, 1, 256);
RNA_def_property_ui_text(prop, "Filter Probes", "Maximum number of samples. Higher gives less blur at distant/oblique angles, but is also slower.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "afmax");
RNA_def_property_range(prop, 1, 256);
RNA_def_property_ui_text(prop, "Filter Eccentricity", "Maximum eccentricity. Higher gives less blur at distant/oblique angles, but is also slower.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_plugin(BlenderRNA *brna)
@@ -1124,13 +1158,13 @@ static void rna_def_texture_environment_map(BlenderRNA *brna)
prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "environment_map", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "env");
RNA_def_property_struct_type(prop, "EnvironmentMap");
RNA_def_property_ui_text(prop, "Environment Map", "Gets the environment map associated with this texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
rna_def_filter_size_common(srna);
}
@@ -1156,62 +1190,62 @@ static void rna_def_texture_musgrave(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_musgrave_type);
RNA_def_property_ui_text(prop, "Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "highest_dimension", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_H");
RNA_def_property_range(prop, 0.0001, 2);
RNA_def_property_ui_text(prop, "Highest Dimension", "Highest fractal dimension");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "lacunarity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_lacunarity");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Lacunarity", "Gap between succesive frequencies");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "octaves", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_octaves");
RNA_def_property_range(prop, 0, 8);
RNA_def_property_ui_text(prop, "Octaves", "Number of frequencies used");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_offset");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Offset", "The fractal offset");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_gain");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Gain", "The gain multiplier");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ns_outscale");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Noise Intensity", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_voronoi(BlenderRNA *brna)
@@ -1245,62 +1279,62 @@ static void rna_def_texture_voronoi(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "vn_w1");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 1", "Voronoi feature weight 1");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "weight_2", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w2");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 2", "Voronoi feature weight 2");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "weight_3", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w3");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 3", "Voronoi feature weight 3");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "weight_4", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w4");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 4", "Voronoi feature weight 4");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "minkovsky_exponent", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_mexp");
RNA_def_property_range(prop, 0.01, 10);
RNA_def_property_ui_text(prop, "Minkovsky Exponent", "Minkovsky exponent");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "distance_metric", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "vn_distm");
RNA_def_property_enum_items(prop, prop_distance_metric_items);
RNA_def_property_ui_text(prop, "Distance Metric", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "vn_coltype");
RNA_def_property_enum_items(prop, prop_coloring_items);
RNA_def_property_ui_text(prop, "Coloring", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ns_outscale");
RNA_def_property_range(prop, 0.01, 10);
RNA_def_property_ui_text(prop, "Noise Intensity", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_distorted_noise(BlenderRNA *brna)
@@ -1316,32 +1350,32 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "dist_amount");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Distortion Amount", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Distortion", "Sets the noise basis for the distortion");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_pointdensity(BlenderRNA *brna)
@@ -1397,104 +1431,104 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "source");
RNA_def_property_enum_items(prop, point_source_items);
RNA_def_property_ui_text(prop, "Point Source", "Point data to use as renderable point density");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Object", "Object to take point data from");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "psys");
RNA_def_property_ui_text(prop, "Particle System", "Particle System to render as points");
RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "particle_cache", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "psys_cache_space");
RNA_def_property_enum_items(prop, particle_cache_items);
RNA_def_property_ui_text(prop, "Particle Cache", "Co-ordinate system to cache particles in");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "vertices_cache", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ob_cache_space");
RNA_def_property_enum_items(prop, vertice_cache_items);
RNA_def_property_ui_text(prop, "Vertices Cache", "Co-ordinate system to cache vertices in");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "radius");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Radius", "Radius from the shaded sample to look for points within");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "falloff_type");
RNA_def_property_enum_items(prop, falloff_items);
RNA_def_property_ui_text(prop, "Falloff", "Method of attenuating density by distance from the point");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "falloff_softness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "falloff_softness");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Softness", "Softness of the 'soft' falloff option");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "color_source", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "color_source");
RNA_def_property_enum_items(prop, color_source_items);
RNA_def_property_ui_text(prop, "Color Source", "Data to derive color results from");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "speed_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "speed_scale");
RNA_def_property_range(prop, 0.001, 100.0);
RNA_def_property_ui_text(prop, "Scale", "Multipler to bring particle speed within an acceptable range");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Color Ramp", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* Turbulence */
prop= RNA_def_property(srna, "turbulence", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_TURBULENCE);
RNA_def_property_ui_text(prop, "Turbulence", "Add directed noise to the density at render-time");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noise_size");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Size", "Scale of the added turbulent noise");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noise_fac");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Strength", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noise_depth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence_influence", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noise_influence");
RNA_def_property_enum_items(prop, turbulence_influence_items);
RNA_def_property_ui_text(prop, "Turbulence Influence", "Method for driving added turbulent noise");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noise_basis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Noise formula used for tubulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
srna= RNA_def_struct(brna, "PointDensityTexture", "Texture");
@@ -1505,7 +1539,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "pd");
RNA_def_property_struct_type(prop, "PointDensity");
RNA_def_property_ui_text(prop, "Point Density", "The point density settings associated with this texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_voxeldata(BlenderRNA *brna)
@@ -1537,46 +1571,46 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "interp_type");
RNA_def_property_enum_items(prop, interpolation_type_items);
RNA_def_property_ui_text(prop, "Interpolation", "Method to interpolate/smooth values between voxel cells");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "int_multiplier");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Intensity", "Multiplier for intensity values");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "file_format");
RNA_def_property_enum_items(prop, file_format_items);
RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render ");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "source_path", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "source_path");
RNA_def_property_ui_text(prop, "Source Path", "The external source data file to use");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resol");
RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "still", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_VD_STILL);
RNA_def_property_ui_text(prop, "Still Frame Only", "Always render a still frame from the voxel data sequence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "still_frame_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "still_frame");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "domain_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Domain Object", "Object used as the smoke simulation domain");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
srna= RNA_def_struct(brna, "VoxelDataTexture", "Texture");
@@ -1587,7 +1621,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "vd");
RNA_def_property_struct_type(prop, "VoxelData");
RNA_def_property_ui_text(prop, "Voxel Data", "The voxel data associated with this texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture(BlenderRNA *brna)
@@ -1626,49 +1660,49 @@ static void rna_def_texture(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Texture_type_set", NULL);
RNA_def_property_ui_text(prop, "Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_COLORBAND);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_color_ramp_set");
RNA_def_property_ui_text(prop, "Use Color Ramp", "Toggle color ramp operations.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Color Ramp", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bright");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Brightness", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 5);
RNA_def_property_ui_text(prop, "Contrast", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "rgb_factor", PROP_FLOAT, PROP_RGB);
RNA_def_property_float_sdna(prop, NULL, "rfac");
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "RGB Factor", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* nodetree */
prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_nodes_set");
RNA_def_property_ui_text(prop, "Use Nodes", "Make this a node-based texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based textures");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
rna_def_animdata_common(srna);
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
index c6068d0a650..0cbbe28967f 100644
--- a/source/blender/makesrna/intern/rna_world.c
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -34,14 +34,17 @@
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
-#include "WM_types.h"
-
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
+#include "BKE_depsgraph.h"
+#include "BKE_main.h"
#include "BKE_texture.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
static PointerRNA rna_World_ambient_occlusion_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_WorldAmbientOcclusion, ptr->id.data);
@@ -95,6 +98,22 @@ static void rna_World_active_texture_set(PointerRNA *ptr, PointerRNA value)
}
}
+static void rna_World_update(bContext *C, PointerRNA *ptr)
+{
+ World *wo= ptr->id.data;
+
+ DAG_id_flush_update(&wo->id, 0);
+ WM_event_add_notifier(C, NC_WORLD, wo);
+}
+
+static void rna_World_draw_update(bContext *C, PointerRNA *ptr)
+{
+ World *wo= ptr->id.data;
+
+ DAG_id_flush_update(&wo->id, 0);
+ WM_event_add_notifier(C, NC_WORLD|ND_WORLD_DRAW, wo);
+}
+
#else
static void rna_def_world_mtex(BlenderRNA *brna)
@@ -119,22 +138,22 @@ static void rna_def_world_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "map_blend", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_BLEND);
RNA_def_property_ui_text(prop, "Blend", "Affect the color progression of the background.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "map_horizon", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_HORIZ);
RNA_def_property_ui_text(prop, "Horizon", "Affect the color of the horizon.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "map_zenith_up", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENUP);
RNA_def_property_ui_text(prop, "Zenith Up", "Affect the color of the zenith above.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "map_zenith_down", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENDOWN);
RNA_def_property_ui_text(prop, "Zenith Down", "Affect the color of the zenith below.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* unused
prop= RNA_def_property(srna, "map_mist", PROP_BOOLEAN, PROP_NONE);
@@ -145,38 +164,38 @@ static void rna_def_world_mtex(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "texco");
RNA_def_property_enum_items(prop, texco_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", "Texture coordinates used to map the texture onto the background.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "varfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Blend Factor", "Amount texture affects color progression of the background.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "horizon_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Horizon Factor", "Amount texture affects color of the horizon.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "zenith_up_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Zenith Up Factor", "Amount texture affects color of the zenith above.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "zenith_down_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Zenith Down Factor", "Amount texture affects color of the zenith below.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
}
static void rna_def_ambient_occlusion(BlenderRNA *brna)
@@ -215,83 +234,100 @@ static void rna_def_ambient_occlusion(BlenderRNA *brna)
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_AMB_OCC);
RNA_def_property_ui_text(prop, "Enabled", "Use Ambient Occlusion to add light based on distance between elements, creating the illusion of omnipresent light");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "aodist");
RNA_def_property_ui_text(prop, "Distance", "Length of rays, defines how far away other faces give occlusion effect.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "falloff_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aodistfac");
RNA_def_property_ui_text(prop, "Strength", "Distance attenuation factor, the higher, the 'shorter' the shadows.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aoenergy");
RNA_def_property_ui_range(prop, 0, 10, 0.1, 3);
RNA_def_property_ui_text(prop, "Energy", "Amount of enerygy generated by ambient occlusion.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aobias");
RNA_def_property_range(prop, 0, 0.5);
RNA_def_property_ui_text(prop, "Bias", "Bias (in radians) to prevent smoothed faces from showing banding (for Raytrace Constant Jittered).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_adapt_thresh");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Threshold", "Samples below this threshold will be considered fully shadowed/unshadowed and skipped (for Raytrace Adaptive QMC).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "adapt_to_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_adapt_speed_fac");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Adapt To Speed", "Use the speed vector pass to reduce AO samples in fast moving pixels. Higher values result in more aggressive sample reduction. Requires Vec pass enabled (for Raytrace Adaptive QMC).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "error_tolerance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_approx_error");
RNA_def_property_range(prop, 0.0001, 10);
RNA_def_property_ui_text(prop, "Error Tolerance", "Low values are slower and higher quality (for Approximate).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "correction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_approx_correction");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
RNA_def_property_ui_text(prop, "Correction", "Ad-hoc correction for over-occlusion due to the approximation (for Approximate).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "falloff", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AODIST);
RNA_def_property_ui_text(prop, "Falloff", "");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "pixel_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AOCACHE);
RNA_def_property_ui_text(prop, "Pixel Cache", "Cache AO results in pixels and interpolate over neighbouring pixels for speedup (for Approximate).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "aosamp");
RNA_def_property_range(prop, 1, 32);
RNA_def_property_ui_text(prop, "Samples", "Amount of ray samples. Higher values give smoother results and longer rendering times");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "aomix");
RNA_def_property_enum_items(prop, blend_mode_items);
RNA_def_property_ui_text(prop, "Blend Mode", "Defines how AO mixes with material shading.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "color", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "aocolor");
RNA_def_property_enum_items(prop, prop_color_items);
RNA_def_property_ui_text(prop, "Color", "Defines the color of the AO light");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "sample_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ao_samp_method");
RNA_def_property_enum_items(prop, prop_sample_method_items);
RNA_def_property_ui_text(prop, "Sample Method", "Method for generating shadow samples (for Raytrace).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "gather_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ao_gather_method");
RNA_def_property_enum_items(prop, prop_gather_method_items);
RNA_def_property_ui_text(prop, "Gather Method", "");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "passes", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ao_approx_passes");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Passes", "Number of preprocessing passes to reduce overocclusion (for Approximate).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
}
static void rna_def_world_mist(BlenderRNA *brna)
@@ -313,35 +349,39 @@ static void rna_def_world_mist(BlenderRNA *brna)
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_MIST);
RNA_def_property_ui_text(prop, "Enabled", "Occlude objects with the environment color as they are further away.");
+ RNA_def_property_update(prop, 0, "rna_World_draw_update");
prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "misi");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Intensity", "Intensity of the mist effect.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "miststa");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist, measured from the camera");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_draw_update");
prop= RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "mistdist");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Depth", "The distance over which the mist effect fades in");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_draw_update");
prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "misthi");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Height", "Control how much mist density decreases with height");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mistype");
RNA_def_property_enum_items(prop, falloff_items);
RNA_def_property_ui_text(prop, "Falloff", "Type of transition used to fade mist");
+ RNA_def_property_update(prop, 0, "rna_World_update");
}
static void rna_def_world_stars(BlenderRNA *brna)
@@ -357,37 +397,38 @@ static void rna_def_world_stars(BlenderRNA *brna)
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_STARS);
RNA_def_property_ui_text(prop, "Enabled", "Enable starfield generation.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "starsize");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Size", "Average screen dimension of stars.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "min_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "starmindist");
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance to the camera for stars.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "average_separation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stardist");
RNA_def_property_range(prop, 2, 1000);
RNA_def_property_ui_text(prop, "Average Separation", "Average distance between any two stars.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "color_randomization", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "starcolnoise");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Color Randomization", "Randomize star colors.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* unused
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "starr");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Color", "Stars color.");*/
+ RNA_def_property_ui_text(prop, "Color", "Stars color.");
+ RNA_def_property_update(prop, 0, "rna_World_update");*/
}
void RNA_def_world(BlenderRNA *brna)
@@ -412,53 +453,55 @@ void RNA_def_world(BlenderRNA *brna)
rna_def_animdata_common(srna);
rna_def_mtex_common(srna, "rna_World_mtex_begin", "rna_World_active_texture_get",
- "rna_World_active_texture_set", "WorldTextureSlot");
+ "rna_World_active_texture_set", "WorldTextureSlot", "rna_World_update");
/* colors */
prop= RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "horr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "zenr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Zenith Color", "Color at the zenith.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "ambr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Ambient Color", "");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* exp, range */
prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "exp");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Exposure", "Amount of exponential color correction for light.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "range");
RNA_def_property_range(prop, 0.2, 5.0);
RNA_def_property_ui_text(prop, "Range", "The color range that will be mapped to 0-1.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* sky type */
prop= RNA_def_property(srna, "blend_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYBLEND);
RNA_def_property_ui_text(prop, "Blend Sky", "Render background with natural progression from horizon to zenith.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "paper_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYPAPER);
RNA_def_property_ui_text(prop, "Paper Sky", "Flatten blend or texture coordinates.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "real_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYREAL);
RNA_def_property_ui_text(prop, "Real Sky", "Render background with a real horizon, relative to the camera angle.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* nested structs */
prop= RNA_def_property(srna, "ambient_occlusion", PROP_POINTER, PROP_NONE);
diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c
index 2c21627dad9..f2333ffcf2e 100644
--- a/source/blender/nodes/intern/TEX_util.c
+++ b/source/blender/nodes/intern/TEX_util.c
@@ -47,8 +47,6 @@
#define PREV_RES 128 /* default preview resolution */
-int preview_flag = 0;
-
void tex_call_delegate(TexDelegate *dg, float *out, TexParams *params, short thread)
{
if(dg->node->need_exec)
@@ -217,7 +215,8 @@ void ntreeTexExecTree(
short thread,
Tex *tex,
short which_output,
- int cfra
+ int cfra,
+ int preview
){
TexResult dummy_texres;
TexCallData data;
@@ -231,21 +230,14 @@ void ntreeTexExecTree(
data.dxt = dxt;
data.dyt = dyt;
data.target = texres;
- data.do_preview = preview_flag;
+ data.do_preview = preview;
data.thread = thread;
data.which_output = which_output;
data.cfra= cfra;
- preview_flag = 0;
-
ntreeExecTree(nodes, &data, thread);
}
-void ntreeTexSetPreviewFlag(int doit)
-{
- preview_flag = doit;
-}
-
char* ntreeTexOutputMenu(bNodeTree *ntree)
{
bNode *node;
diff --git a/source/blender/nodes/intern/TEX_util.h b/source/blender/nodes/intern/TEX_util.h
index 87a9cf288d6..fd3d47f4729 100644
--- a/source/blender/nodes/intern/TEX_util.h
+++ b/source/blender/nodes/intern/TEX_util.h
@@ -102,8 +102,6 @@ float tex_input_value(bNodeStack *in, TexParams *params, short thread);
void tex_output(bNode *node, bNodeStack **in, bNodeStack *out, TexFn texfn);
void tex_do_preview(bNode *node, bNodeStack *ns, TexCallData *cdata);
-void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, float *dxt, float *dyt, short thread, struct Tex *tex, short which_output, int cfra);
-
void params_from_cdata(TexParams *out, TexCallData *in);
#endif
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index f25a167600f..4830dab7d37 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -721,7 +721,7 @@ static int evalnodes(Tex *tex, float *texvec, float *dxt, float *dyt, TexResult
short rv = TEX_INT;
bNodeTree *nodes = tex->nodetree;
- ntreeTexExecTree(nodes, texres, texvec, dxt, dyt, thread, tex, which_output, R.r.cfra);
+ ntreeTexExecTree(nodes, texres, texvec, dxt, dyt, thread, tex, which_output, R.r.cfra, (R.r.scemode & R_NODE_PREVIEW));
if(texres->nor) rv |= TEX_NOR;
rv |= TEX_RGB;
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index c24cf783063..d746df01421 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -183,9 +183,12 @@ typedef struct wmNotifier {
#define ND_SHADING_DRAW (31<<16)
/* NC_LAMP Lamp */
-#define ND_LIGHTING (44<<16)
-#define ND_LIGHTING_DRAW (45<<16)
-#define ND_SKY (46<<16)
+#define ND_LIGHTING (40<<16)
+#define ND_LIGHTING_DRAW (41<<16)
+#define ND_SKY (42<<16)
+
+ /* NC_WORLD World */
+#define ND_WORLD_DRAW (45<<16)
/* NC_TEXT Text */
#define ND_CURSOR (50<<16)
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 1074c424663..f8985fd6531 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -78,7 +78,7 @@
#include "ED_armature.h"
#include "ED_keyframing.h"
#include "ED_node.h"
-#include "ED_previewrender.h"
+#include "ED_render.h"
#include "ED_space_api.h"
#include "ED_screen.h"
#include "ED_util.h"
@@ -89,6 +89,7 @@
#include "GPU_extensions.h"
#include "GPU_draw.h"
+#include "BKE_depsgraph.h"
#include "BKE_sound.h"
static void wm_init_reports(bContext *C)
@@ -112,6 +113,7 @@ void WM_init(bContext *C)
set_free_windowmanager_cb(wm_close_and_free); /* library.c */
set_blender_test_break_cb(wm_window_testbreak); /* blender.c */
+ DAG_editors_update_cb(ED_render_id_flush_update); /* depsgraph.c */
ED_spacetypes_init(); /* editors/space_api/spacetype.c */
@@ -128,6 +130,8 @@ void WM_init(bContext *C)
wm_init_reports(C); /* reports cant be initialized before the wm */
+ GPU_extensions_init();
+
UI_init();
// clear_matcopybuf(); /* XXX */
@@ -138,8 +142,6 @@ void WM_init(bContext *C)
ED_preview_init_dbase();
- GPU_extensions_init();
-
G.ndofdevice = -1; /* XXX bad initializer, needs set otherwise buttons show! */
read_Blog();